Class AppRole.Builder
- java.lang.Object
-
- de.stklcode.jvault.connector.model.AppRole.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder(String name)
ConstructAppRole.Builder
with only the role name set.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AppRole
build()
Build the AppRole role based on given parameters.AppRole.Builder
wit0hTokenPeriod(Integer tokenPeriod)
Set renewal period for generated token in seconds.AppRole.Builder
withBindSecretID()
Bind role to secret ID.AppRole.Builder
withBindSecretID(Boolean bindSecretId)
Set if role is bound to secret ID.AppRole.Builder
withEnableLocalSecretIds(Boolean enableLocalSecretIds)
Enable or disable local secret IDs.AppRole.Builder
withId(String id)
Add custom role ID.AppRole.Builder
withName(String name)
Add role name.AppRole.Builder
withoutBindSecretID()
Do not bind role to secret ID.AppRole.Builder
withPeriod(Integer period)
Deprecated.Usewit0hTokenPeriod(Integer)
instead.AppRole.Builder
withPolicies(List<String> policies)
Deprecated.UsewithTokenPolicies(List)
instead.AppRole.Builder
withPolicy(String policy)
Deprecated.UsewithTokenPolicy(String)
instead.AppRole.Builder
withSecretBoundCidr(String secretBoundCidr)
Add a CIDR block to list of bound blocks for secret.AppRole.Builder
withSecretIdBoundCidrs(List<String> secretIdBoundCidrs)
Set bound CIDR blocks.AppRole.Builder
withSecretIdNumUses(Integer secretIdNumUses)
Set number of uses for sectet IDs.AppRole.Builder
withSecretIdTtl(Integer secretIdTtl)
Set default sectet ID TTL in seconds.AppRole.Builder
withTokenBoundCidr(String tokenBoundCidr)
Add a CIDR block to list of bound blocks for token.AppRole.Builder
withTokenBoundCidrs(List<String> tokenBoundCidrs)
Set bound CIDR blocks for associated tokens.AppRole.Builder
withTokenExplicitMaxTtl(Integer tokenExplicitMaxTtl)
Set explicit maximum token TTL in seconds.AppRole.Builder
withTokenMaxTtl(Integer tokenMaxTtl)
Set maximum token TTL in seconds.AppRole.Builder
withTokenNoDefaultPolicy(Boolean tokenNoDefaultPolicy)
Enable or disable default policy for generated token.AppRole.Builder
withTokenNumUses(Integer tokenNumUses)
Set number of uses for generated tokens.AppRole.Builder
withTokenPolicies(List<String> tokenPolicies)
Add given policies.AppRole.Builder
withTokenPolicy(String tokenPolicy)
Add a single policy.AppRole.Builder
withTokenTtl(Integer tokenTtl)
Set default token TTL in seconds.AppRole.Builder
withTokenType(Token.Type tokenType)
Set type of generated token.
-
-
-
Constructor Detail
-
Builder
public Builder(String name)
ConstructAppRole.Builder
with only the role name set.- Parameters:
name
- Role name
-
-
Method Detail
-
withName
public AppRole.Builder withName(String name)
Add role name.- Parameters:
name
- Role name- Returns:
- self
-
withId
public AppRole.Builder withId(String id)
Add custom role ID. (optional)- Parameters:
id
- the ID- Returns:
- self
-
withBindSecretID
public AppRole.Builder withBindSecretID(Boolean bindSecretId)
Set if role is bound to secret ID.- Parameters:
bindSecretId
- the display name- Returns:
- self
-
withBindSecretID
public AppRole.Builder withBindSecretID()
Bind role to secret ID. Convenience method forwithBindSecretID(Boolean)
- Returns:
- self
-
withoutBindSecretID
public AppRole.Builder withoutBindSecretID()
Do not bind role to secret ID. Convenience method forwithBindSecretID(Boolean)
- Returns:
- self
-
withSecretIdBoundCidrs
public AppRole.Builder withSecretIdBoundCidrs(List<String> secretIdBoundCidrs)
Set bound CIDR blocks.- Parameters:
secretIdBoundCidrs
- List of CIDR blocks which can perform login- Returns:
- self
- Since:
- 0.8 replaces
withBoundCidrList(List)
-
withSecretBoundCidr
public AppRole.Builder withSecretBoundCidr(String secretBoundCidr)
Add a CIDR block to list of bound blocks for secret.- Parameters:
secretBoundCidr
- the CIDR block- Returns:
- self
- Since:
- 0.9
-
withTokenPolicies
public AppRole.Builder withTokenPolicies(List<String> tokenPolicies)
Add given policies.- Parameters:
tokenPolicies
- the token policies- Returns:
- self
- Since:
- 0.9
-
withPolicies
@Deprecated public AppRole.Builder withPolicies(List<String> policies)
Deprecated.UsewithTokenPolicies(List)
instead.Add given policies.- Parameters:
policies
- the policies- Returns:
- self
-
withTokenPolicy
public AppRole.Builder withTokenPolicy(String tokenPolicy)
Add a single policy.- Parameters:
tokenPolicy
- the token policy- Returns:
- self
- Since:
- 0.9
-
withPolicy
@Deprecated public AppRole.Builder withPolicy(String policy)
Deprecated.UsewithTokenPolicy(String)
instead.Add a single policy.- Parameters:
policy
- the policy- Returns:
- self
-
withSecretIdNumUses
public AppRole.Builder withSecretIdNumUses(Integer secretIdNumUses)
Set number of uses for sectet IDs.- Parameters:
secretIdNumUses
- the number of uses- Returns:
- self
-
withSecretIdTtl
public AppRole.Builder withSecretIdTtl(Integer secretIdTtl)
Set default sectet ID TTL in seconds.- Parameters:
secretIdTtl
- the TTL- Returns:
- self
-
withEnableLocalSecretIds
public AppRole.Builder withEnableLocalSecretIds(Boolean enableLocalSecretIds)
Enable or disable local secret IDs.- Parameters:
enableLocalSecretIds
- Enable local secret IDs?- Returns:
- self
- Since:
- 0.9
-
withTokenTtl
public AppRole.Builder withTokenTtl(Integer tokenTtl)
Set default token TTL in seconds.- Parameters:
tokenTtl
- the TTL- Returns:
- self
-
withTokenMaxTtl
public AppRole.Builder withTokenMaxTtl(Integer tokenMaxTtl)
Set maximum token TTL in seconds.- Parameters:
tokenMaxTtl
- the TTL- Returns:
- self
-
withTokenBoundCidrs
public AppRole.Builder withTokenBoundCidrs(List<String> tokenBoundCidrs)
Set bound CIDR blocks for associated tokens.- Parameters:
tokenBoundCidrs
- List of CIDR blocks which can perform login- Returns:
- self
- Since:
- 0.9
-
withTokenBoundCidr
public AppRole.Builder withTokenBoundCidr(String tokenBoundCidr)
Add a CIDR block to list of bound blocks for token.- Parameters:
tokenBoundCidr
- the CIDR block- Returns:
- self
- Since:
- 0.9
-
withTokenExplicitMaxTtl
public AppRole.Builder withTokenExplicitMaxTtl(Integer tokenExplicitMaxTtl)
Set explicit maximum token TTL in seconds.- Parameters:
tokenExplicitMaxTtl
- the TTL- Returns:
- self
-
withTokenNoDefaultPolicy
public AppRole.Builder withTokenNoDefaultPolicy(Boolean tokenNoDefaultPolicy)
Enable or disable default policy for generated token.- Parameters:
tokenNoDefaultPolicy
- Enable default policy for token?- Returns:
- self
- Since:
- 0.9
-
withTokenNumUses
public AppRole.Builder withTokenNumUses(Integer tokenNumUses)
Set number of uses for generated tokens.- Parameters:
tokenNumUses
- number of uses for tokens- Returns:
- self
- Since:
- 0.9
-
wit0hTokenPeriod
public AppRole.Builder wit0hTokenPeriod(Integer tokenPeriod)
Set renewal period for generated token in seconds.- Parameters:
tokenPeriod
- period in seconds- Returns:
- self
- Since:
- 0.9
-
withPeriod
@Deprecated public AppRole.Builder withPeriod(Integer period)
Deprecated.Usewit0hTokenPeriod(Integer)
instead.Set renewal period for generated token in seconds.- Parameters:
period
- period in seconds- Returns:
- self
-
withTokenType
public AppRole.Builder withTokenType(Token.Type tokenType)
Set type of generated token.- Parameters:
tokenType
- token type- Returns:
- self
- Since:
- 0.9
-
build
public AppRole build()
Build the AppRole role based on given parameters.- Returns:
- the role
-
-