Add browser-based CLI login support#53
Conversation
Expose the CLI login API in generated SDKs and add Node CLI login/logout commands so saved credentials can be managed end to end.
|
@greptile review |
Greptile SummaryThis PR adds browser-based
Confidence Score: 4/5Safe to merge with awareness of a race condition in credential cleanup that can silently undo a successful login when two CLI processes run concurrently against stale credentials. The new removeStaleSavedCredentialOnUnauthorized helper deletes the credentials file without acquiring the directory-based lock that login and logout use. If a concurrent login completes and writes fresh credentials during the window between another command resolving its auth and that command's 401 handler firing, the freshly-saved credentials are silently deleted. The rest of the change is solid and well-tested. sdk-node/src/oclif/api-command.ts — the removeStaleSavedCredentialOnUnauthorized function and every call site that reaches it without holding the credential lock. Important Files Changed
|
|
@greptile review |
Commit the Go artifacts produced by the CI generator so generated-file checks stay in sync.
|
@greptile review |
Move slow_down to the RFC-compatible 400 response and document the CLI login metadata size limit across generated SDK artifacts.
|
@greptile review |
|
A few things from a deeper pass. Reviewed the hand-written surface ( Should fix
Worth addressing
Minor
What's good
|
|
@greptile review |
|
Re-review of 1. Stale lock on crash.
PID-based recovery is the kinder UX and isn't much code. 2. Otherwise looks great. LGTM with these two. |
|
@greptile review |
|
@greptile review |
Summary
primitive loginandprimitive logoutwith file-backed saved credentials.Verification
pnpm --dir sdk-node typecheckpnpm --dir sdk-node testpnpm --dir sdk-node build:oclifbiome check --error-on-warnings src/oclif tests/oclifgit diff --checkPre-Merge