feat(auth): add read-only auth status command#263
Open
LorrisSaintGenez wants to merge 5 commits into
Open
Conversation
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 27 |
| Duplication | 6 |
TIP This summary will be updated as you push new changes.
…cation Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
What
algolia auth status: reports whether you're signed in (and as whom), which application is current, and whether an API key is available — with a non-zero exit code when neither a session nor API credentials are found. Strictly read-only: never prompts, opens a browser, or mutates stored credentials (unlikeauth get, which triggers the OAuth flow when logged out). Flags active environment overrides (ALGOLIA_APPLICATION_ID,ALGOLIA_API_KEY,ALGOLIA_ADMIN_API_KEYdeprecated,ALGOLIA_SEARCH_HOSTSwith its value) so misdirected requests are diagnosable at a glance.authgroup description now mentions sign-up and status.Run algolia application select, or pass --application-idinstead of the misleadingPlease run algolia auth login; the keychain-missing error keeps its own remediation without a contradictory extra line.auth getno longer panics (nil dereference) when authentication succeeds but the token cannot be persisted to the OS keychain — it returns a clear error instead.Why the pkg/config changes are in this PR
validators.go+profile.go: the hint logic inroot.goneeds to distinguish "key missing from keychain" from the generic auth errors viaerrors.Is, so the existing inline error string becomes theErrAPIKeyMissingFromKeychainsentinel, wrapped with%wwhere it was produced. The user-facing message is byte-for-byte identical.resolution_test.go: pre-existing flake surfaced while running the suite for this PR — theGetSearchHoststests read the ambient environment, so they fail on any machine where the repo's.env(direnv) is loaded. Twot.Setenvlines neutralize it. Happy to split it out if preferred.Test