@virtonetwork/authenticators-webauthn 1.1.3 → 1.2.0
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/dist/cjs/index.js +6 -5
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +5 -4
- package/package.json +2 -2
package/dist/cjs/index.js
CHANGED
|
@@ -62,8 +62,8 @@ var WebAuthn = /** @class */ (function () {
|
|
|
62
62
|
* @param credentialsHandler - An implementation of {@link CredentialsHandler},
|
|
63
63
|
*
|
|
64
64
|
*/
|
|
65
|
-
function WebAuthn(userId, getChallenge,
|
|
66
|
-
|
|
65
|
+
function WebAuthn(userId, getChallenge, handler, addressGenerator) {
|
|
66
|
+
if (handler === void 0) { handler = new in_memory_credentials_handler_ts_1.InMemoryCredentialsHandler(); }
|
|
67
67
|
if (addressGenerator === void 0) { addressGenerator = signer_1.kreivoPassDefaultAddressGenerator; }
|
|
68
68
|
this.userId = userId;
|
|
69
69
|
this.getChallenge = getChallenge;
|
|
@@ -73,9 +73,10 @@ var WebAuthn = /** @class */ (function () {
|
|
|
73
73
|
* for all WebAuthn operations.
|
|
74
74
|
*/
|
|
75
75
|
this.hashedUserId = new Uint8Array(32);
|
|
76
|
-
|
|
77
|
-
this.
|
|
78
|
-
this.
|
|
76
|
+
var publicKeyCreateOptions = handler.publicKeyCreateOptions, publicKeyRequestOptions = handler.publicKeyRequestOptions, onCreatedCredentials = handler.onCreatedCredentials;
|
|
77
|
+
this.getPublicKeyCreateOptions = publicKeyCreateOptions.bind(handler);
|
|
78
|
+
this.getPublicKeyRequestOptions = publicKeyRequestOptions.bind(handler);
|
|
79
|
+
this.onCreatedCredentials = onCreatedCredentials.bind(handler);
|
|
79
80
|
}
|
|
80
81
|
/**
|
|
81
82
|
* Pre‑computes {@link hashedUserId}.
|
package/dist/esm/index.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ export declare class WebAuthn implements Authenticator<number> {
|
|
|
52
52
|
* @param credentialsHandler - An implementation of {@link CredentialsHandler},
|
|
53
53
|
*
|
|
54
54
|
*/
|
|
55
|
-
constructor(userId: string, getChallenge: Challenger<number>,
|
|
55
|
+
constructor(userId: string, getChallenge: Challenger<number>, handler?: CredentialsHandler, addressGenerator?: AddressGenerator);
|
|
56
56
|
/**
|
|
57
57
|
* Pre‑computes {@link hashedUserId}.
|
|
58
58
|
*
|
package/dist/esm/index.js
CHANGED
|
@@ -34,13 +34,14 @@ export class WebAuthn {
|
|
|
34
34
|
* @param credentialsHandler - An implementation of {@link CredentialsHandler},
|
|
35
35
|
*
|
|
36
36
|
*/
|
|
37
|
-
constructor(userId, getChallenge,
|
|
37
|
+
constructor(userId, getChallenge, handler = new InMemoryCredentialsHandler(), addressGenerator = kreivoPassDefaultAddressGenerator) {
|
|
38
38
|
this.userId = userId;
|
|
39
39
|
this.getChallenge = getChallenge;
|
|
40
40
|
this.addressGenerator = addressGenerator;
|
|
41
|
-
|
|
42
|
-
this.
|
|
43
|
-
this.
|
|
41
|
+
const { publicKeyCreateOptions, publicKeyRequestOptions, onCreatedCredentials, } = handler;
|
|
42
|
+
this.getPublicKeyCreateOptions = publicKeyCreateOptions.bind(handler);
|
|
43
|
+
this.getPublicKeyRequestOptions = publicKeyRequestOptions.bind(handler);
|
|
44
|
+
this.onCreatedCredentials = onCreatedCredentials.bind(handler);
|
|
44
45
|
}
|
|
45
46
|
/**
|
|
46
47
|
* Pre‑computes {@link hashedUserId}.
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@virtonetwork/authenticators-webauthn",
|
|
3
3
|
"description": "An Authenticator compatible with KreivoPassSigner that uses the WebAuthn standard",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.2.0",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist"
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
38
|
"@simplewebauthn/server": "^13.1.1",
|
|
39
|
-
"@virtonetwork/signer": "^1.
|
|
39
|
+
"@virtonetwork/signer": "^1.2.0",
|
|
40
40
|
"nid-webauthn-emulator": "^0.2.4"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|