diff --git a/changelog/unreleased/serviceUser-systemUser.md b/changelog/unreleased/serviceUser-systemUser.md new file mode 100644 index 00000000000..6310f12278c --- /dev/null +++ b/changelog/unreleased/serviceUser-systemUser.md @@ -0,0 +1,6 @@ +Change: rename serviceUser to systemUser + +We renamed serviceUser to systemUser in all configs and vars +including yaml-tags and env vars + +https://github.com/owncloud/ocis/pull/3673 diff --git a/extensions/settings/pkg/config/config.go b/extensions/settings/pkg/config/config.go index 9bae2fae420..e9f79f52e41 100644 --- a/extensions/settings/pkg/config/config.go +++ b/extensions/settings/pkg/config/config.go @@ -39,7 +39,7 @@ type Metadata struct { GatewayAddress string `yaml:"gateway_addr" env:"STORAGE_GATEWAY_GRPC_ADDR"` StorageAddress string `yaml:"storage_addr" env:"STORAGE_GRPC_ADDR"` - ServiceUserID string `yaml:"service_user_id" env:"METADATA_SERVICE_USER_UUID"` - ServiceUserIDP string `yaml:"service_user_idp" env:"METADATA_SERVICE_USER_IDP"` + SystemUserID string `yaml:"system_user_id" env:"OCIS_SYSTEM_USER_ID;SETTINGS_SYSTEM_USER_ID"` + SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_SYSTEM_USER_IDP;SETTINGS_SYSTEM_USER_IDP"` SystemUserAPIKey string `yaml:"system_user_api_key" env:"OCIS_SYSTEM_USER_API_KEY"` } diff --git a/extensions/settings/pkg/config/defaults/defaultconfig.go b/extensions/settings/pkg/config/defaults/defaultconfig.go index 236bad6f45a..01b7709e227 100644 --- a/extensions/settings/pkg/config/defaults/defaultconfig.go +++ b/extensions/settings/pkg/config/defaults/defaultconfig.go @@ -52,7 +52,7 @@ func DefaultConfig() *config.Config { Metadata: config.Metadata{ GatewayAddress: "127.0.0.1:9215", // system storage StorageAddress: "127.0.0.1:9215", - ServiceUserIDP: "internal", + SystemUserIDP: "internal", }, } } @@ -93,8 +93,8 @@ func EnsureDefaults(cfg *config.Config) { cfg.Metadata.SystemUserAPIKey = cfg.Commons.SystemUserAPIKey } - if cfg.Metadata.ServiceUserID == "" && cfg.Commons != nil && cfg.Commons.SystemUserID != "" { - cfg.Metadata.ServiceUserID = cfg.Commons.SystemUserID + if cfg.Metadata.SystemUserID == "" && cfg.Commons != nil && cfg.Commons.SystemUserID != "" { + cfg.Metadata.SystemUserID = cfg.Commons.SystemUserID } } diff --git a/extensions/settings/pkg/store/metadata/store.go b/extensions/settings/pkg/store/metadata/store.go index 7511c510e33..5f4a51c090a 100644 --- a/extensions/settings/pkg/store/metadata/store.go +++ b/extensions/settings/pkg/store/metadata/store.go @@ -84,7 +84,7 @@ func New(cfg *config.Config) settings.Manager { // NewMetadataClient returns the MetadataClient func NewMetadataClient(cfg config.Metadata) MetadataClient { - mdc, err := metadata.NewCS3Storage(cfg.GatewayAddress, cfg.StorageAddress, cfg.ServiceUserID, cfg.ServiceUserIDP, cfg.SystemUserAPIKey) + mdc, err := metadata.NewCS3Storage(cfg.GatewayAddress, cfg.StorageAddress, cfg.SystemUserID, cfg.SystemUserIDP, cfg.SystemUserAPIKey) if err != nil { log.Fatal("error connecting to mdc:", err) } diff --git a/extensions/sharing/pkg/config/config.go b/extensions/sharing/pkg/config/config.go index 8926fcc731e..d7f70299ce2 100644 --- a/extensions/sharing/pkg/config/config.go +++ b/extensions/sharing/pkg/config/config.go @@ -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"` } diff --git a/extensions/sharing/pkg/config/defaults/defaultconfig.go b/extensions/sharing/pkg/config/defaults/defaultconfig.go index c191a21d21f..68f0e27557b 100644 --- a/extensions/sharing/pkg/config/defaults/defaultconfig.go +++ b/extensions/sharing/pkg/config/defaults/defaultconfig.go @@ -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 } } diff --git a/extensions/sharing/pkg/config/parser/parse.go b/extensions/sharing/pkg/config/parser/parse.go index 9b12b8f56a6..dcd30fba825 100644 --- a/extensions/sharing/pkg/config/parser/parse.go +++ b/extensions/sharing/pkg/config/parser/parse.go @@ -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) } diff --git a/extensions/sharing/pkg/revaconfig/config.go b/extensions/sharing/pkg/revaconfig/config.go index a7099520d27..54411284b63 100644 --- a/extensions/sharing/pkg/revaconfig/config.go +++ b/extensions/sharing/pkg/revaconfig/config.go @@ -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, }, },