fix: empty/whitespace credentials should raise MissingCredentialsError#190
Merged
Kamilbenkirane merged 3 commits intomainfrom Feb 25, 2026
Merged
fix: empty/whitespace credentials should raise MissingCredentialsError#190Kamilbenkirane merged 3 commits intomainfrom
Kamilbenkirane merged 3 commits intomainfrom
Conversation
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
Member
Author
Code reviewFound 3 issues:
celeste-python/src/celeste/credentials.py Lines 100 to 105 in c82f1fc
celeste-python/src/celeste/credentials.py Lines 97 to 100 in c82f1fc
celeste-python/src/celeste/credentials.py Lines 132 to 133 in c82f1fc 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
Also updates get_credentials and has_credential docstrings to reflect the new empty/whitespace-only rejection behavior.
`if override_key:` was falsy for "" and SecretStr(""), silently falling
through to env-var lookup instead of raising MissingCredentialsError.
Also adds SecretStr coverage and a fallthrough regression test.
3 tasks
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
Closes #184
get_credentials()now rejects empty/whitespaceSecretStrvalues withMissingCredentialsErrorinstead of passing them through to produce invalid HTTP headershas_credential()now returnsFalsefor empty/whitespace credentials, which also fixeslist_available_providers()test_whitespace_credentialsto assert the new behaviorTest plan
test_whitespace_credentials_are_treated_as_missingpasses for""," ","\t\n"