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:
- Resolve the configured
PolicyRegistryviaJSentinelServiceResolver.policyRegistry(). - Build a
PolicyContextfrom the inboundAccessContext. - Evaluate the named policy. If the policy is not registered, the
registry returns a
Denied("unknown policy: ...")— this evaluator never throws. - Publish a
PolicyEvaluatedaudit event so consumers get per-policy visibility on top of the adapter's coarse access-level audit. - Bridge the
PolicyDecisiondown to anAuthorizationDecisionviaPolicyDecisions.
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.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionevaluate(AccessContext context, RequiresPolicy annotation) Evaluates access.
-
Constructor Details
-
RequiresPolicyEvaluator
public RequiresPolicyEvaluator()Creates a new evaluator instance.
-
-
Method Details