Closed endgame closed 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:.
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.
I can confirm that our integration tests work just fine with aws mocked with localstack and endpoint override configured not to use vhosts.
Looks like these changes work fine for us, for both real AWS usage and for local mocking with Moto.
Implement S3 vhost rewriting customisation using the design proposed by @basvandijk. The basic design is the same:
request :: AWSRequest a => Service -> a -> Request a
inclass AWSRequest
is now accepts the service to send the request to, instead of generators hardcodingdefaultService
. This allows theRequest
to be computed from the overridenService
instead ofdefaultService
.service :: AWSRequest a => Proxy a -> Service
somewhere. We apply overrides to it before passing it torequest
.request :: AWSRequest a => (Service -> Service) -> a -> Request a
, but every option I could think of seemed worse than a new typeclass method.There are some differences to the original design (which I cherry-picked from @ivb-supercede's branch with generator fixes):
service
function is a method ofclass AWSRequest a
instead of a separateclass AWSService a
and makingclass AWSService a => AWSRequest a
; I couldn't see much benefit in a separate typeclass. Am I wrong?Bool
, I added a sum type to match the S3 addressing style optionsBecause 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