Skip to content

Auth UX: seamless gated-box first contact, lager whoami, and command renames#139

Merged
cmfisher606 merged 4 commits into
mainfrom
cf/auth_updates
Jul 22, 2026
Merged

Auth UX: seamless gated-box first contact, lager whoami, and command renames#139
cmfisher606 merged 4 commits into
mainfrom
cf/auth_updates

Conversation

@cmfisher606

Copy link
Copy Markdown
Collaborator

Auth/session UX improvements plus a command-naming cleanup.

Gateway auth & session UX

  • Seamless first contact with a gated box. The CLI learns a box's auth server from its first 401; that request is now retried once transparently (record the mapping, attach the stored token, resend), so the very first command against a freshly-guarded box succeeds instead of asking the user to re-run it. A plain box never receives the token — only a gateway sends the discovery header — so no credentials leak to un-gated boxes. Genuine denials (revoked session, no grant, auth server down) still raise the actionable error.
  • lager whoami. Shows which auth servers you're signed in to, as whom, and the session state — the first thing to run when a box reports an authorization problem. The session line reports the actionable state (active / renews automatically / expired — run lager login) rather than the short-lived access token's by-design expiry.
  • Clearer gateway auth errors. Signed-in-but-no-access, needs-sign-in, and expired-session each get a distinct message linking to the new "Signing In" docs page (reference/cli/login).

Command renames (old spellings warn but still work)

  • lager box configlager box-config and lager box dutlager dut — the box group is flattened to top level.
  • lager authorizelager ssh-setup — it does one-time SSH key setup, and the old name read like authentication once lager login arrived.
  • All three old spellings remain as hidden aliases that print a DEPRECATED warning to stderr; they will be removed in a future release. Error hints, docs pages, docs.json navigation, and tests follow the new names.

The CLI learns a box's auth server only from its first 401, so the very
first command against a freshly-guarded box used to fail with a 're-run
this command' message. _check_gateway now retries that request once,
transparently: on a first-contact 401 it records the mapping, attaches
the stored token, and resends — the caller gets the authenticated
response and never sees the round trip. A plain box never receives the
token (only a gateway sends the discovery header), so no credentials
leak to un-gated boxes. Genuine denials (revoked session, no grant,
auth server down) still raise the actionable error. All box-call sites
adopt the returned response.
- lager whoami: shows which auth servers you're signed in to, as whom,
  when each session expires, and which gated boxes it has seen — the
  first thing to run when a box reports an authorization problem.
- Gateway auth errors are clearer (signed-in-but-no-access vs needs
  sign-in vs expired session) and each links to a troubleshooting page.
- New docs page 'Signing In' (reference/cli/login) covering lager login,
  whoami, and every gateway message with its fix.
The Session line reported the short-lived access token's expiry, which
lapses every few minutes by design and refreshes silently — so a
healthy session read as 'expired 1h ago', which looked alarming for no
reason. It now leads with the actionable state (active / renews
automatically / expired — run lager login) and drops the 'gated boxes
seen' list, which showed IPs and only meant the CLI had encountered
them, not that you're authorized.
lager box config is now lager box-config, lager box dut is now
lager dut, and lager authorize is now lager ssh-setup -- the old
name read like authentication once lager login (gateway sign-in)
arrived, when it actually does one-time SSH key setup. All three
old spellings keep working as hidden aliases that print a
DEPRECATED warning. Error hints, docs pages, docs.json navigation,
and tests follow the new names.
@gemini-code-assist

Copy link
Copy Markdown

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@cmfisher606
cmfisher606 merged commit 45a5388 into main Jul 22, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant