Add Docker-compatible device authentication#82
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughThe CLI replaces OAuth PKCE callback authentication with OAuth device-code authentication, including browser verification, polling, cancellation, expiry, and token persistence. Credential storage now uses the OS keyring when available and falls back to a protected JSON file with configurable paths and atomic writes. Integration tests cover authentication outcomes and filesystem behavior. The README documents containerized login and credential persistence. Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/api/auth.ts`:
- Around line 53-63: Update the access-token validation in the authentication
flow around getUserInfo so transient errors are not converted to null and do not
trigger secureStore.clearAll(). Only clear stored credentials when getUserInfo
definitively returns null for an invalid or unauthorized token; preserve the
existing already-authenticated and force-authentication behavior.
In `@src/lib/keyring.ts`:
- Around line 43-72: Update the catch handling in Keyring.read so ENOENT and
corrupted JSON continue returning an empty record, but unexpected filesystem
errors are rethrown after logging or otherwise propagated. Preserve set’s use of
read while preventing write from replacing an existing store when read fails for
an unrecognized FS error.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: c339abc3-560b-4eb2-a1cb-ff14f19bc6ac
📒 Files selected for processing (5)
README.mdsrc/api/auth.tssrc/lib/keyring.tstests/integration/file-keyring.test.tstests/integration/login-flow.test.ts
Summary by CodeRabbit
ENKRYPTIFY_STORE_PATHsupport to control where credentials are persisted.