Skip to content

feat(node): add node implementation - #9

Merged
edlng merged 11 commits into
release-2from
add-node
Sep 11, 2026
Merged

edlng merged 11 commits into
release-2from
add-node

Conversation

@edlng

@edlng edlng commented Sep 10, 2026

Copy link
Copy Markdown
Collaborator

Summary

This adds a Node.js library for generating Amazon ElastiCache IAM authentication tokens. It supports serverless caches and node-based replication groups through a typed API and a reusable token provider.

The change also adds Node CI, package validation, examples, documentation, and focused coverage for signing, configuration resolution, credential refresh, validation, and published-package exports.

What's in it

Area Change
node/src Adds SigV4 token generation, typed options, public error types, and ElastiCacheIAMAuthTokenProvider.
node/examples Adds standalone token-generation and Valkey GLIDE integration examples.
node/test Covers known-answer signatures, target and user validation, region precedence, credential failures and rotation, provider lifecycle, and package exports.
node/package.json Adds the Node 22+ ESM package, AWS signing dependencies, build/test scripts, and package metadata.
.github/workflows/node.yml Tests Node 22 and 24 on Ubuntu and Windows with lint, formatting, typecheck, tests, build, and package validation.
.github/dependabot.yml Adds weekly npm dependency updates for the Node package.
README.md, node/README.md Documents Node installation, token generation, provider usage, examples, and the Python/Node package split.

Design decisions

  • ElastiCacheIAMAuthTokenProvider.create() resolves the region before returning so missing configuration fails during setup. The synchronous constructor retains the error and reports it from getToken().
  • The provider retains its signing region but resolves credentials for every token request so rotated SSO, assumed-role, container, and instance credentials are picked up.
  • The Node CLI and release workflow were removed. The Node package is library-only; the Python package remains the command-line interface. Let me know if we need it, I can add this back.

Tests

  • npm run lint — passed.
  • npm run typecheck — passed.
  • npm test — passed, 56 tests.
  • npm run format:check — currently fails because node/src/errors.ts contains trailing whitespace.

Not in this PR

  • Publishing or release automation for the private Node package.
  • A Node command-line interface. Do we need one for Node? Let me know if we need it, I can add this back.

Signed-off-by: Edward Liang liawedwa@amazon.com

Signed-off-by: Edward Liang <liawedwa@amazon.com>
Signed-off-by: Edward Liang <liawedwa@amazon.com>
Signed-off-by: Edward Liang <liawedwa@amazon.com>
Signed-off-by: Edward Liang <liawedwa@amazon.com>
Signed-off-by: Edward Liang <liawedwa@amazon.com>
Signed-off-by: Edward Liang <liawedwa@amazon.com>
Signed-off-by: Edward Liang <liawedwa@amazon.com>
Signed-off-by: Edward Liang <liawedwa@amazon.com>
Comment thread .github/workflows/node.yml Outdated
@edlng
edlng requested a review from mwaisaida-13 September 10, 2026 20:21
Signed-off-by: Edward Liang <liawedwa@amazon.com>
Signed-off-by: Edward Liang <liawedwa@amazon.com>
Comment thread .github/workflows/node.yml Outdated
Comment thread .github/workflows/node.yml Outdated
Comment thread node/examples/connect-valkey.mjs Outdated
Comment thread node/package.json Outdated

@mwaisaida-13 mwaisaida-13 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Really solid port, 1:1 with the Python library on the parity contract. Four small comments inline (centralize the Node version matrix, add macOS to CI, swap the GLIDE example for a client without built-in IAM auth, drop examples from files). One more: please add node/CHANGELOG.md in Keep-a-Changelog format with an Unreleased entry, since versions and releases are per-language. Thank you!

P.S. no need for the CLI :)

Signed-off-by: Edward Liang <liawedwa@amazon.com>

@mwaisaida-13 mwaisaida-13 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Thanks, LGTM 🚀

@edlng
edlng merged commit b79179f into release-2 Sep 11, 2026
10 checks passed
@edlng
edlng deleted the add-node branch September 11, 2026 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants