Recommended hook/enforcement point for external (out-of-gateway) user authorization across all surfaces (MCP transport, tools/list, /rpc, /sse)? #6087
Replies: 1 comment 1 reply
|
Not a maintainer, but your reading of the hook surface matches what's actually in the framework, so I'll at least confirm the source side of it in case it saves you chasing a hook that isn't there. The plugin framework defines six core hook points (ADR 016, So there is genuinely no The HTTP level hooks you found ( Worth noting: ADR 016's "future" section explicitly lists The two questions that actually need a maintainer, since they're about intent rather than what the code does: (1) whether |
Uh oh!
There was an error while loading. Please reload this page.
Context
We are deploying ContextForge as an MCP gateway with this identity model:
The question
Which plugin hook is the supported place to make an external allow/deny decision, such that it covers all client-facing surfaces — the MCP transport (
/servers/<uuid>/mcp,/mcp), includingtools/list, as well as/rpc,/sse, and/message?What we found so far
We could not find a single hook that covers everything, and each candidate has a gap:
http_pre_requestfires on every surface and carries the path — but it cannot deny: bothcontinue_processing=Falseandraise PluginViolationErrorare silently discarded.http_auth_resolve_usercan deny (raisingPluginViolationError→ 401) — but only in its "attached" invocation via theget_current_userroute dependency, which the MCP transport never uses. The "detached" invocation fromAuthContextMiddlewaredoes fire on MCP requests, but its 401 is swallowed ("continuing as anonymous") unless the exception message exactly matches one of_HARD_DENY_DETAILS; additionally, the detached payload carries no request path.http_auth_check_permissionnever fires on the MCP transport.tool_pre_invokeblocks correctly on all surfaces — but only coverstools/call. There is no hook fortools/list, and no HTTP hook can see the JSON-RPC body to distinguish methods.Questions for the maintainers
tools/list)?http_pre_requestbeing non-blocking intentional and stable, or would a PR making it honorcontinue_processing=False/ violations be considered?Environment: ContextForge v1.0.6, native (in-process) plugins,
mode: sequential,on_error: fail.Thanks for the help 👐🏼
All reactions