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 Summary
-
Method Summary
Modifier 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.withAllowedPolicy
(String allowedPolicy) Add an allowed policy.withDisallowedPolicies
(List<String> disallowedPolicies) Add disallowed policies.withDisallowedPolicy
(String disallowedPolicy) Add a disallowed policy.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
-
Builder
public Builder()
-
-
Method Details
-
forName
Add token role name.- Parameters:
name
- role name- Returns:
- self
-
withAllowedPolicy
Add an allowed policy.- Parameters:
allowedPolicy
- allowed policy to add- Returns:
- self
-
withAllowedPolicies
Add allowed policies.- Parameters:
allowedPolicies
- list of allowed policies- Returns:
- self
-
withDisallowedPolicy
Add a disallowed policy.- Parameters:
disallowedPolicy
- disallowed policy to add- Returns:
- self
-
withDisallowedPolicies
Add disallowed policies.- Parameters:
disallowedPolicies
- list of disallowed policies- Returns:
- self
-
orphan
Set TRUE if the token role should be created orphan.- Parameters:
orphan
- if TRUE, token role is created as orphan- Returns:
- self
-
renewable
Set TRUE if the token role should be created renewable.- Parameters:
renewable
- if TRUE, token role is created renewable- Returns:
- self
-
withPathSuffix
Set token role path suffix.- Parameters:
pathSuffix
- path suffix to use- Returns:
- self
-
withAllowedEntityAlias
Add an allowed entity alias.- Parameters:
allowedEntityAlias
- allowed entity alias to add- Returns:
- self
-
withAllowedEntityAliases
Add allowed entity aliases.- Parameters:
allowedEntityAliases
- list of allowed entity aliases to add- Returns:
- self
-
withTokenBoundCidr
Add a single bound CIDR.- Parameters:
tokenBoundCidr
- bound CIDR to add- Returns:
- self
-
withTokenBoundCidrs
Add a list of bound CIDRs.- Parameters:
tokenBoundCidrs
- list of bound CIDRs to add- Returns:
- self
-
withTokenExplicitMaxTtl
Set explicit max. TTL for token.- Parameters:
tokenExplicitMaxTtl
- explicit maximum TTL- Returns:
- self
-
withTokenNoDefaultPolicy
Set TRUE if the token role should be created renewable.- Parameters:
tokenNoDefaultPolicy
- if TRUE, token is created without default policy.- Returns:
- self
-
withTokenNumUses
Set number of uses for tokens.- Parameters:
tokenNumUses
- number of uses for associated tokens.- Returns:
- self
-
withTokenPeriod
Set token period.- Parameters:
tokenPeriod
- token period- Returns:
- self
-
withTokenType
Set token type.- Parameters:
tokenType
- token type- Returns:
- self
-
build
Build the token based on given parameters.- Returns:
- the token
-