Skip to content

S3: fix IfMatch/IfNoneMatch in pre-signed URLs #12624

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

Merged
merged 1 commit into from
May 15, 2025
Merged

Conversation

bentsku
Copy link
Contributor

@bentsku bentsku commented May 15, 2025

Motivation

We've got a report in our Community Slack that we were not enforcing the IfNoneMatch parameter with pre-signed URLs. After a quick investigation, it showed that boto3 was disregarding those parameters during the signing process, leading to us ignoring them and not passing them down to our parser; thus them not being enforced.

This issue shows that Boto3 is not even passing those to the query string parameters of the pre-signed URL: boto/boto3#4367

Changes

  • add a new field in the pre-signed URL code to manually pick those values from the query string to pass it back to the headers, for them to be enforced
  • add a test directly using botocore because as reported in the boto GH issue, using botocore allows you to properly create a pre-signed URL with the If-None-Match header in the query string

@bentsku bentsku added this to the 4.5 milestone May 15, 2025
@bentsku bentsku self-assigned this May 15, 2025
@bentsku bentsku added aws:s3 Amazon Simple Storage Service semver: patch Non-breaking changes which can be included in patch releases labels May 15, 2025
Copy link

S3 Image Test Results (AMD64 / ARM64)

  2 files    2 suites   8m 37s ⏱️
495 tests 445 ✅  50 💤 0 ❌
990 runs  890 ✅ 100 💤 0 ❌

Results for commit 8715d3d.

Copy link

LocalStack Community integration with Pro

    2 files      2 suites   1h 3m 58s ⏱️
1 802 tests 1 577 ✅ 225 💤 0 ❌
1 804 runs  1 577 ✅ 227 💤 0 ❌

Results for commit 8715d3d.

@bentsku bentsku marked this pull request as ready for review May 15, 2025 13:59
@bentsku bentsku requested a review from k-a-il May 15, 2025 13:59
Copy link
Contributor

@k-a-il k-a-il left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work! I didn’t notice any issues when reviewing the files. LGTM 🚀

@bentsku bentsku merged commit f3a4c74 into master May 15, 2025
44 checks passed
@bentsku bentsku deleted the s3-none-match-presigned branch May 15, 2025 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:s3 Amazon Simple Storage Service semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants