Module de.stklcode.jvault.connector
Class AppRole.Builder
java.lang.Object
de.stklcode.jvault.connector.model.AppRole.Builder
- Enclosing class:
AppRole
A builder for vault AppRole roles..
- Since:
- 0.4.0, 0.9 Moved into subclass of
AppRole
. - Author:
- Stefan Kalscheuer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the AppRole role based on given parameters.Bind role to secret ID.withBindSecretID
(Boolean bindSecretId) Set if role is bound to secret ID.Add custom role ID.withLocalSecretIds
(Boolean localSecretIds) Enable or disable local secret IDs.Add role name.Do not bind role to secret ID.withSecretBoundCidr
(String secretBoundCidr) Add a CIDR block to list of bound blocks for secret.withSecretIdBoundCidrs
(List<String> secretIdBoundCidrs) Set bound CIDR blocks.withSecretIdNumUses
(Integer secretIdNumUses) Set number of uses for sectet IDs.withSecretIdTtl
(Integer secretIdTtl) Set default sectet ID TTL in seconds.withTokenBoundCidr
(String tokenBoundCidr) Add a CIDR block to list of bound blocks for token.withTokenBoundCidrs
(List<String> tokenBoundCidrs) Set bound CIDR blocks for associated tokens.withTokenExplicitMaxTtl
(Integer tokenExplicitMaxTtl) Set explicit maximum token TTL in seconds.withTokenMaxTtl
(Integer tokenMaxTtl) Set maximum token TTL in seconds.withTokenNoDefaultPolicy
(Boolean tokenNoDefaultPolicy) Enable or disable default policy for generated token.withTokenNumUses
(Integer tokenNumUses) Set number of uses for generated tokens.withTokenPeriod
(Integer tokenPeriod) Set renewal period for generated token in seconds.withTokenPolicies
(List<String> tokenPolicies) Add given policies.withTokenPolicy
(String tokenPolicy) Add a single policy.withTokenTtl
(Integer tokenTtl) Set default token TTL in seconds.withTokenType
(Token.Type tokenType) Set type of generated token.
-
Constructor Details
-
Builder
ConstructAppRole.Builder
with only the role name set.- Parameters:
name
- Role name
-
-
Method Details
-
withName
Add role name.- Parameters:
name
- Role name- Returns:
- self
-
withId
Add custom role ID. (optional)- Parameters:
id
- the ID- Returns:
- self
-
withBindSecretID
Set if role is bound to secret ID.- Parameters:
bindSecretId
- the display name- Returns:
- self
-
withBindSecretID
Bind role to secret ID. Convenience method forwithBindSecretID(Boolean)
- Returns:
- self
-
withoutBindSecretID
Do not bind role to secret ID. Convenience method forwithBindSecretID(Boolean)
- Returns:
- self
-
withSecretIdBoundCidrs
Set bound CIDR blocks.- Parameters:
secretIdBoundCidrs
- List of CIDR blocks which can perform login- Returns:
- self
- Since:
- 0.8 replaces
withBoundCidrList(List)
-
withSecretBoundCidr
Add a CIDR block to list of bound blocks for secret.- Parameters:
secretBoundCidr
- the CIDR block- Returns:
- self
- Since:
- 0.9
-
withTokenPolicies
Add given policies.- Parameters:
tokenPolicies
- the token policies- Returns:
- self
- Since:
- 0.9
-
withTokenPolicy
Add a single policy.- Parameters:
tokenPolicy
- the token policy- Returns:
- self
- Since:
- 0.9
-
withSecretIdNumUses
Set number of uses for sectet IDs.- Parameters:
secretIdNumUses
- the number of uses- Returns:
- self
-
withSecretIdTtl
Set default sectet ID TTL in seconds.- Parameters:
secretIdTtl
- the TTL- Returns:
- self
-
withLocalSecretIds
Enable or disable local secret IDs.- Parameters:
localSecretIds
- Enable local secret IDs?- Returns:
- self
- Since:
- 0.9, 1.3 renamed to
withLocalSecretIds()
-
withTokenTtl
Set default token TTL in seconds.- Parameters:
tokenTtl
- the TTL- Returns:
- self
-
withTokenMaxTtl
Set maximum token TTL in seconds.- Parameters:
tokenMaxTtl
- the TTL- Returns:
- self
-
withTokenBoundCidrs
Set bound CIDR blocks for associated tokens.- Parameters:
tokenBoundCidrs
- List of CIDR blocks which can perform login- Returns:
- self
- Since:
- 0.9
-
withTokenBoundCidr
Add a CIDR block to list of bound blocks for token.- Parameters:
tokenBoundCidr
- the CIDR block- Returns:
- self
- Since:
- 0.9
-
withTokenExplicitMaxTtl
Set explicit maximum token TTL in seconds.- Parameters:
tokenExplicitMaxTtl
- the TTL- Returns:
- self
-
withTokenNoDefaultPolicy
Enable or disable default policy for generated token.- Parameters:
tokenNoDefaultPolicy
- Enable default policy for token?- Returns:
- self
- Since:
- 0.9
-
withTokenNumUses
Set number of uses for generated tokens.- Parameters:
tokenNumUses
- number of uses for tokens- Returns:
- self
- Since:
- 0.9
-
withTokenPeriod
Set renewal period for generated token in seconds.- Parameters:
tokenPeriod
- period in seconds- Returns:
- self
- Since:
- 0.9
-
withTokenType
Set type of generated token.- Parameters:
tokenType
- token type- Returns:
- self
- Since:
- 0.9
-
build
Build the AppRole role based on given parameters.- Returns:
- the role
-