Class TokenRole.Builder
- java.lang.Object
-
- de.stklcode.jvault.connector.model.TokenRole.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TokenRolebuild()Build the token based on given parameters.TokenRole.BuilderforName(String name)Add token role name.TokenRole.Builderorphan(Boolean orphan)Set TRUE if the token role should be created orphan.TokenRole.Builderrenewable(Boolean renewable)Set TRUE if the token role should be created renewable.TokenRole.BuilderwithAllowedEntityAlias(String allowedEntityAlias)Add an allowed entity alias.TokenRole.BuilderwithAllowedEntityAliases(List<String> allowedEntityAliases)Add allowed entity aliases.TokenRole.BuilderwithAllowedPolicies(List<String> allowedPolicies)Add allowed policies.TokenRole.BuilderwithAllowedPolicy(String allowedPolicy)Add an allowed policy.TokenRole.BuilderwithDisallowedPolicies(List<String> disallowedPolicies)Add disallowed policies.TokenRole.BuilderwithDisallowedPolicy(String disallowedPolicy)Add a disallowed policy.TokenRole.BuilderwithPathSuffix(String pathSuffix)Set token role path suffix.TokenRole.BuilderwithTokenBoundCidr(String tokenBoundCidr)Add a single bound CIDR.TokenRole.BuilderwithTokenBoundCidrs(List<String> tokenBoundCidrs)Add a list of bound CIDRs.TokenRole.BuilderwithTokenExplicitMaxTtl(Integer tokenExplicitMaxTtl)Set explicit max.TokenRole.BuilderwithTokenNoDefaultPolicy(Boolean tokenNoDefaultPolicy)Set TRUE if the token role should be created renewable.TokenRole.BuilderwithTokenNumUses(Integer tokenNumUses)Set number of uses for tokens.TokenRole.BuilderwithTokenPeriod(Integer tokenPeriod)Set token period.TokenRole.BuilderwithTokenType(Token.Type tokenType)Set token type.
-
-
-
Method Detail
-
forName
public TokenRole.Builder forName(String name)
Add token role name.- Parameters:
name- role name- Returns:
- self
-
withAllowedPolicy
public TokenRole.Builder withAllowedPolicy(String allowedPolicy)
Add an allowed policy.- Parameters:
allowedPolicy- allowed policy to add- Returns:
- self
-
withAllowedPolicies
public TokenRole.Builder withAllowedPolicies(List<String> allowedPolicies)
Add allowed policies.- Parameters:
allowedPolicies- list of allowed policies- Returns:
- self
-
withDisallowedPolicy
public TokenRole.Builder withDisallowedPolicy(String disallowedPolicy)
Add a disallowed policy.- Parameters:
disallowedPolicy- disallowed policy to add- Returns:
- self
-
withDisallowedPolicies
public TokenRole.Builder withDisallowedPolicies(List<String> disallowedPolicies)
Add disallowed policies.- Parameters:
disallowedPolicies- list of disallowed policies- Returns:
- self
-
orphan
public TokenRole.Builder orphan(Boolean orphan)
Set TRUE if the token role should be created orphan.- Parameters:
orphan- if TRUE, token role is created as orphan- Returns:
- self
-
renewable
public TokenRole.Builder renewable(Boolean renewable)
Set TRUE if the token role should be created renewable.- Parameters:
renewable- if TRUE, token role is created renewable- Returns:
- self
-
withPathSuffix
public TokenRole.Builder withPathSuffix(String pathSuffix)
Set token role path suffix.- Parameters:
pathSuffix- path suffix to use- Returns:
- self
-
withAllowedEntityAlias
public TokenRole.Builder withAllowedEntityAlias(String allowedEntityAlias)
Add an allowed entity alias.- Parameters:
allowedEntityAlias- allowed entity alias to add- Returns:
- self
-
withAllowedEntityAliases
public TokenRole.Builder withAllowedEntityAliases(List<String> allowedEntityAliases)
Add allowed entity aliases.- Parameters:
allowedEntityAliases- list of allowed entity aliases to add- Returns:
- self
-
withTokenBoundCidr
public TokenRole.Builder withTokenBoundCidr(String tokenBoundCidr)
Add a single bound CIDR.- Parameters:
tokenBoundCidr- bound CIDR to add- Returns:
- self
-
withTokenBoundCidrs
public TokenRole.Builder withTokenBoundCidrs(List<String> tokenBoundCidrs)
Add a list of bound CIDRs.- Parameters:
tokenBoundCidrs- list of bound CIDRs to add- Returns:
- self
-
withTokenExplicitMaxTtl
public TokenRole.Builder withTokenExplicitMaxTtl(Integer tokenExplicitMaxTtl)
Set explicit max. TTL for token.- Parameters:
tokenExplicitMaxTtl- explicit maximum TTL- Returns:
- self
-
withTokenNoDefaultPolicy
public TokenRole.Builder withTokenNoDefaultPolicy(Boolean tokenNoDefaultPolicy)
Set TRUE if the token role should be created renewable.- Parameters:
tokenNoDefaultPolicy- if TRUE, token is created without default policy.- Returns:
- self
-
withTokenNumUses
public TokenRole.Builder withTokenNumUses(Integer tokenNumUses)
Set number of uses for tokens.- Parameters:
tokenNumUses- number of uses for associated tokens.- Returns:
- self
-
withTokenPeriod
public TokenRole.Builder withTokenPeriod(Integer tokenPeriod)
Set token period.- Parameters:
tokenPeriod- token period- Returns:
- self
-
withTokenType
public TokenRole.Builder withTokenType(Token.Type tokenType)
Set token type.- Parameters:
tokenType- token type- Returns:
- self
-
build
public TokenRole build()
Build the token based on given parameters.- Returns:
- the token
-
-