Skip to content

refactor(internal-plugin-encryption): pkijs v3 + node 20 engines#4951

Open
Tiuipuv wants to merge 2 commits intowebex:nextfrom
Evernorth:refactor/internal-plugin-encryption-pkijs-v3
Open

refactor(internal-plugin-encryption): pkijs v3 + node 20 engines#4951
Tiuipuv wants to merge 2 commits intowebex:nextfrom
Evernorth:refactor/internal-plugin-encryption-pkijs-v3

Conversation

@Tiuipuv
Copy link
Copy Markdown
Contributor

@Tiuipuv Tiuipuv commented May 5, 2026

This pull request addresses

Reduce the size of the dependency tree massively (which will allow consumers to remove --omit=optional from npm installs) due to the entire expo/react native tree being installed.

Before, when running npm install webex-js-sdk in a fresh directory will yield this:

  • 1957 deps (415 mb)
  • 68 vulnerabilities (66 moderate, 2 critical)

With this fix branch, it will yield this:

  • 672 deps (134 MB)
  • 59 vulnerabilities (57 moderate, 2 critical)

Lastly, this branch standardizes node ver to >=20 (up from ~18)

by making the following changes

This is done by removing deps in internal-plugin-encryption that are only used by that package, and are replaced with built-in functionality of modern browsers + nodejs.

The following deps are removed:

  • valid-url (replaced by new URL() constructor)
  • asn1js (functionality exposed by modern pkijs)
  • uuid (v4 is exposed on global, pattern already used in other packages)
  • safe-buffer (exposed on global, pattern already used in other packages)
  • isomorphic-webcrypto (modern pkijs no longer requires a separate crypto implementation. this is where the massive react native dependencies is pulled in via optional deps)

The following were updated:

  • pkijs: v2.1.84 to v3.4.0

Also, this standardizes minimum NodeJS by addressing old engines.node fields stuck at v8, v14, v16, and v18, bumping up to v20. Similar to #4288

Change Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Tooling change
  • Internal code refactor

The following scenarios were tested

Ran unit tests, and attempted manual bad path injection to verify code coverage of kms.

For reviewing speed purposes, the actual logic changes occur just under internal-plugin-encryption, with the following files:

  • src/kms.js
  • src/kms-certificate-validation.js
  • test/integration/spec/kms.js

The GAI Coding Policy And Copyright Annotation Best Practices

  • GAI was not used (or, no additional notation is required)
  • Code was generated entirely by GAI
  • GAI was used to create a draft that was subsequently customized or modified
  • Coder created a draft manually that was non-substantively modified by GAI (e.g., refactoring was performed by GAI on manually written code)
  • Tool used for AI assistance (GitHub Copilot / Other - specify)
    • Github Copilot
    • Other - Please Specify
  • This PR is related to
    • Feature
    • Defect fix
    • Tech Debt
    • Automation

I certified that

  • I have read and followed contributing guidelines
  • I discussed changes with code owners prior to submitting this pull request
  • I have not skipped any automated checks
  • All existing and new tests passed
  • I have updated the documentation accordingly

Make sure to have followed the contributing guidelines before submitting.

Tiuipuv added 2 commits May 5, 2026 12:17
update pkijs to v3, and fix call points
remove asn1js (using new pkijs features)
remove valid-url (use native URL constructor)
remove isomorphic-webcrypto (use new pkijs features)
remove safe-buffer (use native Buffer constructor)
remove uuid (use native uuid v4 via global crypto)
fix jsdocs
@Tiuipuv Tiuipuv requested review from a team as code owners May 5, 2026 18:46
@Tiuipuv Tiuipuv changed the title Refactor/internal plugin encryption pkijs v3 refactor(internal-plugin-encryption): pkijs v3 + node 20 engines May 5, 2026
@aws-amplify-us-east-2
Copy link
Copy Markdown

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-4951.d3m3l2kee0btzx.amplifyapp.com

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.

1 participant