revert all changes to frontend

This commit is contained in:
case0sh
2023-10-06 10:53:39 +02:00
parent 330e30c38e
commit 9b291c0739
4 changed files with 12 additions and 2 deletions
+3 -2
View File
@@ -20,8 +20,9 @@ type Config struct {
TransferSecret string `yaml:"transfer_secret" env:"OCIS_TRANSFER_SECRET" desc:"Transfer secret for signing file up- and download requests."`
TokenManager *TokenManager `yaml:"token_manager"`
Reva *shared.Reva `yaml:"reva"`
TokenManager *TokenManager `yaml:"token_manager"`
Reva *shared.Reva `yaml:"reva"`
MachineAuthAPIKey string `yaml:"machine_auth_api_key" env:"OCIS_MACHINE_AUTH_API_KEY;FRONTEND_MACHINE_AUTH_API_KEY" desc:"The machine auth API key used to validate internal requests necessary to access resources from other services."`
SkipUserGroupsInToken bool `yaml:"skip_user_groups_in_token" env:"FRONTEND_SKIP_USER_GROUPS_IN_TOKEN" desc:"Disables the loading of user's group memberships from the reva access token."`
@@ -169,6 +169,10 @@ func EnsureDefaults(cfg *config.Config) {
cfg.TransferSecret = cfg.Commons.TransferSecret
}
if cfg.MachineAuthAPIKey == "" && cfg.Commons != nil && cfg.Commons.MachineAuthAPIKey != "" {
cfg.MachineAuthAPIKey = cfg.Commons.MachineAuthAPIKey
}
}
// Sanitize sanitized the configuration
@@ -43,6 +43,10 @@ func Validate(cfg *config.Config) error {
return shared.MissingRevaTransferSecretError(cfg.Service.Name)
}
if cfg.MachineAuthAPIKey == "" {
return shared.MissingMachineAuthApiKeyError(cfg.Service.Name)
}
if cfg.GRPCClientTLS == nil && cfg.Commons != nil {
cfg.GRPCClientTLS = structs.CopyOrZeroValue(cfg.Commons.GRPCClientTLS)
}
@@ -168,6 +168,7 @@ func FrontendConfigFromStruct(cfg *config.Config, logger log.Logger) (map[string
"stat_cache_table": cfg.OCS.StatCacheTable,
"prefix": cfg.OCS.Prefix,
"additional_info_attribute": cfg.OCS.AdditionalInfoAttribute,
"machine_auth_apikey": cfg.MachineAuthAPIKey,
"enable_denials": cfg.OCS.EnableDenials,
"cache_warmup_driver": cfg.OCS.CacheWarmupDriver,
"cache_warmup_drivers": map[string]interface{}{