Repository navigation
Conversation
Author
|
The linked hosted jobs pass all 52 unit tests with 99.31% coverage on Python 3.9 and 3.13, plus pylint, Ruff and the upstream fatal-error flake8 check. Could a maintainer approve the pending Python package workflow? The description records the initial Python 3.9 runner-image limitation and the successful Ubuntu 22.04 checks. |
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.
Description
Why is this change being made?
InjectSecretStringmistakesget(secret, request)for an instance method whenrequestis a dictionary, becausedict.getexists. It injects the secret after the request instead of before it. A static method receiving an instance of its containing class has the same problem.What is changing?
Check whether the first argument's class hierarchy actually contains a method wrapping the decorated function, instead of checking for an unrelated attribute with the same name. Exclude static/class-method descriptors from instance-method classification, while preserving inherited methods,
super()calls, outerlru_cachewrappers, and properties. Secret retrieval remains per invocation except when an existing outer decorator itself caches the call.Related Links
InjectSecretStringclobberingselfarg in class methods (#24) #58.Testing
How was this tested?
GitHub-hosted Ubuntu 22.04, Python 3.9.25 and 3.13.18, exact base
b66d1a9866dc7d96fb246039def477038ce0f5da:git diff --checkpass.An initial Python 3.9 attempt stopped at interpreter setup on Ubuntu 26.04. The final jobs use Ubuntu 22.04 and both pass. No live AWS integration tests were run; the suite uses stubbed service responses and the new cases use a mock cache.
When testing locally, provide testing artifact(s):
Tests ran on hosted runners, not on the local laptop:
Reviewee Checklist
Update the checklist after submitting the PR
Editable-package installation and all 52 unit tests pass in both hosted jobs.
Not needed for decorator argument placement; unit regressions cover the changed behavior.
No logging was added; regression secrets are fixed test strings.
Classification has an explanatory comment and regression names identify the compatibility cases.
No public API or documented usage change; the fix restores the existing injection contract.
No intentional breaking API change.
Reviewer Checklist
All reviewers please ensure the following are true before reviewing:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.