Module de.stklcode.jvault.connector
Class TokenRole.Builder
java.lang.Object
de.stklcode.jvault.connector.model.TokenRole.Builder
- Enclosing class:
- TokenRole
A builder for vault token roles.
- Since:
- 0.9
- Author:
- Stefan Kalscheuer
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbuild()Build the token based on given parameters.Add token role name.Set TRUE if the token role should be created orphan.Set TRUE if the token role should be created renewable.withAllowedEntityAlias(String allowedEntityAlias) Add an allowed entity alias.withAllowedEntityAliases(List<String> allowedEntityAliases) Add allowed entity aliases.withAllowedPolicies(List<String> allowedPolicies) Add allowed policies.withAllowedPoliciesGlob(List<String> allowedPoliciesGlob) Add allowed policy glob patterns.withAllowedPolicy(String allowedPolicy) Add an allowed policy.withAllowedPolicyGlob(String allowedPolicyGlob) Add an allowed policy glob pattern.withDisallowedPolicies(List<String> disallowedPolicies) Add disallowed policies.withDisallowedPoliciesGlob(List<String> disallowedPoliciesGlob) Add disallowed policy glob patterns.withDisallowedPolicy(String disallowedPolicy) Add a disallowed policy.withDisallowedPolicyGlob(String disallowedPolicyGlob) Add an allowed policy glob pattern.withPathSuffix(String pathSuffix) Set token role path suffix.withTokenBoundCidr(String tokenBoundCidr) Add a single bound CIDR.withTokenBoundCidrs(List<String> tokenBoundCidrs) Add a list of bound CIDRs.withTokenExplicitMaxTtl(Integer tokenExplicitMaxTtl) Set explicit max.withTokenNoDefaultPolicy(Boolean tokenNoDefaultPolicy) Set TRUE if the token role should be created renewable.withTokenNumUses(Integer tokenNumUses) Set number of uses for tokens.withTokenPeriod(Integer tokenPeriod) Set token period.withTokenType(Token.Type tokenType) Set token type.
- 
Constructor Details- 
Builderpublic Builder()
 
- 
- 
Method Details- 
forNameAdd token role name.- Parameters:
- name- role name
- Returns:
- self
 
- 
withAllowedPolicyAdd an allowed policy.- Parameters:
- allowedPolicy- allowed policy to add
- Returns:
- self
 
- 
withAllowedPoliciesAdd allowed policies.- Parameters:
- allowedPolicies- list of allowed policies
- Returns:
- self
 
- 
withAllowedPolicyGlobAdd an allowed policy glob pattern.- Parameters:
- allowedPolicyGlob- allowed policy glob pattern to add
- Returns:
- self
- Since:
- 1.1
 
- 
withAllowedPoliciesGlobAdd allowed policy glob patterns.- Parameters:
- allowedPoliciesGlob- list of allowed policy glob patterns
- Returns:
- self
- Since:
- 1.1
 
- 
withDisallowedPolicyAdd a disallowed policy.- Parameters:
- disallowedPolicy- disallowed policy to add
- Returns:
- self
 
- 
withDisallowedPoliciesAdd disallowed policies.- Parameters:
- disallowedPolicies- list of disallowed policies
- Returns:
- self
 
- 
withDisallowedPolicyGlobAdd an allowed policy glob pattern.- Parameters:
- disallowedPolicyGlob- disallowed policy glob pattern to add
- Returns:
- self
- Since:
- 1.1
 
- 
withDisallowedPoliciesGlobAdd disallowed policy glob patterns.- Parameters:
- disallowedPoliciesGlob- list of disallowed policy glob patterns
- Returns:
- self
- Since:
- 1.1
 
- 
orphanSet TRUE if the token role should be created orphan.- Parameters:
- orphan- if TRUE, token role is created as orphan
- Returns:
- self
 
- 
renewableSet TRUE if the token role should be created renewable.- Parameters:
- renewable- if TRUE, token role is created renewable
- Returns:
- self
 
- 
withPathSuffixSet token role path suffix.- Parameters:
- pathSuffix- path suffix to use
- Returns:
- self
 
- 
withAllowedEntityAliasAdd an allowed entity alias.- Parameters:
- allowedEntityAlias- allowed entity alias to add
- Returns:
- self
 
- 
withAllowedEntityAliasesAdd allowed entity aliases.- Parameters:
- allowedEntityAliases- list of allowed entity aliases to add
- Returns:
- self
 
- 
withTokenBoundCidrAdd a single bound CIDR.- Parameters:
- tokenBoundCidr- bound CIDR to add
- Returns:
- self
 
- 
withTokenBoundCidrsAdd a list of bound CIDRs.- Parameters:
- tokenBoundCidrs- list of bound CIDRs to add
- Returns:
- self
 
- 
withTokenExplicitMaxTtlSet explicit max. TTL for token.- Parameters:
- tokenExplicitMaxTtl- explicit maximum TTL
- Returns:
- self
 
- 
withTokenNoDefaultPolicySet TRUE if the token role should be created renewable.- Parameters:
- tokenNoDefaultPolicy- if TRUE, token is created without default policy.
- Returns:
- self
 
- 
withTokenNumUsesSet number of uses for tokens.- Parameters:
- tokenNumUses- number of uses for associated tokens.
- Returns:
- self
 
- 
withTokenPeriodSet token period.- Parameters:
- tokenPeriod- token period
- Returns:
- self
 
- 
withTokenTypeSet token type.- Parameters:
- tokenType- token type
- Returns:
- self
 
- 
buildBuild the token based on given parameters.- Returns:
- the token
 
 
-