Fix code so it works with Node 18+#56
Merged
Marwan Itani (marwan-itani) merged 11 commits intoAug 11, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the AWS SDK from v2 to v3 to ensure compatibility with Node.js 18+. The v2 SDK is deprecated and incompatible with newer Node.js versions.
- Replaces
aws-sdkwith modular@aws-sdk/client-*packages - Updates configuration loading from callback-based to Promise/async-await pattern
- Modernizes test mocking from
aws-sdk-mocktoaws-sdk-client-mock
Reviewed Changes
Copilot reviewed 5 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| package.json | Adds AWS SDK v3 client packages and new test mocking library |
| build/package.json | Adds AWS SDK v3 client packages for build dependencies |
| config/generic.config.js | Migrates from AWS SDK v2 to v3 with async/await pattern |
| mocha/generic-config.js | Updates tests to use new mocking library and async patterns |
| authn/pkce.index.js | Updates to use Promise-based configuration loading |
Files not reviewed (1)
- build/package-lock.json: Language not supported
Comments suppressed due to low confidence (2)
| return config; | ||
| } catch (err) { | ||
| // Let the calling function handle the error | ||
| console.error("Error fetching configuration:", err); |
There was a problem hiding this comment.
This console.error log may expose sensitive AWS error details in production. Consider logging only a generic error message or use a proper logging framework with configurable levels.
Suggested change
| console.error("Error fetching configuration:", err); | |
| if (process.env.NODE_ENV !== 'production') { | |
| console.error("Error fetching configuration:", err); | |
| } else { | |
| console.error("Error fetching configuration."); | |
| } |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Adrian Grucza (apgrucza)
approved these changes
Aug 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
No description provided.