aws-sdk-go-v2 icon indicating copy to clipboard operation
aws-sdk-go-v2 copied to clipboard

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

Open Madrigal opened this issue 1 year ago • 0 comments

  • 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 avatar Oct 16 '24 23:10 Madrigal