make service user configurable

Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
jkoberg
2022-03-07 11:55:33 +01:00
parent 7bfeb162bc
commit f4619dbb47
5 changed files with 6 additions and 4 deletions

2
go.mod
View File

@@ -277,4 +277,4 @@ require (
// we need to use a fork to make the windows build pass
replace github.com/pkg/xattr => github.com/micbar/xattr v0.4.6-0.20220215112335-88e74d648fb7
replace github.com/cs3org/reva => github.com/kobergj/reva v1.13.1-0.20220303154205-2c903784bfdf
replace github.com/cs3org/reva => github.com/kobergj/reva v1.13.1-0.20220307095710-5e1b13a62aae

4
go.sum
View File

@@ -912,8 +912,8 @@ github.com/klauspost/cpuid/v2 v2.0.4/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa02
github.com/klauspost/cpuid/v2 v2.0.9 h1:lgaqFMSdTdQYdZ04uHyN2d/eKdOMyi2YLSvlQIBFYa4=
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
github.com/kljensen/snowball v0.6.0/go.mod h1:27N7E8fVU5H68RlUmnWwZCfxgt4POBJfENGMvNRhldw=
github.com/kobergj/reva v1.13.1-0.20220303154205-2c903784bfdf h1:SOzP8F2D1er8MWjafd4cIp2IHjkj28QwBZEIjukY/eg=
github.com/kobergj/reva v1.13.1-0.20220303154205-2c903784bfdf/go.mod h1:fdlrnZ0f+UtAdpZfLG+4LM0ZrhT5V8tPEQt6ycYm82c=
github.com/kobergj/reva v1.13.1-0.20220307095710-5e1b13a62aae h1:gbjYn6OqFtTIX9wkX5Hhh4GMSoLSByN1O48WvSJ9jy8=
github.com/kobergj/reva v1.13.1-0.20220307095710-5e1b13a62aae/go.mod h1:fdlrnZ0f+UtAdpZfLG+4LM0ZrhT5V8tPEQt6ycYm82c=
github.com/kolo/xmlrpc v0.0.0-20200310150728-e0350524596b/go.mod h1:o03bZfuBwAXHetKXuInt4S7omeXUu62/A845kiycsSQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=

View File

@@ -40,5 +40,6 @@ type Metadata struct {
StorageAddress string `ocisConfig:"storage_addr" env:"STORAGE_GRPC_ADDR"`
ServiceUserID string `ocisConfig:"service_user_id" env:"METADATA_SERVICE_USER_UUID"`
ServiceUserIDP string `ocisConfig:"service_user_idp" env:"METADATA_SERVICE_USER_IDP"`
MachineAuthAPIKey string `ocisConfig:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY"`
}

View File

@@ -46,6 +46,7 @@ func DefaultConfig() *Config {
GatewayAddress: "127.0.0.1:9142",
StorageAddress: "127.0.0.1:9215",
ServiceUserID: "95cb8724-03b2-11eb-a0a6-c33ef8ef53ad",
ServiceUserIDP: "localhost:9200",
MachineAuthAPIKey: "change-me-please",
},
}

View File

@@ -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.MachineAuthAPIKey)
mdc, err := metadata.NewCS3Storage(cfg.GatewayAddress, cfg.StorageAddress, cfg.ServiceUserID, cfg.ServiceUserIDP, cfg.MachineAuthAPIKey)
if err != nil {
log.Fatal("error connecting to mdc:", err)
}