mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 11:38:02 +00:00
Add creation time to returned wrapped token info
This makes it easier to understand the expected lifetime without a lookup call that uses the single use left on the token. This also adds a couple of safety checks and for JSON uses int, rather than int64, for the TTL for the wrapped token.
This commit is contained in:
@@ -68,8 +68,9 @@ func TestCopy_response(t *testing.T) {
|
||||
"foo": "bar",
|
||||
},
|
||||
WrapInfo: &logical.WrapInfo{
|
||||
TTL: 60,
|
||||
Token: "foo",
|
||||
TTL: 60,
|
||||
Token: "foo",
|
||||
CreationTime: 100000,
|
||||
},
|
||||
}
|
||||
arg := expected
|
||||
@@ -137,8 +138,9 @@ func TestHash(t *testing.T) {
|
||||
"foo": "bar",
|
||||
},
|
||||
WrapInfo: &logical.WrapInfo{
|
||||
TTL: 60,
|
||||
Token: "bar",
|
||||
TTL: 60,
|
||||
Token: "bar",
|
||||
CreationTime: 100000,
|
||||
},
|
||||
},
|
||||
&logical.Response{
|
||||
@@ -146,8 +148,9 @@ func TestHash(t *testing.T) {
|
||||
"foo": "hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317",
|
||||
},
|
||||
WrapInfo: &logical.WrapInfo{
|
||||
TTL: 60,
|
||||
Token: "hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317",
|
||||
TTL: 60,
|
||||
Token: "hmac-sha256:f9320baf0249169e73850cd6156ded0106e2bb6ad8cab01b7bbbebe6d1065317",
|
||||
CreationTime: 100000,
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user