feat(node22): replace aws-sdk with @aws-sdk/s3, remove npm dependency #402
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
✏️ Changes
This PR includes the following changes:
Replaced
aws-sdk
with@aws-sdk/s3-client
. Previously,auth0-extension-s3-tools
relied onaws-sdk
for S3 metadata storage. Now that we're using@aws-sdk/s3-client
directly, soauth0-extension-s3-tools
is no longer needed. A custom S3 client wrapper has been added to replace it.Removed
npm
dependency since it is not used for anythingNotes about
@aws-sdk/s3-client
:The key difference between aws-sdk and @aws-sdk/client-s3 is how they handle region resolution when instantiating an S3 client:
aws-sdk (v2) automatically resolved the region. It was using this logic:
request.httpRequest.region = error.region
before retrying (retryableError).@aws-sdk/client-s3 (v3) does not handle region resolution automatically—you must specify the region explicitly when creating the S3 client. To keep the old behavior, I implemented a wrapper around the new S3 client that replicates the region-handling logic from aws-sdk v2.
🔗 References
Jira Ticket
🎯 Testing
✅ This change has been tested in a Webtask
✅ This change has unit test coverage
✅ This change has integration test coverage
🚫 This change has been tested for performance
🚀 Deployment
✅ This can be deployed any time
🎡 Rollout
In order to verify that the deployment was successful we will test the extension in prod spaces before making it public available.
🔥 Rollback
We will rollback changes if it breaks anything.
📄 Procedure
🖥 Appliance
Note to reviewers: ensure that this change is compatible with the Appliance.