Interface AllowListConfig

All Superinterfaces:
Prototype.Api, Prototype.Factory<AllowList>
All Known Implementing Classes:
AllowListConfig.BuilderBase.AllowListConfigImpl

public interface AllowListConfig extends Prototype.Api
AllowList defines a list of allowed and/or denied matches and tests if a particular value conforms to the conditions.

The algorithm of testing that a value is allowed:

  1. Iterate through all allowed patterns, if none matches, value is not permitted
  2. Iterate through all denied patterns, if any matches, value is not permitted
  3. Value is permitted
See Also:
  • Method Details

    • builder

      static AllowListConfig.Builder builder()
      Create a new fluent API builder to customize configuration.
      Returns:
      a new builder
    • builder

      static AllowListConfig.Builder builder(AllowListConfig instance)
      Create a new fluent API builder from an existing instance.
      Parameters:
      instance - an existing instance used as a base for the builder
      Returns:
      a builder based on an instance
    • create

      static AllowListConfig create(Config config)
      Create a new instance from configuration.
      Parameters:
      config - used to configure the new instance
      Returns:
      a new instance configured from configuration
    • create

      static AllowListConfig create()
      Create a new instance with default values.
      Returns:
      a new instance
    • allowAll

      boolean allowAll()
      Allows all strings to match (subject to "deny" conditions). An allow.all setting of false does not deny all strings but rather represents the absence of a universal match, meaning that other allow and deny settings determine the matching outcomes.
      Returns:
      whether to allow all strings to match (subject to "deny" conditions)
    • allowed

      List<String> allowed()
      Exact strings to allow.
      Returns:
      exact strings to allow
    • allowedPrefixes

      List<String> allowedPrefixes()
      Prefixes specifying strings to allow.
      Returns:
      prefixes which allow matching
    • allowedSuffixes

      List<String> allowedSuffixes()
      Suffixes specifying strings to allow.
      Returns:
      suffixes which allow matching
    • allowedPatterns

      List<Pattern> allowedPatterns()
      Patterns specifying strings to allow.
      Returns:
      patterns which allow matching
    • denied

      List<String> denied()
      Exact strings to deny.
      Returns:
      exact strings to deny
    • deniedPrefixes

      List<String> deniedPrefixes()
      Prefixes specifying strings to deny.
      Returns:
      prefixes which deny matching
    • deniedSuffixes

      List<String> deniedSuffixes()
      Suffixes specifying strings to deny.
      Returns:
      suffixes which deny matching
    • deniedPatterns

      List<Pattern> deniedPatterns()
      Patterns specifying strings to deny.
      Returns:
      patterns which deny matching
    • allowedPredicates

      List<Predicate<String>> allowedPredicates()
      Allowed predicates.
      Returns:
      predicates to allow
    • deniedPredicates

      List<Predicate<String>> deniedPredicates()
      Deny predicates.
      Returns:
      predicates to deny