aws-beam / aws-codegen

Code generator for AWS clients in Erlang and Elixir.
Other
53 stars 49 forks source link

Allow aws-s3 to use virtual hosts by passing a Bucket downwards and moving it from the path to the host #84

Closed onno-vos-dev closed 2 years ago

onno-vos-dev commented 2 years ago

Description

In essence, AWS has two styles of talking with S3, by Path or by VirtualHost. The recommended approach is using VirtualHost since Paths are deprecated (but not removed yet since the internet will probably fall apart when doing so... :smile:). This PR changes the aws_s3.erl module to use the VirtualHost style rather than the Path style in order to be compliant with this new approach.

Patch diff

Adding patch diff which shows that on a clean master of aws-erlang the diff is isolated to aws_s3.erl and a newline in aws_s3_control.erl.

A similar patch will likely need to be made to rest.ex.eex but I haven't had the time to do so. If approved, I'll open an issue on aws-elixir and see if someone wants to grab it :-)

aws-erlang diff

Further reading

https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html https://aws.amazon.com/blogs/aws/amazon-s3-path-deprecation-plan-the-rest-of-the-story/

Relates to: https://github.com/aws/aws-sdk-go/issues/4244

TODO:

onno-vos-dev commented 2 years ago

Squashing all these fixup commits into Rename is_s3_context to s3_context

philss commented 2 years ago

@onno-vos-dev just to avoid too many CI executions, you can commit things in batch while doing the review.

onno-vos-dev commented 2 years ago

@onno-vos-dev just to avoid too many CI executions, you can commit things in batch while doing the review.

You live and learn, I tried to find that option but couldn't figure it out... I squashed all these fixups into the "main rename" commit now so hopefully that aborts all these github actions as well

onno-vos-dev commented 2 years ago

@philss Please hold off merging the aws-erlang PR that gets triggered tonight, I'd like to make sure that diff looks OK :-)

philss commented 2 years ago

@onno-vos-dev :+1: