Class Policy.Rule.RuleBuilder

java.lang.Object
org.springframework.vault.support.Policy.Rule.RuleBuilder
Enclosing class:
Policy.Rule

public static class Policy.Rule.RuleBuilder extends Object
Builder for a Policy.Rule.
  • Constructor Details

    • RuleBuilder

      public RuleBuilder()
  • Method Details

    • path

      public Policy.Rule.RuleBuilder path(String path)
      Associate a path with the rule.
      Parameters:
      path - must not be null or empty.
      Returns:
      this builder.
    • capability

      public Policy.Rule.RuleBuilder capability(Policy.Capability capability)
      Configure a Policy.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 builder.
    • capabilities

      public Policy.Rule.RuleBuilder capabilities(Policy.Capability... 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 builder.
    • capabilities

      public Policy.Rule.RuleBuilder capabilities(Collection<? extends Policy.Capability> 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 builder.
      Since:
      3.1
    • capabilities

      public Policy.Rule.RuleBuilder capabilities(String... capabilities)
      Configure capabilities represented as String literals. This method resolves capabilities using Policy.BuiltinCapabilities. Capabilities are added when calling this method and do not replace already configured capabilities.
      Parameters:
      capabilities - must not be null.
      Returns:
      this builder.
      Throws:
      IllegalArgumentException - if the capability cannot be resolved to a built-in Policy.Capability.
    • minWrappingTtl

      public Policy.Rule.RuleBuilder minWrappingTtl(Duration ttl)
      Configure a min TTL for response wrapping.
      Parameters:
      ttl - must not be null.
      Returns:
      this builder.
    • maxWrappingTtl

      public Policy.Rule.RuleBuilder maxWrappingTtl(Duration ttl)
      Configure a max TTL for response wrapping.
      Parameters:
      ttl - must not be null.
      Returns:
      this builder.
    • allowedParameter

      public Policy.Rule.RuleBuilder allowedParameter(String name, String... values)
      Configure allowed parameter values given name and values. Allowing parameter values replaces previously configured allowed parameter values. Empty values allow all values for the given parameter name.
      Parameters:
      name - must not be null or empty.
      values - must not be null.
      Returns:
      this builder.
    • deniedParameter

      public Policy.Rule.RuleBuilder deniedParameter(String name, String... values)
      Configure denied parameter values given name and values. Denying parameter values replaces previously configured denied parameter values. Empty values deny parameter usage.
      Parameters:
      name - must not be null or empty.
      values - must not be null.
      Returns:
      this builder.
    • build

      public Policy.Rule build()
      Build the Policy.Rule object. Requires a configured path(String) and at least one capability(Policy.Capability).
      Returns:
      the new Policy.Rule object.