mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 11:38:02 +00:00
Rename config lease_duration parameters to lease_ttl in line with current standardization efforts
This commit is contained in:
@@ -22,10 +22,10 @@ type Config struct {
|
||||
|
||||
Telemetry *Telemetry `hcl:"telemetry"`
|
||||
|
||||
MaxLeaseDuration time.Duration `hcl:"-"`
|
||||
MaxLeaseDurationRaw string `hcl:"max_lease_duration"`
|
||||
DefaultLeaseDuration time.Duration `hcl:"-"`
|
||||
DefaultLeaseDurationRaw string `hcl:"default_lease_duration"`
|
||||
MaxLeaseTTL time.Duration `hcl:"-"`
|
||||
MaxLeaseTTLRaw string `hcl:"max_lease_ttl"`
|
||||
DefaultLeaseTTL time.Duration `hcl:"-"`
|
||||
DefaultLeaseTTLRaw string `hcl:"default_lease_ttl"`
|
||||
}
|
||||
|
||||
// DevConfig is a Config that is used for dev mode of Vault.
|
||||
@@ -48,8 +48,8 @@ func DevConfig() *Config {
|
||||
|
||||
Telemetry: &Telemetry{},
|
||||
|
||||
MaxLeaseDuration: 30 * 24 * time.Hour,
|
||||
DefaultLeaseDuration: 30 * 24 * time.Hour,
|
||||
MaxLeaseTTL: 30 * 24 * time.Hour,
|
||||
DefaultLeaseTTL: 30 * 24 * time.Hour,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,14 +113,14 @@ func (c *Config) Merge(c2 *Config) *Config {
|
||||
}
|
||||
|
||||
// merge these integers via a MAX operation
|
||||
result.MaxLeaseDuration = c.MaxLeaseDuration
|
||||
if c2.MaxLeaseDuration > result.MaxLeaseDuration {
|
||||
result.MaxLeaseDuration = c2.MaxLeaseDuration
|
||||
result.MaxLeaseTTL = c.MaxLeaseTTL
|
||||
if c2.MaxLeaseTTL > result.MaxLeaseTTL {
|
||||
result.MaxLeaseTTL = c2.MaxLeaseTTL
|
||||
}
|
||||
|
||||
result.DefaultLeaseDuration = c.DefaultLeaseDuration
|
||||
if c2.DefaultLeaseDuration > result.DefaultLeaseDuration {
|
||||
result.DefaultLeaseDuration = c2.DefaultLeaseDuration
|
||||
result.DefaultLeaseTTL = c.DefaultLeaseTTL
|
||||
if c2.DefaultLeaseTTL > result.DefaultLeaseTTL {
|
||||
result.DefaultLeaseTTL = c2.DefaultLeaseTTL
|
||||
}
|
||||
|
||||
return result
|
||||
@@ -161,13 +161,13 @@ func LoadConfigFile(path string) (*Config, error) {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
if result.MaxLeaseDurationRaw != "" {
|
||||
if result.MaxLeaseDuration, err = time.ParseDuration(result.MaxLeaseDurationRaw); err != nil {
|
||||
if result.MaxLeaseTTLRaw != "" {
|
||||
if result.MaxLeaseTTL, err = time.ParseDuration(result.MaxLeaseTTLRaw); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
if result.DefaultLeaseDurationRaw != "" {
|
||||
if result.DefaultLeaseDuration, err = time.ParseDuration(result.DefaultLeaseDurationRaw); err != nil {
|
||||
if result.DefaultLeaseTTLRaw != "" {
|
||||
if result.DefaultLeaseTTL, err = time.ParseDuration(result.DefaultLeaseTTLRaw); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user