Module de.stklcode.jvault.connector
Class AppRole.Builder
- java.lang.Object
-
- de.stklcode.jvault.connector.model.AppRole.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder(String name)ConstructAppRole.Builderwith only the role name set.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AppRolebuild()Build the AppRole role based on given parameters.AppRole.BuilderwithBindSecretID()Bind role to secret ID.AppRole.BuilderwithBindSecretID(Boolean bindSecretId)Set if role is bound to secret ID.AppRole.BuilderwithEnableLocalSecretIds(Boolean enableLocalSecretIds)Enable or disable local secret IDs.AppRole.BuilderwithId(String id)Add custom role ID.AppRole.BuilderwithName(String name)Add role name.AppRole.BuilderwithoutBindSecretID()Do not bind role to secret ID.AppRole.BuilderwithSecretBoundCidr(String secretBoundCidr)Add a CIDR block to list of bound blocks for secret.AppRole.BuilderwithSecretIdBoundCidrs(List<String> secretIdBoundCidrs)Set bound CIDR blocks.AppRole.BuilderwithSecretIdNumUses(Integer secretIdNumUses)Set number of uses for sectet IDs.AppRole.BuilderwithSecretIdTtl(Integer secretIdTtl)Set default sectet ID TTL in seconds.AppRole.BuilderwithTokenBoundCidr(String tokenBoundCidr)Add a CIDR block to list of bound blocks for token.AppRole.BuilderwithTokenBoundCidrs(List<String> tokenBoundCidrs)Set bound CIDR blocks for associated tokens.AppRole.BuilderwithTokenExplicitMaxTtl(Integer tokenExplicitMaxTtl)Set explicit maximum token TTL in seconds.AppRole.BuilderwithTokenMaxTtl(Integer tokenMaxTtl)Set maximum token TTL in seconds.AppRole.BuilderwithTokenNoDefaultPolicy(Boolean tokenNoDefaultPolicy)Enable or disable default policy for generated token.AppRole.BuilderwithTokenNumUses(Integer tokenNumUses)Set number of uses for generated tokens.AppRole.BuilderwithTokenPeriod(Integer tokenPeriod)Set renewal period for generated token in seconds.AppRole.BuilderwithTokenPolicies(List<String> tokenPolicies)Add given policies.AppRole.BuilderwithTokenPolicy(String tokenPolicy)Add a single policy.AppRole.BuilderwithTokenTtl(Integer tokenTtl)Set default token TTL in seconds.AppRole.BuilderwithTokenType(Token.Type tokenType)Set type of generated token.
-
-
-
Constructor Detail
-
Builder
public Builder(String name)
ConstructAppRole.Builderwith 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
-
withTokenPolicy
public AppRole.Builder withTokenPolicy(String tokenPolicy)
Add a single policy.- Parameters:
tokenPolicy- the token policy- Returns:
- self
- Since:
- 0.9
-
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
-
withTokenPeriod
public AppRole.Builder withTokenPeriod(Integer tokenPeriod)
Set renewal period for generated token in seconds.- Parameters:
tokenPeriod- period in seconds- Returns:
- self
- Since:
- 0.9
-
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
-
-