Class Policy.Rule.RuleBuilder
java.lang.Object
org.springframework.vault.support.Policy.Rule.RuleBuilder
- Enclosing class:
- Policy.Rule
Builder for a
Policy.Rule
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionallowedParameter
(String name, String... values) Configure allowed parameter values givenname
andvalues
.build()
Build thePolicy.Rule
object.capabilities
(String... capabilities) Configure capabilities represented asString
literals.capabilities
(Collection<? extends Policy.Capability> capabilities) Configure capabilities.capabilities
(Policy.Capability... capabilities) Configure capabilities.capability
(Policy.Capability capability) Configure aPolicy.Capability
for the rule.deniedParameter
(String name, String... values) Configure denied parameter values givenname
andvalues
.maxWrappingTtl
(Duration ttl) Configure a max TTL for response wrapping.minWrappingTtl
(Duration ttl) Configure a min TTL for response wrapping.Associate apath
with the rule.
-
Constructor Details
-
RuleBuilder
public RuleBuilder()
-
-
Method Details
-
path
Associate apath
with the rule.- Parameters:
path
- must not be null or empty.- Returns:
this
Policy.Rule.RuleBuilder
.
-
capability
Configure aPolicy.Capability
for the rule. Capabilities are added when calling this method and do not replace already configured capabilities.- Parameters:
capability
- must not be null.- Returns:
this
Policy.Rule.RuleBuilder
.
-
capabilities
Configure capabilities. Capabilities are added when calling this method and do not replace already configured capabilities.- Parameters:
capabilities
- must not be null.- Returns:
this
Policy.Rule.RuleBuilder
.
-
capabilities
Configure capabilities. Capabilities are added when calling this method and do not replace already configured capabilities.- Parameters:
capabilities
- must not be null.- Returns:
this
Policy.Rule.RuleBuilder
.- Since:
- 3.1
-
capabilities
Configure capabilities represented asString
literals. This method resolves capabilities usingPolicy.BuiltinCapabilities
. Capabilities are added when calling this method and do not replace already configured capabilities.- Parameters:
capabilities
- must not be null.- Returns:
this
Policy.Rule.RuleBuilder
.- Throws:
IllegalArgumentException
- if the capability cannot be resolved to a built-inPolicy.Capability
.
-
minWrappingTtl
Configure a min TTL for response wrapping.- Parameters:
ttl
- must not be null.- Returns:
this
Policy.Rule.RuleBuilder
.
-
maxWrappingTtl
Configure a max TTL for response wrapping.- Parameters:
ttl
- must not be null.- Returns:
this
Policy.Rule.RuleBuilder
.
-
allowedParameter
Configure allowed parameter values givenname
andvalues
. Allowing parameter values replaces previously configured allowed parameter values. Emptyvalues
allow all values for the given parametername
.- Parameters:
name
- must not be null or empty.values
- must not be null.- Returns:
this
Policy.Rule.RuleBuilder
.
-
deniedParameter
Configure denied parameter values givenname
andvalues
. Denying parameter values replaces previously configured denied parameter values. Emptyvalues
deny parameter usage.- Parameters:
name
- must not be null or empty.values
- must not be null.- Returns:
this
Policy.Rule.RuleBuilder
.
-
build
Build thePolicy.Rule
object. Requires a configuredpath(String)
and at least onecapability(Policy.Capability)
.- Returns:
- the new
Policy.Rule
object.
-