Repository navigation
test: assert notification rule secrets stay out of SDK debug trace and exceptions - #700
Draft
sophiecarreras wants to merge 1 commit into
Draft
sophiecarreras wants to merge 1 commit into
sophiecarreras wants to merge 1 commit into
Conversation
…d exceptions Covers Bucket.set_notification_rules for the signing secret and a custom header value on the success, pre-authorization, API error and validation error paths. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
|
This branch has not been deployed
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
Adds unit tests proving the signing secret and a custom header value of a notification rule never appear in the SDK DEBUG trace or in exception text raised by
Bucket.set_notification_rules, on four paths: success, pre-authorization, API error and validation error. One test per (surface, path), parametrized over the two inputs; 16 cases.B2RawHTTPApiover a faked HTTP session answering 400.eventTypesas aset), which fails locally before anything is sent.No production code changed and no real leak was found.
Verification
pytest --api=v0..v3on the new file: 16 passed each;pytest --api=v3 test/unit: 1244 passed, 77 skipped, 25 xfailed;ruff checkandruff format --checkclean.logger.debugof the rules inBucket.set_notification_rulesfailed all 8 debug-trace cases; a temporary re-raise embedding the rules failed the exception cases on the failure paths (and the validation debug-trace cases, via the exception type). Both reverted.notification_rule_setmissing cells (surfaces, paths, inputs) went from all missing to none missing; expectation state moved frommissingtopending_run(a bound run is a separate criterion).🤖 Generated with Claude Code