adjust to multiple spaces config in latest reva

Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
Jörn Friedrich Dreyer
2021-12-08 16:47:16 +00:00
parent 5e1bfb387c
commit 22834af1ea
3 changed files with 25 additions and 16 deletions
+21 -12
View File
@@ -221,23 +221,32 @@ func spacesProviders(cfg *config.Config, logger log.Logger) map[string]map[strin
// generate rules based on default config
return map[string]map[string]interface{}{
cfg.Reva.StorageUsers.Endpoint: {
"mount_path": "/users",
"space_type": "personal",
"path_template": "/users/{{.Space.Owner.Id.OpaqueId}}",
"description": "Personal Spaces",
"spaces": map[string]interface{}{
"personal": map[string]interface{}{
"mount_point": "/users",
"path_template": "/users/{{.Space.Owner.Id.OpaqueId}}",
},
"project": map[string]interface{}{
"mount_point": "/projects",
"path_template": "/projects/{{.Space.Name}}",
},
},
},
cfg.Reva.StorageShares.Endpoint: {
"mount_path": "/users/{{.CurrentUser.Id.OpaqueId}}/Shares",
"space_type": "share",
"path_template": "/users/{{.CurrentUser.Id.OpaqueId}}/Shares/{{.Space.Name}}",
"description": "Shares",
"spaces": map[string]interface{}{
"share": map[string]interface{}{
"mount_point": "/users/{{.CurrentUser.Id.OpaqueId}}/Shares",
"path_template": "/users/{{.CurrentUser.Id.OpaqueId}}/Shares/{{.Space.Name}}",
},
},
},
// public link storage returns the mount id of the actual storage
cfg.Reva.StoragePublicLink.Endpoint: {
"mount_path": "/public",
"space_type": "public",
"path_template": "/public",
"description": "Public Links",
"spaces": map[string]interface{}{
"public": map[string]interface{}{
"mount_point": "/public",
},
},
},
// medatada storage not part of the global namespace
}