-
Notifications
You must be signed in to change notification settings - Fork 504
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
Make hostname and credentials customisable per request #161
base: master
Are you sure you want to change the base?
Conversation
This makes it possible to customise the endpoint / hostname per request, rather than having the static / global state. NOTES: 1. A great level of effort has been put in to make sure backward compatibility changes to be minimal, but there are cases that couldn't have been avoided. Sorry peeps! 2. Also some custom business logic for bucket region deduction has been removed, and has been replaced with a callback. Other changes * Reduce global / static state in S3 class * Various efficiency tweaks * Various formatting tweaks
* Removed the region deducer callback; RTFM for me! * Added workaround to avoid 307 redirects by always talking to the correct regional-service-endpoint. This also improves performance overall as it requires less network magic in AWS. * Fixed examples such that no code need to be modified in order to run them; takes parameters from environment. * Tweaks to composer.json to fix autoloading and to specify extension requirements. * Added export-ignore git attributes to remove dev artifacts from composer install when included into other projects.
Turned ON via an env variable SIGNATURE_DEBUG=ON
@tpyo forgot to mention that there is also an optimisation to make the examples work against S3 regions that redirects using I have changed according to the workaround suggested in AWS docs; rather than always going to Hostname / endpoint is formulated using the pattern described here |
Most part of the change is to reduce global state, while keeping the API as close to original as possible. Please note that there are breaking changes, but I hope you will find them OK to live with.
I have also taken the liberty of adding a license file to match what is mentioned in
composer.json
andS3.php
, and I have also added my employer to the list of copyrights, considering the amount of changes and the time spent doing them.There are some tweaks to make examples work better with composer's autoloading. Also changes to those examples to make it load values through environment variables rather than having to edit the files.
I have tested these as much as I can against S3 and an in house implementation of S3 like storage access layer.