From cd6d82c2a889e929044e5a768c8c388ee3b9d040 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 4 May 2022 11:53:42 +0200 Subject: [PATCH 1/3] serviceUser -> systemUser Signed-off-by: jkoberg --- extensions/settings/pkg/config/config.go | 4 ++-- .../pkg/config/defaults/defaultconfig.go | 6 +++--- extensions/settings/pkg/store/metadata/store.go | 2 +- extensions/sharing/pkg/config/config.go | 8 ++++---- .../sharing/pkg/config/defaults/defaultconfig.go | 16 ++++++++-------- extensions/sharing/pkg/config/parser/parse.go | 4 ++-- extensions/sharing/pkg/revaconfig/config.go | 8 ++++---- 7 files changed, 24 insertions(+), 24 deletions(-) diff --git a/extensions/settings/pkg/config/config.go b/extensions/settings/pkg/config/config.go index 8182911bf5a..2f227012c03 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;METADATA_SYSTEM_USER_UUID"` + SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_URL;OCIS_SYSTEM_USER_IDP;METADATA_SYSTEM_USER_IDP"` MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY"` } diff --git a/extensions/settings/pkg/config/defaults/defaultconfig.go b/extensions/settings/pkg/config/defaults/defaultconfig.go index 6fee017caaa..79eccbb22fe 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", // metadata storage StorageAddress: "127.0.0.1:9215", - ServiceUserIDP: "internal", + SystemUserIDP: "internal", }, } } @@ -93,8 +93,8 @@ func EnsureDefaults(cfg *config.Config) { cfg.Metadata.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey } - 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 c98615559a7..15735126d5a 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.MachineAuthAPIKey) + mdc, err := metadata.NewCS3Storage(cfg.GatewayAddress, cfg.StorageAddress, cfg.SystemUserID, cfg.SystemUserIDP, cfg.MachineAuthAPIKey) 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 553ba05ec76..f416067a130 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_SERVICE_USER_ID"` + SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_URL;OCIS_SYSTEM_USER_IDP;SHARING_USER_CS3_SERVICE_USER_IDP"` MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;SHARING_USER_CS3_MACHINE_AUTH_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_URL;OCIS_SYSTEM_USER_IDP;SHARING_PUBLIC_CS3_SERVICE_USER_IDP"` MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;SHARING_PUBLIC_CS3_MACHINE_AUTH_API_KEY"` } diff --git a/extensions/sharing/pkg/config/defaults/defaultconfig.go b/extensions/sharing/pkg/config/defaults/defaultconfig.go index 518c0ae58ea..0cc672be528 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.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey } - 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.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" { cfg.PublicSharingDrivers.CS3.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey } - 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 df63239c292..02923047dca 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.MissingMachineAuthApiKeyError(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.MissingMachineAuthApiKeyError(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 00a8d3a2511..50b8de33f36 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, + "system_user_id": cfg.UserSharingDrivers.CS3.SystemUserID, + "system_user_idp": cfg.UserSharingDrivers.CS3.SystemUserIDP, "machine_auth_apikey": cfg.UserSharingDrivers.CS3.MachineAuthAPIKey, }, }, @@ -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, + "system_user_id": cfg.PublicSharingDrivers.CS3.SystemUserID, + "system_user_idp": cfg.PublicSharingDrivers.CS3.SystemUserIDP, "machine_auth_apikey": cfg.PublicSharingDrivers.CS3.MachineAuthAPIKey, }, }, From 6ce9f76aeac190ecc1bc92b97650943f09014c51 Mon Sep 17 00:00:00 2001 From: jkoberg Date: Wed, 4 May 2022 11:55:46 +0200 Subject: [PATCH 2/3] changelog Signed-off-by: jkoberg --- changelog/unreleased/serviceUser-systemUser.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 changelog/unreleased/serviceUser-systemUser.md 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 From 080ad7ce89207526a9b36a308146786de2d02026 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rn=20Friedrich=20Dreyer?= Date: Wed, 4 May 2022 11:16:43 +0000 Subject: [PATCH 3/3] leave out OCIS_URL, cleanup MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jörn Friedrich Dreyer --- extensions/settings/pkg/config/config.go | 4 ++-- extensions/sharing/pkg/config/config.go | 6 +++--- extensions/sharing/pkg/revaconfig/config.go | 8 ++++---- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/extensions/settings/pkg/config/config.go b/extensions/settings/pkg/config/config.go index 2f227012c03..77004bf5c08 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"` - SystemUserID string `yaml:"system_user_id" env:"OCIS_SYSTEM_USER_ID;METADATA_SYSTEM_USER_UUID"` - SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_URL;OCIS_SYSTEM_USER_IDP;METADATA_SYSTEM_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"` MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY"` } diff --git a/extensions/sharing/pkg/config/config.go b/extensions/sharing/pkg/config/config.go index f416067a130..cda6542c90a 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"` - SystemUserID string `yaml:"system_user_id" env:"OCIS_SYSTEM_USER_ID;SHARING_USER_CS3_SERVICE_USER_ID"` - SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_URL;OCIS_SYSTEM_USER_IDP;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"` MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;SHARING_USER_CS3_MACHINE_AUTH_API_KEY"` } @@ -126,7 +126,7 @@ type PublicSharingSQLDriver struct { type PublicSharingCS3Driver struct { ProviderAddr string `yaml:"provider_addr" env:"SHARING_PUBLIC_CS3_PROVIDER_ADDR"` 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_URL;OCIS_SYSTEM_USER_IDP;SHARING_PUBLIC_CS3_SERVICE_USER_IDP"` + SystemUserIDP string `yaml:"system_user_idp" env:"OCIS_SYSTEM_USER_IDP;SHARING_PUBLIC_CS3_SYSTEM_USER_IDP"` MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;SHARING_PUBLIC_CS3_MACHINE_AUTH_API_KEY"` } diff --git a/extensions/sharing/pkg/revaconfig/config.go b/extensions/sharing/pkg/revaconfig/config.go index 50b8de33f36..593bed02901 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, - "system_user_id": cfg.UserSharingDrivers.CS3.SystemUserID, - "system_user_idp": cfg.UserSharingDrivers.CS3.SystemUserIDP, + "service_user_id": cfg.UserSharingDrivers.CS3.SystemUserID, + "service_user_idp": cfg.UserSharingDrivers.CS3.SystemUserIDP, "machine_auth_apikey": cfg.UserSharingDrivers.CS3.MachineAuthAPIKey, }, }, @@ -75,8 +75,8 @@ func SharingConfigFromStruct(cfg *config.Config) map[string]interface{} { }, "cs3": map[string]interface{}{ "provider_addr": cfg.PublicSharingDrivers.CS3.ProviderAddr, - "system_user_id": cfg.PublicSharingDrivers.CS3.SystemUserID, - "system_user_idp": cfg.PublicSharingDrivers.CS3.SystemUserIDP, + "service_user_id": cfg.PublicSharingDrivers.CS3.SystemUserID, + "service_user_idp": cfg.PublicSharingDrivers.CS3.SystemUserIDP, "machine_auth_apikey": cfg.PublicSharingDrivers.CS3.MachineAuthAPIKey, }, },