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": "",
|
"entity_id": "",
|
||||||
"token_type": "service",
|
"token_type": "service",
|
||||||
"orphan": false,
|
"orphan": false,
|
||||||
|
"num_uses": json.Number("0"),
|
||||||
},
|
},
|
||||||
"warnings": nilWarnings,
|
"warnings": nilWarnings,
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,6 +39,7 @@ func LogicalResponseToHTTPResponse(input *Response) *HTTPResponse {
|
||||||
EntityID: input.Auth.EntityID,
|
EntityID: input.Auth.EntityID,
|
||||||
TokenType: input.Auth.TokenType.String(),
|
TokenType: input.Auth.TokenType.String(),
|
||||||
Orphan: input.Auth.Orphan,
|
Orphan: input.Auth.Orphan,
|
||||||
|
NumUses: input.Auth.NumUses,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -108,6 +109,7 @@ type HTTPAuth struct {
|
||||||
EntityID string `json:"entity_id"`
|
EntityID string `json:"entity_id"`
|
||||||
TokenType string `json:"token_type"`
|
TokenType string `json:"token_type"`
|
||||||
Orphan bool `json:"orphan"`
|
Orphan bool `json:"orphan"`
|
||||||
|
NumUses int `json:"num_uses"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type HTTPWrapInfo struct {
|
type HTTPWrapInfo struct {
|
||||||
|
|
|
@ -158,7 +158,8 @@ $ curl \
|
||||||
"renewable": true,
|
"renewable": true,
|
||||||
"entity_id": "",
|
"entity_id": "",
|
||||||
"token_type": "service",
|
"token_type": "service",
|
||||||
"orphan": false
|
"orphan": false,
|
||||||
|
"num_uses": 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Reference in New Issue