@metamask-previews/profile-sync-controller 32.1.1-preview-d43f7b9f4 → 32.1.1-preview-2731bd7

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/CHANGELOG.md CHANGED
@@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
9
9
 
10
10
  ### Added
11
11
 
12
+ - Add validated MFA domain types and structured `MfaError` classes with a serialization-safe `mfaCode` ([#10264](https://github.com/MetaMask/core/pull/10264))
12
13
  - Add `rampsOrders` to `USER_STORAGE_FEATURE_NAMES` ([#10227](https://github.com/MetaMask/core/pull/10227))
13
14
 
14
15
  ## [32.1.1]
@@ -0,0 +1,691 @@
1
+ import type { Struct } from '@metamask/superstruct';
2
+ export declare const MFA_CREDENTIAL_TYPES: readonly ['passkey', 'email_otp'];
3
+ export declare const MfaCredentialTypeStruct: Struct<"email_otp" | "passkey", {
4
+ email_otp: "email_otp";
5
+ passkey: "passkey";
6
+ }>;
7
+ export declare const PublicKeyCredentialCreationOptionsJSONStruct: Struct<{
8
+ rp: {
9
+ id: string;
10
+ name: string;
11
+ };
12
+ user: {
13
+ id: string;
14
+ name: string;
15
+ displayName: string;
16
+ };
17
+ challenge: string;
18
+ pubKeyCredParams: {
19
+ type: "public-key";
20
+ alg: number;
21
+ }[];
22
+ excludeCredentials?: {
23
+ type: "public-key";
24
+ id: string;
25
+ transports?: string[] | undefined;
26
+ }[] | undefined;
27
+ authenticatorSelection?: {
28
+ authenticatorAttachment?: string | undefined;
29
+ residentKey?: string | undefined;
30
+ requireResidentKey?: boolean | undefined;
31
+ userVerification?: string | undefined;
32
+ } | undefined;
33
+ attestation?: string | undefined;
34
+ timeout?: number | undefined;
35
+ extensions?: {} | undefined;
36
+ }, {
37
+ rp: Struct<{
38
+ id: string;
39
+ name: string;
40
+ }, {
41
+ id: Struct<string, null>;
42
+ name: Struct<string, null>;
43
+ }>;
44
+ user: Struct<{
45
+ id: string;
46
+ name: string;
47
+ displayName: string;
48
+ }, {
49
+ id: Struct<string, null>;
50
+ name: Struct<string, null>;
51
+ displayName: Struct<string, null>;
52
+ }>;
53
+ challenge: Struct<string, null>;
54
+ pubKeyCredParams: Struct<{
55
+ type: "public-key";
56
+ alg: number;
57
+ }[], Struct<{
58
+ type: "public-key";
59
+ alg: number;
60
+ }, {
61
+ type: Struct<"public-key", "public-key">;
62
+ alg: Struct<number, null>;
63
+ }>>;
64
+ excludeCredentials: Struct<{
65
+ type: "public-key";
66
+ id: string;
67
+ transports?: string[] | undefined;
68
+ }[] | undefined, Struct<{
69
+ type: "public-key";
70
+ id: string;
71
+ transports?: string[] | undefined;
72
+ }, {
73
+ type: Struct<"public-key", "public-key">;
74
+ id: Struct<string, null>;
75
+ transports: Struct<string[] | undefined, Struct<string, null>>;
76
+ }>>;
77
+ authenticatorSelection: Struct<{
78
+ authenticatorAttachment?: string | undefined;
79
+ residentKey?: string | undefined;
80
+ requireResidentKey?: boolean | undefined;
81
+ userVerification?: string | undefined;
82
+ } | undefined, {
83
+ authenticatorAttachment: Struct<string | undefined, null>;
84
+ residentKey: Struct<string | undefined, null>;
85
+ requireResidentKey: Struct<boolean | undefined, null>;
86
+ userVerification: Struct<string | undefined, null>;
87
+ }>;
88
+ attestation: Struct<string | undefined, null>;
89
+ timeout: Struct<number | undefined, null>;
90
+ extensions: Struct<{} | undefined, {}>;
91
+ }>;
92
+ export declare const PublicKeyCredentialRequestOptionsJSONStruct: Struct<{
93
+ challenge: string;
94
+ rpId?: string | undefined;
95
+ allowCredentials?: {
96
+ type: "public-key";
97
+ id: string;
98
+ transports?: string[] | undefined;
99
+ }[] | undefined;
100
+ userVerification?: string | undefined;
101
+ timeout?: number | undefined;
102
+ extensions?: {} | undefined;
103
+ }, {
104
+ challenge: Struct<string, null>;
105
+ rpId: Struct<string | undefined, null>;
106
+ allowCredentials: Struct<{
107
+ type: "public-key";
108
+ id: string;
109
+ transports?: string[] | undefined;
110
+ }[] | undefined, Struct<{
111
+ type: "public-key";
112
+ id: string;
113
+ transports?: string[] | undefined;
114
+ }, {
115
+ type: Struct<"public-key", "public-key">;
116
+ id: Struct<string, null>;
117
+ transports: Struct<string[] | undefined, Struct<string, null>>;
118
+ }>>;
119
+ userVerification: Struct<string | undefined, null>;
120
+ timeout: Struct<number | undefined, null>;
121
+ extensions: Struct<{} | undefined, {}>;
122
+ }>;
123
+ export declare const PasskeyCreateDataStruct: Struct<{
124
+ publicKey: {
125
+ rp: {
126
+ id: string;
127
+ name: string;
128
+ };
129
+ user: {
130
+ id: string;
131
+ name: string;
132
+ displayName: string;
133
+ };
134
+ challenge: string;
135
+ pubKeyCredParams: {
136
+ type: "public-key";
137
+ alg: number;
138
+ }[];
139
+ excludeCredentials?: {
140
+ type: "public-key";
141
+ id: string;
142
+ transports?: string[] | undefined;
143
+ }[] | undefined;
144
+ authenticatorSelection?: {
145
+ authenticatorAttachment?: string | undefined;
146
+ residentKey?: string | undefined;
147
+ requireResidentKey?: boolean | undefined;
148
+ userVerification?: string | undefined;
149
+ } | undefined;
150
+ attestation?: string | undefined;
151
+ timeout?: number | undefined;
152
+ extensions?: {} | undefined;
153
+ };
154
+ }, {
155
+ publicKey: Struct<{
156
+ rp: {
157
+ id: string;
158
+ name: string;
159
+ };
160
+ user: {
161
+ id: string;
162
+ name: string;
163
+ displayName: string;
164
+ };
165
+ challenge: string;
166
+ pubKeyCredParams: {
167
+ type: "public-key";
168
+ alg: number;
169
+ }[];
170
+ excludeCredentials?: {
171
+ type: "public-key";
172
+ id: string;
173
+ transports?: string[] | undefined;
174
+ }[] | undefined;
175
+ authenticatorSelection?: {
176
+ authenticatorAttachment?: string | undefined;
177
+ residentKey?: string | undefined;
178
+ requireResidentKey?: boolean | undefined;
179
+ userVerification?: string | undefined;
180
+ } | undefined;
181
+ attestation?: string | undefined;
182
+ timeout?: number | undefined;
183
+ extensions?: {} | undefined;
184
+ }, {
185
+ rp: Struct<{
186
+ id: string;
187
+ name: string;
188
+ }, {
189
+ id: Struct<string, null>;
190
+ name: Struct<string, null>;
191
+ }>;
192
+ user: Struct<{
193
+ id: string;
194
+ name: string;
195
+ displayName: string;
196
+ }, {
197
+ id: Struct<string, null>;
198
+ name: Struct<string, null>;
199
+ displayName: Struct<string, null>;
200
+ }>;
201
+ challenge: Struct<string, null>;
202
+ pubKeyCredParams: Struct<{
203
+ type: "public-key";
204
+ alg: number;
205
+ }[], Struct<{
206
+ type: "public-key";
207
+ alg: number;
208
+ }, {
209
+ type: Struct<"public-key", "public-key">;
210
+ alg: Struct<number, null>;
211
+ }>>;
212
+ excludeCredentials: Struct<{
213
+ type: "public-key";
214
+ id: string;
215
+ transports?: string[] | undefined;
216
+ }[] | undefined, Struct<{
217
+ type: "public-key";
218
+ id: string;
219
+ transports?: string[] | undefined;
220
+ }, {
221
+ type: Struct<"public-key", "public-key">;
222
+ id: Struct<string, null>;
223
+ transports: Struct<string[] | undefined, Struct<string, null>>;
224
+ }>>;
225
+ authenticatorSelection: Struct<{
226
+ authenticatorAttachment?: string | undefined;
227
+ residentKey?: string | undefined;
228
+ requireResidentKey?: boolean | undefined;
229
+ userVerification?: string | undefined;
230
+ } | undefined, {
231
+ authenticatorAttachment: Struct<string | undefined, null>;
232
+ residentKey: Struct<string | undefined, null>;
233
+ requireResidentKey: Struct<boolean | undefined, null>;
234
+ userVerification: Struct<string | undefined, null>;
235
+ }>;
236
+ attestation: Struct<string | undefined, null>;
237
+ timeout: Struct<number | undefined, null>;
238
+ extensions: Struct<{} | undefined, {}>;
239
+ }>;
240
+ }>;
241
+ export declare const PasskeyRequestDataStruct: Struct<{
242
+ publicKey: {
243
+ challenge: string;
244
+ rpId?: string | undefined;
245
+ allowCredentials?: {
246
+ type: "public-key";
247
+ id: string;
248
+ transports?: string[] | undefined;
249
+ }[] | undefined;
250
+ userVerification?: string | undefined;
251
+ timeout?: number | undefined;
252
+ extensions?: {} | undefined;
253
+ };
254
+ }, {
255
+ publicKey: Struct<{
256
+ challenge: string;
257
+ rpId?: string | undefined;
258
+ allowCredentials?: {
259
+ type: "public-key";
260
+ id: string;
261
+ transports?: string[] | undefined;
262
+ }[] | undefined;
263
+ userVerification?: string | undefined;
264
+ timeout?: number | undefined;
265
+ extensions?: {} | undefined;
266
+ }, {
267
+ challenge: Struct<string, null>;
268
+ rpId: Struct<string | undefined, null>;
269
+ allowCredentials: Struct<{
270
+ type: "public-key";
271
+ id: string;
272
+ transports?: string[] | undefined;
273
+ }[] | undefined, Struct<{
274
+ type: "public-key";
275
+ id: string;
276
+ transports?: string[] | undefined;
277
+ }, {
278
+ type: Struct<"public-key", "public-key">;
279
+ id: Struct<string, null>;
280
+ transports: Struct<string[] | undefined, Struct<string, null>>;
281
+ }>>;
282
+ userVerification: Struct<string | undefined, null>;
283
+ timeout: Struct<number | undefined, null>;
284
+ extensions: Struct<{} | undefined, {}>;
285
+ }>;
286
+ }>;
287
+ export declare const RegistrationResponseJSONStruct: Struct<{
288
+ id: string;
289
+ rawId: string;
290
+ type: "public-key";
291
+ response: {
292
+ attestationObject: string;
293
+ clientDataJSON: string;
294
+ transports?: string[] | undefined;
295
+ publicKeyAlgorithm?: number | undefined;
296
+ publicKey?: string | undefined;
297
+ authenticatorData?: string | undefined;
298
+ };
299
+ authenticatorAttachment?: string | null | undefined;
300
+ clientExtensionResults?: {} | undefined;
301
+ }, {
302
+ id: Struct<string, null>;
303
+ rawId: Struct<string, null>;
304
+ type: Struct<"public-key", "public-key">;
305
+ response: Struct<{
306
+ attestationObject: string;
307
+ clientDataJSON: string;
308
+ transports?: string[] | undefined;
309
+ publicKeyAlgorithm?: number | undefined;
310
+ publicKey?: string | undefined;
311
+ authenticatorData?: string | undefined;
312
+ }, {
313
+ attestationObject: Struct<string, null>;
314
+ clientDataJSON: Struct<string, null>;
315
+ transports: Struct<string[] | undefined, Struct<string, null>>;
316
+ publicKeyAlgorithm: Struct<number | undefined, null>;
317
+ publicKey: Struct<string | undefined, null>;
318
+ authenticatorData: Struct<string | undefined, null>;
319
+ }>;
320
+ authenticatorAttachment: Struct<string | null | undefined, null>;
321
+ clientExtensionResults: Struct<{} | undefined, {}>;
322
+ }>;
323
+ export declare const AuthenticationResponseJSONStruct: Struct<{
324
+ id: string;
325
+ rawId: string;
326
+ type: "public-key";
327
+ response: {
328
+ authenticatorData: string;
329
+ clientDataJSON: string;
330
+ signature: string;
331
+ userHandle?: string | null | undefined;
332
+ };
333
+ authenticatorAttachment?: string | null | undefined;
334
+ clientExtensionResults?: {} | undefined;
335
+ }, {
336
+ id: Struct<string, null>;
337
+ rawId: Struct<string, null>;
338
+ type: Struct<"public-key", "public-key">;
339
+ response: Struct<{
340
+ authenticatorData: string;
341
+ clientDataJSON: string;
342
+ signature: string;
343
+ userHandle?: string | null | undefined;
344
+ }, {
345
+ authenticatorData: Struct<string, null>;
346
+ clientDataJSON: Struct<string, null>;
347
+ signature: Struct<string, null>;
348
+ userHandle: Struct<string | null | undefined, null>;
349
+ }>;
350
+ authenticatorAttachment: Struct<string | null | undefined, null>;
351
+ clientExtensionResults: Struct<{} | undefined, {}>;
352
+ }>;
353
+ /**
354
+ * Only the assertion JWT is consumed from the verification response; the
355
+ * profile fields on the wire duplicate what the login flow already resolved.
356
+ */
357
+ export declare const MfaVerifyCompleteResponseStruct: Struct<{
358
+ token: string;
359
+ expires_in: number;
360
+ }, {
361
+ token: Struct<string, null>;
362
+ expires_in: Struct<number, null>;
363
+ }>;
364
+ export declare const MfaEnrollResponseStruct: Struct<{
365
+ flow_id: string;
366
+ expires_at: string;
367
+ passkey_create_data?: string | undefined;
368
+ }, {
369
+ flow_id: Struct<string, null>;
370
+ expires_at: Struct<string, null>;
371
+ passkey_create_data: Struct<string | undefined, null>;
372
+ }>;
373
+ export declare const MfaEnrollCompleteResponseStruct: Struct<{
374
+ status: "enrolled";
375
+ }, {
376
+ status: Struct<"enrolled", "enrolled">;
377
+ }>;
378
+ export declare const MfaVerifyResponseStruct: Struct<{
379
+ flow_id: string;
380
+ expires_at: string;
381
+ passkey_request_data?: string | undefined;
382
+ }, {
383
+ flow_id: Struct<string, null>;
384
+ expires_at: Struct<string, null>;
385
+ passkey_request_data: Struct<string | undefined, null>;
386
+ }>;
387
+ export declare const MfaPasskeyDetailStruct: Struct<{
388
+ display_name?: string | undefined;
389
+ added_at?: string | undefined;
390
+ }, {
391
+ display_name: Struct<string | undefined, null>;
392
+ added_at: Struct<string | undefined, null>;
393
+ }>;
394
+ export declare const MfaEmailDetailStruct: Struct<{
395
+ address?: string | undefined;
396
+ verified?: boolean | undefined;
397
+ }, {
398
+ address: Struct<string | undefined, null>;
399
+ verified: Struct<boolean | undefined, null>;
400
+ }>;
401
+ export declare const MfaCredentialStruct: Struct<{
402
+ credential_type: string;
403
+ status: string;
404
+ enrolled_at?: string | undefined;
405
+ passkey?: {
406
+ display_name?: string | undefined;
407
+ added_at?: string | undefined;
408
+ } | undefined;
409
+ email?: {
410
+ address?: string | undefined;
411
+ verified?: boolean | undefined;
412
+ } | undefined;
413
+ }, {
414
+ credential_type: Struct<string, null>;
415
+ status: Struct<string, null>;
416
+ enrolled_at: Struct<string | undefined, null>;
417
+ passkey: Struct<{
418
+ display_name?: string | undefined;
419
+ added_at?: string | undefined;
420
+ } | undefined, {
421
+ display_name: Struct<string | undefined, null>;
422
+ added_at: Struct<string | undefined, null>;
423
+ }>;
424
+ email: Struct<{
425
+ address?: string | undefined;
426
+ verified?: boolean | undefined;
427
+ } | undefined, {
428
+ address: Struct<string | undefined, null>;
429
+ verified: Struct<boolean | undefined, null>;
430
+ }>;
431
+ }>;
432
+ export declare const MfaCredentialsResponseStruct: Struct<{
433
+ credentials: {
434
+ credential_type: string;
435
+ status: string;
436
+ enrolled_at?: string | undefined;
437
+ passkey?: {
438
+ display_name?: string | undefined;
439
+ added_at?: string | undefined;
440
+ } | undefined;
441
+ email?: {
442
+ address?: string | undefined;
443
+ verified?: boolean | undefined;
444
+ } | undefined;
445
+ }[];
446
+ }, {
447
+ credentials: Struct<{
448
+ credential_type: string;
449
+ status: string;
450
+ enrolled_at?: string | undefined;
451
+ passkey?: {
452
+ display_name?: string | undefined;
453
+ added_at?: string | undefined;
454
+ } | undefined;
455
+ email?: {
456
+ address?: string | undefined;
457
+ verified?: boolean | undefined;
458
+ } | undefined;
459
+ }[], Struct<{
460
+ credential_type: string;
461
+ status: string;
462
+ enrolled_at?: string | undefined;
463
+ passkey?: {
464
+ display_name?: string | undefined;
465
+ added_at?: string | undefined;
466
+ } | undefined;
467
+ email?: {
468
+ address?: string | undefined;
469
+ verified?: boolean | undefined;
470
+ } | undefined;
471
+ }, {
472
+ credential_type: Struct<string, null>;
473
+ status: Struct<string, null>;
474
+ enrolled_at: Struct<string | undefined, null>;
475
+ passkey: Struct<{
476
+ display_name?: string | undefined;
477
+ added_at?: string | undefined;
478
+ } | undefined, {
479
+ display_name: Struct<string | undefined, null>;
480
+ added_at: Struct<string | undefined, null>;
481
+ }>;
482
+ email: Struct<{
483
+ address?: string | undefined;
484
+ verified?: boolean | undefined;
485
+ } | undefined, {
486
+ address: Struct<string | undefined, null>;
487
+ verified: Struct<boolean | undefined, null>;
488
+ }>;
489
+ }>>;
490
+ }>;
491
+ export declare const MfaErrorResponseStruct: Struct<{
492
+ code?: string | undefined;
493
+ message: string;
494
+ }, {
495
+ code: Struct<string | undefined, null>;
496
+ message: Struct<string, null>;
497
+ }>;
498
+ export declare const TokenReasonStruct: Struct<{
499
+ operation: string;
500
+ }, {
501
+ operation: Struct<string, null>;
502
+ }>;
503
+ export declare const BeginEnrollmentRequestStruct: Struct<{
504
+ type: "email_otp" | "passkey";
505
+ email?: string | undefined;
506
+ reason: {
507
+ operation: string;
508
+ };
509
+ }, {
510
+ type: Struct<"email_otp" | "passkey", {
511
+ email_otp: "email_otp";
512
+ passkey: "passkey";
513
+ }>;
514
+ email: Struct<string | undefined, null>;
515
+ reason: Struct<{
516
+ operation: string;
517
+ }, {
518
+ operation: Struct<string, null>;
519
+ }>;
520
+ }>;
521
+ export declare const CompleteEnrollmentRequestStruct: Struct<{
522
+ flowId: string;
523
+ proof: {
524
+ type: "passkey";
525
+ attestation: {
526
+ id: string;
527
+ rawId: string;
528
+ type: "public-key";
529
+ response: {
530
+ attestationObject: string;
531
+ clientDataJSON: string;
532
+ transports?: string[] | undefined;
533
+ publicKeyAlgorithm?: number | undefined;
534
+ publicKey?: string | undefined;
535
+ authenticatorData?: string | undefined;
536
+ };
537
+ authenticatorAttachment?: string | null | undefined;
538
+ clientExtensionResults?: {} | undefined;
539
+ };
540
+ } | {
541
+ type: "email_otp";
542
+ code: string;
543
+ };
544
+ reason: {
545
+ operation: string;
546
+ };
547
+ }, {
548
+ flowId: Struct<string, null>;
549
+ proof: Struct<{
550
+ type: "passkey";
551
+ attestation: {
552
+ id: string;
553
+ rawId: string;
554
+ type: "public-key";
555
+ response: {
556
+ attestationObject: string;
557
+ clientDataJSON: string;
558
+ transports?: string[] | undefined;
559
+ publicKeyAlgorithm?: number | undefined;
560
+ publicKey?: string | undefined;
561
+ authenticatorData?: string | undefined;
562
+ };
563
+ authenticatorAttachment?: string | null | undefined;
564
+ clientExtensionResults?: {} | undefined;
565
+ };
566
+ } | {
567
+ type: "email_otp";
568
+ code: string;
569
+ }, null>;
570
+ reason: Struct<{
571
+ operation: string;
572
+ }, {
573
+ operation: Struct<string, null>;
574
+ }>;
575
+ }>;
576
+ export declare const BeginStepUpRequestStruct: Struct<{
577
+ type: "email_otp" | "passkey";
578
+ reason: {
579
+ operation: string;
580
+ };
581
+ }, {
582
+ type: Struct<"email_otp" | "passkey", {
583
+ email_otp: "email_otp";
584
+ passkey: "passkey";
585
+ }>;
586
+ reason: Struct<{
587
+ operation: string;
588
+ }, {
589
+ operation: Struct<string, null>;
590
+ }>;
591
+ }>;
592
+ export declare const CompleteStepUpRequestStruct: Struct<{
593
+ flowId: string;
594
+ proof: {
595
+ type: "passkey";
596
+ assertion: {
597
+ id: string;
598
+ rawId: string;
599
+ type: "public-key";
600
+ response: {
601
+ authenticatorData: string;
602
+ clientDataJSON: string;
603
+ signature: string;
604
+ userHandle?: string | null | undefined;
605
+ };
606
+ authenticatorAttachment?: string | null | undefined;
607
+ clientExtensionResults?: {} | undefined;
608
+ };
609
+ } | {
610
+ type: "email_otp";
611
+ code: string;
612
+ };
613
+ reason: {
614
+ operation: string;
615
+ };
616
+ }, {
617
+ flowId: Struct<string, null>;
618
+ proof: Struct<{
619
+ type: "passkey";
620
+ assertion: {
621
+ id: string;
622
+ rawId: string;
623
+ type: "public-key";
624
+ response: {
625
+ authenticatorData: string;
626
+ clientDataJSON: string;
627
+ signature: string;
628
+ userHandle?: string | null | undefined;
629
+ };
630
+ authenticatorAttachment?: string | null | undefined;
631
+ clientExtensionResults?: {} | undefined;
632
+ };
633
+ } | {
634
+ type: "email_otp";
635
+ code: string;
636
+ }, null>;
637
+ reason: Struct<{
638
+ operation: string;
639
+ }, {
640
+ operation: Struct<string, null>;
641
+ }>;
642
+ }>;
643
+ export declare const GetElevatedTokenRequestStruct: Struct<{
644
+ maxSessionAgeMs?: number | undefined;
645
+ }, {
646
+ maxSessionAgeMs: Struct<number | undefined, null>;
647
+ }>;
648
+ export declare const ElevatedTokenClaimsStruct: Struct<{
649
+ sub: string;
650
+ aal: 2;
651
+ exp: number;
652
+ amr: "email_otp" | "passkey" | ("email_otp" | "passkey")[];
653
+ }, {
654
+ sub: Struct<string, null>;
655
+ aal: Struct<2, 2>;
656
+ exp: Struct<number, null>;
657
+ amr: Struct<"email_otp" | "passkey" | ("email_otp" | "passkey")[], null>;
658
+ }>;
659
+ /**
660
+ * Validates data received from the authentication service.
661
+ *
662
+ * @param value - Untrusted response data.
663
+ * @param struct - Expected response structure.
664
+ * @throws MfaError if the response does not match the structure.
665
+ */
666
+ export declare function assertValidMfaResponse<Value>(value: unknown, struct: Struct<Value>): asserts value is Value;
667
+ /**
668
+ * Validates data received from an untyped controller boundary.
669
+ *
670
+ * @param value - Untrusted request data.
671
+ * @param struct - Expected request structure.
672
+ * @throws MfaError if the request does not match the structure.
673
+ */
674
+ export declare function assertValidMfaRequest<Value>(value: unknown, struct: Struct<Value>): asserts value is Value;
675
+ /**
676
+ * Validates and normalizes claims from an elevated access token.
677
+ *
678
+ * Hydra places hook-supplied claims under `ext` unless they are promoted to
679
+ * the top level, so `aal` and `amr` are read from either location.
680
+ *
681
+ * @param payload - Decoded JWT payload.
682
+ * @returns Validated claims with `amr` represented as an array.
683
+ * @throws ElevatedTokenInvalidError if claims are missing or invalid.
684
+ */
685
+ export declare function parseElevatedTokenClaims(payload: unknown): {
686
+ sub: string;
687
+ aal: 2;
688
+ exp: number;
689
+ amr: ('passkey' | 'email_otp')[];
690
+ };
691
+ //# sourceMappingURL=schemas.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../../../../src/sdk/authentication-jwt-bearer/mfa/schemas.ts"],"names":[],"mappings":"AAmBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAIpD,eAAO,MAAM,oBAAoB,YAAI,SAAS,EAAE,WAAW,CAAU,CAAC;AAEtE,eAAO,MAAM,uBAAuB;;;EAA8B,CAAC;AAUnE,eAAO,MAAM,4CAA4C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA6BvD,CAAC;AAEH,eAAO,MAAM,2CAA2C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAOtD,CAAC;AAEH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAElC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAEnC,CAAC;AAEH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;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