Auth UX: seamless gated-box first contact, lager whoami, and command renames#139
Merged
Conversation
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.
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Auth/session UX improvements plus a command-naming cleanup.
Gateway auth & session UX
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 — runlager login) rather than the short-lived access token's by-design expiry.Command renames (old spellings warn but still work)
lager box config→lager box-configandlager box dut→lager dut— theboxgroup is flattened to top level.lager authorize→lager ssh-setup— it does one-time SSH key setup, and the old name read like authentication oncelager loginarrived.