Package codes.grow.packages.vault
Class CreateTokenOptions.Builder
java.lang.Object
codes.grow.packages.vault.CreateTokenOptions.Builder
- Enclosing class:
CreateTokenOptions
Builder of
CreateTokenOptions.-
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds the options.displayName(String displayName) Sets the display name.explicitMaxTtl(Duration explicitMaxTtl) Sets the explicit maximum TTL.Adds a metadata entry.noDefaultPolicy(boolean noDefaultPolicy) Leaves out thedefaultpolicy.noParent(boolean noParent) Creates an orphan token (needs root or sudo).numUses(int numUses) Sets the number of uses (0 = unlimited).Creates a periodic token.Sets the policies.renewable(boolean renewable) Sets whether the token is renewable.Creates the token from a token role (auth/token/create/<role>).Sets the TTL.
-
Method Details
-
policies
Sets the policies.- Parameters:
policies- policy names- Returns:
- this builder
-
ttl
Sets the TTL.- Parameters:
ttl- TTL- Returns:
- this builder
-
explicitMaxTtl
Sets the explicit maximum TTL.- Parameters:
explicitMaxTtl- maximum TTL- Returns:
- this builder
-
renewable
Sets whether the token is renewable.- Parameters:
renewable- flag- Returns:
- this builder
-
displayName
Sets the display name.- Parameters:
displayName- name- Returns:
- this builder
-
meta
Adds a metadata entry.- Parameters:
key- keyvalue- value- Returns:
- this builder
-
numUses
Sets the number of uses (0 = unlimited).- Parameters:
numUses- uses,>= 0- Returns:
- this builder
-
noParent
Creates an orphan token (needs root or sudo).- Parameters:
noParent- flag- Returns:
- this builder
-
noDefaultPolicy
Leaves out thedefaultpolicy.- Parameters:
noDefaultPolicy- flag- Returns:
- this builder
-
period
Creates a periodic token.- Parameters:
period- renewal period- Returns:
- this builder
-
role
Creates the token from a token role (auth/token/create/<role>).- Parameters:
role- role name- Returns:
- this builder
-
build
Builds the options.- Returns:
- the options
-