From 5fce007412f8a31da6acf099e594e6c4ac60e7fe Mon Sep 17 00:00:00 2001 From: Matt Strom Date: Thu, 11 Dec 2025 11:48:17 -0800 Subject: [PATCH 1/2] ci: set up trusted publisher for npm --- .github/workflows/on-deployment.yml | 8 ++++++-- .github/workflows/on-pull.yml | 8 ++++---- .github/workflows/on-push.yml | 8 ++++---- .nvmrc | 2 +- package-lock.json | 26 +++++++++++++++++++++----- 5 files changed, 36 insertions(+), 16 deletions(-) diff --git a/.github/workflows/on-deployment.yml b/.github/workflows/on-deployment.yml index 86c515b..ea2102e 100644 --- a/.github/workflows/on-deployment.yml +++ b/.github/workflows/on-deployment.yml @@ -10,6 +10,10 @@ jobs: deploy: name: Deploy to Environment runs-on: ubuntu-latest + permissions: + id-token: write # NPM Trusted Publisher (eliminates need for NPM_TOKEN) + contents: write + deployments: write steps: - name: Checkout Ref uses: actions/checkout@v1 @@ -54,9 +58,9 @@ jobs: echo ::set-output name=SLACK_WEBHOOK::${{ secrets.SLACK_WEBHOOK }} fi - name: Setup Node - uses: actions/setup-node@v1 + uses: actions/setup-node@v3 with: - node-version: '16.14.2' + node-version-file: '.nvmrc' - name: Setup Python uses: actions/setup-python@v2 with: diff --git a/.github/workflows/on-pull.yml b/.github/workflows/on-pull.yml index e443064..3da93f0 100644 --- a/.github/workflows/on-pull.yml +++ b/.github/workflows/on-pull.yml @@ -10,12 +10,12 @@ jobs: name: Run Tests and Linting runs-on: ubuntu-latest steps: - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: '16.14.2' - name: Checkout Ref uses: actions/checkout@v1 + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' - name: Run Tests and Lint run: bash -e ./scripts/test.sh env: diff --git a/.github/workflows/on-push.yml b/.github/workflows/on-push.yml index 560d7d9..eaed766 100644 --- a/.github/workflows/on-push.yml +++ b/.github/workflows/on-push.yml @@ -10,14 +10,14 @@ jobs: name: Tag Build runs-on: ubuntu-latest steps: - - name: Set up Node - uses: actions/setup-node@v1 - with: - node-version: '16.14.2' - name: Checkout Ref uses: actions/checkout@v1 with: ref: ${{ github.event.push.after }} + - name: Set up Node + uses: actions/setup-node@v3 + with: + node-version-file: '.nvmrc' - name: Set Up Variables id: variables run: | diff --git a/.nvmrc b/.nvmrc index 87ec884..248216a 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -18.18.2 +24.12.0 diff --git a/package-lock.json b/package-lock.json index 8a0ad42..6b74202 100644 --- a/package-lock.json +++ b/package-lock.json @@ -67,6 +67,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.2.tgz", "integrity": "sha512-OgC1mON+l4U4B4wiohJlQNUU3H73mpTyYY3j/c8U9dr9UagGGSm+WFpzjy/YLdoyjiG++c1kIDgxCo/mLwQJeQ==", "dev": true, + "peer": true, "dependencies": { "@babel/code-frame": "^7.12.13", "@babel/generator": "^7.14.2", @@ -880,6 +881,7 @@ "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", "dev": true, + "peer": true, "dependencies": { "@types/linkify-it": "*", "@types/mdurl": "*" @@ -907,7 +909,8 @@ "version": "14.14.37", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/@types/normalize-package-data": { "version": "2.4.1", @@ -929,6 +932,7 @@ "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", "dev": true, + "peer": true, "bin": { "acorn": "bin/acorn" }, @@ -1324,6 +1328,7 @@ "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", "dev": true, + "peer": true, "dependencies": { "assertion-error": "^1.1.0", "check-error": "^1.0.2", @@ -1584,6 +1589,7 @@ "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -4442,6 +4448,7 @@ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz", "integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==", "dev": true, + "peer": true, "bin": { "rollup": "dist/bin/rollup" }, @@ -4924,6 +4931,7 @@ "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", "dev": true, + "peer": true, "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" @@ -5296,6 +5304,7 @@ "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.14.2.tgz", "integrity": "sha512-OgC1mON+l4U4B4wiohJlQNUU3H73mpTyYY3j/c8U9dr9UagGGSm+WFpzjy/YLdoyjiG++c1kIDgxCo/mLwQJeQ==", "dev": true, + "peer": true, "requires": { "@babel/code-frame": "^7.12.13", "@babel/generator": "^7.14.2", @@ -5991,6 +6000,7 @@ "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-12.2.3.tgz", "integrity": "sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==", "dev": true, + "peer": true, "requires": { "@types/linkify-it": "*", "@types/mdurl": "*" @@ -6018,7 +6028,8 @@ "version": "14.14.37", "resolved": "https://registry.npmjs.org/@types/node/-/node-14.14.37.tgz", "integrity": "sha512-XYmBiy+ohOR4Lh5jE379fV2IU+6Jn4g5qASinhitfyO71b/sCo6MKsMLF5tc7Zf2CE8hViVQyYSobJNke8OvUw==", - "dev": true + "dev": true, + "peer": true }, "@types/normalize-package-data": { "version": "2.4.1", @@ -6039,7 +6050,8 @@ "version": "8.8.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.0.tgz", "integrity": "sha512-QOxyigPVrpZ2GXT+PFyZTl6TtOFc5egxHIP9IlQ+RbupQuX4RkT/Bee4/kQuC02Xkzg84JcT7oLYtDIQxp+v7w==", - "dev": true + "dev": true, + "peer": true }, "acorn-jsx": { "version": "5.3.2", @@ -6333,6 +6345,7 @@ "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", "dev": true, + "peer": true, "requires": { "assertion-error": "^1.1.0", "check-error": "^1.0.2", @@ -6537,7 +6550,8 @@ "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", + "peer": true }, "default-require-extensions": { "version": "3.0.0", @@ -8648,6 +8662,7 @@ "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.79.2.tgz", "integrity": "sha512-fS6iqSPZDs3dr/y7Od6y5nha8dW1YnbgtsyotCVvoFGKbERG++CVRFv1meyGDE1SNItQA8BrnCw7ScdAhRJ3XQ==", "dev": true, + "peer": true, "requires": { "fsevents": "~2.3.2" } @@ -9004,7 +9019,8 @@ "version": "4.7.4", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.7.4.tgz", "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==", - "dev": true + "dev": true, + "peer": true }, "uc.micro": { "version": "1.0.6", From 8204435b0ba246e33cc3aa9525f7dd66ef8a4a94 Mon Sep 17 00:00:00 2001 From: Matt Strom Date: Thu, 11 Dec 2025 11:59:23 -0800 Subject: [PATCH 2/2] test: fix test configuration for crypto module --- src/tests/index.test.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/tests/index.test.js b/src/tests/index.test.js index 03c614a..f5b2464 100644 --- a/src/tests/index.test.js +++ b/src/tests/index.test.js @@ -209,10 +209,8 @@ describe('Evolv client integration tests', () => { xhrMock.setup(); // Uncomment to hit Frazer's endpoint // global.XMLHttpRequest = xmlhttprequest.XMLHttpRequest; - global.crypto = new Crypto(); }); afterEach(() => { - delete global.crypto; delete global.XMLHttpRequest; xhrMock.teardown(); }); @@ -466,7 +464,7 @@ describe('Evolv client integration tests', () => { const evolv = new Evolv(options); const confirmedSpy = chai.spy(); evolv.on(Evolv.CONFIRMED, confirmedSpy); - + await validateClient(evolv, options, uid); expect(confirmedSpy).to.have.been.called.exactly(1); @@ -529,7 +527,7 @@ describe('Evolv client integration tests', () => { const evolv = new Evolv(options); const confirmedSpy = chai.spy(); evolv.on(Evolv.CONFIRMED, confirmedSpy); - + await validateClient(evolv, options, uid); expect(confirmedSpy).to.have.been.called.exactly(1);