diff --git a/changelog/unreleased/add-ocm-wayf-configuration.md b/changelog/unreleased/add-ocm-wayf-configuration.md new file mode 100644 index 000000000..6c3b4f5c2 --- /dev/null +++ b/changelog/unreleased/add-ocm-wayf-configuration.md @@ -0,0 +1,7 @@ +Enhancement: Add WAYF configuration for reva OCM service + +Add WAYF 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/opencloud-eu/opencloud/pull/1714 diff --git a/services/ocm/pkg/config/config.go b/services/ocm/pkg/config/config.go index 4b9d7de90..395613590 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:"1.0.0"` - MeshDirectoryURL string `yaml:"science_mesh_directory_url" env:"OCM_MESH_DIRECTORY_URL" desc:"URL of the mesh directory service." introductionVersion:"1.0.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:"1.0.0"` + MeshDirectoryURL string `yaml:"science_mesh_directory_url" env:"OCM_MESH_DIRECTORY_URL" desc:"URL of the mesh directory service." introductionVersion:"1.0.0"` + Federations string `yaml:"federations_file" env:"OCM_FEDERATIONS_FILE" desc:"Path to the JSON file where OCM federations data will be stored." introductionVersion:"3.5.0"` + 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:"3.5.0"` } type OCMD struct { diff --git a/services/ocm/pkg/config/defaults/defaultconfig.go b/services/ocm/pkg/config/defaults/defaultconfig.go index ce2f4e5e7..f9d3a8000 100644 --- a/services/ocm/pkg/config/defaults/defaultconfig.go +++ b/services/ocm/pkg/config/defaults/defaultconfig.go @@ -90,7 +90,9 @@ func DefaultConfig() *config.Config { Cluster: "opencloud-cluster", }, ScienceMesh: config.ScienceMesh{ - Prefix: "sciencemesh", + Prefix: "sciencemesh", + Federations: filepath.Join(defaults.BaseConfigPath(), "federations.json"), + 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 9ef55ef7b..a79e735aa 100644 --- a/services/ocm/pkg/revaconfig/config.go +++ b/services/ocm/pkg/revaconfig/config.go @@ -60,13 +60,14 @@ 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.OpenCloudURL, - "provider": "OpenCloud", - "webdav_root": "/dav/ocm", - "webapp_root": cfg.ScienceMesh.Prefix, - "enable_webapp": false, - "enable_datatx": false, + "ocm_prefix": cfg.OCMD.Prefix, + "endpoint": cfg.Commons.OpenCloudURL, + "provider": "OpenCloud", + "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{}{ @@ -74,6 +75,7 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter "smtp_credentials": map[string]string{}, "gatewaysvc": cfg.Reva.Address, "mesh_directory_url": cfg.ScienceMesh.MeshDirectoryURL, + "federations_file": cfg.ScienceMesh.Federations, "provider_domain": providerDomain, "events": map[string]interface{}{ "natsaddress": cfg.Events.Endpoint, diff --git a/services/proxy/pkg/config/defaults/defaultconfig.go b/services/proxy/pkg/config/defaults/defaultconfig.go index adc27c054..c507e546d 100644 --- a/services/proxy/pkg/config/defaults/defaultconfig.go +++ b/services/proxy/pkg/config/defaults/defaultconfig.go @@ -171,6 +171,18 @@ func DefaultPolicies() []config.Policy { Service: "eu.opencloud.web.frontend", Unprotected: true, }, + // OCM WAYF public endpoints + { + Endpoint: "/sciencemesh/federations", + Service: "eu.opencloud.web.ocm", + Unprotected: true, + }, + { + Endpoint: "/sciencemesh/discover", + Service: "eu.opencloud.web.ocm", + Unprotected: true, + }, + // General sciencemesh endpoints { Endpoint: "/sciencemesh/", Service: "eu.opencloud.web.ocm",