Skip to content

Fix code so it works with Node 18+#56

Merged
Marwan Itani (marwan-itani) merged 11 commits into
masterfrom
feature/fix-code-for-node20
Aug 11, 2025
Merged

Fix code so it works with Node 18+#56
Marwan Itani (marwan-itani) merged 11 commits into
masterfrom
feature/fix-code-for-node20

Conversation

@marwan-itani

Copy link
Copy Markdown

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-sdk with modular @aws-sdk/client-* packages
  • Updates configuration loading from callback-based to Promise/async-await pattern
  • Modernizes test mocking from aws-sdk-mock to aws-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)

Comment thread config/generic.config.js
return config;
} catch (err) {
// Let the calling function handle the error
console.error("Error fetching configuration:", err);

Copilot AI Aug 11, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.");
}

Copilot uses AI. Check for mistakes.
Comment thread authn/pkce.index.js Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@marwan-itani Marwan Itani (marwan-itani) merged commit 3985a3e into master Aug 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants