From d018c6ac3ce6b03f49f9419c9087f16cd5cc051a Mon Sep 17 00:00:00 2001 From: Tim Shamilov Date: Fri, 16 Aug 2024 23:13:25 +0800 Subject: [PATCH] add assertion --- package-lock.json | 7 ++++--- package.json | 1 + tests/scenarios/web5-connect.spec.ts | 2 ++ 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 0a47ee9..631ede4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,6 +10,7 @@ "dependencies": { "@tbd54566975/dwn-sdk-js": "0.4.5", "@tbd54566975/dwn-sql-store": "0.6.5", + "@web5/crypto": "^1.0.3", "better-sqlite3": "^8.5.0", "body-parser": "^1.20.2", "bytes": "3.1.2", @@ -3166,9 +3167,9 @@ "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, "node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", + "version": "6.5.7", + "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", + "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", "dev": true, "dependencies": { "bn.js": "^4.11.9", diff --git a/package.json b/package.json index bd0ca56..6cd7eda 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "dependencies": { "@tbd54566975/dwn-sdk-js": "0.4.5", "@tbd54566975/dwn-sql-store": "0.6.5", + "@web5/crypto": "^1.0.3", "better-sqlite3": "^8.5.0", "body-parser": "^1.20.2", "bytes": "3.1.2", diff --git a/tests/scenarios/web5-connect.spec.ts b/tests/scenarios/web5-connect.spec.ts index 3533600..28c2f58 100644 --- a/tests/scenarios/web5-connect.spec.ts +++ b/tests/scenarios/web5-connect.spec.ts @@ -71,6 +71,8 @@ describe('Web5 Connect scenarios', function () { // 2. Identity Provider (wallet) fetches the Web5 Connect Request object from the Web5 Connect server. const requestUrl = (await postWeb5ConnectRequestResult.json() as any).request_uri; + const regex = /^http:\/\/localhost:3000\/connect\/authorize\/[a-zA-Z0-9\-]{21,}\.jwt$/; + expect(requestUrl).to.match(regex); let getWeb5ConnectRequestResult; await Poller.pollUntilSuccessOrTimeout(async () => {