-
-
Notifications
You must be signed in to change notification settings - Fork 227
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
amazonka-s3: Rewrite requests to use vhost bucket endpoints #673
Conversation
This is my first PR doing serious wrangling to requests, so I'd appreciate a close review. |
72c4974
to
8d5087d
Compare
8d5087d
to
d479019
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested creating/destroying buckets in us-east-1 and eu-west-1, as well as GetBucketLocation
and putting/getting small objects.
"s3" | ||
| virginia -> global "s3.amazonaws.com" | ||
| china -> region ("s3." <> reg <> ".amazonaws.com.cn") | ||
| s3 -> region ("s3-" <> reg <> ".amazonaws.com") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It appears that S3 now has a dotted regional endpoint for each region, so I removed this. I made test requests to s3.us-east-1.amazonaws.com
.
"PutBucketTagging": ["Request.contentMD5Header"], | ||
"PutObject": ["Request.expectHeader"] | ||
"DeleteObjects": ["Request.contentMD5Header", "Request.s3vhost"], | ||
"GetBucketLocation": [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skipping because boto skips it too:
@AriFordsham @RobertFischer Be great if you had a chance to test this PR too. |
Ping @K0Te - this may also fix your issue. |
@endgame Thank you! I'm glad this vital package isn't bit-rotting. I would love to test, but I would need to pull out some old code - I'll see what I can do. |
@AriFordsham In case it helps: https://github.com/gilt/kms-s3/pull/4 is an example PR where I modernised some amazonka usage. You'll need to change the revs in the The changelog also provides an overview of how library conventions have changed: amazonka/amazonka/CHANGELOG.md Lines 10 to 21 in ca9540e
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I'd rather avoid extra dependencies if possible, at least until everything has been pared back (looking at you, conduit) - but regex-posix
is pretty lightweight so lets' ship it and worry about that later.
Me too, but I chose to take on a regex package so the code would have a more obvious correspondence with the boto equivalent. |
@AriFordsham @RobertFischer @K0Te I'm merging this now but it would be good if you tested it. |
Closes #630
Closes #628
Closes #610