diff --git a/changelog/unreleased/add-ocm-wayf-configuration.md b/changelog/unreleased/add-ocm-wayf-configuration.md new file mode 100644 index 00000000000..d86d495f942 --- /dev/null +++ b/changelog/unreleased/add-ocm-wayf-configuration.md @@ -0,0 +1,7 @@ +Enhancement: Add WAYF configuration for reva OCM service + +Add WAYF (Where Are You From) configuration support for the Reva OCM service, +enabling federation discovery functionality for Open Cloud Mesh. +This includes configuration for federations file storage and invite accept dialog URL. + +https://github.com/owncloud/ocis/pull/11758 diff --git a/services/ocm/pkg/config/config.go b/services/ocm/pkg/config/config.go index c961c1aebbd..61b99073d97 100644 --- a/services/ocm/pkg/config/config.go +++ b/services/ocm/pkg/config/config.go @@ -83,8 +83,10 @@ type GRPCConfig struct { } type ScienceMesh struct { - Prefix string `yaml:"prefix" env:"OCM_SCIENCEMESH_PREFIX" desc:"URL path prefix for the ScienceMesh service. Note that the string must not start with '/'." introductionVersion:"5.0"` - MeshDirectoryURL string `yaml:"science_mesh_directory_url" env:"OCM_MESH_DIRECTORY_URL" desc:"URL of the mesh directory service." introductionVersion:"5.0"` + Prefix string `yaml:"prefix" env:"OCM_SCIENCEMESH_PREFIX" desc:"URL path prefix for the ScienceMesh service. Note that the string must not start with '/'." introductionVersion:"5.0"` + MeshDirectoryURL string `yaml:"science_mesh_directory_url" env:"OCM_MESH_DIRECTORY_URL" desc:"URL of the mesh directory service." introductionVersion:"5.0"` + DirectoryServiceURLs string `yaml:"directory_service_urls" env:"OCM_DIRECTORY_SERVICE_URLS" desc:"Space delimited URLs of the directory services." introductionVersion:"7.1"` + InviteAcceptDialog string `yaml:"invite_accept_dialog" env:"OCM_INVITE_ACCEPT_DIALOG" desc:"/open-cloud-mesh/accept-invite;The frontend URL where to land when receiving an invitation" introductionVersion:"7.1"` } type OCMD struct { diff --git a/services/ocm/pkg/config/defaults/defaultconfig.go b/services/ocm/pkg/config/defaults/defaultconfig.go index aab7f2f2a60..74e4e8218fb 100644 --- a/services/ocm/pkg/config/defaults/defaultconfig.go +++ b/services/ocm/pkg/config/defaults/defaultconfig.go @@ -90,7 +90,8 @@ func DefaultConfig() *config.Config { Cluster: "ocis-cluster", }, ScienceMesh: config.ScienceMesh{ - Prefix: "sciencemesh", + Prefix: "sciencemesh", + InviteAcceptDialog: "/open-cloud-mesh/accept-invite", }, OCMD: config.OCMD{ Prefix: "ocm", diff --git a/services/ocm/pkg/revaconfig/config.go b/services/ocm/pkg/revaconfig/config.go index 9a33ce13c5f..b7a25dbbc11 100644 --- a/services/ocm/pkg/revaconfig/config.go +++ b/services/ocm/pkg/revaconfig/config.go @@ -59,21 +59,23 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter "wellknown": map[string]interface{}{ "prefix": ".well-known", "ocmprovider": map[string]interface{}{ - "ocm_prefix": cfg.OCMD.Prefix, - "endpoint": cfg.Commons.OcisURL, - "provider": "oCIS", - "webdav_root": "/dav/ocm", - "webapp_root": cfg.ScienceMesh.Prefix, - "enable_webapp": false, - "enable_datatx": false, + "ocm_prefix": cfg.OCMD.Prefix, + "endpoint": cfg.Commons.OcisURL, + "provider": "oCIS", + "webdav_root": "/dav/ocm", + "webapp_root": cfg.ScienceMesh.Prefix, + "invite_accept_dialog": cfg.ScienceMesh.InviteAcceptDialog, + "enable_webapp": false, + "enable_datatx": false, }, }, "sciencemesh": map[string]interface{}{ - "prefix": cfg.ScienceMesh.Prefix, - "smtp_credentials": map[string]string{}, - "gatewaysvc": cfg.Reva.Address, - "mesh_directory_url": cfg.ScienceMesh.MeshDirectoryURL, - "provider_domain": providerDomain, + "prefix": cfg.ScienceMesh.Prefix, + "smtp_credentials": map[string]string{}, + "gatewaysvc": cfg.Reva.Address, + "mesh_directory_url": cfg.ScienceMesh.MeshDirectoryURL, + "directory_service_urls": cfg.ScienceMesh.DirectoryServiceURLs, + "provider_domain": providerDomain, "events": map[string]interface{}{ "natsaddress": cfg.Events.Endpoint, "natsclusterid": cfg.Events.Cluster, diff --git a/services/proxy/pkg/config/defaults/defaultconfig.go b/services/proxy/pkg/config/defaults/defaultconfig.go index aab86ff0615..b4ae06c81a5 100644 --- a/services/proxy/pkg/config/defaults/defaultconfig.go +++ b/services/proxy/pkg/config/defaults/defaultconfig.go @@ -168,6 +168,18 @@ func DefaultPolicies() []config.Policy { Service: "com.owncloud.web.frontend", Unprotected: true, }, + // OCM WAYF public endpoints + { + Endpoint: "/sciencemesh/federations", + Service: "com.owncloud.web.ocm", + Unprotected: true, + }, + { + Endpoint: "/sciencemesh/discover", + Service: "com.owncloud.web.ocm", + Unprotected: true, + }, + // General sciencemesh endpoints { Endpoint: "/sciencemesh/", Service: "com.owncloud.web.ocm",