Authorize Method • AI Agent SDK
authorize_method: Central, default-deny authorisation gate for a gateway method.
authorize_method
Function
</div>
This function is defined in the protocols module.
Central, default-deny authorisation gate for a gateway method.
Resolves the required scope from the single source of truth (:func:resolve_required_scope) — so an unclassified/plugin-registered method is `ADMIN-only by omission rather than reachable ungated — and raises :class:GatewayUnauthorized when client_scopes` do not satisfy it. Dispatch calls this once, centrally, instead of scattering per-endpoint checks that can drift from the registry.
Signature
def authorize_method(method: str, client_scopes: 'Set[OperatorScope]', params: Optional[Dict[str, Any]]) -> NoneParameters
ParamField
strNo description available.
ParamField
'Set[OperatorScope]'No description available.
ParamField
OptionalNo description available.
Uses
resolve_required_scopeGatewayUnauthorized
Source
View on GitHubpraisonaiagents/gateway/protocols.py at line 7899