Repository navigation
Description
Parent: #437
Summary
mecatui connecting to a remote mecated/mecak8s deployment had no supported
identity story: connect was a bare dial with an optional static --auth-token,
with no enrolment, no credential persistence, no refresh, and no recovery from an
expired or rejected session. Add that story end to end: enrolment, storage,
refresh, in-TUI recovery, and removal.
This is one piece of #437's "trust mecatl in production" story — a demonstrable
Kubernetes deployment needs a login flow that survives longer than one access
token.
Delivered
Four ADRs, each landing a layer:
- ADR 0242 —
mecatui login ADDRESS(public-client Authorization Code + PKCE, explicit
issuer/client id/audience/CA),mecatui logout ADDRESS, andconnectstaying
a pure dial that never opens a browser or guesses an issuer. Target-bound
credentials in a keyring-wrapped encrypted store, separate from the ToolHive
LLM gateway'smecatui llm login. A scoped private-HTTPS transport
(authn/oidc/scopedhttps) for a private-CA issuer. - ADR 0239
— proactive refresh gated on client activity, not a wall-clock timer, so an
idle session still honors the identity provider's configured SSO idle timeout
instead of silently overriding it. - ADR 0240 — a
closed, proto-free auth-failure taxonomy routed to the existing/connect
overlay instead of exiting the process; a rejected bearer is never offered
re-login (re-authenticating would mint an identical token and loop forever);
session adoption after re-auth defers to the server's own ownership checks
rather than comparing principals client-side. - ADR 0241 — target
logout that removes the credential before the registry entry (so a partial
failure can never orphan a credential the registry can no longer find), with
bounded best-effort RFC 7009 revocation at the provider.
Also fixed along the way
Bugs found while qualifying this against a live Keycloak/Kind fixture, filed and
tracked separately:
- mcp/oauthlogin rejects OAuth callbacks from any provider that does not implement RFC 9207 #764 (closed via main's independent fix(mcp): support optional RFC 9207 issuers #766) — RFC 9207
isswas required
unconditionally, so login could never complete against a provider that doesn't
send it (Dex, and most non-Google/Keycloak IdPs). - mecatui: a persistently rejected bearer causes a zero-delay live-feed reconnect loop #779 (open) — a persistently rejected bearer sent the live-feed reconnect loop
into a zero-delay spin; fixed on the feature branch, not yet onmain. - scheduler: standby replicas log leader-held at INFO on every acquire attempt, burying the log #778 (open) — unrelated scheduler log spam found during the same qualification
pass; not part of this feature's scope.
Verification
Offline: task lint, task test, task docs:check all green on the feature
branch. Live: qualified against a disposable Kind fixture (mecak8s + Keycloak) —
enrolment, connect, a rejected-bearer recovery, an expired-credential recovery,
and the activity-gated refresh surviving an active session across its access
token's lifetime while a fully idle session correctly expires at the identity
provider's SSO idle timeout.
Out of scope
- Remote MCP server OAuth provisioning through the mecatl API (Support MCP OAuth provisioning for remote clients #740 — a
different direction: server-side credential provisioning for a remote caller,
not mecatui's own login to mecated). - Pruning a credential left behind by a since-deleted registry entry — the
credential store has no enumeration capability; noted as a follow-up in
ADR 0241, not blocking.
Activity