fix(auth): validate resolved credentials in status checks - #46
Merged
Conversation
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
Authentication status now reports working
YNAB_API_KEYcredentials the same way as keychain credentials, while rejecting invalid tokens through a lightweight YNAB user lookup. Credential rotation refreshes the cached client, and network or rate-limit failures remain operational errors instead of being mislabeled as invalid authentication.Validation covered valid keychain and environment credentials, invalid environment credentials, missing credentials, CLI and MCP serialization, transient failures, and token non-disclosure. Both Bun and Vitest passed all 45 tests, with typecheck, lint, build, and package dry-run also passing.
Problem
ynab auth statusand MCPcheck_authonly inspected keychain storage, so a successfully workingYNAB_API_KEYstill appeared unauthenticated.Post-Deploy Monitoring & Validation
ynab auth statusand MCPcheck_authreturn true for valid keychain and environment credentials, and false for invalid credentials.v2.8.3; roll back the release if those checks fail.