Skip to navigation

Deny All plugin

The Deny All plugin refuses every request that it applies to, without calling the upstream. Use it to close a route, or combine it with match conditions to block specific paths, methods, or consumers. It runs after authentication, so a caller without a valid credential gets the authentication error first.

Where it runs

ProtocolsAll
Scope kindsglobal, route
PhaseRequest

Configuration

FieldTypeDefaultDescription
reasonstringrequest deniedThe reason returned to the client. The console labels this Reason.
statusnumber403The HTTP status code, from 100 to 599. A status set in a YAML config file is ignored, and the response is 403. Set it through the admin API. The console labels this HTTP status. Ignored on MCP routes.

On MCP routes, the client gets HTTP 200 with a JSON-RPC error, code -32003, whose message is the reason. On every other route, the client gets the configured status with this body:

{ "error": "forbidden", "reason": "request denied" }

Example

{
"name": "close-legacy-route",
"plugin_id": "deny-all",
"scope": { "kind": "route", "name": "legacy-api" },
"config": { "reason": "This route is retired. Use orders-v2.", "status": 410 }
}