Merge pull request #3602 from owncloud/metadata-gateway
introduce metadata gateway
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
|
||||
}
|
||||
|
||||
@@ -45,3 +45,11 @@ func MissingServiceUserPassword(service, serviceUser string) error {
|
||||
"the config/corresponding environment variable).",
|
||||
serviceUser, service, defaults.BaseConfigPath())
|
||||
}
|
||||
|
||||
func MissingMetadataUserID(service string) error {
|
||||
return fmt.Errorf("The metadata user ID has not been configured for %s. "+
|
||||
"Make sure your %s config contains the proper values "+
|
||||
"(e.g. by running ocis init or setting it manually in "+
|
||||
"the config/corresponding environment variable).",
|
||||
service, defaults.BaseConfigPath())
|
||||
}
|
||||
|
||||
@@ -44,4 +44,5 @@ type Commons struct {
|
||||
Reva *Reva `yaml:"reva"`
|
||||
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY"`
|
||||
TransferSecret string `yaml:"transfer_secret,omitempty" env:"REVA_TRANSFER_SECRET"`
|
||||
MetadataUserID string `yaml:"metadata_user_id" env:"METADATA_USER_ID"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user