Class RequiresPolicyEvaluator

java.lang.Object
com.svenruppert.jsentinel.policy.impl.RequiresPolicyEvaluator
All Implemented Interfaces:
AuthorizationEvaluator<RequiresPolicy>

@ExperimentalJSentinelApi public final class RequiresPolicyEvaluator extends Object implements AuthorizationEvaluator<RequiresPolicy>
Bridges RequiresPolicy into the existing AuthorizationEvaluator pipeline.

Behaviour:

  1. Resolve the configured PolicyRegistry via JSentinelServiceResolver.policyRegistry().
  2. Build a PolicyContext from the inbound AccessContext.
  3. Evaluate the named policy. If the policy is not registered, the registry returns a Denied("unknown policy: ...") — this evaluator never throws.
  4. Publish a PolicyEvaluated audit event so consumers get per-policy visibility on top of the adapter's coarse access-level audit.
  5. Bridge the PolicyDecision down to an AuthorizationDecision via PolicyDecisions.

The evaluator has a no-arg constructor so it can be instantiated by the Vaadin instantiator and by reflection in the REST/standalone adapters. State is intentionally absent — every dependency is resolved per evaluation through the static resolver, matching the pattern of RequiresRoleEvaluator.