Skip to content
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

Update presign post URL resolution to use the exact result from EndpointResolverV2 #2842

Merged
merged 4 commits into from
Oct 25, 2024

Conversation

Madrigal
Copy link
Contributor

  • Update presign post URL resolution to use the exact result from EndpointResolverV2

Fixes #2827

Discussed offline. Our original approach was to update toBaseURL to fix this edge case. However, this had the pitfall of being hard to capture all corner cases. Instead of coming up with a heuristic to figure out how to best parse the URL from the bucket, use the URI directly from endpointResolverV2. This change does this by:

  1. Adds a new code generator that has a renderPostEndpointResolutionHook, which generates the line on endpoints.go to store the URI on the context
  2. PresigPost uses this value instead of getting the URL from the request object

Tests are copied from a draft PR with the 1st approach

Testing

  1. Ran all unit tests for presign_post_test
  2. Ran integration tests manually (although we don't need this now since they are run by default 🎉 )

@Madrigal Madrigal requested a review from a team as a code owner October 16, 2024 23:41
Copy link
Contributor

@lucix-aws lucix-aws left a comment

Choose a reason for hiding this comment

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

fixandship

internal/context/context.go Outdated Show resolved Hide resolved
service/s3/presign_post_test.go Show resolved Hide resolved
@Madrigal Madrigal merged commit 63c2a37 into main Oct 25, 2024
13 checks passed
@Madrigal Madrigal deleted the fix-presign-post-use-resolved-uri branch October 25, 2024 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PresignedPostObject doesn't map bucket name in URL
3 participants