Show renewable status for tokens in output
This commit is contained in:
parent
e9fbb9fabe
commit
f8d70b64a0
|
@ -1280,6 +1280,11 @@ func (ts *TokenStore) handleLookup(
|
|||
if !leaseTimes.ExpireTime.IsZero() {
|
||||
resp.Data["ttl"] = int64(leaseTimes.ExpireTime.Sub(time.Now().Round(time.Second)).Seconds())
|
||||
}
|
||||
if err := leaseTimes.renewable(); err == nil {
|
||||
resp.Data["renewable"] = true
|
||||
} else {
|
||||
resp.Data["renewable"] = false
|
||||
}
|
||||
}
|
||||
|
||||
return resp, nil
|
||||
|
|
|
@ -1016,6 +1016,7 @@ func TestTokenStore_HandleRequest_Lookup(t *testing.T) {
|
|||
"ttl": int64(3600),
|
||||
"role": "",
|
||||
"explicit_max_ttl": int64(0),
|
||||
"renewable": true,
|
||||
}
|
||||
|
||||
if resp.Data["creation_time"].(int64) == 0 {
|
||||
|
@ -1058,6 +1059,7 @@ func TestTokenStore_HandleRequest_Lookup(t *testing.T) {
|
|||
"ttl": int64(3600),
|
||||
"role": "",
|
||||
"explicit_max_ttl": int64(0),
|
||||
"renewable": true,
|
||||
}
|
||||
|
||||
if resp.Data["creation_time"].(int64) == 0 {
|
||||
|
|
Loading…
Reference in New Issue