-
Notifications
You must be signed in to change notification settings - Fork 76
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
Migrating to AWS SDK V3 | Add Internal Class to Decide Which AWS SDK Version to Use #7395
Conversation
244b72d
to
244a7a7
Compare
244a7a7
to
1b61294
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.
There is a lot of unnecessary abstraction in this PR.
According to noobaa_s3_client_sdkv3rg.js
, it looks like the interface is almost unchanged (in V2 there is .promise
and in v3 Body
is returned as stream.
can we instead, for V3, return the actual client (new S3(...)
), and for only for V2 have a layer to do the necessary fixes? we still have to handle the conversion from stream to buffer in V3. we already have a util for that in buffer_utils
(see here)
1b61294
to
4906aaf
Compare
4906aaf
to
3d66160
Compare
3d66160
to
2056284
Compare
2056284
to
671c60d
Compare
c7d1aa1
to
86da32e
Compare
Signed-off-by: shirady <57721533+shirady@users.noreply.github.com>
86da32e
to
d7d05b5
Compare
Explain the changes
Background:
when using AWS SDK V2 we encounter the warning about AWS SDK V2 entering maintenance mode:
The API is not backward compatible with the old version, so we need to change our code.
One of the changes is related to
signatureVersion
, by using the AWS SDK V3 we can only usesignatureVersion
v4
.Since the server might only support
signatureVersion
v2
, we still need to support it in our s3-client generated from the AWS SDK.Issues: Fixed #xxx / Gap #xxx
Testing Instructions:
set
AWS_SDK_VERSION_3_DISABLED
to false.AWS Server
js
file in the repo with all needed parameters to create a new instance of s3 client (using aws sdk v3 params), for example, access key, secret access key, endpoint ('https://s3.amazonaws.com'), signature version ('v2'), and region.listObjectsV2
, and print the result.v4
.To run jest tests:
npx jest test_noobaa_s3_client.test.js