fix: distinguish credential backend failures from missing credentials#233
Draft
bukinoshita wants to merge 1 commit intomainfrom
Draft
fix: distinguish credential backend failures from missing credentials#233bukinoshita wants to merge 1 commit intomainfrom
bukinoshita wants to merge 1 commit intomainfrom
Conversation
Linux and Windows secure-storage backends collapsed all lookup failures into null, causing resolveApiKeyAsync() to misreport backend outages as 'No API key found' instead of a storage-specific error. Changes: - linux.ts: exit codes 0/1 mean daemon responded (return null if no output), all other codes throw with backend-specific error message - windows.ts: use exit code 44 for 'Element not found' (credential absent), throw on all other failures with error details - config.ts: wrap backend.get() in try/catch, propagate backend errors as 'Credential backend unavailable' instead of silently falling through - client.ts: use 'credential_store_error' code for backend failures instead of generic 'auth_error' - doctor.ts: catch backend errors in API key checks, report storage backend unavailability instead of misleading 'No API key found' - Add tests for Linux backend error handling and resolveApiKeyAsync backend error propagation Co-authored-by: Bu Kinoshita <bukinoshita@users.noreply.github.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.
Summary by cubic
Fixes misleading “No API key found” by distinguishing credential backend outages from missing credentials on Linux and Windows. Addresses BU-630 and aligns behavior with macOS.
resolveApiKeyAsync(): propagate backend errors as “Credential backend unavailable” instead of falling back to file.requireClient()now emitscredential_store_error;doctorreports backend unavailability and skips validation when down.Written for commit 11c3805. Summary will update on new commits.