From 14b168f22dda6628cb1a15db0ba64c379c47f0de Mon Sep 17 00:00:00 2001 From: Nicolas Morel Date: Wed, 8 Nov 2023 12:33:44 +0100 Subject: [PATCH 1/3] chore: change CI target for next --- .github/workflows/ci-module.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/ci-module.yml b/.github/workflows/ci-module.yml index 54426ca..23bc524 100644 --- a/.github/workflows/ci-module.yml +++ b/.github/workflows/ci-module.yml @@ -9,6 +9,4 @@ on: jobs: test: - uses: hapijs/.github/.github/workflows/ci-module.yml@master - with: - min-node-version: 14 + uses: hapijs/.github/.github/workflows/ci-module.yml@min-node-18-hapi-21 From fbecd6d6bec240105ab0f27a2623f1be0a0dc2ea Mon Sep 17 00:00:00 2001 From: Nicolas Morel Date: Wed, 8 Nov 2023 16:26:52 +0100 Subject: [PATCH 2/3] chore: add next branch to CI targets --- .github/workflows/ci-module.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci-module.yml b/.github/workflows/ci-module.yml index 23bc524..44369c8 100644 --- a/.github/workflows/ci-module.yml +++ b/.github/workflows/ci-module.yml @@ -4,6 +4,7 @@ on: push: branches: - master + - next pull_request: workflow_dispatch: From dae1e68e88941384db5b96f0b32c67ef27516a33 Mon Sep 17 00:00:00 2001 From: Nicolas Morel Date: Mon, 15 Jan 2024 15:32:04 +0100 Subject: [PATCH 3/3] chore: vary expectation depending on node version --- package.json | 9 +++++---- test/index.js | 7 ++++++- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 267e7e3..101627e 100755 --- a/package.json +++ b/package.json @@ -19,17 +19,18 @@ ] }, "dependencies": { - "@hapi/hoek": "^11.0.2", "@hapi/b64": "^6.0.1", "@hapi/boom": "^10.0.1", "@hapi/bourne": "^3.0.0", - "@hapi/cryptiles": "^6.0.1" + "@hapi/cryptiles": "^6.0.1", + "@hapi/hoek": "^11.0.4" }, "devDependencies": { "@hapi/code": "^9.0.3", "@hapi/eslint-plugin": "*", - "@hapi/lab": "^25.1.2", - "@types/node": "^17.0.31", + "@hapi/lab": "^25.2.0", + "@hapi/somever": "^4.1.1", + "@types/node": "^18.19.7", "typescript": "~4.6.4" }, "scripts": { diff --git a/test/index.js b/test/index.js index ccc7eb3..2445e2b 100755 --- a/test/index.js +++ b/test/index.js @@ -6,6 +6,7 @@ const B64 = require('@hapi/b64'); const Code = require('@hapi/code'); const Cryptiles = require('@hapi/cryptiles'); const Hoek = require('@hapi/hoek'); +const Somever = require('@hapi/somever'); const Iron = require('..'); const Lab = require('@hapi/lab'); @@ -352,7 +353,11 @@ describe('Iron', () => { const macBaseString = Iron.macPrefix + '**' + key.salt + '*' + iv + '*' + encryptedB64 + '*'; const mac = await Iron.hmacWithPassword(password, Iron.defaults.integrity, macBaseString); const ticket = macBaseString + '*' + mac.salt + '*' + mac.digest; - const err = await expect(Iron.unseal(ticket, password, Iron.defaults)).to.reject(/Failed parsing sealed object JSON: Unexpected token a/); + const err = await expect(Iron.unseal(ticket, password, Iron.defaults)).to.reject( + Somever.match(process.version, '>=20') ? + /Failed parsing sealed object JSON: Expected property name or '}' in JSON at position 1/ : + /Failed parsing sealed object JSON: Unexpected token a/ + ); expect(err.isBoom).to.be.true(); });