- java.lang.Object
-
- io.github.jopenlibs.vault.response.VaultResponse
-
- io.github.jopenlibs.vault.response.WrapResponse
-
- All Implemented Interfaces:
java.io.Serializable
public class WrapResponse extends VaultResponse
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WrapResponse(RestResponse restResponse, int retries)
Parse response-wrapping and create an instance of response.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAccessor()
If the wrapped response is an authentication response containing a Vault token, this is the value of the wrapped token's accessor.java.lang.String
getCreationPath()
Get the API path that was called in the original requestjava.lang.String
getCreationTime()
Get the time that the response-wrapping token was createdjava.lang.Boolean
getRenewable()
java.lang.String
getToken()
Get response-wrapped token.int
getTtl()
Get wrapped token TTL.-
Methods inherited from class io.github.jopenlibs.vault.response.VaultResponse
getRestResponse, getRetries
-
-
-
-
Constructor Detail
-
WrapResponse
public WrapResponse(RestResponse restResponse, int retries)
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 Detail
-
getRenewable
public java.lang.Boolean getRenewable()
-
getToken
public java.lang.String getToken()
Get response-wrapped token.- Returns:
- response-wrapped token.
-
getAccessor
public java.lang.String 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
public java.lang.String getCreationTime()
Get the time that the response-wrapping token was created- Returns:
- The time that the response-wrapping token was created;
-
getCreationPath
public java.lang.String getCreationPath()
Get the API path that was called in the original request- Returns:
- The API path that was called in the original request
-
-