Return num_uses during authentication (#12791)
* Return num_uses during authentication https://github.com/hashicorp/vault/issues/10664 * Add changelog entry
This commit is contained in:
parent
0e1424782b
commit
961ff4a363
|
@ -0,0 +1,3 @@
|
|||
```release-notes:improvemment
|
||||
core: `num_uses` is now returned during authentication
|
||||
```
|
|
@ -224,6 +224,7 @@ func TestLogical_CreateToken(t *testing.T) {
|
|||
"entity_id": "",
|
||||
"token_type": "service",
|
||||
"orphan": false,
|
||||
"num_uses": json.Number("0"),
|
||||
},
|
||||
"warnings": nilWarnings,
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ func LogicalResponseToHTTPResponse(input *Response) *HTTPResponse {
|
|||
EntityID: input.Auth.EntityID,
|
||||
TokenType: input.Auth.TokenType.String(),
|
||||
Orphan: input.Auth.Orphan,
|
||||
NumUses: input.Auth.NumUses,
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -108,6 +109,7 @@ type HTTPAuth struct {
|
|||
EntityID string `json:"entity_id"`
|
||||
TokenType string `json:"token_type"`
|
||||
Orphan bool `json:"orphan"`
|
||||
NumUses int `json:"num_uses"`
|
||||
}
|
||||
|
||||
type HTTPWrapInfo struct {
|
||||
|
|
|
@ -158,7 +158,8 @@ $ curl \
|
|||
"renewable": true,
|
||||
"entity_id": "",
|
||||
"token_type": "service",
|
||||
"orphan": false
|
||||
"orphan": false,
|
||||
"num_uses": 0
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Reference in New Issue