@dfns/sdk-browser 0.6.0-rc.1 → 0.6.0-rc.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/signers/webauthn.js +0 -7
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dfns/sdk-browser",
|
|
3
|
-
"version": "0.6.0-rc.
|
|
3
|
+
"version": "0.6.0-rc.2",
|
|
4
4
|
"dependencies": {
|
|
5
5
|
"buffer": "6.0.3",
|
|
6
6
|
"cross-fetch": "3.1.6",
|
|
7
7
|
"uuid": "9.0.0"
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"@dfns/sdk": "0.6.0-rc.
|
|
10
|
+
"@dfns/sdk": "0.6.0-rc.2"
|
|
11
11
|
},
|
|
12
12
|
"main": "./index.js",
|
|
13
13
|
"type": "commonjs"
|
package/signers/webauthn.js
CHANGED
|
@@ -13,7 +13,6 @@ class WebAuthnSigner {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
async sign(challenge) {
|
|
16
|
-
checkSpecifiedRpIdIsWhitelisted(this.conf.relyingParty.id, challenge.allowedRelyingParties);
|
|
17
16
|
const response = await navigator.credentials.get({
|
|
18
17
|
publicKey: {
|
|
19
18
|
challenge: buffer_1.Buffer.from(challenge.challenge),
|
|
@@ -43,7 +42,6 @@ class WebAuthnSigner {
|
|
|
43
42
|
};
|
|
44
43
|
}
|
|
45
44
|
async create(challenge) {
|
|
46
|
-
checkSpecifiedRpIdIsWhitelisted(this.conf.relyingParty.id, challenge.allowedRelyingParties);
|
|
47
45
|
const options = {
|
|
48
46
|
publicKey: {
|
|
49
47
|
challenge: buffer_1.Buffer.from(challenge.challenge),
|
|
@@ -80,8 +78,3 @@ class WebAuthnSigner {
|
|
|
80
78
|
}
|
|
81
79
|
}
|
|
82
80
|
exports.WebAuthnSigner = WebAuthnSigner;
|
|
83
|
-
const checkSpecifiedRpIdIsWhitelisted = (rpId, allowedRpIds) => {
|
|
84
|
-
if (!allowedRpIds.includes(rpId)) {
|
|
85
|
-
throw new sdk_1.DfnsError(-1, `The specified relying party id is not whitelisted in the Dfns organisation. Ask your Dfns admin to whitelist rpId "${rpId}" first, or use a whitelisted one: (${allowedRpIds.join(', ')})`);
|
|
86
|
-
}
|
|
87
|
-
};
|