Document MCP auth and transport plan for Prague and beyond. - #158
Open
bentumbler wants to merge 1 commit into
Open
Document MCP auth and transport plan for Prague and beyond.#158bentumbler wants to merge 1 commit into
bentumbler wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Defines how a user, an MCP client, wlanpi-mcp, and wlanpi-core authenticate to each other — a minimal-scope Prague slice that fixes the real risks (cleartext transport, non-working revocation, unenforced expiry), and a beyond-Prague target aligned with MCP spec 2026-07-28 (stateless Streamable HTTP, MCP as OAuth 2.1 resource server, no token passthrough).
Relationship to #139: stays exactly as scoped (credential-based dispatch + sentinel removal). It is item P1 here and the first dependency of everything else. This issue tracks the surrounding architecture.
Defects found during review (verified in code / on-device)
shared_secret.binisroot:wlanpi0640 and wlanpi-mcp runs asUser=wlanpi— MCP can read the HMAC secret today. Everything running aswlanpiis one trust class until permissions are tightened.verify_tokentrusts the in-process cache without checking the revoked flag, andrevoke_tokennever evicts it.time_validation_enabled = False; only the hourly DB purge retires tokens (~1h granularity).is_otg_request()ever returnsTrue,verify_auth_wrapperreturns with no authentication performed.GET /startprofiler//stopprofilercontrol services;/profiler/<filename>serves capture artifacts to anyone. TLS does not mitigate this. Arguably the largest currently-exploitable hole on the device.Prague slice (P1–P8)
expvalidation; TTL option (~24h interactive default):31415for one release (WLAN Pi app compat)getjwt --export/--write-env; no tokens in client configsX-Wlanpi-Client; classroom tool-allowlist profiledid-owned stream handles + subscribe rightsPassthrough is kept for Prague as a documented, temporary deviation: on a single-owner box its marginal risk is negligible, and the budget goes to controls that stop actual classroom attacks. Session UX = daily-renewed JWT; continuity = ownership bound to
did, not the token string.Beyond-Prague (B1–B8, in the doc): Streamable HTTP,
audclaims, core introspection endpoint (HS256 → no JWKS), MCP service identity plus signeddidassertion (preserves per-user attribution), secret-permission tightening, pairing flow to replace SSH+getjwt(WLAN Pi app evolution), scopes. §5 of the doc shows this is non-breaking for the WLAN Pi app andgetjwtifaud/scopes stay lenient — but it doubles Prague auth scope for no classroom risk reduction, hence the split. One cheap pull-forward: start issuingaudclaims now, enforce later.Decisions needed (please weigh in)
Sec-WebSocket-Protocol?:31415is removed?audissuance forward? (recommended: yes)/cc @joshschmelzle @jsnyder81