trinodb / aws-proxy

Proxy for S3
Apache License 2.0
7 stars 3 forks source link

Support S3 request rewriting #147

Closed vagaerg closed 2 weeks ago

vagaerg commented 4 weeks ago

I turned TestPresigningHeaders and TestPresignedRequests into abstract test classes, so unfortunately this results in a large diff. Diffing these files with their Abstract counterparts should provide useful insight.

This PR introduces functionality to redirect the bucket and key of an S3 request, in order to provide a virtualised view of a bucket.

Since the proxy does not decode the responses it gets back from S3, listing files or listing buckets will result in the real names being returned.

The authorisation logic happens with the original bucket and key and not the rewritten one. I believe this is a powerful way of letting users build abstractions on top of existing storage buckets, but it would need to be documented to ensure people understand how request rewriting changes the authorization flow.