diff --git a/.github/workflows/ci-module.yml b/.github/workflows/ci-module.yml index 54426ca..44369c8 100644 --- a/.github/workflows/ci-module.yml +++ b/.github/workflows/ci-module.yml @@ -4,11 +4,10 @@ on: push: branches: - master + - next pull_request: workflow_dispatch: 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 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(); });