-
Notifications
You must be signed in to change notification settings - Fork 85
Adding signature v4 to S3 client #6365
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 2 Skipped Deployments
|
s3_config = Config(signature_version="s3v4") | ||
return session.client("s3", config=s3_config) |
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.
This is the fix
# Verify old URL fails | ||
response = requests.get(old_presigned_url, timeout=10) | ||
assert ( | ||
response.status_code != 200 | ||
), "URL without signature v4 should fail for KMS objects" | ||
assert ( | ||
"require AWS Signature Version 4" in response.text | ||
or response.status_code == 400 | ||
) |
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.
This reproduces the issue from prod before the fix
# Verify v4 URL works | ||
response = requests.get(fixed_presigned_url, timeout=10) | ||
assert ( | ||
response.status_code == 200 | ||
), "URL with signature v4 must work for KMS objects" | ||
assert response.content == test_content |
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.
New URL works 👍
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6365 +/- ##
=======================================
Coverage 86.97% 86.97%
=======================================
Files 454 454
Lines 28961 28963 +2
Branches 3228 3228
=======================================
+ Hits 25190 25192 +2
Misses 3052 3052
Partials 719 719 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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.
🚀 🚀 🚀
fides
|
Project |
fides
|
Branch Review |
main
|
Run status |
|
Run duration | 00m 53s |
Commit |
|
Committer | Adrian Galvan |
View all properties for this run ↗︎ |
Test results | |
---|---|
|
0
|
|
0
|
|
0
|
|
0
|
|
5
|
Upgrade your plan to view test results. | |
View all changes introduced in this branch ↗︎ |
Closes ENG-1021
Description Of Changes
Adding
signature_version=s3v4
to our S3 client to support KMS buckets in S3.Steps to Confirm
test_s3_signature_version_4
test. It creates pre-signed URLs with and without the signature version.Pre-Merge Checklist
CHANGELOG.md
updatedmain
downgrade()
migration is correct and works