prevent int64 overflow for default_lease_ttl and max_lease_ttl (#14206)

* prevent int64 overflow for default_lease_ttl and max_lease_ttl

* add changelog entry

* wording change in changelog entry
This commit is contained in:
Chris Capurso 2022-02-23 17:08:52 -05:00 committed by GitHub
parent 1877fc16d7
commit 45875c7e71
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 6 deletions

4
changelog/14206.txt Normal file
View File

@ -0,0 +1,4 @@
```release-note:change
core: Changes the unit of `default_lease_ttl` and `max_lease_ttl` values returned by
the `/sys/config/state/sanitized` endpoint from nanoseconds to seconds.
```

View File

@ -831,8 +831,8 @@ func (c *Config) Sanitized() map[string]interface{} {
"enable_ui": c.EnableUI,
"max_lease_ttl": c.MaxLeaseTTL,
"default_lease_ttl": c.DefaultLeaseTTL,
"max_lease_ttl": c.MaxLeaseTTL / time.Second,
"default_lease_ttl": c.DefaultLeaseTTL / time.Second,
"cluster_cipher_suites": c.ClusterCipherSuites,

View File

@ -687,7 +687,7 @@ func testConfig_Sanitized(t *testing.T) {
"cluster_addr": "top_level_cluster_addr",
"cluster_cipher_suites": "",
"cluster_name": "testcluster",
"default_lease_ttl": 10 * time.Hour,
"default_lease_ttl": (365 * 24 * time.Hour) / time.Second,
"default_max_request_duration": 0 * time.Second,
"disable_cache": true,
"disable_clustering": false,
@ -718,7 +718,7 @@ func testConfig_Sanitized(t *testing.T) {
},
"log_format": "",
"log_level": "",
"max_lease_ttl": 10 * time.Hour,
"max_lease_ttl": (30 * 24 * time.Hour) / time.Second,
"pid_file": "./pidfile",
"plugin_directory": "",
"seals": []interface{}{

View File

@ -45,8 +45,8 @@ seal "awskms" {
secret_key = "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}
max_lease_ttl = "10h"
default_lease_ttl = "10h"
max_lease_ttl = "30d"
default_lease_ttl = "365d"
cluster_name = "testcluster"
pid_file = "./pidfile"
raw_storage_endpoint = true