Format token lease/TTL as int in JSON API when looking up
This commit is contained in:
parent
4ba4488269
commit
ca50012017
|
@ -730,8 +730,8 @@ func (ts *TokenStore) handleLookup(
|
|||
"meta": out.Meta,
|
||||
"display_name": out.DisplayName,
|
||||
"num_uses": out.NumUses,
|
||||
"creation_time": out.CreationTime,
|
||||
"ttl": out.TTL,
|
||||
"creation_time": int(out.CreationTime),
|
||||
"ttl": int(out.TTL.Seconds()),
|
||||
},
|
||||
}
|
||||
return resp, nil
|
||||
|
|
|
@ -846,7 +846,7 @@ func TestTokenStore_HandleRequest_Lookup(t *testing.T) {
|
|||
"meta": map[string]string(nil),
|
||||
"display_name": "root",
|
||||
"num_uses": 0,
|
||||
"ttl": time.Duration(0),
|
||||
"ttl": 0,
|
||||
}
|
||||
delete(resp.Data, "creation_time")
|
||||
if !reflect.DeepEqual(resp.Data, exp) {
|
||||
|
@ -913,7 +913,7 @@ func TestTokenStore_HandleRequest_LookupSelf(t *testing.T) {
|
|||
"meta": map[string]string(nil),
|
||||
"display_name": "root",
|
||||
"num_uses": 0,
|
||||
"ttl": time.Duration(0),
|
||||
"ttl": 0,
|
||||
}
|
||||
delete(resp.Data, "creation_time")
|
||||
if !reflect.DeepEqual(resp.Data, exp) {
|
||||
|
|
Loading…
Reference in a new issue