ServiceUser -> SystemUser (#3673)
* serviceUser -> systemUser Signed-off-by: jkoberg <jkoberg@owncloud.com> * changelog Signed-off-by: jkoberg <jkoberg@owncloud.com> * leave out OCIS_URL, cleanup Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de> Co-authored-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
co-authored by
Jörn Friedrich Dreyer
parent
d7d9d76cfa
commit
25dc46ecd0
@@ -95,8 +95,8 @@ type UserSharingOwnCloudSQLDriver struct {
|
||||
|
||||
type UserSharingCS3Driver struct {
|
||||
ProviderAddr string `yaml:"provider_addr" env:"SHARING_USER_CS3_PROVIDER_ADDR"`
|
||||
ServiceUserID string `yaml:"service_user_id" env:"SHARING_USER_CS3_SERVICE_USER_ID"`
|
||||
ServiceUserIDP string `yaml:"service_user_idp" env:"OCIS_URL;SHARING_USER_CS3_SERVICE_USER_IDP"`
|
||||
SystemUserID string `yaml:"system_user_id" env:"OCIS_SYSTEM_USER_ID;SHARING_USER_CS3_SYSTEM_USER_ID"`
|
||||
SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_SYSTEM_USER_IDP;SHARING_USER_CS3_SYSTEM_USER_IDP"`
|
||||
SystemUserAPIKey string `yaml:"system_user_api_key" env:"OCIS_SYSTEM_USER_API_KEY;SHARING_USER_CS3_SYSTEM_USER_API_KEY"`
|
||||
}
|
||||
|
||||
@@ -125,8 +125,8 @@ type PublicSharingSQLDriver struct {
|
||||
|
||||
type PublicSharingCS3Driver struct {
|
||||
ProviderAddr string `yaml:"provider_addr" env:"SHARING_PUBLIC_CS3_PROVIDER_ADDR"`
|
||||
ServiceUserID string `yaml:"service_user_id" env:"SHARING_PUBLIC_CS3_SERVICE_USER_ID"`
|
||||
ServiceUserIDP string `yaml:"service_user_idp" env:"OCIS_URL;SHARING_PUBLIC_CS3_SERVICE_USER_IDP"`
|
||||
SystemUserID string `yaml:"system_user_id" env:"OCIS_SYSTEM_USER_ID;SHARING_PUBLIC_CS3_SYSTEM_USER_ID"`
|
||||
SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_SYSTEM_USER_IDP;SHARING_PUBLIC_CS3_SYSTEM_USER_IDP"`
|
||||
SystemUserAPIKey string `yaml:"system_user_api_key" env:"OCIS_SYSTEM_USER_API_KEY;SHARING_USER_CS3_SYSTEM_USER_API_KEY"`
|
||||
}
|
||||
|
||||
|
||||
@@ -39,8 +39,8 @@ func DefaultConfig() *config.Config {
|
||||
File: filepath.Join(defaults.BaseDataPath(), "storage", "shares.json"),
|
||||
},
|
||||
CS3: config.UserSharingCS3Driver{
|
||||
ProviderAddr: "127.0.0.1:9215", // metadata storage
|
||||
ServiceUserIDP: "internal",
|
||||
ProviderAddr: "127.0.0.1:9215", // metadata storage
|
||||
SystemUserIDP: "internal",
|
||||
},
|
||||
},
|
||||
PublicSharingDriver: "json", // "cs3",
|
||||
@@ -49,8 +49,8 @@ func DefaultConfig() *config.Config {
|
||||
File: filepath.Join(defaults.BaseDataPath(), "storage", "publicshares.json"),
|
||||
},
|
||||
CS3: config.PublicSharingCS3Driver{
|
||||
ProviderAddr: "127.0.0.1:9215", // metadata storage
|
||||
ServiceUserIDP: "internal",
|
||||
ProviderAddr: "127.0.0.1:9215", // metadata storage
|
||||
SystemUserIDP: "internal",
|
||||
},
|
||||
},
|
||||
Events: config.Events{
|
||||
@@ -104,16 +104,16 @@ func EnsureDefaults(cfg *config.Config) {
|
||||
cfg.UserSharingDrivers.CS3.SystemUserAPIKey = cfg.Commons.SystemUserAPIKey
|
||||
}
|
||||
|
||||
if cfg.UserSharingDrivers.CS3.ServiceUserID == "" && cfg.Commons != nil && cfg.Commons.SystemUserID != "" {
|
||||
cfg.UserSharingDrivers.CS3.ServiceUserID = cfg.Commons.SystemUserID
|
||||
if cfg.UserSharingDrivers.CS3.SystemUserID == "" && cfg.Commons != nil && cfg.Commons.SystemUserID != "" {
|
||||
cfg.UserSharingDrivers.CS3.SystemUserID = cfg.Commons.SystemUserID
|
||||
}
|
||||
|
||||
if cfg.PublicSharingDrivers.CS3.SystemUserAPIKey == "" && cfg.Commons != nil && cfg.Commons.SystemUserAPIKey != "" {
|
||||
cfg.PublicSharingDrivers.CS3.SystemUserAPIKey = cfg.Commons.SystemUserAPIKey
|
||||
}
|
||||
|
||||
if cfg.PublicSharingDrivers.CS3.ServiceUserID == "" && cfg.Commons != nil && cfg.Commons.SystemUserID != "" {
|
||||
cfg.PublicSharingDrivers.CS3.ServiceUserID = cfg.Commons.SystemUserID
|
||||
if cfg.PublicSharingDrivers.CS3.SystemUserID == "" && cfg.Commons != nil && cfg.Commons.SystemUserID != "" {
|
||||
cfg.PublicSharingDrivers.CS3.SystemUserID = cfg.Commons.SystemUserID
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ func Validate(cfg *config.Config) error {
|
||||
return shared.MissingSystemUserApiKeyError(cfg.Service.Name)
|
||||
}
|
||||
|
||||
if cfg.PublicSharingDriver == "cs3" && cfg.PublicSharingDrivers.CS3.ServiceUserID == "" {
|
||||
if cfg.PublicSharingDriver == "cs3" && cfg.PublicSharingDrivers.CS3.SystemUserID == "" {
|
||||
return shared.MissingSystemUserID(cfg.Service.Name)
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ func Validate(cfg *config.Config) error {
|
||||
return shared.MissingSystemUserApiKeyError(cfg.Service.Name)
|
||||
}
|
||||
|
||||
if cfg.UserSharingDriver == "cs3" && cfg.UserSharingDrivers.CS3.ServiceUserID == "" {
|
||||
if cfg.UserSharingDriver == "cs3" && cfg.UserSharingDrivers.CS3.SystemUserID == "" {
|
||||
return shared.MissingSystemUserID(cfg.Service.Name)
|
||||
}
|
||||
|
||||
|
||||
@@ -50,8 +50,8 @@ func SharingConfigFromStruct(cfg *config.Config) map[string]interface{} {
|
||||
},
|
||||
"cs3": map[string]interface{}{
|
||||
"provider_addr": cfg.UserSharingDrivers.CS3.ProviderAddr,
|
||||
"service_user_id": cfg.UserSharingDrivers.CS3.ServiceUserID,
|
||||
"service_user_idp": cfg.UserSharingDrivers.CS3.ServiceUserIDP,
|
||||
"service_user_id": cfg.UserSharingDrivers.CS3.SystemUserID,
|
||||
"service_user_idp": cfg.UserSharingDrivers.CS3.SystemUserIDP,
|
||||
"machine_auth_apikey": cfg.UserSharingDrivers.CS3.SystemUserAPIKey,
|
||||
},
|
||||
},
|
||||
@@ -75,8 +75,8 @@ func SharingConfigFromStruct(cfg *config.Config) map[string]interface{} {
|
||||
},
|
||||
"cs3": map[string]interface{}{
|
||||
"provider_addr": cfg.PublicSharingDrivers.CS3.ProviderAddr,
|
||||
"service_user_id": cfg.PublicSharingDrivers.CS3.ServiceUserID,
|
||||
"service_user_idp": cfg.PublicSharingDrivers.CS3.ServiceUserIDP,
|
||||
"service_user_id": cfg.PublicSharingDrivers.CS3.SystemUserID,
|
||||
"service_user_idp": cfg.PublicSharingDrivers.CS3.SystemUserIDP,
|
||||
"machine_auth_apikey": cfg.PublicSharingDrivers.CS3.SystemUserAPIKey,
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user