Expand description
MCP caller-auth helper types and pure policy decisions.
This module deliberately avoids concrete #[tool] handlers. It keeps the
reusable identity snapshot / Bearer parsing / early trade-scope policy out of
tools.rs, while tools.rs remains the thin dispatch surface.
Structsยง
- Caller
Snapshot ๐ - Caller authenticated identity snapshot returned by MCP auth guards. Captured once at auth time; subsequent response filtering / push subscriber registration / visibility uses this snapshot rather than re-resolving from Bearer/startup (้ฒ SIGHUP reload race / drift between auth decision and side effect).
Enumsยง
- Early
Trade ๐Scope Decision - Pure decision logic for early trade-scope check.
Functionsยง
- decide_
early_ ๐trade_ scope - http_
bearer_ ๐token - Extract HTTP
Authorization: Bearer <token>from rmcpRequestContext. - outcome_
key_ ๐id_ from_ snapshot - Compute the audit key id from the same snapshot used by the write precheck.
This prevents SIGHUP reload between daemon dispatch and audit emission from
re-attributing an outcome to the startup key or
<none>. - scope_
label ๐ - Scope enum -> human-readable label for early-reject error messages.