Files
hermes-agent/plugins/dashboard_auth/self_hosted
kshitijk4poor f6c8b95fda refactor(dashboard-auth): one refresh-boundary mapping, keep drift visible
Folds the pre-arm review of the salvaged stack:

- Map a grant's "minted token is not ours" InvalidCodeError to
  RefreshExpiredError once, in JwtOAuthProvider.refresh_session, instead of
  a copy in each provider's _grant (the auth-code path already raises
  InvalidCodeError -> 400, so the copies only mattered for refresh).
- A wrong aud/iss is also what config drift looks like (wrong client_id or
  portal URL). Now that it is a 401 instead of a 503, nothing logged it:
  verify_jwt logs the token's and the configured iss/aud at WARNING. The
  diagnostics tests assert that log through verify_session instead of
  calling _claims_for/_verify_id_token directly.
- oauth_contract_version mismatch deliberately stays a 503 (every token
  Portal mints would fail it); say so beside the check.
- Fix the now-stale InvalidCodeError and classify_jwks_lookup_error
  docstrings and trim per-branch comments that restated the rule.
- Tests: fold the gate-level cases into test_opaque_bearer_not_unreachable.py
  with one JWKS-server helper and one gated-app helper (three server copies
  -> one), add a cookie-path case, close the server socket.
2026-11-07 16:04:30 +05:30
..