feat/YT-73-web-layer #1

Merged
David merged 2 commits from feat/YT-73-web-layer into main 2026-07-17 22:27:16 +02:00
Owner
No description provided.
Port the product-agnostic web layer from youtrack-mcp: browser sessions, the OAuth 2.1 Authorization Server (dynamic client registration, PKCE, authorization codes, access and refresh tokens, discovery metadata), the Resource-Server bearer middleware, the expiry sweep, the local-account handlers (signup, login, logout, change password, TOTP enrol/verify, recovery codes, delete), the admin account-lifecycle UI, the askama templates, and AppState + build_router.

Three seams keep the crate product-agnostic:
- AppState carries the generic pool/crypto/signer/http config plus an Arc<dyn UpstreamDirectory>; it reads no environment, and a consumer constructs it via AppState::new.
- build_router(state, mcp_router, extra_routes) assembles the account/admin/OAuth surface and merges the consumer's own bearer-gated /mcp router and instance routes; require_bearer, Principal, and ADVERTISED_SCOPE are re-exported so the consumer builds the /mcp gate itself. The generic crate depends on no rmcp and no upstream client.
- UpstreamDirectory is the connection-status seam: the account page and admin list get a per-account "connected" boolean and a settings-path link without the generic query ever selecting an instance URL or token, making YT-71's projection discipline structural.

No product vocabulary remains in the web layer. HttpConfig is a plain data struct (deployment env-var names stay in the consumer). 112 tests green; fmt and clippy -D warnings clean. Instance handlers, client_for_account, the stdio Config, and HttpConfig env-loading stay in the consumer for phase 2 adoption.

#YT-73
docs: document the adoption contract in the README
All checks were successful
Check / fmt + clippy + build + tests (pull_request) Successful in 26s
02db237d9f
Spell out what a new MCP server must implement to adopt mcp-web: its instance model plus a migration at version 1000+, client resolution over AppState, the UpstreamDirectory connection-status seam, and a bearer-gated /mcp router handed to build_router. Includes AppState assembly, the consumer-owns-env-var-names note, and the migration-composition rules, with youtrack-mcp as the reference implementation.

#YT-73
David merged commit 69917beabb into main 2026-07-17 22:27:16 +02:00
David deleted branch feat/YT-73-web-layer 2026-07-17 22:27:21 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
pandoras-box/mcp-web!1
No description provided.