add host-style buckets support#206
Conversation
arttor
left a comment
There was a problem hiding this comment.
Thanks for submitting the issue and PR!
can you please rebase onto current main - otherwise CI check will not pass.
what do you think about the following approch:
- reuse
addressconfig for detecting host bucket - detect bucket from r.Host and rewrite r.URL.Path to path-style once in
S3Middleware. - auth middleware check runs before req-parse, so SigV4/SigV2 verify the original wire form; the rewrite is invisible to both and there is no need to pass Get/SetVirtualHostStyle to ctx.
aloso, do you have any strategy for e2e testing? not sure that it will be easy to test it on CI with e2e test? have you tested your branch manually?
|
Thanks for the feedback. Changes made:
All tests passed. |
arttor
left a comment
There was a problem hiding this comment.
thanks for updates but there are some comments and questions not adressed from the previous review round.
|
@arttor, I've addressed all the comments and resolved the discussions. Please let me know if I missed anything. |
|
Tested the branch locally chorus debug logs: |
|
ci check failed. can you please update your branch? main has upgraded dependencies. you can also run |
Signed-off-by: Askar Sabyrov <kyrkaz@gmail.com>
Signed-off-by: Askar Sabyrov <kyrkaz@gmail.com>
Signed-off-by: Askar Sabyrov <kyrkaz@gmail.com>
Signed-off-by: Askar Sabyrov <kyrkaz@gmail.com>
|
@arttor Rebased with upstream, but it didn’t resolve the CI govulncheck failure. The new failures were coming from golang.org/x/crypto@v0.50.0 advisories fixed in v0.52.0, so I updated golang.org/x/crypto to v0.52.0 and refreshed related golang.org/x/* dependencies in the root module and tool modules. |
Pull Request
Description
Resolves #208
This PR adds support for S3 virtual-host-style requests in the proxy while keeping existing path-style behavior unchanged.
It introduces host-aware bucket/object parsing in the S3 request parser and wires proxy middleware/auth to use the configured proxy.virtual_hostname value. With this change, requests like PUT / on bucket.<virtual_hostname> are correctly recognized as bucket operations (e.g.
CreateBucket) instead of falling through toUndefinedMethod.Key updates:
pkg/s3/req_parser.go(ParseReqForHost, ParseBucketAndObjectForHost).Checklist
Signed-off-byline to certify agreement with the Developer Certificate of Origin (DCO).make testpassingNote: By submitting this PR, you agree to license your contributions under the Apache 2.0 License and follow our Code of Conduct.