java.lang.Object
io.github.jopenlibs.vault.response.VaultResponse
io.github.jopenlibs.vault.response.WrapResponse
- All Implemented Interfaces:
Serializable
When a response is wrapped, the normal API response from Vault does not contain the original
secret, but rather contains a set of information related to the response-wrapping token.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionWrapResponse(RestResponse restResponse, int retries) Parse response-wrapping and create an instance of response. -
Method Summary
Modifier and TypeMethodDescriptionIf the wrapped response is an authentication response containing a Vault token, this is the value of the wrapped token's accessor.Get the API path that was called in the original requestGet the time that the response-wrapping token was createdgetToken()Get response-wrapped token.intgetTtl()Get wrapped token TTL.Methods inherited from class io.github.jopenlibs.vault.response.VaultResponse
getRestResponse, getRetries
-
Constructor Details
-
WrapResponse
Parse response-wrapping and create an instance of response.- Parameters:
restResponse- The raw HTTP response from Vault.retries- The number of retry attempts that occurred during the API call (can be zero).
-
-
Method Details
-
getRenewable
-
getToken
Get response-wrapped token.- Returns:
- response-wrapped token.
-
getAccessor
If the wrapped response is an authentication response containing a Vault token, this is the value of the wrapped token's accessor. This is useful for orchestration systems (such as Nomad) to be able to control the lifetime of secrets based on their knowledge of the lifetime of jobs, without having to actually unwrap the response-wrapping token or gain knowledge of the token ID inside- Returns:
- Wrapped Accessor.
-
getTtl
public int getTtl()Get wrapped token TTL.- Returns:
- Wrapped token TTL.
-
getCreationTime
Get the time that the response-wrapping token was created- Returns:
- The time that the response-wrapping token was created;
-
getCreationPath
Get the API path that was called in the original request- Returns:
- The API path that was called in the original request
-