Add support for the jsoncs3 share manager

This commit is contained in:
André Duffeck
2022-08-11 09:56:58 +02:00
parent 18996ea42a
commit d363b74dac
3 changed files with 20 additions and 1 deletions

View File

@@ -61,6 +61,7 @@ type GRPCConfig struct {
}
type UserSharingDrivers struct {
JSONCS3 UserSharingJSONCS3Driver `yaml:"jsoncs3"`
JSON UserSharingJSONDriver `yaml:"json"`
CS3 UserSharingCS3Driver `yaml:"cs3"`
OwnCloudSQL UserSharingOwnCloudSQLDriver `yaml:"owncloudsql"`
@@ -100,6 +101,13 @@ type UserSharingCS3Driver struct {
SystemUserAPIKey string `yaml:"system_user_api_key" env:"OCIS_SYSTEM_USER_API_KEY;SHARING_USER_CS3_SYSTEM_USER_API_KEY" desc:"API key for the STORAGE-SYSTEM system user."`
}
type UserSharingJSONCS3Driver struct {
ProviderAddr string `yaml:"provider_addr" env:"SHARING_USER_CS3_PROVIDER_ADDR" desc:"GRPC address of the STORAGE-SYSTEM service."`
SystemUserID string `yaml:"system_user_id" env:"OCIS_SYSTEM_USER_ID;SHARING_USER_CS3_SYSTEM_USER_ID" desc:"ID of the oCIS STORAGE-SYSTEM system user. Admins need to set the ID for the STORAGE-SYSTEM system user in this config option which is then used to reference the user. Any reasonable long string is possible, preferably this would be an UUIDv4 format."`
SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_SYSTEM_USER_IDP;SHARING_USER_CS3_SYSTEM_USER_IDP" desc:"IDP of the oCIS STORAGE-SYSTEM system user."`
SystemUserAPIKey string `yaml:"system_user_api_key" env:"OCIS_SYSTEM_USER_API_KEY;SHARING_USER_CS3_SYSTEM_USER_API_KEY" desc:"API key for the STORAGE-SYSTEM system user."`
}
type PublicSharingDrivers struct {
JSON PublicSharingJSONDriver `yaml:"json"`
CS3 PublicSharingCS3Driver `yaml:"cs3"`

View File

@@ -33,7 +33,7 @@ func DefaultConfig() *config.Config {
Reva: &config.Reva{
Address: "127.0.0.1:9142",
},
UserSharingDriver: "cs3",
UserSharingDriver: "jsoncs3",
UserSharingDrivers: config.UserSharingDrivers{
JSON: config.UserSharingJSONDriver{
File: filepath.Join(defaults.BaseDataPath(), "storage", "shares.json"),
@@ -42,6 +42,10 @@ func DefaultConfig() *config.Config {
ProviderAddr: "127.0.0.1:9215", // system storage
SystemUserIDP: "internal",
},
JSONCS3: config.UserSharingJSONCS3Driver{
ProviderAddr: "127.0.0.1:9215", // system storage
SystemUserIDP: "internal",
},
OwnCloudSQL: config.UserSharingOwnCloudSQLDriver{
DBUsername: "owncloud",
DBHost: "mysql",

View File

@@ -56,6 +56,13 @@ func SharingConfigFromStruct(cfg *config.Config) map[string]interface{} {
"service_user_idp": cfg.UserSharingDrivers.CS3.SystemUserIDP,
"machine_auth_apikey": cfg.UserSharingDrivers.CS3.SystemUserAPIKey,
},
"jsoncs3": map[string]interface{}{
"gateway_addr": cfg.UserSharingDrivers.JSONCS3.ProviderAddr,
"provider_addr": cfg.UserSharingDrivers.JSONCS3.ProviderAddr,
"service_user_id": cfg.UserSharingDrivers.JSONCS3.SystemUserID,
"service_user_idp": cfg.UserSharingDrivers.JSONCS3.SystemUserIDP,
"machine_auth_apikey": cfg.UserSharingDrivers.JSONCS3.SystemUserAPIKey,
},
},
},
"publicshareprovider": map[string]interface{}{