Add safe Lantern authentication diagnostics for MCP discovery failures #53

Merged
cameron merged 1 commit from hermes/infrastructure:fix/lantern-safe-auth-diagnostics into main 2026-10-12 16:00:27 -04:00
Contributor

Purpose

Investigate real ChatGPT OAuth success followed by failed MCP tool discovery and repeated POST /mcp 401s without requesting or logging access tokens.

Changes

  • Internal allowlisted rejection categories distinguish missing bearer, token profile/algorithm/header, JWKS/key, dates, issuer/audience/signature, claims and scope errors.
  • Log only a fixed reason at warning level, at most once per category per five seconds. No token/header/claim values, client IDs, message content or untrusted exception text.
  • Keep generic HTTP 401 responses and existing validation unchanged/fail-closed.
  • Document how to obtain the bounded journal reason after a controlled retry.

Verification

  • 32 Python tests pass, including RED-to-GREEN diagnostic tests and existing live local-JWKS/MCP tests.
  • Five Nix evaluation tests pass.
  • Independent review: no security/logic blockers; rate boundary and bounded dictionary independently checked.
  • Deployed verifier can fetch/parse actual Pocket ID public JWKS; no real access token was authenticated.

Operator next step

Review/merge/deploy through the trusted checkout. Retry ChatGPT once; read the lantern-planning-bridge.service journal for Lantern authentication rejected reason=... and share only that category. Wait five seconds between diagnostic retries due to log suppression. No authentication relaxation, unpause, session adapter activation or deployment performed here.

## Purpose Investigate real ChatGPT OAuth success followed by failed MCP tool discovery and repeated POST /mcp 401s without requesting or logging access tokens. ## Changes - Internal allowlisted rejection categories distinguish missing bearer, token profile/algorithm/header, JWKS/key, dates, issuer/audience/signature, claims and scope errors. - Log only a fixed reason at warning level, at most once per category per five seconds. No token/header/claim values, client IDs, message content or untrusted exception text. - Keep generic HTTP 401 responses and existing validation unchanged/fail-closed. - Document how to obtain the bounded journal reason after a controlled retry. ## Verification - 32 Python tests pass, including RED-to-GREEN diagnostic tests and existing live local-JWKS/MCP tests. - Five Nix evaluation tests pass. - Independent review: no security/logic blockers; rate boundary and bounded dictionary independently checked. - Deployed verifier can fetch/parse actual Pocket ID public JWKS; no real access token was authenticated. ## Operator next step Review/merge/deploy through the trusted checkout. Retry ChatGPT once; read the lantern-planning-bridge.service journal for `Lantern authentication rejected reason=...` and share only that category. Wait five seconds between diagnostic retries due to log suppression. No authentication relaxation, unpause, session adapter activation or deployment performed here.
cameron deleted branch fix/lantern-safe-auth-diagnostics 2026-10-12 16:00:28 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
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
cameron/infrastructure!53
No description provided.