Class LoginToken
java.lang.Object
org.springframework.vault.support.VaultToken
org.springframework.vault.authentication.LoginToken
Value object for a Vault token obtained by a login method.
- Author:
- Mark Paluch
-
Method Summary
Modifier and TypeMethodDescriptionbooleanstatic LoginTokenof(char[] token) Create a newLoginToken.static LoginTokenCreate a newLoginTokenwith aleaseDurationSeconds.static LoginTokenCreate a newLoginToken.static LoginTokenCreate a new renewableLoginTokenwith aleaseDurationSeconds.static LoginTokenrenewable(VaultToken token, Duration leaseDuration) Create a new renewableLoginTokenwith aleaseDurationSeconds.toString()Methods inherited from class org.springframework.vault.support.VaultToken
equals, getToken, hashCode, toCharArray
-
Method Details
-
of
Create a newLoginToken.- Parameters:
token- must not be null.- Returns:
- the created
VaultToken
-
of
Create a newLoginToken.- Parameters:
token- must not be null.- Returns:
- the created
VaultToken - Since:
- 1.1
-
of
Create a newLoginTokenwith aleaseDurationSeconds.- 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
Create a new renewableLoginTokenwith aleaseDurationSeconds.- Parameters:
token- must not be null.leaseDuration- the lease duration, must not be null or negative.- Returns:
- the created
VaultToken - Since:
- 2.0
-
renewable
Create a new renewableLoginTokenwith aleaseDurationSeconds.- Parameters:
token- must not be null.leaseDuration- the lease duration, must not be null or negative.- Returns:
- the created
VaultToken - Since:
- 2.0
-
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
- Overrides:
toStringin classVaultToken
-