Class Policy
java.lang.Object
org.springframework.vault.support.Policy
Value object representing a Vault policy associated with
Policy.Rule
s. Instances of
Policy
support JSON serialization and deserialization using Jackson.- Since:
- 2.0
- Author:
- Mark Paluch
- See Also:
-
Policy.Rule
ObjectMapper
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Built-in Vault capabilities.static interface
Capability interface representing capability literals.static class
Value object representing a rule for a certain path. -
Method Summary
Modifier and TypeMethodDescriptionstatic Policy
empty()
Create an emptyPolicy
without rules.boolean
Lookup aPolicy.Rule
by its path.getRules()
int
hashCode()
static Policy
of
(Set<Policy.Rule> rules) Create aPolicy
from one or morerules
.static Policy
of
(Policy.Rule... rules) Create aPolicy
from one or morerules
.with
(Policy.Rule rule) Create a newPolicy
object containing all configured rules and add the givenPolicy.Rule
to the new policy object.
-
Method Details
-
empty
Create an emptyPolicy
without rules.- Returns:
- an empty
Policy
.
-
of
Create aPolicy
from one or morerules
.- Parameters:
rules
- must not be null.- Returns:
- the
Policy
object containingrules
.
-
of
Create aPolicy
from one or morerules
.- Parameters:
rules
- must not be null.- Returns:
- the
Policy
object containingrules
.
-
with
Create a newPolicy
object containing all configured rules and add the givenPolicy.Rule
to the new policy object. If the givenPolicy.Rule
matches an existing rule path, the exiting rule will be overridden by the new rule object.- Parameters:
rule
- must not be null.- Returns:
- the new
Policy
object containing all configured rules and the givenPolicy.Rule
.
-
getRules
-
getRule
Lookup aPolicy.Rule
by its path. Returns null if the rule was not found.- Parameters:
path
- must not be null.- Returns:
- the
Policy.Rule
or null, if not found.
-
equals
-
hashCode
public int hashCode()
-