@pagopa/io-wallet-oauth2 1.5.8 → 2.0.0-launchpad

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/index.mjs CHANGED
@@ -10,180 +10,20 @@ var createTokenRequest = async (options) => ({
10
10
  // src/access-token/create-token-response.ts
11
11
  import {
12
12
  HashAlgorithm,
13
- calculateJwkThumbprint
14
- } from "@openid4vc/oauth2";
15
- import {
16
13
  addSecondsToDate,
14
+ calculateJwkThumbprint,
17
15
  dateToSeconds,
18
- parseWithErrorHandling as parseWithErrorHandling2
19
- } from "@pagopa/io-wallet-utils";
20
-
21
- // src/common/jwt/decode-jwt-header.ts
22
- import { Oauth2JwtParseError } from "@openid4vc/oauth2";
23
- import {
24
- decodeBase64,
25
- encodeToUtf8String,
26
- formatError,
27
- parseWithErrorHandling,
28
- stringToJsonWithErrorHandling
16
+ jwtHeaderFromJwtSigner,
17
+ parseWithErrorHandling
29
18
  } from "@pagopa/io-wallet-utils";
30
19
 
31
- // src/common/jwt/z-jwt.ts
32
- import z3 from "zod";
33
-
34
- // src/common/jwk/z-jwk.ts
35
- import z2 from "zod";
36
-
37
- // src/common/z-common.ts
38
- import z from "zod";
39
- var zTrustChain = z.tuple([z.string()], z.string());
40
- var zCertificateChain = z.array(z.string()).nonempty();
41
- var zAlgValueNotNone = z.string().refine((alg) => alg !== "none", { message: `alg value may not be 'none'` });
42
-
43
- // src/common/jwk/z-jwk.ts
44
- var zJwk = z2.looseObject({
45
- alg: z2.optional(z2.string()),
46
- crv: z2.optional(z2.string()),
47
- d: z2.optional(z2.string()),
48
- dp: z2.optional(z2.string()),
49
- dq: z2.optional(z2.string()),
50
- e: z2.optional(z2.string()),
51
- ext: z2.optional(z2.boolean()),
52
- k: z2.optional(z2.string()),
53
- key_ops: z2.optional(z2.array(z2.string())),
54
- kid: z2.optional(z2.string()),
55
- kty: z2.string(),
56
- n: z2.optional(z2.string()),
57
- oth: z2.optional(
58
- z2.array(
59
- z2.looseObject({
60
- d: z2.optional(z2.string()),
61
- r: z2.optional(z2.string()),
62
- t: z2.optional(z2.string())
63
- })
64
- )
65
- ),
66
- p: z2.optional(z2.string()),
67
- q: z2.optional(z2.string()),
68
- qi: z2.optional(z2.string()),
69
- use: z2.optional(z2.string()),
70
- x: z2.optional(z2.string()),
71
- x5c: z2.optional(zCertificateChain),
72
- x5t: z2.optional(z2.string()),
73
- "x5t#S256": z2.optional(z2.string()),
74
- x5u: z2.optional(z2.string()),
75
- y: z2.optional(z2.string())
76
- });
77
- var zJwkSet = z2.looseObject({ keys: z2.array(zJwk) });
78
-
79
- // src/common/jwt/z-jwt.ts
80
- var MAX_JTI_LENGTH = 256;
81
- var zCompactJwt = z3.string().regex(/^([a-zA-Z0-9-_]+)\.([a-zA-Z0-9-_]+)\.([a-zA-Z0-9-_]+)$/, {
82
- message: "Not a valid compact jwt"
83
- });
84
- var zJwtConfirmationPayload = z3.looseObject({
85
- // RFC9449. jwk thumbprint of the dpop public key to which the access token is bound
86
- jkt: z3.string().optional(),
87
- jwk: zJwk.optional()
88
- });
89
- var zJwtPayload = z3.looseObject({
90
- aud: z3.string().optional(),
91
- cnf: zJwtConfirmationPayload.optional(),
92
- exp: z3.number().int().optional(),
93
- iat: z3.number().int().optional(),
94
- iss: z3.string().optional(),
95
- jti: z3.string().max(MAX_JTI_LENGTH).optional(),
96
- nbf: z3.number().int().optional(),
97
- nonce: z3.string().optional(),
98
- // Reserved for status parameters
99
- status: z3.record(z3.string(), z3.any()).optional(),
100
- // Reserved for OpenID Federation
101
- trust_chain: zTrustChain.optional()
102
- });
103
- var zJwtHeader = z3.looseObject({
104
- alg: zAlgValueNotNone,
105
- jwk: zJwk.optional(),
106
- kid: z3.string().optional(),
107
- // Reserved for OpenID Federation
108
- trust_chain: zTrustChain.optional(),
109
- typ: z3.string().optional(),
110
- x5c: zCertificateChain.optional()
111
- });
112
-
113
- // src/common/jwt/decode-jwt-header.ts
114
- function decodeJwtHeader(options) {
115
- const jwtParts = options.jwt.split(".");
116
- if (jwtParts.length <= 2) {
117
- throw new Oauth2JwtParseError(
118
- formatError(
119
- "Unable to decode because Jwt is not a valid!",
120
- options.errorMessagePrefix
121
- )
122
- );
123
- }
124
- const [headerPart] = jwtParts;
125
- let headerJson;
126
- try {
127
- headerJson = stringToJsonWithErrorHandling(
128
- encodeToUtf8String(decodeBase64(headerPart)),
129
- formatError(
130
- "Unable to parse jwt header to JSON",
131
- options.errorMessagePrefix
132
- )
133
- );
134
- } catch (error) {
135
- throw new Oauth2JwtParseError(
136
- formatError(
137
- `Error parsing JWT. ${error instanceof Error ? error.message : ""}`,
138
- options.errorMessagePrefix
139
- )
140
- );
141
- }
142
- const header = parseWithErrorHandling(
143
- options.headerSchema ?? zJwtHeader,
144
- headerJson,
145
- formatError("Invalid JWT header", options.errorMessagePrefix)
146
- );
147
- return {
148
- header
149
- };
150
- }
151
- function jwtHeaderFromJwtSigner(signer) {
152
- if (signer.method === "did") {
153
- return {
154
- alg: signer.alg,
155
- kid: signer.didUrl
156
- };
157
- }
158
- if (signer.method === "federation") {
159
- return {
160
- alg: signer.alg,
161
- kid: signer.kid,
162
- trust_chain: signer.trustChain
163
- };
164
- }
165
- if (signer.method === "jwk") {
166
- return {
167
- alg: signer.alg,
168
- jwk: signer.publicJwk
169
- };
170
- }
171
- if (signer.method === "x5c") {
172
- return {
173
- alg: signer.alg,
174
- kid: signer.kid,
175
- trust_chain: signer.trustChain,
176
- x5c: signer.x5c
177
- };
178
- }
179
- return { alg: signer.alg };
180
- }
181
-
182
20
  // src/errors.ts
183
21
  var Oauth2Error = class extends Error {
184
22
  statusCode;
185
23
  constructor(message, options) {
186
- super(message, options);
24
+ const errorMessage = message ?? "Unknown error occurred.";
25
+ const causeMessage = options?.cause instanceof Error ? ` ${options.cause.message}` : options?.cause ? ` ${String(options.cause)}` : "";
26
+ super(`${errorMessage}${causeMessage}`, options);
187
27
  this.name = "Oauth2Error";
188
28
  this.statusCode = options?.statusCode;
189
29
  }
@@ -234,70 +74,75 @@ var ClientAttestationError = class extends Oauth2Error {
234
74
  };
235
75
 
236
76
  // src/access-token/z-token.ts
237
- import { z as z4 } from "zod";
238
- var zAccessTokenRequest = z4.discriminatedUnion("grant_type", [
239
- z4.object({
240
- code: z4.string().nonempty(),
241
- code_verifier: z4.string().nonempty(),
242
- grant_type: z4.literal("authorization_code"),
243
- redirect_uri: z4.string().nonempty()
77
+ import {
78
+ MAX_JTI_LENGTH,
79
+ zJwtHeader,
80
+ zJwtPayload
81
+ } from "@pagopa/io-wallet-utils";
82
+ import { z } from "zod";
83
+ var zAccessTokenRequest = z.discriminatedUnion("grant_type", [
84
+ z.object({
85
+ code: z.string().nonempty(),
86
+ code_verifier: z.string().nonempty(),
87
+ grant_type: z.literal("authorization_code"),
88
+ redirect_uri: z.string().nonempty()
244
89
  }),
245
- z4.object({
246
- grant_type: z4.literal("refresh_token"),
247
- refresh_token: z4.string().nonempty(),
248
- scope: z4.string().optional()
90
+ z.object({
91
+ grant_type: z.literal("refresh_token"),
92
+ refresh_token: z.string().nonempty(),
93
+ scope: z.string().optional()
249
94
  })
250
95
  ]);
251
- var zAccessTokenResponse = z4.looseObject({
252
- access_token: z4.string(),
253
- authorization_details: z4.array(
254
- z4.looseObject({
255
- credential_configuration_id: z4.optional(z4.string()),
256
- credential_identifiers: z4.optional(z4.array(z4.string())),
257
- type: z4.literal("openid_credential")
96
+ var zAccessTokenResponse = z.looseObject({
97
+ access_token: z.string(),
98
+ authorization_details: z.array(
99
+ z.looseObject({
100
+ credential_configuration_id: z.optional(z.string()),
101
+ credential_identifiers: z.optional(z.array(z.string())),
102
+ type: z.literal("openid_credential")
258
103
  })
259
104
  ).optional(),
260
- expires_in: z4.optional(z4.number().int()),
261
- refresh_token: z4.optional(z4.string()),
262
- token_type: z4.union([z4.literal("Bearer"), z4.literal("DPoP")])
105
+ expires_in: z.optional(z.number().int()),
106
+ refresh_token: z.optional(z.string()),
107
+ token_type: z.union([z.literal("Bearer"), z.literal("DPoP")])
263
108
  });
264
- var zAccessTokenProfileJwtHeader = z4.looseObject({
109
+ var zAccessTokenProfileJwtHeader = z.looseObject({
265
110
  ...zJwtHeader.shape,
266
- typ: z4.enum(["application/at+jwt", "at+jwt"])
111
+ typ: z.enum(["application/at+jwt", "at+jwt"])
267
112
  });
268
- var zAccessTokenProfileJwtPayload = z4.looseObject({
113
+ var zAccessTokenProfileJwtPayload = z.looseObject({
269
114
  ...zJwtPayload.shape,
270
- aud: z4.string(),
271
- client_id: z4.string(),
272
- cnf: z4.object({
273
- jkt: z4.string()
115
+ aud: z.string(),
116
+ client_id: z.string(),
117
+ cnf: z.object({
118
+ jkt: z.string()
274
119
  }).optional(),
275
- exp: z4.number(),
276
- iat: z4.number(),
277
- iss: z4.string(),
278
- jti: z4.string().max(MAX_JTI_LENGTH),
279
- nbf: z4.number().optional(),
280
- scope: z4.string().optional(),
281
- sub: z4.string()
120
+ exp: z.number(),
121
+ iat: z.number(),
122
+ iss: z.string(),
123
+ jti: z.string().max(MAX_JTI_LENGTH),
124
+ nbf: z.number().optional(),
125
+ scope: z.string().optional(),
126
+ sub: z.string()
282
127
  });
283
- var zRefreshTokenProfileJwtHeader = z4.looseObject({
128
+ var zRefreshTokenProfileJwtHeader = z.looseObject({
284
129
  ...zJwtHeader.shape,
285
- kid: z4.string(),
286
- typ: z4.literal("rt+jwt")
130
+ kid: z.string(),
131
+ typ: z.literal("rt+jwt")
287
132
  });
288
- var zRefreshTokenProfileJwtPayload = z4.looseObject({
133
+ var zRefreshTokenProfileJwtPayload = z.looseObject({
289
134
  ...zJwtPayload.shape,
290
- aud: z4.string(),
291
- client_id: z4.string(),
292
- cnf: z4.object({
293
- jkt: z4.string()
135
+ aud: z.string(),
136
+ client_id: z.string(),
137
+ cnf: z.object({
138
+ jkt: z.string()
294
139
  }),
295
- exp: z4.number().int(),
296
- iat: z4.number().int(),
297
- iss: z4.string(),
298
- jti: z4.string().max(MAX_JTI_LENGTH),
299
- nbf: z4.number().int(),
300
- sub: z4.string()
140
+ exp: z.number().int(),
141
+ iat: z.number().int(),
142
+ iss: z.string(),
143
+ jti: z.string().max(MAX_JTI_LENGTH),
144
+ nbf: z.number().int(),
145
+ sub: z.string()
301
146
  });
302
147
 
303
148
  // src/access-token/create-token-response.ts
@@ -353,11 +198,11 @@ async function createAccessTokenResponse(options) {
353
198
  now,
354
199
  options.expiresInSeconds
355
200
  );
356
- const header = parseWithErrorHandling2(zAccessTokenProfileJwtHeader, {
201
+ const header = parseWithErrorHandling(zAccessTokenProfileJwtHeader, {
357
202
  ...jwtHeaderFromJwtSigner(options.signer),
358
203
  typ: "at+jwt"
359
204
  });
360
- const payload = parseWithErrorHandling2(zAccessTokenProfileJwtPayload, {
205
+ const payload = parseWithErrorHandling(zAccessTokenProfileJwtPayload, {
361
206
  ...options.additionalPayload,
362
207
  aud: options.audience,
363
208
  client_id: options.clientId,
@@ -382,7 +227,7 @@ async function createAccessTokenResponse(options) {
382
227
  "Unable to resolve a kid for the Refresh Token JOSE header. Provide signer.kid or a publicJwk.kid."
383
228
  );
384
229
  }
385
- const refreshTokenHeader = parseWithErrorHandling2(
230
+ const refreshTokenHeader = parseWithErrorHandling(
386
231
  zRefreshTokenProfileJwtHeader,
387
232
  {
388
233
  alg: options.signer.alg,
@@ -390,7 +235,7 @@ async function createAccessTokenResponse(options) {
390
235
  typ: "rt+jwt"
391
236
  }
392
237
  );
393
- const refreshTokenPayload = parseWithErrorHandling2(
238
+ const refreshTokenPayload = parseWithErrorHandling(
394
239
  zRefreshTokenProfileJwtPayload,
395
240
  {
396
241
  aud: options.authorizationServer,
@@ -415,7 +260,7 @@ async function createAccessTokenResponse(options) {
415
260
  );
416
261
  refreshToken = refreshTokenSignResult.jwt;
417
262
  }
418
- const accessTokenResponse = parseWithErrorHandling2(zAccessTokenResponse, {
263
+ const accessTokenResponse = parseWithErrorHandling(zAccessTokenResponse, {
419
264
  ...options.additionalPayload,
420
265
  access_token: jwt,
421
266
  expires_in: options.expiresInSeconds,
@@ -441,7 +286,7 @@ import {
441
286
  ValidationError,
442
287
  createFetcher,
443
288
  hasStatusOrThrow,
444
- parseWithErrorHandling as parseWithErrorHandling3
289
+ parseWithErrorHandling as parseWithErrorHandling2
445
290
  } from "@pagopa/io-wallet-utils";
446
291
  async function fetchTokenResponse(options) {
447
292
  try {
@@ -457,7 +302,7 @@ async function fetchTokenResponse(options) {
457
302
  method: "POST"
458
303
  });
459
304
  await hasStatusOrThrow(200, UnexpectedStatusCodeError)(tokenResponse);
460
- return parseWithErrorHandling3(
305
+ return parseWithErrorHandling2(
461
306
  zAccessTokenResponse,
462
307
  await tokenResponse.json(),
463
308
  "Failed to parse token response"
@@ -489,98 +334,29 @@ import {
489
334
  } from "@pagopa/io-wallet-utils";
490
335
 
491
336
  // src/client-attestation/wallet-attestation.ts
492
- import { zCompactJwt as zCompactJwt2 } from "@openid4vc/oauth2";
493
337
  import {
494
338
  ItWalletSpecsVersion,
495
- createVersionDispatcher
339
+ createVersionDispatcher,
340
+ zCompactJwt
496
341
  } from "@pagopa/io-wallet-utils";
497
342
 
498
343
  // src/client-attestation/types.ts
499
- import z5 from "zod";
500
- var zOauthClientAttestationHeader = z5.literal(
344
+ import z2 from "zod";
345
+ var zOauthClientAttestationHeader = z2.literal(
501
346
  "OAuth-Client-Attestation"
502
347
  );
503
348
  var oauthClientAttestationHeader = zOauthClientAttestationHeader.value;
504
- var zOauthClientAttestationPopHeader = z5.literal(
349
+ var zOauthClientAttestationPopHeader = z2.literal(
505
350
  "OAuth-Client-Attestation-PoP"
506
351
  );
507
352
  var oauthClientAttestationPopHeader = zOauthClientAttestationPopHeader.value;
508
353
 
509
354
  // src/client-attestation/verify-wallet-attestation-jwt-base.ts
510
- import { jwtSignerFromJwt, verifyJwt } from "@openid4vc/oauth2";
511
-
512
- // src/common/jwt/decode-jwt.ts
513
- import { Oauth2JwtParseError as Oauth2JwtParseError2 } from "@openid4vc/oauth2";
514
355
  import {
515
- decodeBase64 as decodeBase642,
516
- encodeToUtf8String as encodeToUtf8String2,
517
- formatError as formatError2,
518
- parseWithErrorHandling as parseWithErrorHandling4,
519
- stringToJsonWithErrorHandling as stringToJsonWithErrorHandling2
356
+ decodeJwt,
357
+ jwtSignerFromJwt,
358
+ verifyJwt
520
359
  } from "@pagopa/io-wallet-utils";
521
- function decodeJwt(options) {
522
- const jwtParts = options.jwt.split(".");
523
- if (jwtParts.length !== 3) {
524
- throw new Oauth2JwtParseError2(
525
- formatError2(
526
- "Unable to decode because Jwt is not a valid!",
527
- options.errorMessagePrefix
528
- )
529
- );
530
- }
531
- let payloadJson;
532
- try {
533
- const payloadPart = jwtParts[1];
534
- if (payloadPart === void 0) {
535
- throw new Oauth2JwtParseError2(
536
- formatError2(
537
- "Unable to decode because Jwt is not a valid!",
538
- options.errorMessagePrefix
539
- )
540
- );
541
- }
542
- payloadJson = stringToJsonWithErrorHandling2(
543
- encodeToUtf8String2(decodeBase642(payloadPart)),
544
- formatError2(
545
- "Unable to parse jwt payload to JSON",
546
- options.errorMessagePrefix
547
- )
548
- );
549
- } catch (error) {
550
- throw new Oauth2JwtParseError2(
551
- formatError2(
552
- `Error parsing JWT. ${error instanceof Error ? error.message : ""}`,
553
- options.errorMessagePrefix
554
- )
555
- );
556
- }
557
- const signaturePart = jwtParts[2];
558
- if (signaturePart === void 0) {
559
- throw new Oauth2JwtParseError2(
560
- formatError2(
561
- "Unable to decode because Jwt is not a valid!",
562
- options.errorMessagePrefix
563
- )
564
- );
565
- }
566
- const { header } = decodeJwtHeader({
567
- errorMessagePrefix: options.errorMessagePrefix,
568
- headerSchema: options.headerSchema,
569
- jwt: options.jwt
570
- });
571
- const payload = parseWithErrorHandling4(
572
- options.payloadSchema ?? zJwtPayload,
573
- payloadJson,
574
- formatError2("Invalid JWT payload", options.errorMessagePrefix)
575
- );
576
- return {
577
- header,
578
- payload,
579
- signature: signaturePart
580
- };
581
- }
582
-
583
- // src/client-attestation/verify-wallet-attestation-jwt-base.ts
584
360
  async function verifyWalletAttestationBase(options, headerSchema, payloadSchema) {
585
361
  const { header, payload } = decodeJwt({
586
362
  errorMessagePrefix: "Error decoding wallet attestation JWT:",
@@ -601,27 +377,33 @@ async function verifyWalletAttestationBase(options, headerSchema, payloadSchema)
601
377
  }
602
378
 
603
379
  // src/client-attestation/v1.0/z-wallet-attestation.ts
604
- import { z as z6 } from "zod";
605
- var zWalletAttestationJwtHeaderV1_0 = z6.looseObject({
606
- ...zJwtHeader.shape,
380
+ import {
381
+ zJwk,
382
+ zJwtHeader as zJwtHeader2,
383
+ zJwtPayload as zJwtPayload2,
384
+ zTrustChain
385
+ } from "@pagopa/io-wallet-utils";
386
+ import { z as z3 } from "zod";
387
+ var zWalletAttestationJwtHeaderV1_0 = z3.looseObject({
388
+ ...zJwtHeader2.shape,
607
389
  trust_chain: zTrustChain,
608
390
  // REQUIRED in v1.0
609
- typ: z6.literal("oauth-client-attestation+jwt")
391
+ typ: z3.literal("oauth-client-attestation+jwt")
610
392
  });
611
- var zWalletAttestationJwtPayloadV1_0 = z6.looseObject({
612
- ...zJwtPayload.shape,
613
- aal: z6.string(),
614
- cnf: z6.object({
393
+ var zWalletAttestationJwtPayloadV1_0 = z3.looseObject({
394
+ ...zJwtPayload2.shape,
395
+ aal: z3.string(),
396
+ cnf: z3.object({
615
397
  jwk: zJwk
616
398
  }),
617
- exp: z6.number(),
618
- iat: z6.number(),
619
- iss: z6.string(),
620
- sub: z6.string(),
621
- wallet_link: z6.url().optional(),
622
- wallet_name: z6.string().optional()
399
+ exp: z3.number(),
400
+ iat: z3.number(),
401
+ iss: z3.string(),
402
+ sub: z3.string(),
403
+ wallet_link: z3.url().optional(),
404
+ wallet_name: z3.string().optional()
623
405
  });
624
- var zWalletAttestationJwtV1_0 = z6.string().min(1);
406
+ var zWalletAttestationJwtV1_0 = z3.string().min(1);
625
407
 
626
408
  // src/client-attestation/v1.0/verify-wallet-attestation-jwt.ts
627
409
  async function verifyWalletAttestationJwt(options) {
@@ -633,37 +415,44 @@ async function verifyWalletAttestationJwt(options) {
633
415
  }
634
416
 
635
417
  // src/client-attestation/v1.3/z-wallet-attestation.ts
636
- import { z as z7 } from "zod";
637
- var zWalletAttestationJwtHeaderV1_3 = z7.looseObject({
638
- ...zJwtHeader.shape,
639
- trust_chain: zTrustChain.optional(),
418
+ import {
419
+ zCertificateChain,
420
+ zJwk as zJwk2,
421
+ zJwtHeader as zJwtHeader3,
422
+ zJwtPayload as zJwtPayload3,
423
+ zTrustChain as zTrustChain2
424
+ } from "@pagopa/io-wallet-utils";
425
+ import { z as z4 } from "zod";
426
+ var zWalletAttestationJwtHeaderV1_3 = z4.looseObject({
427
+ ...zJwtHeader3.shape,
428
+ trust_chain: zTrustChain2.optional(),
640
429
  // OPTIONAL in v1.3
641
- typ: z7.literal("oauth-client-attestation+jwt"),
430
+ typ: z4.literal("oauth-client-attestation+jwt"),
642
431
  x5c: zCertificateChain
643
432
  // REQUIRED in v1.3
644
433
  });
645
- var zWalletAttestationJwtPayloadV1_3 = z7.looseObject({
646
- ...zJwtPayload.shape,
647
- cnf: z7.object({
648
- jwk: zJwk
434
+ var zWalletAttestationJwtPayloadV1_3 = z4.looseObject({
435
+ ...zJwtPayload3.shape,
436
+ cnf: z4.object({
437
+ jwk: zJwk2
649
438
  }),
650
- exp: z7.number(),
651
- iat: z7.number(),
652
- iss: z7.string(),
653
- nbf: z7.number().optional(),
439
+ exp: z4.number(),
440
+ iat: z4.number(),
441
+ iss: z4.string(),
442
+ nbf: z4.number().optional(),
654
443
  // NEW in v1.3
655
- status: z7.object({
656
- status_list: z7.object({
657
- idx: z7.number().int(),
658
- uri: z7.string()
444
+ status: z4.object({
445
+ status_list: z4.object({
446
+ idx: z4.number().int(),
447
+ uri: z4.string()
659
448
  })
660
449
  }).optional(),
661
450
  // NEW in v1.3 - status object for revocation
662
- sub: z7.string(),
663
- wallet_link: z7.url().optional(),
664
- wallet_name: z7.string().optional()
451
+ sub: z4.string(),
452
+ wallet_link: z4.url().optional(),
453
+ wallet_name: z4.string().optional()
665
454
  });
666
- var zWalletAttestationJwtV1_3 = z7.string().min(1);
455
+ var zWalletAttestationJwtV1_3 = z4.string().min(1);
667
456
 
668
457
  // src/client-attestation/v1.3/verify-wallet-attestation-jwt.ts
669
458
  async function verifyWalletAttestationJwt2(options) {
@@ -675,28 +464,35 @@ async function verifyWalletAttestationJwt2(options) {
675
464
  }
676
465
 
677
466
  // src/client-attestation/v1.4/z-wallet-attestation.ts
678
- import { z as z8 } from "zod";
679
- var zWalletAttestationJwtHeaderV1_4 = z8.looseObject({
680
- ...zJwtHeader.shape,
681
- kid: z8.string(),
682
- trust_chain: zTrustChain.optional(),
683
- typ: z8.literal("oauth-client-attestation+jwt"),
684
- x5c: zCertificateChain
467
+ import {
468
+ zCertificateChain as zCertificateChain2,
469
+ zJwk as zJwk3,
470
+ zJwtHeader as zJwtHeader4,
471
+ zJwtPayload as zJwtPayload4,
472
+ zTrustChain as zTrustChain3
473
+ } from "@pagopa/io-wallet-utils";
474
+ import { z as z5 } from "zod";
475
+ var zWalletAttestationJwtHeaderV1_4 = z5.looseObject({
476
+ ...zJwtHeader4.shape,
477
+ kid: z5.string(),
478
+ trust_chain: zTrustChain3.optional(),
479
+ typ: z5.literal("oauth-client-attestation+jwt"),
480
+ x5c: zCertificateChain2
685
481
  });
686
- var zWalletAttestationJwtPayloadV1_4 = z8.looseObject({
687
- ...zJwtPayload.shape,
688
- cnf: z8.object({
689
- jwk: zJwk
482
+ var zWalletAttestationJwtPayloadV1_4 = z5.looseObject({
483
+ ...zJwtPayload4.shape,
484
+ cnf: z5.object({
485
+ jwk: zJwk3
690
486
  }),
691
- exp: z8.number().int(),
692
- iat: z8.number().int(),
693
- iss: z8.string(),
694
- nbf: z8.number().optional(),
695
- sub: z8.string(),
696
- wallet_link: z8.url(),
697
- wallet_name: z8.string()
487
+ exp: z5.number().int(),
488
+ iat: z5.number().int(),
489
+ iss: z5.string(),
490
+ nbf: z5.number().optional(),
491
+ sub: z5.string(),
492
+ wallet_link: z5.url(),
493
+ wallet_name: z5.string()
698
494
  });
699
- var zWalletAttestationJwtV1_4 = z8.string().min(1);
495
+ var zWalletAttestationJwtV1_4 = z5.string().min(1);
700
496
 
701
497
  // src/client-attestation/v1.4/verify-wallet-attestation-jwt.ts
702
498
  async function verifyWalletAttestationJwt3(options) {
@@ -727,7 +523,7 @@ function extractClientAttestationJwtsFromHeaders(headers) {
727
523
  if (!walletAttestationHeader || !clientAttestationPopHeader) {
728
524
  return { valid: false };
729
525
  }
730
- if (!zCompactJwt2.safeParse(walletAttestationHeader).success || !zCompactJwt2.safeParse(clientAttestationPopHeader).success) {
526
+ if (!zCompactJwt.safeParse(walletAttestationHeader).success || !zCompactJwt.safeParse(clientAttestationPopHeader).success) {
731
527
  return { valid: false };
732
528
  }
733
529
  return {
@@ -740,14 +536,12 @@ function extractClientAttestationJwtsFromHeaders(headers) {
740
536
  // src/token-dpop/create-token-dpop.ts
741
537
  import {
742
538
  HashAlgorithm as HashAlgorithm2,
743
- zCompactJwt as zCompactJwt3
744
- } from "@openid4vc/oauth2";
745
- import {
746
539
  ValidationError as ValidationError2,
747
540
  dateToSeconds as dateToSeconds2,
748
541
  decodeUtf8String,
749
542
  encodeToBase64Url,
750
- parseWithErrorHandling as parseWithErrorHandling5
543
+ parseWithErrorHandling as parseWithErrorHandling3,
544
+ zCompactJwt as zCompactJwt2
751
545
  } from "@pagopa/io-wallet-utils";
752
546
  import { Base64 } from "js-base64";
753
547
 
@@ -760,20 +554,26 @@ var htuFromRequestUrl = (requestUrl) => {
760
554
  };
761
555
 
762
556
  // src/token-dpop/z-dpop.ts
763
- import { zHttpMethod } from "@pagopa/io-wallet-utils";
764
- import z9 from "zod";
765
- var zDpopJwtPayload = z9.looseObject({
766
- ...zJwtPayload.shape,
767
- ath: z9.optional(z9.string()),
557
+ import {
558
+ MAX_JTI_LENGTH as MAX_JTI_LENGTH2,
559
+ zHttpMethod,
560
+ zJwk as zJwk4,
561
+ zJwtHeader as zJwtHeader5,
562
+ zJwtPayload as zJwtPayload5
563
+ } from "@pagopa/io-wallet-utils";
564
+ import z6 from "zod";
565
+ var zDpopJwtPayload = z6.looseObject({
566
+ ...zJwtPayload5.shape,
567
+ ath: z6.optional(z6.string()),
768
568
  htm: zHttpMethod,
769
- htu: z9.url(),
770
- iat: z9.number().int().nonnegative(),
771
- jti: z9.string().max(MAX_JTI_LENGTH)
569
+ htu: z6.url(),
570
+ iat: z6.number().int().nonnegative(),
571
+ jti: z6.string().max(MAX_JTI_LENGTH2)
772
572
  });
773
- var zDpopJwtHeader = z9.looseObject({
774
- ...zJwtHeader.shape,
775
- jwk: zJwk,
776
- typ: z9.literal("dpop+jwt")
573
+ var zDpopJwtHeader = z6.looseObject({
574
+ ...zJwtHeader5.shape,
575
+ jwk: zJwk4,
576
+ typ: z6.literal("dpop+jwt")
777
577
  });
778
578
 
779
579
  // src/token-dpop/create-token-dpop.ts
@@ -794,12 +594,12 @@ async function createTokenDPoP(options) {
794
594
  "Error: neither a default jti nor a generateRandom callback have been provided"
795
595
  );
796
596
  }
797
- const header = parseWithErrorHandling5(zDpopJwtHeader, {
597
+ const header = parseWithErrorHandling3(zDpopJwtHeader, {
798
598
  alg: options.signer.alg,
799
599
  jwk: options.signer.publicJwk,
800
600
  typ: "dpop+jwt"
801
601
  });
802
- const payload = parseWithErrorHandling5(zDpopJwtPayload, {
602
+ const payload = parseWithErrorHandling3(zDpopJwtPayload, {
803
603
  ath,
804
604
  htm: options.tokenRequest.method,
805
605
  htu: htuFromRequestUrl(options.tokenRequest.url),
@@ -824,17 +624,17 @@ function extractDpopJwtFromHeaders(headers) {
824
624
  if (!dpopJwt) {
825
625
  return { valid: true };
826
626
  }
827
- if (!zCompactJwt3.safeParse(dpopJwt).success) {
627
+ if (!zCompactJwt2.safeParse(dpopJwt).success) {
828
628
  return { valid: false };
829
629
  }
830
630
  return { dpopJwt, valid: true };
831
631
  }
832
632
 
833
633
  // src/access-token/z-grant-type.ts
834
- import { z as z10 } from "zod";
835
- var zAuthorizationCodeGrantIdentifier = z10.literal("authorization_code");
634
+ import { z as z7 } from "zod";
635
+ var zAuthorizationCodeGrantIdentifier = z7.literal("authorization_code");
836
636
  var authorizationCodeGrantIdentifier = zAuthorizationCodeGrantIdentifier.value;
837
- var zRefreshTokenGrantIdentifier = z10.literal("refresh_token");
637
+ var zRefreshTokenGrantIdentifier = z7.literal("refresh_token");
838
638
  var refreshTokenGrantIdentifier = zRefreshTokenGrantIdentifier.value;
839
639
 
840
640
  // src/access-token/parse-token-request.ts
@@ -915,42 +715,48 @@ function parseSecurityHeaders(headers) {
915
715
  import {
916
716
  HashAlgorithm as HashAlgorithm3,
917
717
  calculateJwkThumbprint as calculateJwkThumbprint2
918
- } from "@openid4vc/oauth2";
718
+ } from "@pagopa/io-wallet-utils";
919
719
 
920
720
  // src/client-attestation/client-attestation-pop.ts
921
- import { verifyJwt as verifyJwt2 } from "@openid4vc/oauth2";
922
721
  import {
923
722
  ItWalletSpecsVersion as ItWalletSpecsVersion2,
924
723
  addSecondsToDate as addSecondsToDate2,
925
724
  dateToSeconds as dateToSeconds3,
725
+ decodeJwt as decodeJwt2,
926
726
  encodeToBase64Url as encodeToBase64Url2,
927
- parseWithErrorHandling as parseWithErrorHandling6
727
+ parseWithErrorHandling as parseWithErrorHandling4,
728
+ verifyJwt as verifyJwt2
928
729
  } from "@pagopa/io-wallet-utils";
929
730
 
930
731
  // src/client-attestation/z-client-attestation-pop.ts
931
- import z11 from "zod";
732
+ import {
733
+ MAX_JTI_LENGTH as MAX_JTI_LENGTH3,
734
+ zJwtHeader as zJwtHeader6,
735
+ zJwtPayload as zJwtPayload6
736
+ } from "@pagopa/io-wallet-utils";
737
+ import z8 from "zod";
932
738
  var IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES = [
933
739
  "ES256",
934
740
  "ES384",
935
741
  "ES512"
936
742
  ];
937
- var zItWalletClientAttestationPopJwtAlg = z11.enum(
743
+ var zItWalletClientAttestationPopJwtAlg = z8.enum(
938
744
  IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES
939
745
  );
940
- var zItWalletClientAttestationPopJwtPayload = z11.looseObject({
941
- ...zJwtPayload.shape,
942
- aud: z11.string(),
943
- exp: z11.number().int().optional(),
944
- iat: z11.number().int(),
945
- iss: z11.string(),
946
- jti: z11.string().max(MAX_JTI_LENGTH),
947
- nonce: z11.string().optional()
746
+ var zItWalletClientAttestationPopJwtPayload = z8.looseObject({
747
+ ...zJwtPayload6.shape,
748
+ aud: z8.string(),
749
+ exp: z8.number().int().optional(),
750
+ iat: z8.number().int(),
751
+ iss: z8.string(),
752
+ jti: z8.string().max(MAX_JTI_LENGTH3),
753
+ nonce: z8.string().optional()
948
754
  });
949
- var zItWalletClientAttestationPopJwtTyp = z11.literal(
755
+ var zItWalletClientAttestationPopJwtTyp = z8.literal(
950
756
  "oauth-client-attestation-pop+jwt"
951
757
  );
952
- var zItWalletClientAttestationPopJwtHeader = z11.looseObject({
953
- ...zJwtHeader.shape,
758
+ var zItWalletClientAttestationPopJwtHeader = z8.looseObject({
759
+ ...zJwtHeader6.shape,
954
760
  typ: zItWalletClientAttestationPopJwtTyp
955
761
  });
956
762
 
@@ -964,7 +770,7 @@ function assertSupportedClientAttestationPopAlg(alg) {
964
770
  }
965
771
  async function verifyClientAttestationPopJwt(options) {
966
772
  try {
967
- const { header, payload } = decodeJwt({
773
+ const { header, payload } = decodeJwt2({
968
774
  errorMessagePrefix: "Error decoding client attestation PoP JWT:",
969
775
  headerSchema: zItWalletClientAttestationPopJwtHeader,
970
776
  jwt: options.clientAttestationPopJwt,
@@ -1000,7 +806,7 @@ async function verifyClientAttestationPopJwt(options) {
1000
806
  }
1001
807
  async function createClientAttestationPopJwt(options) {
1002
808
  try {
1003
- const clientAttestation = decodeJwt({
809
+ const clientAttestation = decodeJwt2({
1004
810
  errorMessagePrefix: "Error decoding client attestation JWT:",
1005
811
  jwt: options.clientAttestation
1006
812
  });
@@ -1033,7 +839,7 @@ async function createClientAttestationPopJwt(options) {
1033
839
  "Error: neither a default jti nor a generateRandom callback have been provided"
1034
840
  );
1035
841
  }
1036
- const payload = parseWithErrorHandling6(
842
+ const payload = parseWithErrorHandling4(
1037
843
  zItWalletClientAttestationPopJwtPayload,
1038
844
  {
1039
845
  aud: options.authorizationServer,
@@ -1106,9 +912,10 @@ async function verifyClientAttestation(options) {
1106
912
 
1107
913
  // src/pkce.ts
1108
914
  import {
1109
- HashAlgorithm as HashAlgorithm4
1110
- } from "@openid4vc/oauth2";
1111
- import { decodeUtf8String as decodeUtf8String2, encodeToBase64Url as encodeToBase64Url3 } from "@pagopa/io-wallet-utils";
915
+ HashAlgorithm as HashAlgorithm4,
916
+ decodeUtf8String as decodeUtf8String2,
917
+ encodeToBase64Url as encodeToBase64Url3
918
+ } from "@pagopa/io-wallet-utils";
1112
919
  var PkceCodeChallengeMethod = {
1113
920
  Plain: "plain",
1114
921
  S256: "S256"
@@ -1170,15 +977,14 @@ async function calculateCodeChallenge(options) {
1170
977
  import {
1171
978
  HashAlgorithm as HashAlgorithm5,
1172
979
  calculateJwkThumbprint as calculateJwkThumbprint3,
1173
- verifyJwt as verifyJwt3
1174
- } from "@openid4vc/oauth2";
1175
- import {
980
+ decodeJwt as decodeJwt3,
1176
981
  decodeUtf8String as decodeUtf8String3,
1177
982
  encodeToBase64Url as encodeToBase64Url4,
983
+ verifyJwt as verifyJwt3,
1178
984
  verifyJwtIatOrThrow
1179
985
  } from "@pagopa/io-wallet-utils";
1180
986
  async function verifyTokenDPoP(options) {
1181
- const { header, payload } = decodeJwt({
987
+ const { header, payload } = decodeJwt3({
1182
988
  errorMessagePrefix: "Error decoding access token DPoP JWT:",
1183
989
  headerSchema: zDpopJwtHeader,
1184
990
  jwt: options.dpopJwt,
@@ -1328,33 +1134,34 @@ import {
1328
1134
  } from "@pagopa/io-wallet-utils";
1329
1135
 
1330
1136
  // src/authorization-request/z-authorization-request.ts
1331
- import z12 from "zod";
1332
- var zOpenidCredentialAuthorizationDetails = z12.object({
1333
- credential_configuration_id: z12.string(),
1334
- type: z12.literal("openid_credential")
1137
+ import { MAX_JTI_LENGTH as MAX_JTI_LENGTH4 } from "@pagopa/io-wallet-utils";
1138
+ import z9 from "zod";
1139
+ var zOpenidCredentialAuthorizationDetails = z9.object({
1140
+ credential_configuration_id: z9.string(),
1141
+ type: z9.literal("openid_credential")
1335
1142
  });
1336
- var zItL2DocumentProofAuthorizationDetails = z12.object({
1337
- challenge_method: z12.literal("mrtd+ias"),
1338
- challenge_redirect_uri: z12.url(),
1339
- idphinting: z12.url(),
1340
- type: z12.literal("it_l2+document_proof")
1143
+ var zItL2DocumentProofAuthorizationDetails = z9.object({
1144
+ challenge_method: z9.literal("mrtd+ias"),
1145
+ challenge_redirect_uri: z9.url(),
1146
+ idphinting: z9.url(),
1147
+ type: z9.literal("it_l2+document_proof")
1341
1148
  });
1342
- var zAuthorizationRequestBaseObject = z12.looseObject({
1343
- authorization_details: z12.array(
1344
- z12.discriminatedUnion("type", [
1149
+ var zAuthorizationRequestBaseObject = z9.looseObject({
1150
+ authorization_details: z9.array(
1151
+ z9.discriminatedUnion("type", [
1345
1152
  zOpenidCredentialAuthorizationDetails,
1346
1153
  zItL2DocumentProofAuthorizationDetails
1347
1154
  ])
1348
1155
  ).optional(),
1349
- client_id: z12.string(),
1350
- code_challenge: z12.string(),
1351
- code_challenge_method: z12.string(),
1352
- issuer_state: z12.optional(z12.string()),
1353
- jti: z12.string().max(MAX_JTI_LENGTH),
1354
- redirect_uri: z12.url(),
1355
- response_type: z12.string(),
1356
- scope: z12.string().optional(),
1357
- state: z12.string()
1156
+ client_id: z9.string(),
1157
+ code_challenge: z9.string(),
1158
+ code_challenge_method: z9.string(),
1159
+ issuer_state: z9.optional(z9.string()),
1160
+ jti: z9.string().max(MAX_JTI_LENGTH4),
1161
+ redirect_uri: z9.url(),
1162
+ response_type: z9.string(),
1163
+ scope: z9.string().optional(),
1164
+ state: z9.string()
1358
1165
  });
1359
1166
  var zAuthorizationRequestBase = zAuthorizationRequestBaseObject.refine(
1360
1167
  (data) => data.authorization_details !== void 0 || data.scope !== void 0,
@@ -1364,7 +1171,7 @@ var zAuthorizationRequestBase = zAuthorizationRequestBaseObject.refine(
1364
1171
  }
1365
1172
  );
1366
1173
  var zAuthorizationRequestV1_0 = zAuthorizationRequestBaseObject.extend({
1367
- response_mode: z12.string()
1174
+ response_mode: z9.string()
1368
1175
  }).refine(
1369
1176
  (data) => data.authorization_details !== void 0 || data.scope !== void 0,
1370
1177
  {
@@ -1373,25 +1180,25 @@ var zAuthorizationRequestV1_0 = zAuthorizationRequestBaseObject.extend({
1373
1180
  }
1374
1181
  );
1375
1182
  var zAuthorizationRequestV1_3 = zAuthorizationRequestBase;
1376
- var zPushedAuthorizationRequestSigned = z12.looseObject({
1377
- client_id: z12.string().describe(
1183
+ var zPushedAuthorizationRequestSigned = z9.looseObject({
1184
+ client_id: z9.string().describe(
1378
1185
  "MUST be set to the thumbprint of the jwk value in the cnf parameter inside the Wallet Attestation."
1379
1186
  ),
1380
- pkceCodeVerifier: z12.string().describe(
1187
+ pkceCodeVerifier: z9.string().describe(
1381
1188
  "Code verifier for PKCE. If not provided in CreatePushedAuthorizationRequestOptions, SDK will generate one."
1382
1189
  ),
1383
- request: z12.string().describe(
1190
+ request: z9.string().describe(
1384
1191
  "It MUST be a signed JWT. The private key corresponding to the public one in the cnf parameter inside the Wallet Attestation MUST be used for signing the Request Object."
1385
1192
  )
1386
1193
  });
1387
- var zPushedAuthorizationRequestUnsignedBase = (authorizationRequest) => z12.looseObject({
1194
+ var zPushedAuthorizationRequestUnsignedBase = (authorizationRequest) => z9.looseObject({
1388
1195
  authorizationRequest: authorizationRequest.describe(
1389
1196
  "The authorization request parameters as a plain object. Used when require_signed_request_object is false."
1390
1197
  ),
1391
- client_id: z12.string().describe(
1198
+ client_id: z9.string().describe(
1392
1199
  "Thumbprint of the jwk value in the cnf parameter inside Wallet Attestation."
1393
1200
  ),
1394
- pkceCodeVerifier: z12.string().describe(
1201
+ pkceCodeVerifier: z9.string().describe(
1395
1202
  "PKCE code verifier. Auto-generated if not provided in options."
1396
1203
  )
1397
1204
  });
@@ -1403,9 +1210,9 @@ function isPushedAuthorizationRequestSigned(par) {
1403
1210
  function isPushedAuthorizationRequestUnsigned(par) {
1404
1211
  return "authorizationRequest" in par;
1405
1212
  }
1406
- var zPushedAuthorizationResponse = z12.looseObject({
1407
- expires_in: z12.number().int(),
1408
- request_uri: z12.string()
1213
+ var zPushedAuthorizationResponse = z9.looseObject({
1214
+ expires_in: z9.number().int(),
1215
+ request_uri: z9.string()
1409
1216
  });
1410
1217
 
1411
1218
  // src/authorization-request/create-authorization-request.ts
@@ -1581,11 +1388,12 @@ function parseAuthorizationRequest(options) {
1581
1388
  // src/authorization-request/parse-pushed-authorization-request.ts
1582
1389
  import {
1583
1390
  ItWalletSpecsVersion as ItWalletSpecsVersion4,
1391
+ decodeJwt as decodeJwt4,
1584
1392
  dispatchByVersion as dispatchByVersion2,
1585
1393
  formatZodError as formatZodError2,
1586
- parseWithErrorHandling as parseWithErrorHandling7
1394
+ parseWithErrorHandling as parseWithErrorHandling5
1587
1395
  } from "@pagopa/io-wallet-utils";
1588
- import z14 from "zod";
1396
+ import z11 from "zod";
1589
1397
 
1590
1398
  // src/jar/fetch-jar-request-object.ts
1591
1399
  import {
@@ -1651,25 +1459,26 @@ async function parseJarRequest(options) {
1651
1459
  }
1652
1460
 
1653
1461
  // src/jar/z-jar.ts
1654
- import z13 from "zod";
1655
- var zJarAuthorizationRequest = z13.looseObject({
1656
- client_id: z13.optional(z13.string()),
1657
- request: z13.optional(z13.string()),
1658
- request_uri: z13.url().optional()
1462
+ import { zJwtHeader as zJwtHeader7, zJwtPayload as zJwtPayload7 } from "@pagopa/io-wallet-utils";
1463
+ import z10 from "zod";
1464
+ var zJarAuthorizationRequest = z10.looseObject({
1465
+ client_id: z10.optional(z10.string()),
1466
+ request: z10.optional(z10.string()),
1467
+ request_uri: z10.url().optional()
1659
1468
  });
1660
- var zJarRequestObjectPayload = z13.looseObject({
1661
- ...zJwtPayload.shape,
1662
- client_id: z13.string()
1469
+ var zJarRequestObjectPayload = z10.looseObject({
1470
+ ...zJwtPayload7.shape,
1471
+ client_id: z10.string()
1663
1472
  });
1664
- var zSignedAuthorizationRequestJwtHeaderTyp = z13.literal(
1473
+ var zSignedAuthorizationRequestJwtHeaderTyp = z10.literal(
1665
1474
  "oauth-authz-req+jwt"
1666
1475
  );
1667
- var zJarRequestObjectHeader = z13.looseObject({
1668
- ...zJwtHeader.shape,
1476
+ var zJarRequestObjectHeader = z10.looseObject({
1477
+ ...zJwtHeader7.shape,
1669
1478
  typ: zSignedAuthorizationRequestJwtHeaderTyp
1670
1479
  });
1671
1480
  var signedAuthorizationRequestJwtHeaderTyp = zSignedAuthorizationRequestJwtHeaderTyp.value;
1672
- var zJwtAuthorizationRequestJwtHeaderTyp = z13.literal("jwt");
1481
+ var zJwtAuthorizationRequestJwtHeaderTyp = z10.literal("jwt");
1673
1482
  var jwtAuthorizationRequestJwtHeaderTyp = zJwtAuthorizationRequestJwtHeaderTyp.value;
1674
1483
 
1675
1484
  // src/authorization-request/parse-pushed-authorization-request.ts
@@ -1677,8 +1486,8 @@ async function parsePushedAuthorizationRequest(options) {
1677
1486
  const authorizationRequestSchema = getAuthorizationRequestSchema(
1678
1487
  options.config
1679
1488
  );
1680
- const parsed = parseWithErrorHandling7(
1681
- z14.union([authorizationRequestSchema, zJarAuthorizationRequest]),
1489
+ const parsed = parseWithErrorHandling5(
1490
+ z11.union([authorizationRequestSchema, zJarAuthorizationRequest]),
1682
1491
  options.authorizationRequest,
1683
1492
  "Invalid authorization request. Could not parse authorization request or jar."
1684
1493
  );
@@ -1689,7 +1498,7 @@ async function parsePushedAuthorizationRequest(options) {
1689
1498
  callbacks: options.callbacks,
1690
1499
  jarRequestParams: parsed
1691
1500
  });
1692
- const jwt = decodeJwt({
1501
+ const jwt = decodeJwt4({
1693
1502
  errorMessagePrefix: "Error decoding pushed authorization request JWT:",
1694
1503
  jwt: parsedJar.authorizationRequestJwt
1695
1504
  });
@@ -1779,13 +1588,17 @@ async function verifyAuthorizationRequestDpop(options, request, callbacks, now)
1779
1588
  };
1780
1589
  }
1781
1590
 
1591
+ // src/authorization-request/verify-pushed-authorization-request.ts
1592
+ import { decodeJwt as decodeJwt6 } from "@pagopa/io-wallet-utils";
1593
+
1782
1594
  // src/jar/verify-jar-request.ts
1783
1595
  import {
1596
+ decodeJwt as decodeJwt5,
1597
+ parseWithErrorHandling as parseWithErrorHandling6,
1784
1598
  verifyJwt as verifyJwt4,
1785
1599
  zCompactJwe,
1786
- zCompactJwt as zCompactJwt4
1787
- } from "@openid4vc/oauth2";
1788
- import { parseWithErrorHandling as parseWithErrorHandling8 } from "@pagopa/io-wallet-utils";
1600
+ zCompactJwt as zCompactJwt3
1601
+ } from "@pagopa/io-wallet-utils";
1789
1602
  async function verifyJarRequest(options) {
1790
1603
  const { authorizationRequestJwt, callbacks, jarRequestParams, jwtSigner } = options;
1791
1604
  const requestObjectIsEncrypted = zCompactJwe.safeParse(
@@ -1794,7 +1607,7 @@ async function verifyJarRequest(options) {
1794
1607
  if (requestObjectIsEncrypted) {
1795
1608
  throw new Oauth2Error("Encrypted JWE request objects are not supported.");
1796
1609
  }
1797
- const requestIsSigned = zCompactJwt4.safeParse(
1610
+ const requestIsSigned = zCompactJwt3.safeParse(
1798
1611
  authorizationRequestJwt
1799
1612
  ).success;
1800
1613
  if (!requestIsSigned) {
@@ -1847,11 +1660,11 @@ async function verifyJarRequest(options) {
1847
1660
  }
1848
1661
  async function verifyJarRequestObject(options) {
1849
1662
  const { authorizationRequestJwt, callbacks, jwtSigner } = options;
1850
- const jwt = decodeJwt({
1663
+ const jwt = decodeJwt5({
1851
1664
  errorMessagePrefix: "Error decoding JAR authorization request JWT:",
1852
1665
  jwt: authorizationRequestJwt
1853
1666
  });
1854
- const authorizationRequestPayload = parseWithErrorHandling8(
1667
+ const authorizationRequestPayload = parseWithErrorHandling6(
1855
1668
  zJarRequestObjectPayload,
1856
1669
  jwt.payload
1857
1670
  );
@@ -1888,7 +1701,7 @@ async function verifyPushedAuthorizationRequest(options) {
1888
1701
  let jar;
1889
1702
  if (options.authorizationRequestJwt) {
1890
1703
  if (requireSigned) {
1891
- const decoded = decodeJwt({
1704
+ const decoded = decodeJwt6({
1892
1705
  errorMessagePrefix: "Error decoding pushed authorization request JWT:",
1893
1706
  jwt: options.authorizationRequestJwt.jwt
1894
1707
  });
@@ -1980,14 +1793,15 @@ function clientAuthenticationWalletAttestationJwt(options) {
1980
1793
  import {
1981
1794
  ValidationError as ValidationError4,
1982
1795
  addSecondsToDate as addSecondsToDate4,
1983
- dateToSeconds as dateToSeconds5
1796
+ dateToSeconds as dateToSeconds5,
1797
+ decodeJwt as decodeJwt7
1984
1798
  } from "@pagopa/io-wallet-utils";
1985
1799
 
1986
1800
  // src/client-attestation/jwk-thumbprint.ts
1987
1801
  import {
1988
1802
  HashAlgorithm as HashAlgorithm6,
1989
1803
  calculateJwkThumbprint as calculateJwkThumbprint4
1990
- } from "@openid4vc/oauth2";
1804
+ } from "@pagopa/io-wallet-utils";
1991
1805
  var SUPPORTED_KTY = ["RSA", "EC"];
1992
1806
  var calculateDpopJwkThumbprint = (options) => {
1993
1807
  if (!SUPPORTED_KTY.includes(
@@ -2031,7 +1845,7 @@ var createWalletAttestationJwt = async (options) => {
2031
1845
  header,
2032
1846
  payload
2033
1847
  });
2034
- decodeJwt({
1848
+ decodeJwt7({
2035
1849
  errorMessagePrefix: "Error decoding wallet attestation JWT:",
2036
1850
  headerSchema: zWalletAttestationJwtHeaderV1_0,
2037
1851
  jwt: result.jwt,
@@ -2052,7 +1866,8 @@ var createWalletAttestationJwt = async (options) => {
2052
1866
  import {
2053
1867
  ValidationError as ValidationError5,
2054
1868
  addSecondsToDate as addSecondsToDate5,
2055
- dateToSeconds as dateToSeconds6
1869
+ dateToSeconds as dateToSeconds6,
1870
+ decodeJwt as decodeJwt8
2056
1871
  } from "@pagopa/io-wallet-utils";
2057
1872
  var createWalletAttestationJwt2 = async (options) => {
2058
1873
  try {
@@ -2088,7 +1903,7 @@ var createWalletAttestationJwt2 = async (options) => {
2088
1903
  header,
2089
1904
  payload
2090
1905
  });
2091
- decodeJwt({
1906
+ decodeJwt8({
2092
1907
  errorMessagePrefix: "Error decoding wallet attestation JWT:",
2093
1908
  headerSchema: zWalletAttestationJwtHeaderV1_3,
2094
1909
  jwt: result.jwt,
@@ -2109,7 +1924,8 @@ var createWalletAttestationJwt2 = async (options) => {
2109
1924
  import {
2110
1925
  ValidationError as ValidationError6,
2111
1926
  addSecondsToDate as addSecondsToDate6,
2112
- dateToSeconds as dateToSeconds7
1927
+ dateToSeconds as dateToSeconds7,
1928
+ decodeJwt as decodeJwt9
2113
1929
  } from "@pagopa/io-wallet-utils";
2114
1930
  var DEFAULT_EXPIRATION_SECONDS = 3600;
2115
1931
  var MAX_EXPIRATION_SECONDS = 86400;
@@ -2151,7 +1967,7 @@ var createWalletAttestationJwt3 = async (options) => {
2151
1967
  header,
2152
1968
  payload
2153
1969
  });
2154
- decodeJwt({
1970
+ decodeJwt9({
2155
1971
  errorMessagePrefix: "Error decoding wallet attestation JWT:",
2156
1972
  headerSchema: zWalletAttestationJwtHeaderV1_4,
2157
1973
  jwt: result.jwt,
@@ -2168,17 +1984,11 @@ var createWalletAttestationJwt3 = async (options) => {
2168
1984
  }
2169
1985
  };
2170
1986
 
2171
- // src/common/jwt/z-jwe.ts
2172
- import { z as z15 } from "zod";
2173
- var zCompactJwe2 = z15.string().regex(
2174
- /^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/,
2175
- {
2176
- message: "Not a valid compact jwe"
2177
- }
2178
- );
2179
-
2180
1987
  // src/jar/create-jar-request.ts
2181
- import { addSecondsToDate as addSecondsToDate7, dateToSeconds as dateToSeconds8 } from "@pagopa/io-wallet-utils";
1988
+ import {
1989
+ addSecondsToDate as addSecondsToDate7,
1990
+ dateToSeconds as dateToSeconds8
1991
+ } from "@pagopa/io-wallet-utils";
2182
1992
  async function createJarRequest(options) {
2183
1993
  const {
2184
1994
  authorizationRequestHeader,
@@ -2225,6 +2035,7 @@ async function createJarRequest(options) {
2225
2035
  }
2226
2036
 
2227
2037
  // src/jarm-form-post-jwt.ts
2038
+ import { decodeJwt as decodeJwt10 } from "@pagopa/io-wallet-utils";
2228
2039
  var getJwtFromFormPost = async (options) => {
2229
2040
  const inputRegex = /<input[^<>]*>/gi;
2230
2041
  const nameRegex = /name="response"/gi;
@@ -2239,7 +2050,7 @@ var getJwtFromFormPost = async (options) => {
2239
2050
  const responseJwt = matchValue[1];
2240
2051
  if (responseJwt) {
2241
2052
  const jwt = responseJwt.replace(lineExpressionRegex, "");
2242
- const decodedJwt = decodeJwt({
2053
+ const decodedJwt = decodeJwt10({
2243
2054
  errorMessagePrefix: "Error decoding JARM form post JWT:",
2244
2055
  jwt,
2245
2056
  payloadSchema: options.schema
@@ -2261,73 +2072,76 @@ var getJwtFromFormPost = async (options) => {
2261
2072
  };
2262
2073
 
2263
2074
  // src/mrtd-pop/create-mrtd-validation-jwt.ts
2264
- import { dateToSeconds as dateToSeconds9, parseWithErrorHandling as parseWithErrorHandling9 } from "@pagopa/io-wallet-utils";
2075
+ import {
2076
+ dateToSeconds as dateToSeconds9,
2077
+ parseWithErrorHandling as parseWithErrorHandling7
2078
+ } from "@pagopa/io-wallet-utils";
2265
2079
 
2266
2080
  // src/mrtd-pop/z-mrtd-pop.ts
2267
- import z16 from "zod";
2268
- var zMrtdChallengeJwtHeader = z16.looseObject({
2269
- alg: z16.string(),
2270
- kid: z16.string(),
2271
- typ: z16.literal("mrtd-ias+jwt")
2081
+ import z12 from "zod";
2082
+ var zMrtdChallengeJwtHeader = z12.looseObject({
2083
+ alg: z12.string(),
2084
+ kid: z12.string(),
2085
+ typ: z12.literal("mrtd-ias+jwt")
2272
2086
  });
2273
- var zMrtdChallengeJwtPayload = z16.looseObject({
2274
- aud: z16.string(),
2275
- exp: z16.number(),
2276
- htm: z16.literal("POST"),
2277
- htu: z16.url(),
2278
- iat: z16.number(),
2279
- iss: z16.string(),
2280
- mrtd_auth_session: z16.string(),
2281
- mrtd_pop_jwt_nonce: z16.string(),
2282
- state: z16.string(),
2283
- status: z16.literal("require_interaction"),
2284
- type: z16.literal("mrtd+ias")
2087
+ var zMrtdChallengeJwtPayload = z12.looseObject({
2088
+ aud: z12.string(),
2089
+ exp: z12.number(),
2090
+ htm: z12.literal("POST"),
2091
+ htu: z12.url(),
2092
+ iat: z12.number(),
2093
+ iss: z12.string(),
2094
+ mrtd_auth_session: z12.string(),
2095
+ mrtd_pop_jwt_nonce: z12.string(),
2096
+ state: z12.string(),
2097
+ status: z12.literal("require_interaction"),
2098
+ type: z12.literal("mrtd+ias")
2285
2099
  });
2286
- var zMrtdPopInitResponseJwtHeader = z16.looseObject({
2287
- alg: z16.string(),
2288
- kid: z16.string(),
2289
- typ: z16.literal("mrtd-ias-pop+jwt")
2100
+ var zMrtdPopInitResponseJwtHeader = z12.looseObject({
2101
+ alg: z12.string(),
2102
+ kid: z12.string(),
2103
+ typ: z12.literal("mrtd-ias-pop+jwt")
2290
2104
  });
2291
- var zMrtdPopInitResponseJwtPayload = z16.looseObject({
2292
- aud: z16.string(),
2293
- challenge: z16.string(),
2294
- exp: z16.number(),
2295
- htm: z16.literal("POST"),
2296
- htu: z16.url(),
2297
- iat: z16.number(),
2298
- iss: z16.string(),
2299
- mrtd_pop_nonce: z16.string(),
2300
- mrz: z16.string().optional()
2105
+ var zMrtdPopInitResponseJwtPayload = z12.looseObject({
2106
+ aud: z12.string(),
2107
+ challenge: z12.string(),
2108
+ exp: z12.number(),
2109
+ htm: z12.literal("POST"),
2110
+ htu: z12.url(),
2111
+ iat: z12.number(),
2112
+ iss: z12.string(),
2113
+ mrtd_pop_nonce: z12.string(),
2114
+ mrz: z12.string().optional()
2301
2115
  });
2302
- var zMrtdData = z16.looseObject({
2303
- dg1: z16.string(),
2304
- dg11: z16.string(),
2305
- sod_mrtd: z16.string()
2116
+ var zMrtdData = z12.looseObject({
2117
+ dg1: z12.string(),
2118
+ dg11: z12.string(),
2119
+ sod_mrtd: z12.string()
2306
2120
  });
2307
- var zIasData = z16.looseObject({
2308
- challenge_signed: z16.string(),
2309
- ias_pk: z16.string(),
2310
- sod_ias: z16.string()
2121
+ var zIasData = z12.looseObject({
2122
+ challenge_signed: z12.string(),
2123
+ ias_pk: z12.string(),
2124
+ sod_ias: z12.string()
2311
2125
  });
2312
- var zMrtdValidationJwtHeader = z16.looseObject({
2313
- alg: z16.string(),
2314
- kid: z16.string(),
2315
- typ: z16.literal("mrtd-ias+jwt")
2126
+ var zMrtdValidationJwtHeader = z12.looseObject({
2127
+ alg: z12.string(),
2128
+ kid: z12.string(),
2129
+ typ: z12.literal("mrtd-ias+jwt")
2316
2130
  });
2317
- var zMrtdValidationJwtPayload = z16.looseObject({
2318
- aud: z16.string(),
2319
- document_type: z16.literal("cie"),
2320
- exp: z16.number(),
2131
+ var zMrtdValidationJwtPayload = z12.looseObject({
2132
+ aud: z12.string(),
2133
+ document_type: z12.literal("cie"),
2134
+ exp: z12.number(),
2321
2135
  ias: zIasData,
2322
- iat: z16.number(),
2323
- iss: z16.string(),
2136
+ iat: z12.number(),
2137
+ iss: z12.string(),
2324
2138
  mrtd: zMrtdData
2325
2139
  });
2326
- var zMrtdPopVerifyResponse = z16.looseObject({
2327
- mrtd_val_pop_nonce: z16.string(),
2328
- redirect_uri: z16.url(),
2329
- status: z16.literal("require_interaction"),
2330
- type: z16.literal("redirect_to_web")
2140
+ var zMrtdPopVerifyResponse = z12.looseObject({
2141
+ mrtd_val_pop_nonce: z12.string(),
2142
+ redirect_uri: z12.url(),
2143
+ status: z12.literal("require_interaction"),
2144
+ type: z12.literal("redirect_to_web")
2331
2145
  });
2332
2146
 
2333
2147
  // src/mrtd-pop/create-mrtd-validation-jwt.ts
@@ -2339,12 +2153,12 @@ async function createMrtdValidationJwt(options) {
2339
2153
  throw new MrtdPopError("Signer must have a publicJwk.kid property");
2340
2154
  }
2341
2155
  const iat = dateToSeconds9(options.issuedAt);
2342
- const header = parseWithErrorHandling9(zMrtdValidationJwtHeader, {
2156
+ const header = parseWithErrorHandling7(zMrtdValidationJwtHeader, {
2343
2157
  alg: options.signer.alg,
2344
2158
  kid,
2345
2159
  typ: "mrtd-ias+jwt"
2346
2160
  });
2347
- const payload = parseWithErrorHandling9(zMrtdValidationJwtPayload, {
2161
+ const payload = parseWithErrorHandling7(zMrtdValidationJwtPayload, {
2348
2162
  aud: options.audience,
2349
2163
  document_type: "cie",
2350
2164
  exp: iat + JWT_EXPIRY_SECONDS2,
@@ -2377,17 +2191,16 @@ async function createMrtdValidationJwt(options) {
2377
2191
  }
2378
2192
 
2379
2193
  // src/mrtd-pop/fetch-mrtd-pop-init.ts
2380
- import {
2381
- jwtSignerFromJwt as jwtSignerFromJwt2,
2382
- verifyJwt as verifyJwt5
2383
- } from "@openid4vc/oauth2";
2384
2194
  import {
2385
2195
  CONTENT_TYPES as CONTENT_TYPES3,
2386
2196
  HEADERS as HEADERS3,
2387
2197
  UnexpectedStatusCodeError as UnexpectedStatusCodeError4,
2388
2198
  ValidationError as ValidationError7,
2389
2199
  createFetcher as createFetcher4,
2390
- hasStatusOrThrow as hasStatusOrThrow4
2200
+ decodeJwt as decodeJwt11,
2201
+ hasStatusOrThrow as hasStatusOrThrow4,
2202
+ jwtSignerFromJwt as jwtSignerFromJwt2,
2203
+ verifyJwt as verifyJwt5
2391
2204
  } from "@pagopa/io-wallet-utils";
2392
2205
  async function fetchMrtdPopInit(options) {
2393
2206
  try {
@@ -2406,7 +2219,7 @@ async function fetchMrtdPopInit(options) {
2406
2219
  });
2407
2220
  await hasStatusOrThrow4(202, UnexpectedStatusCodeError4)(response);
2408
2221
  const responseJwt = await response.text();
2409
- const jwt = decodeJwt({
2222
+ const jwt = decodeJwt11({
2410
2223
  errorMessagePrefix: "Error decoding MRTD PoP init response JWT:",
2411
2224
  headerSchema: zMrtdPopInitResponseJwtHeader,
2412
2225
  jwt: responseJwt,
@@ -2445,7 +2258,7 @@ import {
2445
2258
  ValidationError as ValidationError8,
2446
2259
  createFetcher as createFetcher5,
2447
2260
  hasStatusOrThrow as hasStatusOrThrow5,
2448
- parseWithErrorHandling as parseWithErrorHandling10
2261
+ parseWithErrorHandling as parseWithErrorHandling8
2449
2262
  } from "@pagopa/io-wallet-utils";
2450
2263
  async function fetchMrtdPopVerify(options) {
2451
2264
  try {
@@ -2464,7 +2277,7 @@ async function fetchMrtdPopVerify(options) {
2464
2277
  method: "POST"
2465
2278
  });
2466
2279
  await hasStatusOrThrow5(202, UnexpectedStatusCodeError5)(response);
2467
- const parsed = parseWithErrorHandling10(
2280
+ const parsed = parseWithErrorHandling8(
2468
2281
  zMrtdPopVerifyResponse,
2469
2282
  await response.json(),
2470
2283
  "Failed to parse MRTD PoP verify response"
@@ -2484,7 +2297,7 @@ async function fetchMrtdPopVerify(options) {
2484
2297
  }
2485
2298
 
2486
2299
  // src/mrtd-pop/parse-mrtd-challenge.ts
2487
- import { zCompactJwt as zCompactJwt5 } from "@openid4vc/oauth2";
2300
+ import { decodeJwt as decodeJwt12, zCompactJwt as zCompactJwt4 } from "@pagopa/io-wallet-utils";
2488
2301
  function parseMrtdChallenge(options) {
2489
2302
  const url = new URL(options.redirectUrl);
2490
2303
  const challengeJwt = url.searchParams.get("challenge_info");
@@ -2493,12 +2306,12 @@ function parseMrtdChallenge(options) {
2493
2306
  "Missing 'challenge_info' query parameter in redirect URL"
2494
2307
  );
2495
2308
  }
2496
- if (!zCompactJwt5.safeParse(challengeJwt).success) {
2309
+ if (!zCompactJwt4.safeParse(challengeJwt).success) {
2497
2310
  throw new MrtdPopError(
2498
2311
  "Invalid JWT format in 'challenge_info' query parameter"
2499
2312
  );
2500
2313
  }
2501
- const { header, payload } = decodeJwt({
2314
+ const { header, payload } = decodeJwt12({
2502
2315
  errorMessagePrefix: "Error decoding MRTD challenge JWT:",
2503
2316
  headerSchema: zMrtdChallengeJwtHeader,
2504
2317
  jwt: challengeJwt,
@@ -2509,12 +2322,13 @@ function parseMrtdChallenge(options) {
2509
2322
 
2510
2323
  // src/mrtd-pop/verify-mrtd-challenge.ts
2511
2324
  import {
2325
+ decodeJwt as decodeJwt13,
2512
2326
  jwtSignerFromJwt as jwtSignerFromJwt3,
2513
2327
  verifyJwt as verifyJwt6
2514
- } from "@openid4vc/oauth2";
2328
+ } from "@pagopa/io-wallet-utils";
2515
2329
  async function verifyMrtdChallenge(options) {
2516
2330
  const { callbacks, challengeJwt, clientId } = options;
2517
- const jwt = decodeJwt({
2331
+ const jwt = decodeJwt13({
2518
2332
  errorMessagePrefix: "Error decoding MRTD challenge JWT:",
2519
2333
  headerSchema: zMrtdChallengeJwtHeader,
2520
2334
  jwt: challengeJwt,
@@ -2536,24 +2350,14 @@ async function verifyMrtdChallenge(options) {
2536
2350
  });
2537
2351
  return { header: jwt.header, payload: jwt.payload, signer };
2538
2352
  }
2539
-
2540
- // src/index.ts
2541
- import {
2542
- HashAlgorithm as HashAlgorithm7,
2543
- Oauth2JwtParseError as Oauth2JwtParseError3,
2544
- verifyJwt as verifyJwt7
2545
- } from "@openid4vc/oauth2";
2546
2353
  export {
2547
2354
  ClientAttestationError,
2548
2355
  CreateTokenDPoPError,
2549
2356
  CreateTokenResponseError,
2550
2357
  FetchTokenResponseError,
2551
- HashAlgorithm7 as HashAlgorithm,
2552
2358
  IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES,
2553
- MAX_JTI_LENGTH,
2554
2359
  MrtdPopError,
2555
2360
  Oauth2Error,
2556
- Oauth2JwtParseError3 as Oauth2JwtParseError,
2557
2361
  PkceCodeChallengeMethod,
2558
2362
  PushedAuthorizationRequestError,
2559
2363
  SupportedClientAuthenticationMethod,
@@ -2571,8 +2375,6 @@ export {
2571
2375
  createWalletAttestationJwt as createWalletAttestationJwtV1_0,
2572
2376
  createWalletAttestationJwt2 as createWalletAttestationJwtV1_3,
2573
2377
  createWalletAttestationJwt3 as createWalletAttestationJwtV1_4,
2574
- decodeJwt,
2575
- decodeJwtHeader,
2576
2378
  extractClientAttestationJwtsFromHeaders,
2577
2379
  extractDpopJwtFromHeaders,
2578
2380
  fetchJarRequestObject,
@@ -2587,7 +2389,6 @@ export {
2587
2389
  isPushedAuthorizationRequestSigned,
2588
2390
  isPushedAuthorizationRequestUnsigned,
2589
2391
  jwtAuthorizationRequestJwtHeaderTyp,
2590
- jwtHeaderFromJwtSigner,
2591
2392
  parseAccessTokenRequest,
2592
2393
  parseAuthorizationRequest,
2593
2394
  parseJarRequest,
@@ -2602,7 +2403,6 @@ export {
2602
2403
  verifyClientAttestation,
2603
2404
  verifyClientAttestationPopJwt,
2604
2405
  verifyJarRequest,
2605
- verifyJwt7 as verifyJwt,
2606
2406
  verifyMrtdChallenge,
2607
2407
  verifyPkce,
2608
2408
  verifyPushedAuthorizationRequest,
@@ -2615,13 +2415,9 @@ export {
2615
2415
  zAccessTokenProfileJwtPayload,
2616
2416
  zAccessTokenRequest,
2617
2417
  zAccessTokenResponse,
2618
- zAlgValueNotNone,
2619
2418
  zAuthorizationCodeGrantIdentifier,
2620
2419
  zAuthorizationRequestV1_0,
2621
2420
  zAuthorizationRequestV1_3,
2622
- zCertificateChain,
2623
- zCompactJwe2 as zCompactJwe,
2624
- zCompactJwt,
2625
2421
  zDpopJwtHeader,
2626
2422
  zDpopJwtPayload,
2627
2423
  zItWalletClientAttestationPopJwtAlg,
@@ -2631,11 +2427,6 @@ export {
2631
2427
  zJarAuthorizationRequest,
2632
2428
  zJarRequestObjectHeader,
2633
2429
  zJarRequestObjectPayload,
2634
- zJwk,
2635
- zJwkSet,
2636
- zJwtConfirmationPayload,
2637
- zJwtHeader,
2638
- zJwtPayload,
2639
2430
  zMrtdChallengeJwtHeader,
2640
2431
  zMrtdChallengeJwtPayload,
2641
2432
  zMrtdPopInitResponseJwtHeader,
@@ -2651,7 +2442,6 @@ export {
2651
2442
  zRefreshTokenProfileJwtHeader,
2652
2443
  zRefreshTokenProfileJwtPayload,
2653
2444
  zSignedAuthorizationRequestJwtHeaderTyp,
2654
- zTrustChain,
2655
2445
  zWalletAttestationJwtHeaderV1_0,
2656
2446
  zWalletAttestationJwtHeaderV1_3,
2657
2447
  zWalletAttestationJwtHeaderV1_4,