Skip to content

fix: wizard auth check#358

Merged
calvinbrewer merged 1 commit intomainfrom
fix-wizard-auth
Apr 23, 2026
Merged

fix: wizard auth check#358
calvinbrewer merged 1 commit intomainfrom
fix-wizard-auth

Conversation

@calvinbrewer
Copy link
Copy Markdown
Contributor

@calvinbrewer calvinbrewer commented Apr 23, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Fixed the CLI wizard's authentication prerequisite check to use the proper authentication service instead of probing hardcoded paths.
    • Corrected the login command's success message to accurately reflect authentication status.

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Apr 23, 2026

🦋 Changeset detected

Latest commit: 7f5a05a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@cipherstash/cli Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

The PR refactors CLI authentication checks to delegate to the @cipherstash/auth package instead of filesystem path probing. It converts the prerequisite checker to async, adds a new helper using AutoStrategy.detect().getToken(), and updates the login spinner message accordingly.

Changes

Cohort / File(s) Summary
Changeset Metadata
.changeset/violet-emus-wait.md
Added changeset documenting minor version bump for @cipherstash/cli with behavioral fix for CLI wizard authentication checking.
Login Command
packages/cli/src/commands/auth/login.ts
Removed device-code regression TODO comment and updated spinner stop message to "Authenticated!" (removed claim about token save location).
Authentication Integration
packages/cli/src/commands/wizard/lib/prerequisites.ts
Converted checkPrerequisites() to async. Introduced hasCredentials() helper using @cipherstash/auth's AutoStrategy.detect().getToken() with selective error handling for NOT_AUTHENTICATED and MISSING_WORKSPACE_CRN codes.
Async Prerequisite Handling
packages/cli/src/commands/wizard/run.ts
Added await keyword when calling checkPrerequisites() to handle its new async signature.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Possibly related PRs

  • fix: invalid client on init #341: Modifies CLI authentication behavior in packages/cli/src/commands/auth/login.ts, specifically adjusting device-code client handling alongside this PR's messaging and auth integration changes.

Suggested reviewers

  • coderdan

Poem

🐰 A wizard's path, once stashed in files,
Now speaks with Auth in trusty styles—
We wait, await, and check with care,
No path-probing—Strategy's there! 🔐

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: wizard auth check' directly relates to the main change: converting authentication checks in the CLI wizard from hardcoded path probing to using the @cipherstash/auth package.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-wizard-auth

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@calvinbrewer calvinbrewer merged commit 5ee7a41 into main Apr 23, 2026
5 of 6 checks passed
@calvinbrewer calvinbrewer deleted the fix-wizard-auth branch April 23, 2026 20:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant