mirror of
https://github.com/opencloud-eu/opencloud.git
synced 2026-05-12 22:39:34 -05:00
Add support for the jsoncs3 public share manager
This commit is contained in:
@@ -275,6 +275,13 @@ func revaPublicShareConfig(cfg *sharing.Config) map[string]interface{} {
|
||||
"file": cfg.PublicSharingDrivers.JSON.File,
|
||||
"gateway_addr": cfg.Reva.Address,
|
||||
},
|
||||
"jsoncs3": map[string]interface{}{
|
||||
"gateway_addr": cfg.PublicSharingDrivers.JSONCS3.ProviderAddr,
|
||||
"provider_addr": cfg.PublicSharingDrivers.JSONCS3.ProviderAddr,
|
||||
"service_user_id": cfg.PublicSharingDrivers.JSONCS3.SystemUserID,
|
||||
"service_user_idp": cfg.PublicSharingDrivers.JSONCS3.SystemUserIDP,
|
||||
"machine_auth_apikey": cfg.PublicSharingDrivers.JSONCS3.SystemUserAPIKey,
|
||||
},
|
||||
"sql": map[string]interface{}{
|
||||
"db_username": cfg.PublicSharingDrivers.SQL.DBUsername,
|
||||
"db_password": cfg.PublicSharingDrivers.SQL.DBPassword,
|
||||
|
||||
@@ -110,8 +110,9 @@ type UserSharingJSONCS3Driver struct {
|
||||
}
|
||||
|
||||
type PublicSharingDrivers struct {
|
||||
JSON PublicSharingJSONDriver `yaml:"json"`
|
||||
CS3 PublicSharingCS3Driver `yaml:"cs3"`
|
||||
JSON PublicSharingJSONDriver `yaml:"json"`
|
||||
CS3 PublicSharingCS3Driver `yaml:"cs3"`
|
||||
JSONCS3 PublicSharingJSONCS3Driver `yaml:"jsoncs3"`
|
||||
|
||||
SQL PublicSharingSQLDriver `yaml:"sql,omitempty"` // not supported by the oCIS product, therefore not part of docs
|
||||
}
|
||||
@@ -136,7 +137,15 @@ type PublicSharingCS3Driver struct {
|
||||
ProviderAddr string `yaml:"provider_addr" env:"SHARING_PUBLIC_CS3_PROVIDER_ADDR" desc:"GRPC address of the STORAGE-SYSTEM service."`
|
||||
SystemUserID string `yaml:"system_user_id" env:"OCIS_SYSTEM_USER_ID;SHARING_PUBLIC_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_PUBLIC_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."`
|
||||
SystemUserAPIKey string `yaml:"system_user_api_key" env:"OCIS_SYSTEM_USER_API_KEY;SHARING_PUBLIC_CS3_SYSTEM_USER_API_KEY" desc:"API key for the STORAGE-SYSTEM system user."`
|
||||
}
|
||||
|
||||
// PublicSharingJSONCS3Driver holds the jsoncs3 driver config
|
||||
type PublicSharingJSONCS3Driver struct {
|
||||
ProviderAddr string `yaml:"provider_addr" env:"SHARING_PUBLIC_CS3_PROVIDER_ADDR" desc:"GRPC address of the STORAGE-SYSTEM service."`
|
||||
SystemUserID string `yaml:"system_user_id" env:"OCIS_SYSTEM_USER_ID;SHARING_PUBLIC_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_PUBLIC_CS3_SYSTEM_USER_ID" desc:"IDP of the oCIS STORAGE-SYSTEM system user."`
|
||||
SystemUserAPIKey string `yaml:"system_user_api_key" env:"OCIS_SYSTEM_USER_API_KEY;SHARING_PUBLIC_CS3_SYSTEM_USER_API_KEY" desc:"API key for the STORAGE-SYSTEM system user."`
|
||||
}
|
||||
|
||||
type Events struct {
|
||||
|
||||
@@ -62,6 +62,10 @@ func DefaultConfig() *config.Config {
|
||||
ProviderAddr: "127.0.0.1:9215", // system storage
|
||||
SystemUserIDP: "internal",
|
||||
},
|
||||
JSONCS3: config.PublicSharingJSONCS3Driver{
|
||||
ProviderAddr: "127.0.0.1:9215", // system storage
|
||||
SystemUserIDP: "internal",
|
||||
},
|
||||
// TODO implement and add owncloudsql publicshare driver
|
||||
},
|
||||
Events: config.Events{
|
||||
|
||||
@@ -89,6 +89,13 @@ func SharingConfigFromStruct(cfg *config.Config) map[string]interface{} {
|
||||
"service_user_idp": cfg.PublicSharingDrivers.CS3.SystemUserIDP,
|
||||
"machine_auth_apikey": cfg.PublicSharingDrivers.CS3.SystemUserAPIKey,
|
||||
},
|
||||
"jsoncs3": map[string]interface{}{
|
||||
"gateway_addr": cfg.PublicSharingDrivers.JSONCS3.ProviderAddr,
|
||||
"provider_addr": cfg.PublicSharingDrivers.JSONCS3.ProviderAddr,
|
||||
"service_user_id": cfg.PublicSharingDrivers.JSONCS3.SystemUserID,
|
||||
"service_user_idp": cfg.PublicSharingDrivers.JSONCS3.SystemUserIDP,
|
||||
"machine_auth_apikey": cfg.PublicSharingDrivers.JSONCS3.SystemUserAPIKey,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user