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
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic LoginToken.LoginTokenBuilder
builder()
getType()
boolean
boolean
boolean
static LoginToken
of
(char[] token) Create a newLoginToken
.static LoginToken
Create a newLoginToken
with aleaseDurationSeconds
.static LoginToken
Create a newLoginToken
.static LoginToken
Create a new renewableLoginToken
with aleaseDurationSeconds
.static LoginToken
renewable
(VaultToken token, Duration leaseDuration) Create a new renewableLoginToken
with aleaseDurationSeconds
.toString()
Methods inherited from class org.springframework.vault.support.VaultToken
equals, getToken, hashCode, toCharArray
-
Method Details
-
builder
- Returns:
- a new
LoginToken.LoginTokenBuilder
. - Since:
- 3.0.2
-
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 newLoginToken
with 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 renewableLoginToken
with 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 renewableLoginToken
with 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.
-
getAccessor
- Returns:
- the token accessor.
- Since:
- 3.0.2
-
getType
- Returns:
- the token type.
- Since:
- 3.0.2
- See Also:
-
isBatchToken
public boolean isBatchToken()- Returns:
- true if the token is a batch token.
- Since:
- 3.0.2
-
isServiceToken
public boolean isServiceToken()- Returns:
- true if the token is a service token.
- Since:
- 3.0.2
-
toString
- Overrides:
toString
in classVaultToken
-