mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
VAULT-24736 CE changes for static secret capability behaviour toggle (#26744)
This commit is contained in:
@@ -109,6 +109,7 @@ type Cache struct {
|
||||
DisableCachingDynamicSecrets bool `hcl:"disable_caching_dynamic_secrets"`
|
||||
StaticSecretTokenCapabilityRefreshIntervalRaw interface{} `hcl:"static_secret_token_capability_refresh_interval"`
|
||||
StaticSecretTokenCapabilityRefreshInterval time.Duration `hcl:"-"`
|
||||
StaticSecretTokenCapabilityRefreshBehaviour string `hcl:"static_secret_token_capability_refresh_behavior"`
|
||||
}
|
||||
|
||||
// AutoAuth is the configured authentication method and sinks
|
||||
@@ -271,6 +272,15 @@ func (c *Config) ValidateConfig() error {
|
||||
return fmt.Errorf("no auto_auth, cache, or listener block found in config")
|
||||
}
|
||||
|
||||
if c.Cache != nil && c.Cache.StaticSecretTokenCapabilityRefreshBehaviour != "" {
|
||||
switch c.Cache.StaticSecretTokenCapabilityRefreshBehaviour {
|
||||
case "pessimistic":
|
||||
case "optimistic":
|
||||
default:
|
||||
return fmt.Errorf("cache.static_secret_token_capability_refresh_behavior must be either \"optimistic\" or \"pessimistic\"")
|
||||
}
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user