Class AppRoleBuilder
- java.lang.Object
-
- de.stklcode.jvault.connector.model.AppRoleBuilder
-
public final class AppRoleBuilder extends Object
A builder for vault AppRole roles..- Since:
- 0.4.0
- Author:
- Stefan Kalscheuer
-
-
Constructor Summary
Constructors Constructor Description AppRoleBuilder(String name)ConstructAppRoleBuilderwith only the role name set.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AppRolebuild()Build the AppRole role based on given parameters.AppRoleBuilderwithBindSecretID()Bind role to secret ID.AppRoleBuilderwithBindSecretID(Boolean bindSecretId)Set if role is bound to secret ID.AppRoleBuilderwithBoundCidrList(List<String> boundCidrList)Deprecated.UsewithSecretIdBoundCidrs(List)instead, as this parameter is deprecated in Vault.AppRoleBuilderwithCidrBlock(String cidrBlock)Add a CIDR block to list of bound blocks.AppRoleBuilderwithId(String id)Add custom role ID.AppRoleBuilderwithoutBindSecretID()Do not bind role to secret ID.AppRoleBuilderwithPeriod(Integer period)Set renewal period for generated token in seconds.AppRoleBuilderwithPolicies(List<String> policies)Add given policies.AppRoleBuilderwithPolicy(String policy)Add a single policy.AppRoleBuilderwithSecretIdBoundCidrs(List<String> secretIdBoundCidrs)Set bound CIDR blocks.AppRoleBuilderwithSecretIdNumUses(Integer secredIdNumUses)Set number of uses for sectet IDs.AppRoleBuilderwithSecretIdTtl(Integer secredIdTtl)Set default sectet ID TTL in seconds.AppRoleBuilderwithTokenMaxTtl(Integer tokenMaxTtl)Set maximum token TTL in seconds.AppRoleBuilderwithTokenTtl(Integer tokenTtl)Set default token TTL in seconds.
-
-
-
Constructor Detail
-
AppRoleBuilder
public AppRoleBuilder(String name)
ConstructAppRoleBuilderwith only the role name set.- Parameters:
name- Role name
-
-
Method Detail
-
withId
public AppRoleBuilder withId(String id)
Add custom role ID. (optional)- Parameters:
id- the ID- Returns:
- self
-
withBindSecretID
public AppRoleBuilder withBindSecretID(Boolean bindSecretId)
Set if role is bound to secret ID.- Parameters:
bindSecretId- the display name- Returns:
- self
-
withBindSecretID
public AppRoleBuilder withBindSecretID()
Bind role to secret ID. Convenience method forwithBindSecretID(Boolean)- Returns:
- self
-
withoutBindSecretID
public AppRoleBuilder withoutBindSecretID()
Do not bind role to secret ID. Convenience method forwithBindSecretID(Boolean)- Returns:
- self
-
withBoundCidrList
@Deprecated public AppRoleBuilder withBoundCidrList(List<String> boundCidrList)
Deprecated.UsewithSecretIdBoundCidrs(List)instead, as this parameter is deprecated in Vault.Set bound CIDR blocks.- Parameters:
boundCidrList- List of CIDR blocks which can perform login- Returns:
- self
-
withSecretIdBoundCidrs
public AppRoleBuilder 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)
-
withCidrBlock
public AppRoleBuilder withCidrBlock(String cidrBlock)
Add a CIDR block to list of bound blocks.- Parameters:
cidrBlock- the CIDR block- Returns:
- self
-
withPolicies
public AppRoleBuilder withPolicies(List<String> policies)
Add given policies.- Parameters:
policies- the policies- Returns:
- self
-
withPolicy
public AppRoleBuilder withPolicy(String policy)
Add a single policy.- Parameters:
policy- the policy- Returns:
- self
-
withSecretIdNumUses
public AppRoleBuilder withSecretIdNumUses(Integer secredIdNumUses)
Set number of uses for sectet IDs.- Parameters:
secredIdNumUses- the number of uses- Returns:
- self
-
withSecretIdTtl
public AppRoleBuilder withSecretIdTtl(Integer secredIdTtl)
Set default sectet ID TTL in seconds.- Parameters:
secredIdTtl- the TTL- Returns:
- self
-
withTokenTtl
public AppRoleBuilder withTokenTtl(Integer tokenTtl)
Set default token TTL in seconds.- Parameters:
tokenTtl- the TTL- Returns:
- self
-
withTokenMaxTtl
public AppRoleBuilder withTokenMaxTtl(Integer tokenMaxTtl)
Set maximum token TTL in seconds.- Parameters:
tokenMaxTtl- the TTL- Returns:
- self
-
withPeriod
public AppRoleBuilder withPeriod(Integer period)
Set renewal period for generated token in seconds.- Parameters:
period- period in seconds- Returns:
- self
-
build
public AppRole build()
Build the AppRole role based on given parameters.- Returns:
- the role
-
-