Move reva transfer secret to shared.Commons

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2022-04-26 14:09:29 +02:00
parent a4d7696232
commit 58a24e620e
9 changed files with 31 additions and 15 deletions
+3 -2
View File
@@ -57,8 +57,9 @@ type Config struct {
Registry string `yaml:"registry,omitempty"`
TokenManager *shared.TokenManager `yaml:"token_manager,omitempty"`
MachineAuthAPIKey string
Runtime Runtime `yaml:"runtime,omitempty"`
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY"`
TransferSecret string `yaml:"transfer_secret,omitempty"`
Runtime Runtime `yaml:"runtime,omitempty"`
Audit *audit.Config `yaml:"audit,omitempty"`
Accounts *accounts.Config `yaml:"accounts,omitempty"`
+6
View File
@@ -57,6 +57,12 @@ func ParseConfig(cfg *config.Config) error {
log.Fatalf("machine auth api key is not set up properly, bailing out (ocis)")
}
if cfg.TransferSecret != "" {
cfg.Commons.TransferSecret = cfg.TransferSecret
} else {
log.Fatalf("reva transfer secret not properly set, bailing out (ocis)")
}
// load all env variables relevant to the config in the current context.
if err := envdecode.Decode(cfg); err != nil {
// no environment variable set for this config is an expected "error"
+1
View File
@@ -37,4 +37,5 @@ type Commons struct {
OcisURL string `yaml:"ocis_url" env:"OCIS_URL"`
TokenManager *TokenManager `yaml:"token_manager"`
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY"`
TransferSecret string `yaml:"transfer_secret,omitempty" env:"REVA_TRANSFER_SECRET"`
}