Add interactive login#64
Conversation
Code Review: Add interactive login
|
8908deb to
6b05689
Compare
|
Claude finished @ramilamparo's task in 8m 37s —— View job Code Review: Add interactive login
The latest push ( Ran four specialized subagents against the full PR diff. No new noteworthy findings beyond what prior reviews have already raised. Five open items remain unaddressed but none are blocking:
Resolved 3 now-addressed bot threads, minimized 14 outdated bot review summaries, and deleted 1 progress-tracking comment. Submitted as APPROVE. |
hi-rai
left a comment
There was a problem hiding this comment.
PR looks okay. Few minor nits
| keyring: 'the system keyring', | ||
| 'credentials.json': 'a credentials file (~/.config/qasphere/credentials.json)', |
There was a problem hiding this comment.
Should we expose the internal details of how the oauth credentials are stored to the user ? Or simply mention oauth ?
There was a problem hiding this comment.
I don't see the harm. Showing "OAuth" could be a bit misleading. Since keyring also uses OAuth.
|
Claude finished @ramilamparo's task in 10m 18s —— View job Code Review: Add interactive login
The latest commit ( Ran four specialized subagents against the full PR diff. No new noteworthy findings beyond what prior reviews have already raised. Two previously-open test gaps are now addressed ( |
|
Claude finished @ramilamparo's task in 10m 25s —— View job Code Review: Add interactive login
The latest commit ( Ran four specialized subagents against the full PR diff. Two new findings posted as inline comments:
Minimized 16 outdated bot review summaries. Three open items from prior reviews remain unaddressed but none are blocking. Submitted as APPROVE. |
Code Review: Add interactive login
|
|
Claude finished @ramilamparo's task in 14m 7s —— View job Code Review: Add interactive login
The latest commits ( Ran four specialized subagents against the full PR diff. One new finding posted as an inline comment: Minimized 17 outdated bot review summaries. Three open items from prior reviews remain unaddressed but none are blocking. Submitted as APPROVE. |
satvik007
left a comment
There was a problem hiding this comment.
I did some local reviews with agents and helped me find out some issues that we can address before merge.
- Restrict openBrowser URL scheme to http/https, surface execFile stderr - Restore withDevAuth middleware in createApi - Include client_id on refresh (RFC 6749 §6) and validate OAuth responses with Zod - Distinguish OAuth protocol vs transport errors so transient failures preserve credentials - Warn when stale-credential clear fails - Strip trailing slash on tenantUrl in apikey resolvers - Narrow credential source into ApiKeyCredentialSource | OAuthCredentialSource - Warn on partial QAS_TOKEN/QAS_URL config per source - Drop redundant pre-exit SIGINT removeListener calls - Reword --run-url host mismatch error to show both hosts - Cover OAuth bearer upload path and host-mismatch case in tests
|
Claude finished @ramilamparo's task in 13m 4s —— View job Code Review: Add interactive login
The latest commit ( Ran four specialized subagents against the full PR diff. Three new findings posted as inline comments — none blocking:
Resolved 1 now-addressed bot thread ( |
- Validate verification_uri / verification_uri_complete as URLs - Extract credentialsFromTokenResponse to deduplicate token-to-credentials mapping - Disable withHttpRetry on pollDeviceToken so the polling loop owns retry timing; treat 429/502/503 as transient and keep polling, honoring Retry-After - Share parseRetryAfterMs and DEFAULT_HTTP_RETRY_OPTIONS between withHttpRetry and the poll path
|
Claude finished @ramilamparo's task in 11m 0s —— View job Code Review: Add interactive login
The latest commit (
Ran four specialized subagents against the full PR diff. All findings map to items already raised and addressed or acknowledged in prior review cycles. Resolved 3 now-addressed bot threads and minimized 19 outdated bot review summaries. One remaining low-priority item from prior reviews is still open but not blocking:
Submitted as APPROVE. |
|
Claude finished @satvik007's task in 13m 36s —— View job Code Review: Add interactive login
The latest commit ( Ran four specialized subagents against the full PR diff. All findings map to items already raised and addressed or acknowledged in prior review cycles. Minimized 20 outdated bot review summaries. One remaining low-priority item from prior reviews is still open but not blocking:
Submitted as APPROVE. |
There was a problem hiding this comment.
The latest commit (557ec01 — "Add user details in auth status") replaces projects.list() with users.me() for status validation and now displays the authenticated user's name, email, and role. The change is clean and well-tested — lifecycle and refresh tests updated to match.
Ran four specialized subagents (code quality, security, performance, test coverage) against the full PR diff. All findings map to items already raised and addressed or acknowledged in prior review cycles. One remaining low-priority item is still open but not blocking:
keyring.ts:22—loadKeyringModule()re-attempts dynamic import on every call (performance/low — Node.js caches successful imports internally, so this only adds overhead on the failure path)
LGTM.

Summary
Adds interactive
qasphere authcommands for login, logout, and status — replacing the need to manually manage API keys and environment variables.For testing purposes, you can override the
QAS_LOGIN_SERVICE_URL.Login methods
Credential storage
Credentials are persisted in priority order:
@napi-rs/keyring) — preferred, used when the OS keyring daemon is available~/.config/qasphere/credentials.json) — restricted permissions (0600), used when keyring is unavailableCredential resolution
resolveCredentialSource()checks sources in priority order:QAS_TOKEN+QAS_URLenvironment variables.envfile in cwd~/.config/qasphere/credentials.json.qasphereclifile (searched up directory tree)Auth subcommands
qasphere auth loginqasphere auth statusqasphere auth logout