-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(feat) Add masking to python middleware #955
Conversation
@AndriiAndreiev when you have a chance, can you take over this PR from Kenny? I'm happy to chat through this live - but the general intention is to use hash any |
@@ -224,6 +220,9 @@ def _build_request_payload(self, request) -> dict: | |||
"bodySize": -1, | |||
} | |||
|
|||
if "Authorization" in headers: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
at this point, if there is an Authorization
header, won't there already be an unmasked Authorization header in payload["headers"]
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That would be my expectation too - does .append
overwrite the existing header here, or do we need to forcefully delete it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AndriiAndreiev aside from confirming @llimllib 's comment, this looks good to me! Thank you for picking this up and bringing it to the finish line 😊
@gratcliff @llimllib I made small changes on "Authorization" header masking so that there is no copy of the original and masked header |
| 🚥 Resolves [RM-8742](https://linear.app/readme-io/issue/RM-8742) | | :------------------- | ## 🧰 Changes Adds sensitive data masking to the Dotnet SDK The logic is the same as we will have in Python SDK (PR #955)
| 🚥 Resolves [RM-8742](https://linear.app/readme-io/issue/RM-8742) | | :------------------- | ## 🧰 Changes Adds sensitive data masking to the PHP SDK The logic is the same as we will have in Python SDK (PR #955)
🧰 Changes
Adds sensitive data masking to the Python SDK
🧬 QA & Testing
Updated and added tests as applicable