java.lang.Object
io.github.jopenlibs.vault.api.Auth.TokenRequest
- All Implemented Interfaces:
Serializable
- Enclosing class:
- Auth
A container for all of the options that can be passed to the createToken(TokenRequest)
method, to avoid that method having an excessive number of parameters (with null
typically passed to most of them).
All properties here are optional. Use of this class resembles a builder pattern (i.e.
call the mutator method for each property you wish to set), but this class lacks a final
build() method as no post-initialization logic is necessary.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondisplayName(String displayName) entityAlias(String entityAlias) explicitMaxTtl(String explicitMaxTtl) getId()getMeta()getRole()getTtl()getType()noDefaultPolicy(Boolean noDefaultPolicy)
-
Constructor Details
-
TokenRequest
public TokenRequest()
-
-
Method Details
-
id
- Parameters:
id- (optional) The ID of the client token. Can only be specified by a root token. Otherwise, the token ID is a randomly generated UUID.- Returns:
- This object, with its id field populated
-
polices
- Parameters:
polices- (optional) A list of policies for the token. This must be a subset of the policies belonging to the token- Returns:
- This object, with its polices field populated
-
meta
- Parameters:
meta- (optional) A map of string to string valued metadata. This is passed through to the audit backends.- Returns:
- This object, with its meta field populated
-
noParent
- Parameters:
noParent- (optional) If true and set by a root caller, the token will not have the parent token of the caller. This creates a token with no parent.- Returns:
- This object, with its noParent field populated
-
noDefaultPolicy
- Parameters:
noDefaultPolicy- (optional) Iftruethe default policy will not be a part of this token's policy set.- Returns:
- This object, with its noDefaultPolicy field populated
-
ttl
- Parameters:
ttl- (optional) The TTL period of the token, provided as "1h", where hour is the largest suffix. If not provided, the token is valid for the default lease TTL, or indefinitely if the root policy is used.- Returns:
- This object, with its ttl field populated
-
displayName
- Parameters:
displayName- (optional) The display name of the token. Defaults to "token".- Returns:
- This object, with its displayName field populated
-
numUses
- Parameters:
numUses- (optional) The maximum uses for the given token. This can be used to create a one-time-token or limited use token. Defaults to 0, which has no limit to the number of uses.- Returns:
- This object, with its numUses field populated
-
role
- Parameters:
role- (optional) The role the token will be created with. Default is no role.- Returns:
- This object, with its role field populated
-
renewable
- Parameters:
renewable- Set to false to disable the ability of the token to be renewed past its initial TTL. Setting the value to true will allow the token to be renewable up to the system/mount maximum TTL.- Returns:
- This object, with its renewable field populated
-
type
- Parameters:
type- The token type. Can be "batch" or "service".- Returns:
- This object, with its type field populated
-
explicitMaxTtl
- Parameters:
explicitMaxTtl- If set, the token will have an explicit max TTL set upon it.- Returns:
- This object, with its explicitMaxTtl field populated
-
period
- Parameters:
period- If specified, the token will be periodic- Returns:
- This object, with its period field populated
-
entityAlias
- Parameters:
entityAlias- Name of the entity alias to associate with during token creation.- Returns:
- This object, with its period field populated
-
getId
-
getPolices
-
getMeta
-
getNoParent
-
getNoDefaultPolicy
-
getTtl
-
getDisplayName
-
getNumUses
-
getRole
-
getRenewable
-
getType
-
getExplicitMaxTtl
-
getPeriod
-
getEntityAlias
-