brendanhay / amazonka

A comprehensive Amazon Web Services SDK for Haskell.
https://amazonka.brendanhay.nz
Other
599 stars 227 forks source link

S3 vhost customisation #832

Closed endgame closed 1 year ago

endgame commented 1 year ago

Implement S3 vhost rewriting customisation using the design proposed by @basvandijk. The basic design is the same:

There are some differences to the original design (which I cherry-picked from @ivb-supercede's branch with generator fixes):

Because we're going to have to regenerate everything, I updated botocore as well. A full regeneration is available at endgame:s3-vhost-customisation-generation and will be merged once this branch lands. I have rebuilt the entire repo locally and it at least compiles.

Ping @basvandijk @ivb-supercede @kfigiela @akshaymankar @periodic who might be interested — please test the branch above.

@basvandijk / @ivb-supercede: Is it OK that I've cherry-picked your commits here?

Fixes #760 Closes #797

ivb-supercede commented 1 year ago

The service function is a method of class AWSRequest a instead of a separate class AWSService a and making class AWSService a => AWSRequest a; I couldn't see much benefit in a separate typeclass. Am I wrong?

I don't know enough to comment on this in general, since I just cribbed this from Bas' code. But in the case where AWSService is a superclass of AWSRequest, then this is design doesn't really make a difference - without any typeclass laws, what meaningful code can be written with only a AWSService instance?

Ping @basvandijk @ivb-supercede @kfigiela @akshaymankar @periodic who might be interested — please test the branch above.

Will do.

@basvandijk / @ivb-supercede: Is it OK that I've cherry-picked your commits here?

All good with me :+1:.

kfigiela commented 1 year ago

I will test this soon. If anyone needs a version with all services regenerated, it's available on my fork with the same branch name.

kfigiela commented 1 year ago

I can confirm that our integration tests work just fine with aws mocked with localstack and endpoint override configured not to use vhosts.

ivb-supercede commented 1 year ago

Looks like these changes work fine for us, for both real AWS usage and for local mocking with Moto.