Interface IEndpointCapabilityGrantValidator
- Namespace
- AsiBackbone.AspNetCore.Endpoints
- Assembly
- AsiBackbone.AspNetCore.dll
Optional host-owned validator for endpoint capability-grant metadata.
public interface IEndpointCapabilityGrantValidator
Remarks
The ASP.NET Core package does not infer grant storage, proof verification, or replay semantics. Hosts that attach capability metadata should register an implementation that validates the request against their grant source, or opt in to SignedCapabilityGrantEndpointValidator through AddAsiBackboneSignedCapabilityGrants(IServiceCollection, Action<SignedCapabilityGrantOptions>) for signed, request-bound grants. An implementation that accepts a grant can record it in IEndpointCapabilityGrantFeature so the decision receipt names it.
Methods
ValidateAsync(HttpContext, EndpointGovernanceDescriptor, GovernanceDecision, CancellationToken)
Validates endpoint capability requirements before endpoint execution continues.
ValueTask<GovernanceDecision> ValidateAsync(HttpContext httpContext, EndpointGovernanceDescriptor descriptor, GovernanceDecision currentDecision, CancellationToken cancellationToken = default)
Parameters
httpContextHttpContextThe current HTTP context.
descriptorEndpointGovernanceDescriptorThe endpoint governance descriptor.
currentDecisionGovernanceDecisionThe current governance decision.
cancellationTokenCancellationTokenA token that can cancel validation.
Returns
- ValueTask<GovernanceDecision>
A governance decision representing the capability validation result.
Remarks
The validator is called for every decision that is not already denied, so currentDecision
may allow the request, carry a warning, require acknowledgment, be deferred, or recommend escalation. A validator
that does not find every required grant should return a denied decision instead of preserving any of those
outcomes. A valid grant may preserve the current decision so the host can continue its acknowledgment, deferral,
or escalation flow.