Class LoginToken

java.lang.Object
org.springframework.vault.support.VaultToken
org.springframework.vault.authentication.LoginToken

public class LoginToken extends VaultToken
Value object for a Vault token obtained by a login method.
Author:
Mark Paluch
  • Method Details

    • of

      public static LoginToken of(String token)
      Create a new LoginToken.
      Parameters:
      token - must not be null.
      Returns:
      the created VaultToken
    • of

      public static LoginToken of(char[] token)
      Create a new LoginToken.
      Parameters:
      token - must not be null.
      Returns:
      the created VaultToken
      Since:
      1.1
    • of

      public static LoginToken of(char[] token, Duration leaseDuration)
      Create a new LoginToken with a leaseDurationSeconds.
      Parameters:
      token - must not be null.
      leaseDuration - the lease duration, must not be negative and not be null.
      Returns:
      the created VaultToken
      Since:
      2.0
    • renewable

      public static LoginToken renewable(VaultToken token, Duration leaseDuration)
      Create a new renewable LoginToken with a leaseDurationSeconds.
      Parameters:
      token - must not be null.
      leaseDuration - the lease duration, must not be null or negative.
      Returns:
      the created VaultToken
      Since:
      2.0
    • renewable

      public static LoginToken renewable(char[] token, Duration leaseDuration)
      Create a new renewable LoginToken with a leaseDurationSeconds.
      Parameters:
      token - must not be null.
      leaseDuration - the lease duration, must not be null or negative.
      Returns:
      the created VaultToken
      Since:
      2.0
    • getLeaseDuration

      public Duration getLeaseDuration()
      Returns:
      the lease duration in seconds. May be 0 if none.
    • isRenewable

      public boolean isRenewable()
      Returns:
      true if this token is renewable; false otherwise.
    • toString

      public String toString()
      Overrides:
      toString in class VaultToken