Merge pull request #1714 from MahdiBaghbani/feature-ocm-wayf

feat(ocm): add WAYF configuration for reva OCM service
This commit is contained in:
Christian Richter
2025-11-27 12:55:59 +01:00
committed by GitHub
5 changed files with 39 additions and 15 deletions
@@ -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
+4 -2
View File
@@ -83,8 +83,10 @@ type GRPCConfig struct {
} }
type ScienceMesh 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"` 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"` MeshDirectoryURL string `yaml:"science_mesh_directory_url" env:"OCM_MESH_DIRECTORY_URL" desc:"URL of the mesh directory service." introductionVersion:"1.0.0"`
DirectoryServiceURLs string `yaml:"directory_service_urls" env:"OCM_DIRECTORY_SERVICE_URLS" desc:"Space delimited URLs of the directory services." 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 { type OCMD struct {
@@ -90,7 +90,8 @@ func DefaultConfig() *config.Config {
Cluster: "opencloud-cluster", Cluster: "opencloud-cluster",
}, },
ScienceMesh: config.ScienceMesh{ ScienceMesh: config.ScienceMesh{
Prefix: "sciencemesh", Prefix: "sciencemesh",
InviteAcceptDialog: "/open-cloud-mesh/accept-invite",
}, },
OCMD: config.OCMD{ OCMD: config.OCMD{
Prefix: "ocm", Prefix: "ocm",
+14 -12
View File
@@ -60,21 +60,23 @@ func OCMConfigFromStruct(cfg *config.Config, logger log.Logger) map[string]inter
"wellknown": map[string]interface{}{ "wellknown": map[string]interface{}{
"prefix": ".well-known", "prefix": ".well-known",
"ocmprovider": map[string]interface{}{ "ocmprovider": map[string]interface{}{
"ocm_prefix": cfg.OCMD.Prefix, "ocm_prefix": cfg.OCMD.Prefix,
"endpoint": cfg.Commons.OpenCloudURL, "endpoint": cfg.Commons.OpenCloudURL,
"provider": "OpenCloud", "provider": "OpenCloud",
"webdav_root": "/dav/ocm", "webdav_root": "/dav/ocm",
"webapp_root": cfg.ScienceMesh.Prefix, "webapp_root": cfg.ScienceMesh.Prefix,
"enable_webapp": false, "invite_accept_dialog": cfg.ScienceMesh.InviteAcceptDialog,
"enable_datatx": false, "enable_webapp": false,
"enable_datatx": false,
}, },
}, },
"sciencemesh": map[string]interface{}{ "sciencemesh": map[string]interface{}{
"prefix": cfg.ScienceMesh.Prefix, "prefix": cfg.ScienceMesh.Prefix,
"smtp_credentials": map[string]string{}, "smtp_credentials": map[string]string{},
"gatewaysvc": cfg.Reva.Address, "gatewaysvc": cfg.Reva.Address,
"mesh_directory_url": cfg.ScienceMesh.MeshDirectoryURL, "mesh_directory_url": cfg.ScienceMesh.MeshDirectoryURL,
"provider_domain": providerDomain, "directory_service_urls": cfg.ScienceMesh.DirectoryServiceURLs,
"provider_domain": providerDomain,
"events": map[string]interface{}{ "events": map[string]interface{}{
"natsaddress": cfg.Events.Endpoint, "natsaddress": cfg.Events.Endpoint,
"natsclusterid": cfg.Events.Cluster, "natsclusterid": cfg.Events.Cluster,
@@ -172,6 +172,18 @@ func DefaultPolicies() []config.Policy {
Service: "eu.opencloud.web.frontend", Service: "eu.opencloud.web.frontend",
Unprotected: true, 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/", Endpoint: "/sciencemesh/",
Service: "eu.opencloud.web.ocm", Service: "eu.opencloud.web.ocm",