@ideem/zsm-client-sdk 2.5.1 → 2.6.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/ErrorHandler.js +154 -0
- package/FIDO2ClientBase.js +1 -0
- package/RelyingPartyBase.js +38 -18
- package/UMFAClientBase.js +14 -7
- package/WASMRustInterface.js +448 -357
- package/WebAuthnClientBase.js +147 -75
- package/package.json +68 -19
package/WebAuthnClientBase.js
CHANGED
|
@@ -4,6 +4,7 @@ import { uid2iid, iid4uid } from './IdentityIndexing.js';
|
|
|
4
4
|
import { toObject } from './Utils.js';
|
|
5
5
|
import {zsmPluginManager} from './PluginManager.js';
|
|
6
6
|
|
|
7
|
+
|
|
7
8
|
eventCoordinator.update('WebAuthnClientBase');
|
|
8
9
|
|
|
9
10
|
const tracePrimer = (obj=false) => {
|
|
@@ -89,7 +90,7 @@ class WebAuthnClientBase {
|
|
|
89
90
|
* @param {Object} config The configuration object for ZSM initialization.
|
|
90
91
|
* @returns {Promise<ZSMAPI>} Resolves with the initialized ZSM API.
|
|
91
92
|
*/
|
|
92
|
-
getZsmApi
|
|
93
|
+
async getZsmApi (config) {}
|
|
93
94
|
|
|
94
95
|
/**
|
|
95
96
|
* @name primeZsmApi
|
|
@@ -98,14 +99,14 @@ class WebAuthnClientBase {
|
|
|
98
99
|
* @ by the initializeZsm thereafter. Fixes several potential race conditions and improves performance.
|
|
99
100
|
* @returns {Promise<ZSMAPI>} Resolves with the initialized ZSM API.
|
|
100
101
|
*/
|
|
101
|
-
primeZsmApi
|
|
102
|
+
async primeZsmApi () { return (!this.zsmApi) ? (this.zsmApi = await this.getZsmApi(Object.assign({}, GLOBAL.mpcConfig, {consumer_id: await iid4uid(GLOBAL.mpcConfig.consumer_id)}))) : this.zsmApi; }
|
|
102
103
|
|
|
103
104
|
/**
|
|
104
105
|
* @name initializeZsm
|
|
105
106
|
* @description Reconfigures the ZSM API, should the consumer_id change (as after an identity_id is obtained)
|
|
106
107
|
* @returns {Promise<ZSMAPI>} Resolves when the ZSM API is reconfigured.
|
|
107
108
|
*/
|
|
108
|
-
initializeZsm
|
|
109
|
+
async initializeZsm () {
|
|
109
110
|
if(GLOBAL.mpcConfig.consumer_id !== this.MPCConfig.consumer_id) {
|
|
110
111
|
// console.log('GLOBAL.mpcConfig :', Object.assign({},GLOBAL.mpcConfig));
|
|
111
112
|
await this.zsmApi.configure(GLOBAL.mpcConfig);
|
|
@@ -126,22 +127,66 @@ class WebAuthnClientBase {
|
|
|
126
127
|
*/
|
|
127
128
|
|
|
128
129
|
async checkIdentity (userIdentifier, primeEnroll=false) {
|
|
130
|
+
|
|
129
131
|
try {
|
|
130
|
-
this.status='CHECKING_IDENTITY_STARTING';
|
|
131
132
|
const resultOfCheck = await this.relyingParty.checkServerSideIdentity(primeEnroll);
|
|
133
|
+
|
|
132
134
|
if(!resultOfCheck) throw new Error('Unable to communicate with identity server!');
|
|
133
|
-
const identityID = resultOfCheck.identity_id;
|
|
135
|
+
const identityID = Array.isArray(resultOfCheck) ? resultOfCheck[0].identity_id : resultOfCheck.identity_id;
|
|
136
|
+
|
|
134
137
|
if(!identityID) throw new Error('Unable to acquire identity_id!');
|
|
138
|
+
|
|
135
139
|
uid2iid(userIdentifier, identityID);
|
|
136
140
|
GLOBAL.mpcConfig.consumer_id = identityID;
|
|
137
|
-
this.status = 'CHECKING_IDENTITY_FINISHED';
|
|
138
141
|
return identityID;
|
|
139
142
|
} catch(err) {
|
|
140
|
-
this.status = 'CHECKING_IDENTITY_FAILED';
|
|
141
143
|
return Promise.reject(err);
|
|
142
144
|
}
|
|
143
145
|
}
|
|
144
146
|
|
|
147
|
+
/**
|
|
148
|
+
* @name webauthnCreate
|
|
149
|
+
* @description Creates a new WebAuthn credential for the specified userIdentifier.
|
|
150
|
+
* @param {string} userIdentifier The user identifier.
|
|
151
|
+
* @returns {Promise<Object>} Resolves with the created credential.
|
|
152
|
+
* @throws {Error} Throws a COUNTED error if unable to retrieve the public key from the Relying Party Server.
|
|
153
|
+
* @throws {Error} [MPC] Throws an error if unable to obtain the createResponse from the Crypto Server.
|
|
154
|
+
* @throws {Error} [MPC] Throws an error if the createResponse is missing the credential.
|
|
155
|
+
* @throws {Error} [MPC] Throws an error if the credential is missing the attestation object.
|
|
156
|
+
* @throws {Error} Throws a COUNTED error if unable to verify the credential with the Relying Party Server.
|
|
157
|
+
*/
|
|
158
|
+
async webauthnCreate (userIdentifier) {
|
|
159
|
+
|
|
160
|
+
await this.initializeZsm('webauthnCreate');
|
|
161
|
+
|
|
162
|
+
|
|
163
|
+
const publicKey = await this.relyingParty.registrationStart();
|
|
164
|
+
if(publicKey instanceof Error) throw new Error(publicKey);
|
|
165
|
+
else if (!publicKey) throw new Error('[WebAuthnClient] :: webauthnCreate :: Unable to retrieve public key from Relying Party Server!');
|
|
166
|
+
|
|
167
|
+
publicKey.user_id = publicKey.user.id;
|
|
168
|
+
|
|
169
|
+
let createResponse = await this.zsmApi.webauthn_create(publicKey, undefined, userIdentifier, tracePrimer());
|
|
170
|
+
if(!createResponse) throw new Error('[WebAuthnClient - mpc_round] :: webauthnCreate :: Unable to obtain response from Crypto Server!');
|
|
171
|
+
|
|
172
|
+
|
|
173
|
+
createResponse = toObject(createResponse);
|
|
174
|
+
GLOBAL.dispatchEvent(new CustomEvent("MPCResponse", {bubbles: true, cancelable: false, detail: createResponse }));
|
|
175
|
+
|
|
176
|
+
if(!createResponse?.result) throw new Error('[WebAuthnClient - mpc_round] :: webauthnCreate :: Unable to obtain credential from Crypto Server!');
|
|
177
|
+
if(!createResponse?.result?.response) throw new Error('[WebAuthnClient - mpc_round] :: webauthnCreate :: Unable to acquire attestation object!');
|
|
178
|
+
|
|
179
|
+
const credential = createResponse.result;
|
|
180
|
+
|
|
181
|
+
|
|
182
|
+
const registrationResult = await this.relyingParty.registrationFinish(credential);
|
|
183
|
+
if(registrationResult instanceof Error) throw new Error(registrationResult);
|
|
184
|
+
else if(registrationResult == false) throw new Error('[WebAuthnClient] :: webauthnCreate :: Unable to verify credential Relying Party Server!');
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
return registrationResult;
|
|
188
|
+
};
|
|
189
|
+
|
|
145
190
|
/**
|
|
146
191
|
* @name webauthnCreate
|
|
147
192
|
* @description Creates a new WebAuthn credential for the specified userIdentifier.
|
|
@@ -154,16 +199,11 @@ class WebAuthnClientBase {
|
|
|
154
199
|
* @throws {Error} Throws an error if unable to acquire the identity ID from the Relying Party Server.
|
|
155
200
|
* @throws {Error} Throws an error if the user ID or token is missing from the response body.
|
|
156
201
|
*/
|
|
157
|
-
async
|
|
202
|
+
async webauthnCreateMpcThenFinish (userIdentifier, publicKey, pairing_token) {
|
|
158
203
|
this.status = 'ENROLLMENT_STARTING';
|
|
159
204
|
await this.initializeZsm('webauthnCreate');
|
|
160
205
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
const publicKey = await this.relyingParty.registrationStart();
|
|
164
|
-
if(!publicKey) throw new Error('[WebAuthnClient] :: webauthnCreate :: Unable to retrieve public key from Relying Party Server!');
|
|
165
|
-
|
|
166
|
-
let createResponse = await this.zsmApi.webauthn_create(publicKey, tracePrimer());
|
|
206
|
+
let createResponse = await this.zsmApi.webauthn_create(publicKey, pairing_token, userIdentifier, tracePrimer());
|
|
167
207
|
if(!createResponse) throw new Error('[WebAuthnClient - mpc_round] :: webauthnCreate :: Unable to obtain response from Crypto Server!');
|
|
168
208
|
|
|
169
209
|
createResponse = toObject(createResponse);
|
|
@@ -177,7 +217,7 @@ class WebAuthnClientBase {
|
|
|
177
217
|
const registrationResult = await this.relyingParty.registrationFinish(credential);
|
|
178
218
|
if (!registrationResult) throw new Error('[WebAuthnClient] :: webauthnCreate :: Unable to verify credential Relying Party Server!');
|
|
179
219
|
|
|
180
|
-
return registrationResult;
|
|
220
|
+
return registrationResult.credential;
|
|
181
221
|
};
|
|
182
222
|
|
|
183
223
|
/**
|
|
@@ -186,96 +226,124 @@ class WebAuthnClientBase {
|
|
|
186
226
|
* @param {string} userIdentifier The user identifier.
|
|
187
227
|
* @returns {Promise<ZSMAPI>} Resolves with the retrieved credential.
|
|
188
228
|
* @throws {Error} Throws an error if no credential ID is found.
|
|
189
|
-
* @throws {Error} Throws
|
|
229
|
+
* @throws {Error} Throws a COUNTED error if unable to start authentication with the Relying Party Server.
|
|
190
230
|
* @throws {Error} Throws an error if unable to retrieve the public key/challenge from the Relying Party Server.
|
|
191
|
-
* @throws {Error} Throws an error if unable to obtain the
|
|
231
|
+
* @throws {Error} Throws an error if unable to obtain the mpcResponse/credential from the Crypto Server.
|
|
192
232
|
* @throws {Error} Throws an error if unable to verify the credential with the Relying Party Server.
|
|
193
233
|
* @throws {Error} Throws an error if the user ID or token is missing from the response body.
|
|
194
234
|
*/
|
|
195
|
-
webauthnGet
|
|
196
|
-
this.status = 'AUTHENTICATION_STARTING';
|
|
235
|
+
async webauthnGet (userIdentifier) {
|
|
197
236
|
|
|
198
237
|
await this.initializeZsm('webauthnGet');
|
|
199
|
-
await this.webauthnRetrieve(userIdentifier, true)
|
|
238
|
+
const credentialId = await this.webauthnRetrieve(userIdentifier, true);
|
|
200
239
|
|
|
240
|
+
if (!this.isEnrolled) throw new Error(`[WebAuthnClient] :: webauthnGet :: ${userIdentifier} is not enrolled, lacks a credential, or credential is corrupted!`);
|
|
201
241
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
let authStartResponse = await this.relyingParty.authenticationStart(this.credentialID);
|
|
205
|
-
if(!authStartResponse) throw new Error('[WebAuthnClient] :: webauthnGet :: Unable to start authentication with Relying Party Server!');
|
|
242
|
+
let authStartResponse = await this.relyingParty.authenticationStart(credentialId);
|
|
206
243
|
|
|
244
|
+
if (authStartResponse instanceof Error) throw new Error(authStartResponse);
|
|
245
|
+
else if (!authStartResponse) throw new Error('[WebAuthnClient] :: webauthnGet :: Unable to start authentication with Relying Party Server!');
|
|
246
|
+
|
|
207
247
|
authStartResponse = toObject(authStartResponse);
|
|
208
248
|
|
|
209
|
-
if(!authStartResponse?.rcr
|
|
210
|
-
|
|
211
|
-
const pubKey = authStartResponse?.rcr?.publicKey;
|
|
212
|
-
|
|
213
|
-
if(!pubKey || !pubKey?.challenge) throw new Error('[WebAuthnClient] :: webauthnGet :: Unable to acquire challenge from public key!');
|
|
249
|
+
if(!authStartResponse?.rcr?.publicKey?.challenge) throw new Error('[WebAuthnClient] :: webauthnGet :: Unable to locate public key/challenge inside Relying Party Server response!\nResponse Body: ' + JSON.stringify(authStartResponse));
|
|
250
|
+
const publicKey = authStartResponse.rcr.publicKey;
|
|
214
251
|
|
|
215
|
-
let
|
|
216
|
-
|
|
252
|
+
let mpcResponse = await this.zsmApi.webauthn_get(publicKey, undefined, userIdentifier, tracePrimer());
|
|
253
|
+
|
|
217
254
|
|
|
218
|
-
|
|
255
|
+
if(!mpcResponse) throw new Error('[WebAuthnClient - mpc_round] :: webauthnGet :: Crypto server did not respond!');
|
|
219
256
|
|
|
220
|
-
|
|
257
|
+
mpcResponse = toObject(mpcResponse);
|
|
258
|
+
if(!mpcResponse?.result) throw new Error('[WebAuthnClient - mpc_round] :: webauthnGet :: Response from Crypto Server did not contain a credential!\nResponse Body: ' + JSON.stringify(mpcResponse));
|
|
221
259
|
|
|
222
|
-
GLOBAL.dispatchEvent(new CustomEvent("MPCResponse", {bubbles: true, cancelable: false, detail:
|
|
260
|
+
GLOBAL.dispatchEvent(new CustomEvent("MPCResponse", {bubbles: true, cancelable: false, detail: mpcResponse }));
|
|
223
261
|
|
|
224
|
-
const credential =
|
|
262
|
+
const credential = mpcResponse.result;
|
|
225
263
|
let authFinishResponse = await this.relyingParty.authenticationFinish(credential);
|
|
226
264
|
|
|
227
|
-
if
|
|
265
|
+
if (authFinishResponse instanceof Error) throw new Error(authFinishResponse);
|
|
266
|
+
else if (!authFinishResponse) throw new Error('[WebAuthnClient] :: webauthnGet :: Unable to verify credential from Relying Party Server!');
|
|
228
267
|
|
|
229
268
|
authFinishResponse = toObject(authFinishResponse)
|
|
230
|
-
|
|
231
|
-
if (!authFinishResponse.user_id || !authFinishResponse.token) throw new Error('[WebAuthnClient] :: webauthnGet :: User ID or token is missing from response body!');
|
|
269
|
+
if (!authFinishResponse.token) throw new Error('[WebAuthnClient] :: webauthnGet :: Token mismatched or missing from Relying Party Server verification attempt!\nResponse Body: ' + JSON.stringify(authFinishResponse));
|
|
232
270
|
|
|
233
271
|
return {
|
|
234
272
|
signature : credential.response.signature,
|
|
235
273
|
signedChallenge : credential.response.clientDataJSON,
|
|
236
274
|
user_id : authFinishResponse.user_id,
|
|
237
275
|
token : authFinishResponse.token,
|
|
238
|
-
challenge :
|
|
276
|
+
challenge : publicKey.challenge,
|
|
239
277
|
credential
|
|
240
278
|
};
|
|
241
279
|
};
|
|
242
280
|
|
|
281
|
+
|
|
282
|
+
|
|
243
283
|
/**
|
|
244
284
|
* @name webauthnRetrieve
|
|
245
285
|
* @description Looks up the Identity ID for the specified userIdentifier and retrieves its credential ID (if it exists).
|
|
246
286
|
* @ This is used to make a client-only check to see if a given userIdentifier already has an enrollment on the device.
|
|
247
287
|
* @param {string} userIdentifier The user identifier.
|
|
248
|
-
* @param {
|
|
249
|
-
* @
|
|
250
|
-
* @
|
|
288
|
+
* @param {string} targetData The specific data to retrieve. Options are:
|
|
289
|
+
* @ - 'id' or omitted: retrieves the ZSM credential ID (default)
|
|
290
|
+
* @ - 'all': retrieves an object containing all relevant credential data
|
|
291
|
+
* @ - any other string: retrieves the specified field from the response
|
|
292
|
+
* @returns {Promise<Boolean:false>} Returns `false` if retrieval fails (no enrollment found).
|
|
293
|
+
* @returns {Promise<String>} Returns the requested data if found (e.g., ").
|
|
294
|
+
* @returns {Promise<Object>} Resolves with an object containing all relevant credential data.
|
|
295
|
+
* @returns {Promise<Null>} Resolves with null if the requested data is not found.
|
|
296
|
+
* @throws {Error} Throws an error if an uncaught/unhandled error occurs while retrieving the credential.
|
|
251
297
|
*/
|
|
252
|
-
webauthnRetrieve
|
|
298
|
+
async webauthnRetrieve (userIdentifier) {
|
|
253
299
|
this.credentialID = null;
|
|
254
|
-
if (!silent) {
|
|
255
|
-
this.status = 'CREDENTIAL_RETRIEVING';
|
|
256
|
-
}
|
|
257
300
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
let response = await this.zsmApi.webauthn_retrieve(credentialIdentifier);
|
|
264
|
-
response = toObject(response);
|
|
265
|
-
|
|
266
|
-
if (response.error || !response?.result?.rawId) return false;
|
|
301
|
+
this.initializeZsm('webauthnRetrieve');
|
|
302
|
+
let credentialIdentifier = await iid4uid(userIdentifier),
|
|
303
|
+
requestedData = {};
|
|
304
|
+
GLOBAL.mpcConfig.consumer_id = credentialIdentifier;
|
|
267
305
|
|
|
268
|
-
|
|
269
|
-
|
|
306
|
+
let response = await this.zsmApi.webauthn_retrieve(userIdentifier);
|
|
307
|
+
response = toObject(response);
|
|
270
308
|
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
throw error;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
309
|
+
if (response?.error || !response?.result) return false;
|
|
310
|
+
|
|
311
|
+
this.credentialID = response?.result['zsm_credential_id']??null;
|
|
312
|
+
return this.credentialID || false;
|
|
278
313
|
};
|
|
314
|
+
// async webauthnRetrieve (userIdentifier, targetData='id') {
|
|
315
|
+
// this.credentialID = null;
|
|
316
|
+
//
|
|
317
|
+
// this.initializeZsm('webauthnRetrieve');
|
|
318
|
+
// let credentialIdentifier = await iid4uid(userIdentifier),
|
|
319
|
+
// requestedData = {};
|
|
320
|
+
// GLOBAL.mpcConfig.consumer_id = credentialIdentifier;
|
|
321
|
+
//
|
|
322
|
+
// let response = await this.zsmApi.webauthn_retrieve(userIdentifier);
|
|
323
|
+
// response = toObject(response);
|
|
324
|
+
//
|
|
325
|
+
// if (response?.error || !response?.result) return false;
|
|
326
|
+
//
|
|
327
|
+
// this.credentialID = response?.result['zsm_credential_id']??null;
|
|
328
|
+
//
|
|
329
|
+
// if([undefined,true,false,null,'','id'].includes(targetData)) {
|
|
330
|
+
// return this.credentialID;
|
|
331
|
+
// }
|
|
332
|
+
// let pkpCred = await iid4uid(`pk:${userIdentifier}`);
|
|
333
|
+
// if(pkpCred === `pk:${userIdentifier}`) pkpCred = undefined;
|
|
334
|
+
// requestedData = {
|
|
335
|
+
// userIdentifier,
|
|
336
|
+
// zsmCredID : this.credentialID,
|
|
337
|
+
// hasZSMCred : (this.credentialID != null),
|
|
338
|
+
// pkpCredID : pkpCred,
|
|
339
|
+
// hasLocalPasskey : (typeof pkpCred === 'string' && pkpCred !== ''),
|
|
340
|
+
// hasRemotePasskey : (typeof pkpCred === 'object')
|
|
341
|
+
// };
|
|
342
|
+
// if (targetData === "all") {
|
|
343
|
+
// return requestedData;
|
|
344
|
+
// }
|
|
345
|
+
// return response?.[targetData] ?? response?.result?.[targetData] ?? requestedData?.[targetData] ?? null;
|
|
346
|
+
// };
|
|
279
347
|
|
|
280
348
|
/**
|
|
281
349
|
* @name webauthnPartialGet
|
|
@@ -285,10 +353,10 @@ class WebAuthnClientBase {
|
|
|
285
353
|
* @throws {Error} Throws an error if the credential is missing for the userIdentifier provided.
|
|
286
354
|
* @throws {Error} Throws an error if unable to start authentication with the Relying Party Server.
|
|
287
355
|
* @throws {Error} Throws an error if unable to retrieve the public key from the Relying Party Server.
|
|
288
|
-
* @throws {Error} Throws an error if unable to obtain the
|
|
289
|
-
* @emits {CustomEvent} Emits a "MPCResponse" event with the
|
|
356
|
+
* @throws {Error} Throws an error if unable to obtain the mpcResponse/credential from the Crypto Server.
|
|
357
|
+
* @emits {CustomEvent} Emits a "MPCResponse" event with the mpcResponse data.
|
|
290
358
|
*/
|
|
291
|
-
webauthnPartialGet
|
|
359
|
+
async webauthnPartialGet (userIdentifier) {
|
|
292
360
|
this.status = 'AUTHENTICATION_STARTING';
|
|
293
361
|
await this.initializeZsm('webauthnPartialGet');
|
|
294
362
|
|
|
@@ -302,16 +370,16 @@ class WebAuthnClientBase {
|
|
|
302
370
|
if(!getChallenge?.rcr || !getChallenge.rcr.publicKey) throw new Error('[WebAuthnClient] :: webauthnPartialGet :: Unable to retrieve public key from Relying Party Server!');
|
|
303
371
|
const pubKey = getChallenge.rcr.publicKey;
|
|
304
372
|
|
|
305
|
-
let
|
|
306
|
-
if(!
|
|
373
|
+
let mpcResponse = await this.zsmApi.webauthn_get(pubKey, null, userIdentifier, tracePrimer());
|
|
374
|
+
if(!mpcResponse) throw new Error('[WebAuthnClient - mpc_round] :: webauthnPartialGet :: Unable to obtain mpcResponse from Crypto Server!');
|
|
307
375
|
|
|
308
|
-
|
|
376
|
+
mpcResponse = toObject(mpcResponse);
|
|
309
377
|
|
|
310
|
-
if(!
|
|
378
|
+
if(!mpcResponse?.result) throw new Error('[WebAuthnClient - mpc_round] :: webauthnPartialGet :: Unable to obtain credential from Crypto Server!');
|
|
311
379
|
|
|
312
|
-
GLOBAL.dispatchEvent(new CustomEvent("MPCResponse", {bubbles: true, cancelable: false, detail:
|
|
380
|
+
GLOBAL.dispatchEvent(new CustomEvent("MPCResponse", {bubbles: true, cancelable: false, detail: mpcResponse }));
|
|
313
381
|
|
|
314
|
-
const getCredential =
|
|
382
|
+
const getCredential = mpcResponse.result;
|
|
315
383
|
return {
|
|
316
384
|
signature: getCredential.response.signature,
|
|
317
385
|
signedChallenge: getCredential.response.clientDataJSON,
|
|
@@ -330,7 +398,7 @@ class WebAuthnClientBase {
|
|
|
330
398
|
* @throws {Error<CredentialError>} Throws an CredentialError if the credential is missing for the userIdentifier provided
|
|
331
399
|
* @throws {Error<UnenrollError>} Throws an UnenrollError if a credential matching userIdentifier IS stored on the device, but was unable to be removed.
|
|
332
400
|
*/
|
|
333
|
-
unbindFromDevice
|
|
401
|
+
async unbindFromDevice (userIdentifier) {
|
|
334
402
|
this.status = 'UNENROLL_STARTING';
|
|
335
403
|
if(userIdentifier !== this.userIdentifier) return false;
|
|
336
404
|
await this.initializeZsm('unbindFromDevice');
|
|
@@ -346,7 +414,11 @@ class WebAuthnClientBase {
|
|
|
346
414
|
const cursor = event.target.result;
|
|
347
415
|
if (cursor) {
|
|
348
416
|
const { key, value } = cursor;
|
|
349
|
-
if
|
|
417
|
+
if(
|
|
418
|
+
key.includes(userIdentifier) ||
|
|
419
|
+
(typeof value === 'string' && value.includes(userIdentifier)) ||
|
|
420
|
+
typeof value === 'object' && value?.zsm_credential?.get('rawId') === rawID
|
|
421
|
+
) (store.delete(key), true);
|
|
350
422
|
cursor.continue();
|
|
351
423
|
}
|
|
352
424
|
};
|
package/package.json
CHANGED
|
@@ -1,23 +1,72 @@
|
|
|
1
1
|
{
|
|
2
|
-
"name"
|
|
3
|
-
"version"
|
|
4
|
-
"description"
|
|
5
|
-
"author"
|
|
6
|
-
"keywords"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
"
|
|
2
|
+
"name": "@ideem/zsm-client-sdk",
|
|
3
|
+
"version": "2.6.0",
|
|
4
|
+
"description": "ZSM makes 2FA easy and invisible for everyone, all the time, using advanced cryptography like MPC to establish cryptographic proof of the origin of any transaction or login attempt, while eliminating opportunities for social engineering. ZSM has no reliance on specific hardware. Our cryptographic module has completed FIPS 140-3 NIST approved lab testing, is FIDO2-ready, and is on the Modules In Progress (MIP) list. Superior Usability. no opt-in, no codes, no downloads, no authenticator apps. Better Security.",
|
|
5
|
+
"author": "@JJ (Jason Jurusz) <jj@useideem.com>/<nerdy.deeds@done.cheap>",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"ideem",
|
|
8
|
+
"zsm",
|
|
9
|
+
"zsm-client-sdk",
|
|
10
|
+
"UMFAClient",
|
|
11
|
+
"FIDO2Client",
|
|
12
|
+
"library",
|
|
13
|
+
"UMFA",
|
|
14
|
+
"FIDO2",
|
|
15
|
+
"client",
|
|
16
|
+
"authentication",
|
|
17
|
+
"javascript",
|
|
18
|
+
"multi-factor",
|
|
19
|
+
"webauthn",
|
|
20
|
+
"authentication",
|
|
21
|
+
"security",
|
|
22
|
+
"cryptography",
|
|
23
|
+
"MPC",
|
|
24
|
+
"FIPS",
|
|
25
|
+
"NIST",
|
|
26
|
+
"FIDO2-ready",
|
|
27
|
+
"Modules In Progress",
|
|
28
|
+
"MIP"
|
|
29
|
+
],
|
|
30
|
+
"type": "module",
|
|
31
|
+
"main": "./ZSMClientSDK.js",
|
|
32
|
+
"scripts": {
|
|
33
|
+
"start": "echo 'This is the Ideem SDK library, not a freestanding application. There is no start script defined. To use, import the library into a browser application.' 1>&2",
|
|
34
|
+
"version": "echo \"$(npm pkg get name | tr -d \\\") current version: $(npm pkg get version | tr -d \\\")\""
|
|
12
35
|
},
|
|
13
|
-
"collaborators"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
36
|
+
"collaborators": [
|
|
37
|
+
"Joel Teply <joel@useideem.com>",
|
|
38
|
+
"Todd Decker <todd@useideem.com>",
|
|
39
|
+
"Brian Koziel <brian@useideem.com>"
|
|
40
|
+
],
|
|
41
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "github : useideem/vHSM"
|
|
18
45
|
},
|
|
19
|
-
"homepage"
|
|
20
|
-
"bugs"
|
|
21
|
-
"files"
|
|
22
|
-
|
|
46
|
+
"homepage": "https://useideem.com",
|
|
47
|
+
"bugs": "https://github.com/useideem/vHSM/issues",
|
|
48
|
+
"files": [
|
|
49
|
+
"./ErrorHandler.js",
|
|
50
|
+
"./EventCoordinator.js",
|
|
51
|
+
"./FIDO2Client.js",
|
|
52
|
+
"./FIDO2ClientBase.js",
|
|
53
|
+
"./GlobalScoping.js",
|
|
54
|
+
"./IdentityIndexing.js",
|
|
55
|
+
"./package.json",
|
|
56
|
+
"./PluginManager.js",
|
|
57
|
+
"./RelyingParty.js",
|
|
58
|
+
"./RelyingPartyBase.js",
|
|
59
|
+
"./shims/",
|
|
60
|
+
"./UMFAClient.js",
|
|
61
|
+
"./UMFAClientBase.js",
|
|
62
|
+
"./Utils.js",
|
|
63
|
+
"./WASMRustInterface.js",
|
|
64
|
+
"./WebAuthnClient.js",
|
|
65
|
+
"./WebAuthnClientBase.js",
|
|
66
|
+
"./ZSMClientSDK.js",
|
|
67
|
+
"./CHANGELOG.md",
|
|
68
|
+
"./LICENSE",
|
|
69
|
+
"./README.md"
|
|
70
|
+
],
|
|
71
|
+
"sideEffects": false
|
|
23
72
|
}
|