Class WrapResponse

java.lang.Object
io.github.jopenlibs.vault.response.VaultResponse
io.github.jopenlibs.vault.response.WrapResponse
All Implemented Interfaces:
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:
  • Constructor Details

    • 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 Details

    • getRenewable

      public Boolean getRenewable()
    • getToken

      public String getToken()
      Get response-wrapped token.
      Returns:
      response-wrapped token.
    • getAccessor

      public 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 String getCreationTime()
      Get the time that the response-wrapping token was created
      Returns:
      The time that the response-wrapping token was created;
    • getCreationPath

      public String getCreationPath()
      Get the API path that was called in the original request
      Returns:
      The API path that was called in the original request