diff options
author | Matthew Miller <matthew@millerti.me> | 2020-10-07 21:39:01 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2020-10-07 21:39:01 -0700 |
commit | 8e57b87b70a367a530f6ccece32b072fc0765b25 (patch) | |
tree | 5277a1dd54d389b3cdfc2a38b274bc183db6ec9d | |
parent | c82266544479e91af6f6ca5dd03a20a76fbb6184 (diff) |
Upgrade example to v0.10.0
-rw-r--r-- | example/fido-conformance.js | 12 | ||||
-rw-r--r-- | example/index.js | 14 | ||||
-rw-r--r-- | example/package-lock.json | 81 | ||||
-rw-r--r-- | example/package.json | 2 | ||||
-rw-r--r-- | example/public/login/index.html | 2 | ||||
-rw-r--r-- | example/public/register/index.html | 2 |
6 files changed, 68 insertions, 45 deletions
diff --git a/example/fido-conformance.js b/example/fido-conformance.js index 706e420..b7cdc09 100644 --- a/example/fido-conformance.js +++ b/example/fido-conformance.js @@ -124,7 +124,11 @@ fidoConformanceRouter.post('/attestation/options', (req, res) => { attestationType: attestation, authenticatorSelection, extensions, - excludedCredentialIDs: devices.map(dev => dev.credentialID), + excludeCredentials: devices.map(dev => ({ + id: dev.credentialID, + type: 'public-key', + transports: ['usb', 'ble', 'nfc', 'internal'], + })), }); user.currentChallenge = opts.challenge; @@ -199,7 +203,11 @@ fidoConformanceRouter.post('/assertion/options', (req, res) => { const opts = generateAssertionOptions({ extensions, userVerification, - allowedCredentialIDs: devices.map(dev => dev.credentialID), + allowCredentials: devices.map(dev => ({ + id: dev.credentialID, + type: 'public-key', + transports: ['usb', 'ble', 'nfc', 'internal'], + })), }); user.currentChallenge = opts.challenge; diff --git a/example/index.js b/example/index.js index 6a80e72..00e60e5 100644 --- a/example/index.js +++ b/example/index.js @@ -123,14 +123,18 @@ app.get('/generate-attestation-options', (req, res) => { userID: loggedInUserId, userName: username, timeout: 60000, - attestationType: 'direct', + attestationType: 'indirect', /** * Passing in a user's list of already-registered authenticator IDs here prevents users from * registering the same device multiple times. The authenticator will simply throw an error in * the browser if it's asked to perform an attestation when one of these ID's already resides * on it. */ - excludedCredentialIDs: devices.map(dev => dev.credentialID), + excludeCredentials: devices.map(dev => ({ + id: dev.credentialID, + type: 'public-key', + transports: ['usb', 'ble', 'nfc', 'internal'], + })), /** * The optional authenticatorSelection property allows for specifying more constraints around * the types of authenticators that users to can use for attestation @@ -201,7 +205,11 @@ app.get('/generate-assertion-options', (req, res) => { const options = generateAssertionOptions({ timeout: 60000, - allowedCredentialIDs: user.devices.map(data => data.credentialID), + allowCredentials: user.devices.map(dev => ({ + id: dev.credentialID, + type: 'public-key', + transports: ['usb', 'ble', 'nfc', 'internal'], + })), /** * This optional value controls whether or not the authenticator needs be able to uniquely * identify the user interacting with it (via built-in PIN pad, fingerprint scanner, etc...) diff --git a/example/package-lock.json b/example/package-lock.json index 47f3f63..bba5a16 100644 --- a/example/package-lock.json +++ b/example/package-lock.json @@ -5,47 +5,54 @@ "requires": true, "dependencies": { "@peculiar/asn1-android": { - "version": "2.0.17", - "resolved": "https://registry.npmjs.org/@peculiar/asn1-android/-/asn1-android-2.0.17.tgz", - "integrity": "sha512-BMX6Tzlx80AiYb/Mq5zz8/Q8fBfi0SCbEkZ736vLXDSWw/hY3vEirejtnldjdLpavNP+EN5gcmq5qRX1sFW+VA==", + "version": "2.0.23", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-android/-/asn1-android-2.0.23.tgz", + "integrity": "sha512-9kNdp67kImBqR6qttUZqFahUMyu44hTYOi+E6nN+BFfwKscW3sEwcPVWdS2uclvuOgV0FAflvqxPIooLACpDwA==", "requires": { - "@peculiar/asn1-schema": "^2.0.17", + "@peculiar/asn1-schema": "^2.0.23", "asn1js": "^2.0.26", - "tslib": "^2.0.1" + "tslib": "^2.0.2" } }, "@peculiar/asn1-schema": { - "version": "2.0.17", - "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.0.17.tgz", - "integrity": "sha512-7rJD8bR1r6NFE4skDxXsLsFEO3zM2TfjX9wdq5SERoBNEuxGkAJ3uIH84sIMxvDgJtb3cMfLsv8iNpGN0nAWdw==", + "version": "2.0.23", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-schema/-/asn1-schema-2.0.23.tgz", + "integrity": "sha512-dV1xQJiWTzwyjfAbvwTT+RTrS4UN9kPJuy92B6oGv572wPZxaoA8R+nxLX92jLz23L43CnLvxiBo+Rip59SWfw==", "requires": { - "@types/asn1js": "^0.0.1", + "@types/asn1js": "^0.0.2", "asn1js": "^2.0.26", - "pvtsutils": "^1.0.11", - "tslib": "^2.0.1" + "pvtsutils": "^1.0.14", + "tslib": "^2.0.2" } }, "@peculiar/asn1-x509": { - "version": "2.0.22", - "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509/-/asn1-x509-2.0.22.tgz", - "integrity": "sha512-rs64MnK9RBvUKp01Xe0HWisxLpfcNoThHk8t5/4Zk6kn/pJEBlZhW50dGncj2/IoRjwRIpPI63lF9yvTtoCYRA==", + "version": "2.0.23", + "resolved": "https://registry.npmjs.org/@peculiar/asn1-x509/-/asn1-x509-2.0.23.tgz", + "integrity": "sha512-9tpiZirrWleYDhYT6MvDeQUWzvxz+oj8DzhQgcpY7Mq+5iPUv/+HS0NqPB7tPZOSmEHTKFisjO+YQrKefkO0qA==", "requires": { - "@peculiar/asn1-schema": "^2.0.17", + "@peculiar/asn1-schema": "^2.0.23", "asn1js": "^2.0.26", - "ipaddr.js": "^1.9.1", - "pvtsutils": "^1.0.11", - "tslib": "^2.0.1" + "ipaddr.js": "^2.0.0", + "pvtsutils": "^1.0.14", + "tslib": "^2.0.2" + }, + "dependencies": { + "ipaddr.js": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-2.0.0.tgz", + "integrity": "sha512-S54H9mIj0rbxRIyrDMEuuER86LdlgUg9FSeZ8duQb6CUG2iRrA36MYVQBSprTF/ZeAwvyQ5mDGuNvIPM0BIl3w==" + } } }, "@simplewebauthn/server": { - "version": "0.9.1", - "resolved": "https://registry.npmjs.org/@simplewebauthn/server/-/server-0.9.1.tgz", - "integrity": "sha512-bMUjN9BJFPEho24WQEbKd0L4QXwbCh6lX+IPn4HFNd5FbOL41mxShqPxuSxUMQLoTgPD44LymGE9cc2SZAa13A==", + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@simplewebauthn/server/-/server-0.10.0.tgz", + "integrity": "sha512-7nlrgmzDWZ4wk5ooG4E1xl4lZJry3u63RTHvjPXHAKuxQBqvC1FhaMdAnsNUouPdjVB2nvPZvvPFP8ND2JpYcg==", "requires": { "@peculiar/asn1-android": "^2.0.8", "@peculiar/asn1-schema": "^2.0.8", "@peculiar/asn1-x509": "^2.0.10", - "@simplewebauthn/typescript-types": "^0.9.0", + "@simplewebauthn/typescript-types": "^0.10.0", "base64url": "^3.0.1", "cbor": "^5.0.2", "elliptic": "^6.5.3", @@ -56,9 +63,9 @@ } }, "@simplewebauthn/typescript-types": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/@simplewebauthn/typescript-types/-/typescript-types-0.9.0.tgz", - "integrity": "sha512-dwqma3ga/1xw9jouZPTh7aA0zv7r3EVCSZpRHpIGGm1c03+SbV4uayFA5yPIDCX9Z5mNqmSivD5DuhtF+7vA3Q==" + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/@simplewebauthn/typescript-types/-/typescript-types-0.10.0.tgz", + "integrity": "sha512-Pvg3I76o1YNt7FYOe5K3upsuLwR2Q6xSu6ofGrs/ltIFdTXI2JLCJzTvOIsnIXNSBWY4Wp3c9gizb8mn6Q6ntw==" }, "@sindresorhus/is": { "version": "0.14.0", @@ -76,9 +83,9 @@ } }, "@types/asn1js": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@types/asn1js/-/asn1js-0.0.1.tgz", - "integrity": "sha1-74uflwjLFjKhw6nNJ3F8qr55O8I=", + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@types/asn1js/-/asn1js-0.0.2.tgz", + "integrity": "sha512-xtLPq140WhPqvDZDpY70rTx4qTezHs+8htbhWQGuevBRQko8FRjFSO5WVTwXOwd3W5tQRxJ7eni30fDUP2q4wQ==", "requires": { "@types/pvutils": "*" } @@ -201,9 +208,9 @@ "integrity": "sha512-ir1UPr3dkwexU7FdV8qBBbNDRUhMmIekYMFZfi+C/sLNnRESKPl23nB9b2pltqfOQNnGzsDdId90AEtG5tCx4A==" }, "bignumber.js": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.0.tgz", - "integrity": "sha512-t/OYhhJ2SD+YGBQcjY8GzzDHEk9f3nerxjtfa6tlMXfe7frs/WozhvCNoGvpM0P3bNf3Gq5ZRMlGr5f3r4/N8A==" + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==" }, "binary-extensions": { "version": "2.0.0", @@ -1184,9 +1191,9 @@ } }, "pvtsutils": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.0.12.tgz", - "integrity": "sha512-fudCcWFUE7WPHMRVdlEDdeaeLf+8hvZFvfJJ+p8GZlwrrdoiVfv7WZaPt6k7k/NZjMxR8yUbbH51hpwlSmLHiQ==", + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/pvtsutils/-/pvtsutils-1.0.14.tgz", + "integrity": "sha512-X9SBWQ9ceNAEEgLweoE7m7P6LDnZ3pZADBq7utQQV4pQ1vj7uQIAXaAQRCz/4nKLKQRT9ZrHOuxailKqBiztrg==", "requires": { "tslib": "^2.0.1" } @@ -1452,9 +1459,9 @@ } }, "tslib": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", - "integrity": "sha512-SgIkNheinmEBgx1IUNirK0TUD4X9yjjBRTqqjggWCU3pUEqIk3/Uwl3yRixYKT6WjQuGiwDv4NomL3wqRCj+CQ==" + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.2.tgz", + "integrity": "sha512-wAH28hcEKwna96/UacuWaVspVLkg4x1aDM9JlzqaQTOFczCktkVAb5fmXChgandR1EraDPs2w8P+ozM+oafwxg==" }, "type-fest": { "version": "0.8.1", diff --git a/example/package.json b/example/package.json index 2b42438..f1075eb 100644 --- a/example/package.json +++ b/example/package.json @@ -10,7 +10,7 @@ "author": "", "license": "ISC", "dependencies": { - "@simplewebauthn/server": "^0.9.1", + "@simplewebauthn/server": "^0.10.0", "express": "^4.17.1", "node-fetch": "^2.6.0" }, diff --git a/example/public/login/index.html b/example/public/login/index.html index 4b3f2d0..e95ccf1 100644 --- a/example/public/login/index.html +++ b/example/public/login/index.html @@ -3,7 +3,7 @@ <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <script src="https://unpkg.com/@simplewebauthn/browser@0.9.0/dist/simplewebauthn-browser.min.js"></script> + <script src="https://unpkg.com/@simplewebauthn/browser@0.10.0/dist/simplewebauthn-browser.min.js"></script> <link rel="stylesheet" href="../styles.css" /> <title>SimpleWebAuthn Example Site | Login</title> </head> diff --git a/example/public/register/index.html b/example/public/register/index.html index 7de8c6d..d65de2b 100644 --- a/example/public/register/index.html +++ b/example/public/register/index.html @@ -3,7 +3,7 @@ <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> - <script src="https://unpkg.com/@simplewebauthn/browser@0.9.0/dist/simplewebauthn-browser.min.js"></script> + <script src="https://unpkg.com/@simplewebauthn/browser@0.10.0/dist/simplewebauthn-browser.min.js"></script> <link rel="stylesheet" href="../styles.css" /> <title>SimpleWebAuthn Example Site | Register</title> </head> |