ApiAuthorizationMiddleware
final class ApiAuthorizationMiddleware implements MiddlewareInterface (View source)
Enforces endpoint access, authenticated trust and scopes before API controller dispatch.
Non-API routes pass through unchanged. API routes receive the canonical RouteMatch only after their registry binding is verified; protected routes additionally receive an authorized identity.
Methods
Binds authorization to endpoint resolution, authentication, scope policy and Problem Details responses.
Matches once, fails closed for the API namespace, and dispatches only authorized endpoints.
Details
__construct
__construct(ApiEndpointRequestResolver $endpointResolver, ApiAuthenticatorInterface $authenticator, ScopeVoter $scopeVoter, ProblemDetailsFactory $problems, AppConfig $appConfig, Router $router)
Binds authorization to endpoint resolution, authentication, scope policy and Problem Details responses.
process
ResponseInterface
process(ServerRequestInterface $request, RequestHandlerInterface $handler)
Matches once, fails closed for the API namespace, and dispatches only authorized endpoints.