docs(auth): CLI auth docs and gated e2e conformance test#58
Merged
Conversation
Add a README section covering the authenticated CLI: profiles, email OTP login, whoami, sessions, logout, config-as-code, and the users and organizations admin verbs, each with examples. Document the OS keychain behavior per platform (macOS Keychain, Windows Credential Manager, Linux Secret Service) and the headless SEAMLESS_REFRESH_TOKEN fallback. Add src/core/authFlow.e2e.test.ts, a gated end-to-end test that runs against a live instance when SEAMLESS_E2E_URL is set: it registers and verifies a user, logs in through the real login flow, makes an authenticated call, exercises transparent refresh, and asserts a reused refresh token is rejected. The rate-limit (429) check is gated behind a second flag since it exhausts the OTP limiter. The test is skipped in normal runs. Closes #47
Contributor
Author
|
Live verification: ran the non-destructive subset against a local instance (Node 24 auth-api + postgres) with So a full email OTP login through the real |
9 tasks
Bccorb
added a commit
that referenced
this pull request
Jul 17, 2026
docs(auth): CLI auth docs and gated e2e conformance test
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.
Summary
Final issue in the CLI auth epic (#38). Documents the authenticated CLI and adds an end-to-end test that exercises the login and token lifecycle against a running instance.
Docs
A new README section, "Authenticating against an instance", covers every command added across #39 to #46 with runnable examples:
profile add/list/use/remove,--profile,SEAMLESS_PROFILE)whoami,logout,logout --allsessionslist and revokeconfigget/set/roles/diff/apply (config as code)usersandorgadmin verbsSEAMLESS_REFRESH_TOKENfallback for CIEnd-to-end test
src/core/authFlow.e2e.test.tsdrives the CLI's real modules (completeLogin,createAuthClient, keychain, refresh) against a running instance. It is skipped unlessSEAMLESS_E2E_URLis set, so it never runs in the normal unit suite (verified:npm testshows it skipped).It covers the acceptance criteria:
GET /users/me).SEAMLESS_E2E_RATE_LIMIT) exhausts the OTP limiter and asserts the 429 path, kept out of routine runs because it saturates the shared per-IP limiter for 15 minutes.To read the OTP the CLI generates, the test wraps
fetchto add the instance's external-delivery header to the CLI's own generate call and captures the returned code, so login is a single deterministic generate rather than a racing second one. The external-delivery seam only returns codes outside production, so the target instance must run in dev/test and haveemail_otpenabled.Run it with:
Verification
npm run build(tsc strict): passing.npm test: 81 passing, 4 e2e skipped (noSEAMLESS_E2E_URL).Acceptance criteria
Closes #47