Interface GuardPredicate
- All Known Implementing Classes:
ExtPredicate, RateLimitPredicate
public interface GuardPredicate
One condition of a guard rule (e.g. "uri~^/admin/", "!cookie:hruc").
Implementations run on the request thread for every request, before cache and origin, so they
must be cheap and must never throw: a predicate that cannot decide returns false.
-
Method Summary
Modifier and TypeMethodDescriptiondescribe()default booleanWhether a plugin answers this predicate (ext:, negated or not) - code the node does not own, which may have no answer (PredicateUndecided).default ExtPredicateThe plugin's predicate this one is, or negates; null for a core predicate.booleantest(RequestContext context)
-
Method Details
-
test
- Parameters:
context- request context - may carry a null servlet request (async include, or a synthetic probe context used for startup loop detection)- Returns:
- true when this condition holds for the request
-
describe
String describe()- Returns:
- the predicate as written in guard-rules.conf (used by logs and the admin API)
-
isPluginPredicate
default boolean isPluginPredicate()Whether a plugin answers this predicate (ext:, negated or not) - code the node does not own, which may have no answer (PredicateUndecided). Anallowrule naming one must sayon-error=allow. -
pluginPredicate
The plugin's predicate this one is, or negates; null for a core predicate.
-