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
+2 -2
View File
@@ -31,6 +31,7 @@ require (
github.com/gofrs/uuid v4.2.0+incompatible
github.com/golang-jwt/jwt/v4 v4.1.0
github.com/golang/protobuf v1.5.2
github.com/google/uuid v1.3.0
github.com/gookit/config/v2 v2.0.27
github.com/gorilla/mux v1.8.0
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.1
@@ -143,7 +144,6 @@ require (
github.com/gomodule/redigo v1.8.5 // indirect
github.com/google/go-cmp v0.5.6 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/gookit/goutil v0.3.15 // indirect
github.com/gorilla/schema v1.2.0 // indirect
github.com/grpc-ecosystem/go-grpc-middleware v1.3.0 // indirect
@@ -241,4 +241,4 @@ require (
stash.kopano.io/kgol/oidc-go v0.3.2 // indirect
)
replace github.com/cs3org/reva => github.com/cs3org/reva v1.16.1-0.20211207113801-1fa1ac1d3349
replace github.com/cs3org/reva => github.com/cs3org/reva v1.16.1-0.20211208164450-3abd76eecf8b
+2 -2
View File
@@ -299,8 +299,8 @@ github.com/crewjam/saml v0.4.5/go.mod h1:qCJQpUtZte9R1ZjUBcW8qtCNlinbO363ooNl02S
github.com/cs3org/cato v0.0.0-20200828125504-e418fc54dd5e/go.mod h1:XJEZ3/EQuI3BXTp/6DUzFr850vlxq11I6satRtz0YQ4=
github.com/cs3org/go-cs3apis v0.0.0-20211104090126-8e972dca8304 h1:e/nIPR518vyvrulo9goAZTtYD6gFfu/2/9MDe6mTGcw=
github.com/cs3org/go-cs3apis v0.0.0-20211104090126-8e972dca8304/go.mod h1:UXha4TguuB52H14EMoSsCqDj7k8a/t7g4gVP+bgY5LY=
github.com/cs3org/reva v1.16.1-0.20211207113801-1fa1ac1d3349 h1:nqswCeR3uzHjMAwHdCLaf27+8niLI+nS8/u749Xh0cE=
github.com/cs3org/reva v1.16.1-0.20211207113801-1fa1ac1d3349/go.mod h1:3n/zVKsKTCL10Mwn2Nhtvn50gP5mA+933lQ2IYNAJso=
github.com/cs3org/reva v1.16.1-0.20211208164450-3abd76eecf8b h1:qF8a3q73QkxLdwYHUfxjCj0DE+VVy3tKwaUUfudUbIE=
github.com/cs3org/reva v1.16.1-0.20211208164450-3abd76eecf8b/go.mod h1:3n/zVKsKTCL10Mwn2Nhtvn50gP5mA+933lQ2IYNAJso=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8 h1:Z9lwXumT5ACSmJ7WGnFl+OMLLjpz5uR2fyz7dC255FI=
github.com/cubewise-code/go-mime v0.0.0-20200519001935-8c5762b177d8/go.mod h1:4abs/jPXcmJzYoYGF91JF9Uq9s/KL5n1jvFDix8KcqY=
github.com/cyberdelia/templates v0.0.0-20141128023046-ca7fffd4298c/go.mod h1:GyV+0YP4qX0UQ7r2MoYZ+AvYDp12OF5yg4q8rGnyNh4=
+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
}