make service user configurable
Signed-off-by: jkoberg <jkoberg@owncloud.com>
This commit is contained in:
@@ -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"`
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user