generate metadata user id
Signed-off-by: Jörn Friedrich Dreyer <jfd@butonic.de>
This commit is contained in:
@@ -67,6 +67,7 @@ type Config struct {
|
||||
TokenManager *shared.TokenManager `yaml:"token_manager"`
|
||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY"`
|
||||
TransferSecret string `yaml:"transfer_secret" env:"STORAGE_TRANSFER_SECRET"`
|
||||
MetadataUserID string `yaml:"metadata_user_id"`
|
||||
Runtime Runtime `yaml:"runtime"`
|
||||
|
||||
Audit *audit.Config `yaml:"audit"`
|
||||
|
||||
@@ -94,6 +94,10 @@ func EnsureCommons(cfg *config.Config) {
|
||||
cfg.Commons.TransferSecret = cfg.TransferSecret
|
||||
}
|
||||
|
||||
// copy metadata user id to the commons part if set
|
||||
if cfg.MetadataUserID != "" {
|
||||
cfg.Commons.MetadataUserID = cfg.MetadataUserID
|
||||
}
|
||||
}
|
||||
|
||||
func Validate(cfg *config.Config) error {
|
||||
@@ -109,5 +113,9 @@ func Validate(cfg *config.Config) error {
|
||||
return shared.MissingMachineAuthApiKeyError("ocis")
|
||||
}
|
||||
|
||||
if cfg.MetadataUserID == "" {
|
||||
return shared.MissingMetadataUserID("ocis")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user