@breeztech/breez-sdk-spark-react-native 0.20.0-dev1 → 0.21.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/BreezSdkSparkReactNative.podspec +6 -0
- package/cpp/generated/breez_sdk_spark.cpp +168 -11
- package/cpp/generated/breez_sdk_spark.hpp +21 -0
- package/lib/commonjs/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/commonjs/generated/breez_sdk_spark.js +225 -35
- package/lib/commonjs/generated/breez_sdk_spark.js.map +1 -1
- package/lib/commonjs/passkey-prf-provider.js +31 -11
- package/lib/commonjs/passkey-prf-provider.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark-ffi.js.map +1 -1
- package/lib/module/generated/breez_sdk_spark.js +224 -34
- package/lib/module/generated/breez_sdk_spark.js.map +1 -1
- package/lib/module/passkey-prf-provider.js +31 -11
- package/lib/module/passkey-prf-provider.js.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts +8 -2
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts +811 -26
- package/lib/typescript/commonjs/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/passkey-prf-provider.d.ts +24 -6
- package/lib/typescript/commonjs/src/passkey-prf-provider.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts +8 -2
- package/lib/typescript/module/src/generated/breez_sdk_spark-ffi.d.ts.map +1 -1
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts +811 -26
- package/lib/typescript/module/src/generated/breez_sdk_spark.d.ts.map +1 -1
- package/lib/typescript/module/src/passkey-prf-provider.d.ts +24 -6
- package/lib/typescript/module/src/passkey-prf-provider.d.ts.map +1 -1
- package/package.json +4 -4
- package/plugin/build/index.d.ts +1 -1
- package/plugin/build/index.js +3 -1
- package/plugin/build/withAndroid.d.ts +1 -1
- package/plugin/build/withAndroid.js +1 -1
- package/plugin/build/withBinaryArtifacts.d.ts +1 -1
- package/plugin/build/withBinaryArtifacts.js +1 -1
- package/plugin/build/withIOS.d.ts +1 -1
- package/plugin/build/withIOS.js +1 -1
- package/scripts/post-ubrn.js +42 -0
- package/src/generated/breez_sdk_spark-ffi.ts +18 -1
- package/src/generated/breez_sdk_spark.ts +1303 -36
- package/src/passkey-prf-provider.ts +41 -12
|
@@ -59,6 +59,21 @@ export interface PasskeyCredential {
|
|
|
59
59
|
backupEligible: boolean | null;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
/**
|
|
63
|
+
* Result of {@link PasskeyProvider.createPasskey}: the new credential, plus
|
|
64
|
+
* the PRF outputs when the authenticator evaluated them during the create
|
|
65
|
+
* ceremony. `seeds` null means it did not, so the caller derives through
|
|
66
|
+
* {@link PasskeyProvider.deriveSeeds}.
|
|
67
|
+
*
|
|
68
|
+
* Seeds returned here must equal what `deriveSeeds` returns for the same
|
|
69
|
+
* salts: the wallet is derived from them either way, so a mismatch means
|
|
70
|
+
* register and sign-in land on different wallets.
|
|
71
|
+
*/
|
|
72
|
+
export interface CreatePasskeyOutput {
|
|
73
|
+
credential: PasskeyCredential;
|
|
74
|
+
seeds: Uint8Array[] | null;
|
|
75
|
+
}
|
|
76
|
+
|
|
62
77
|
/**
|
|
63
78
|
* Result of {@link PasskeyProvider.checkDomainAssociation}. Switch on `kind`
|
|
64
79
|
* to handle each outcome.
|
|
@@ -199,13 +214,20 @@ export class PasskeyProvider {
|
|
|
199
214
|
}
|
|
200
215
|
|
|
201
216
|
/**
|
|
202
|
-
* Register a new PRF-capable passkey
|
|
203
|
-
*
|
|
204
|
-
* `
|
|
205
|
-
*
|
|
206
|
-
*
|
|
217
|
+
* Register a new PRF-capable passkey. `excludeCredentials` blocks
|
|
218
|
+
* re-registering a device that already holds a credential, surfaced as a
|
|
219
|
+
* `credentialAlreadyExists` failure. The returned user handle is minted
|
|
220
|
+
* fresh per call (never host-supplied).
|
|
221
|
+
*
|
|
222
|
+
* Asking the create ceremony to evaluate PRF for `salts` removes the
|
|
223
|
+
* assertion that would otherwise follow it. `seeds` is null when the
|
|
224
|
+
* authenticator reported PRF support without evaluating, or returned
|
|
225
|
+
* fewer outputs than salts; the caller then derives as before.
|
|
207
226
|
*/
|
|
208
|
-
async createPasskey(
|
|
227
|
+
async createPasskey(
|
|
228
|
+
excludeCredentials: Uint8Array[] = [],
|
|
229
|
+
salts: string[] = []
|
|
230
|
+
): Promise<CreatePasskeyOutput> {
|
|
209
231
|
if (!BreezSdkSparkPasskey) {
|
|
210
232
|
throw passkeyModuleUnavailableError('createPasskey');
|
|
211
233
|
}
|
|
@@ -215,22 +237,29 @@ export class PasskeyProvider {
|
|
|
215
237
|
try {
|
|
216
238
|
const result: {
|
|
217
239
|
credentialId: string;
|
|
218
|
-
userId: string;
|
|
240
|
+
userId: string | null;
|
|
219
241
|
aaguid: string | null;
|
|
220
242
|
backupEligible: boolean | null;
|
|
243
|
+
seeds: string[] | null;
|
|
221
244
|
} = await BreezSdkSparkPasskey.createPasskey(
|
|
222
245
|
this.rpId,
|
|
223
246
|
this.rpName,
|
|
224
247
|
this.userName,
|
|
225
248
|
this.userDisplayName,
|
|
226
|
-
excludeBase64
|
|
249
|
+
excludeBase64,
|
|
250
|
+
salts
|
|
227
251
|
);
|
|
228
252
|
|
|
229
253
|
return {
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
254
|
+
credential: {
|
|
255
|
+
credentialId: base64ToUint8Array(result.credentialId),
|
|
256
|
+
userId: result.userId ? base64ToUint8Array(result.userId) : null,
|
|
257
|
+
aaguid: result.aaguid ? base64ToUint8Array(result.aaguid) : null,
|
|
258
|
+
backupEligible: result.backupEligible,
|
|
259
|
+
},
|
|
260
|
+
// Null unless the authenticator evaluated PRF during the create
|
|
261
|
+
// ceremony and returned one output per salt.
|
|
262
|
+
seeds: result.seeds ? result.seeds.map(base64ToUint8Array) : null,
|
|
234
263
|
};
|
|
235
264
|
} catch (err) {
|
|
236
265
|
throw mapNativeError(err);
|