@pagopa/io-wallet-oauth2 1.5.7 → 2.0.0-apt

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.d.mts CHANGED
@@ -1,83 +1,143 @@
1
- import * as _openid4vc_oauth2 from '@openid4vc/oauth2';
2
- import { CallbackContext, JwtSigner as JwtSigner$1, JwtSignerJwk as JwtSignerJwk$1, ClientAttestationJwtPayload, RequestDpopOptions, JwtSignerWithJwk as JwtSignerWithJwk$1, HttpMethod as HttpMethod$1 } from '@openid4vc/oauth2';
3
- export { CallbackContext, ClientAttestationPopJwtHeader, ClientAttestationPopJwtPayload, DecryptJweCallback, EncryptJweCallback, GenerateRandomCallback, HashAlgorithm, JweEncryptor, JwtSigner, JwtSignerJwk, Oauth2JwtParseError, RequestDpopOptions, SignJwtCallback, VerifyJwtCallback, verifyJwt } from '@openid4vc/oauth2';
4
- import z, { z as z$1 } from 'zod';
5
- import { RequestLike as RequestLike$1, ItWalletSpecsVersion, IoWalletSdkConfig, FetchHeaders, HttpMethod, BaseSchema, ContentType, Fetch } from '@pagopa/io-wallet-utils';
6
- import { ItWalletAuthorizationServerMetadata } from '@pagopa/io-wallet-oid-federation';
1
+ import * as _pagopa_io_wallet_utils from '@pagopa/io-wallet-utils';
2
+ import { IoWalletSdkConfig, ItWalletSpecsVersion, CallbackContext, Jwk, JwtSigner, RequestLike, JwtSignerJwk, JwtPayload, FetchHeaders, RequestDpopOptions, decodeJwt, JwtSignerWithJwk, ClientAuthenticationCallback as ClientAuthenticationCallback$1, ClientAuthenticationCallbackOptions as ClientAuthenticationCallbackOptions$1, JweEncryptor, Fetch, DecodeJwtResult, HttpMethod } from '@pagopa/io-wallet-utils';
3
+ import z$1, { z } from 'zod';
7
4
 
8
- interface RetrieveAuthorizationCodeAccessTokenOptions {
9
- /**
10
- * Additional payload to include in the access token request. Items will be encoded and sent
11
- * using x-www-form-urlencoded format. Nested items (JSON) will be stringified and url encoded.
12
- */
13
- additionalRequestPayload?: Record<string, unknown>;
14
- /**
15
- * The authorization code
16
- */
17
- authorizationCode: string;
18
- /**
19
- * Callbacks to use for requesting access token
20
- */
21
- callbacks: Pick<CallbackContext, "clientAuthentication" | "fetch" | "generateRandom" | "hash" | "signJwt">;
22
- /**
23
- * PKCE Code verifier that was used in the authorization request.
24
- */
25
- pkceCodeVerifier: string;
26
- /**
27
- * Redirect uri to include in the access token request.
28
- * It MUST be set as in the Request Object.
29
- */
30
- redirectUri: string;
31
- }
32
- /**
33
- * Creates an OAuth 2.0 authorization-code access token request body.
34
- *
35
- * @param options - Access token request inputs.
36
- * @param options.additionalRequestPayload - Extra form fields to include in the token request.
37
- * @param options.authorizationCode - Authorization code received from the authorization response.
38
- * @param options.pkceCodeVerifier - PKCE verifier associated with the authorization request.
39
- * @param options.redirectUri - Redirect URI used in the authorization request.
40
- * @returns URL-form-encodable authorization-code grant request data.
41
- */
42
- declare const createTokenRequest: (options: RetrieveAuthorizationCodeAccessTokenOptions) => Promise<{
43
- code: string;
44
- code_verifier: string;
5
+ declare const zAuthorizationCodeGrantIdentifier: z.ZodLiteral<"authorization_code">;
6
+ declare const authorizationCodeGrantIdentifier: "authorization_code";
7
+ type AuthorizationCodeGrantIdentifier = z.infer<typeof zAuthorizationCodeGrantIdentifier>;
8
+ declare const zPreAuthorizedCodeGrantIdentifier: z.ZodLiteral<"urn:ietf:params:oauth:grant-type:pre-authorized_code">;
9
+ declare const preAuthorizedCodeGrantIdentifier: "urn:ietf:params:oauth:grant-type:pre-authorized_code";
10
+ type PreAuthorizedCodeGrantIdentifier = z.infer<typeof zPreAuthorizedCodeGrantIdentifier>;
11
+ declare const zRefreshTokenGrantIdentifier: z.ZodLiteral<"refresh_token">;
12
+ declare const refreshTokenGrantIdentifier: "refresh_token";
13
+ type RefreshTokenGrantIdentifier = z.infer<typeof zRefreshTokenGrantIdentifier>;
14
+
15
+ declare const zPreAuthorizedCodeTokenRequest: z.ZodObject<{
16
+ grant_type: z.ZodLiteral<"urn:ietf:params:oauth:grant-type:pre-authorized_code">;
17
+ "pre-authorized_code": z.ZodString;
18
+ tx_code: z.ZodOptional<z.ZodString>;
19
+ }, z.core.$strip>;
20
+ declare const zAuthorizationCodeTokenRequest: z.ZodObject<{
21
+ code: z.ZodString;
22
+ code_verifier: z.ZodString;
23
+ grant_type: z.ZodLiteral<"authorization_code">;
24
+ redirect_uri: z.ZodString;
25
+ }, z.core.$strip>;
26
+ declare const zRefreshTokenTokenRequest: z.ZodObject<{
27
+ grant_type: z.ZodLiteral<"refresh_token">;
28
+ refresh_token: z.ZodString;
29
+ scope: z.ZodOptional<z.ZodString>;
30
+ }, z.core.$strip>;
31
+ declare const zAccessTokenRequest: z.ZodDiscriminatedUnion<[z.ZodObject<{
32
+ code: z.ZodString;
33
+ code_verifier: z.ZodString;
34
+ grant_type: z.ZodLiteral<"authorization_code">;
35
+ redirect_uri: z.ZodString;
36
+ }, z.core.$strip>, z.ZodObject<{
37
+ grant_type: z.ZodLiteral<"refresh_token">;
38
+ refresh_token: z.ZodString;
39
+ scope: z.ZodOptional<z.ZodString>;
40
+ }, z.core.$strip>], "grant_type">;
41
+ type AccessTokenRequest = z.infer<typeof zAccessTokenRequest>;
42
+ declare const zAccessTokenRequestAPTITUDE: z.ZodDiscriminatedUnion<[z.ZodObject<{
43
+ code: z.ZodString;
44
+ code_verifier: z.ZodString;
45
+ grant_type: z.ZodLiteral<"authorization_code">;
46
+ redirect_uri: z.ZodString;
47
+ }, z.core.$strip>, z.ZodObject<{
48
+ grant_type: z.ZodLiteral<"refresh_token">;
49
+ refresh_token: z.ZodString;
50
+ scope: z.ZodOptional<z.ZodString>;
51
+ }, z.core.$strip>, z.ZodObject<{
52
+ grant_type: z.ZodLiteral<"urn:ietf:params:oauth:grant-type:pre-authorized_code">;
53
+ "pre-authorized_code": z.ZodString;
54
+ tx_code: z.ZodOptional<z.ZodString>;
55
+ }, z.core.$strip>], "grant_type">;
56
+ type AccessTokenRequestAPTITUDE = z.infer<typeof zAccessTokenRequestAPTITUDE>;
57
+ type AuthorizationCodeGrantType = Extract<AccessTokenRequest, {
45
58
  grant_type: "authorization_code";
46
- redirect_uri: string;
47
59
  }>;
48
-
49
- declare const zJwk: z.ZodObject<{
50
- alg: z.ZodOptional<z.ZodString>;
51
- crv: z.ZodOptional<z.ZodString>;
52
- d: z.ZodOptional<z.ZodString>;
53
- dp: z.ZodOptional<z.ZodString>;
54
- dq: z.ZodOptional<z.ZodString>;
55
- e: z.ZodOptional<z.ZodString>;
56
- ext: z.ZodOptional<z.ZodBoolean>;
57
- k: z.ZodOptional<z.ZodString>;
58
- key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
59
- kid: z.ZodOptional<z.ZodString>;
60
- kty: z.ZodString;
61
- n: z.ZodOptional<z.ZodString>;
62
- oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
63
- d: z.ZodOptional<z.ZodString>;
64
- r: z.ZodOptional<z.ZodString>;
65
- t: z.ZodOptional<z.ZodString>;
60
+ type PreAuthorizedCodeGrantType = Extract<AccessTokenRequestAPTITUDE, {
61
+ grant_type: "urn:ietf:params:oauth:grant-type:pre-authorized_code";
62
+ }>;
63
+ type RefreshTokenGrantType = Extract<AccessTokenRequest, {
64
+ grant_type: "refresh_token";
65
+ }>;
66
+ declare const zAccessTokenResponse: z.ZodObject<{
67
+ access_token: z.ZodString;
68
+ authorization_details: z.ZodOptional<z.ZodArray<z.ZodObject<{
69
+ credential_configuration_id: z.ZodOptional<z.ZodString>;
70
+ credential_identifiers: z.ZodOptional<z.ZodArray<z.ZodString>>;
71
+ type: z.ZodLiteral<"openid_credential">;
66
72
  }, z.core.$loose>>>;
67
- p: z.ZodOptional<z.ZodString>;
68
- q: z.ZodOptional<z.ZodString>;
69
- qi: z.ZodOptional<z.ZodString>;
70
- use: z.ZodOptional<z.ZodString>;
71
- x: z.ZodOptional<z.ZodString>;
73
+ expires_in: z.ZodOptional<z.ZodNumber>;
74
+ refresh_token: z.ZodOptional<z.ZodString>;
75
+ token_type: z.ZodUnion<readonly [z.ZodLiteral<"Bearer">, z.ZodLiteral<"DPoP">]>;
76
+ }, z.core.$loose>;
77
+ type AccessTokenResponse = z.infer<typeof zAccessTokenResponse>;
78
+ declare const zAccessTokenProfileJwtHeader: z.ZodObject<{
79
+ typ: z.ZodEnum<{
80
+ "application/at+jwt": "application/at+jwt";
81
+ "at+jwt": "at+jwt";
82
+ }>;
83
+ alg: z.ZodString;
84
+ jwk: z.ZodOptional<z.ZodObject<{
85
+ alg: z.ZodOptional<z.ZodString>;
86
+ crv: z.ZodOptional<z.ZodString>;
87
+ d: z.ZodOptional<z.ZodString>;
88
+ dp: z.ZodOptional<z.ZodString>;
89
+ dq: z.ZodOptional<z.ZodString>;
90
+ e: z.ZodOptional<z.ZodString>;
91
+ ext: z.ZodOptional<z.ZodBoolean>;
92
+ k: z.ZodOptional<z.ZodString>;
93
+ key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
94
+ kid: z.ZodOptional<z.ZodString>;
95
+ kty: z.ZodString;
96
+ n: z.ZodOptional<z.ZodString>;
97
+ oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
98
+ d: z.ZodOptional<z.ZodString>;
99
+ r: z.ZodOptional<z.ZodString>;
100
+ t: z.ZodOptional<z.ZodString>;
101
+ }, z.core.$loose>>>;
102
+ p: z.ZodOptional<z.ZodString>;
103
+ q: z.ZodOptional<z.ZodString>;
104
+ qi: z.ZodOptional<z.ZodString>;
105
+ use: z.ZodOptional<z.ZodString>;
106
+ x: z.ZodOptional<z.ZodString>;
107
+ x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
108
+ x5t: z.ZodOptional<z.ZodString>;
109
+ "x5t#S256": z.ZodOptional<z.ZodString>;
110
+ x5u: z.ZodOptional<z.ZodString>;
111
+ y: z.ZodOptional<z.ZodString>;
112
+ }, z.core.$loose>>;
113
+ kid: z.ZodOptional<z.ZodString>;
114
+ trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
72
115
  x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
73
- x5t: z.ZodOptional<z.ZodString>;
74
- "x5t#S256": z.ZodOptional<z.ZodString>;
75
- x5u: z.ZodOptional<z.ZodString>;
76
- y: z.ZodOptional<z.ZodString>;
77
116
  }, z.core.$loose>;
78
- type Jwk = z.infer<typeof zJwk>;
79
- declare const zJwkSet: z.ZodObject<{
80
- keys: z.ZodArray<z.ZodObject<{
117
+ type AccessTokenProfileJwtHeader = z.infer<typeof zAccessTokenProfileJwtHeader>;
118
+ declare const zAccessTokenProfileJwtPayload: z.ZodObject<{
119
+ aud: z.ZodString;
120
+ client_id: z.ZodString;
121
+ cnf: z.ZodOptional<z.ZodObject<{
122
+ jkt: z.ZodString;
123
+ }, z.core.$strip>>;
124
+ exp: z.ZodNumber;
125
+ iat: z.ZodNumber;
126
+ iss: z.ZodString;
127
+ jti: z.ZodString;
128
+ nbf: z.ZodOptional<z.ZodNumber>;
129
+ scope: z.ZodOptional<z.ZodString>;
130
+ sub: z.ZodString;
131
+ nonce: z.ZodOptional<z.ZodString>;
132
+ status: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
133
+ trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
134
+ }, z.core.$loose>;
135
+ type AccessTokenProfileJwtPayload = z.infer<typeof zAccessTokenProfileJwtPayload>;
136
+ declare const zRefreshTokenProfileJwtHeader: z.ZodObject<{
137
+ kid: z.ZodString;
138
+ typ: z.ZodLiteral<"rt+jwt">;
139
+ alg: z.ZodString;
140
+ jwk: z.ZodOptional<z.ZodObject<{
81
141
  alg: z.ZodOptional<z.ZodString>;
82
142
  crv: z.ZodOptional<z.ZodString>;
83
143
  d: z.ZodOptional<z.ZodString>;
@@ -106,8 +166,123 @@ declare const zJwkSet: z.ZodObject<{
106
166
  x5u: z.ZodOptional<z.ZodString>;
107
167
  y: z.ZodOptional<z.ZodString>;
108
168
  }, z.core.$loose>>;
169
+ trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
170
+ x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
171
+ }, z.core.$loose>;
172
+ type RefreshTokenProfileJwtHeader = z.infer<typeof zRefreshTokenProfileJwtHeader>;
173
+ declare const zRefreshTokenProfileJwtPayload: z.ZodObject<{
174
+ aud: z.ZodString;
175
+ client_id: z.ZodString;
176
+ cnf: z.ZodObject<{
177
+ jkt: z.ZodString;
178
+ }, z.core.$strip>;
179
+ exp: z.ZodNumber;
180
+ iat: z.ZodNumber;
181
+ iss: z.ZodString;
182
+ jti: z.ZodString;
183
+ nbf: z.ZodNumber;
184
+ sub: z.ZodString;
185
+ nonce: z.ZodOptional<z.ZodString>;
186
+ status: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
187
+ trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
109
188
  }, z.core.$loose>;
110
- type JwkSet = z.infer<typeof zJwkSet>;
189
+ type RefreshTokenProfileJwtPayload = z.infer<typeof zRefreshTokenProfileJwtPayload>;
190
+
191
+ interface BaseRetrieveAccessTokenOptions {
192
+ /**
193
+ * Additional payload to include in the access token request. Items are encoded and sent
194
+ * using x-www-form-urlencoded format. Nested items (JSON) are stringified and url encoded.
195
+ * Can be used to include form fields such as client_id or authorization_details.
196
+ */
197
+ additionalRequestPayload?: Record<string, unknown>;
198
+ config: IoWalletSdkConfig;
199
+ }
200
+ interface RetrieveAccessTokenOptionsAuthCode<V extends ItWalletSpecsVersion> extends BaseRetrieveAccessTokenOptions {
201
+ /**
202
+ * The authorization code
203
+ */
204
+ authorizationCode: string;
205
+ config: IoWalletSdkConfig<V>;
206
+ /** The authorization_code grant type. */
207
+ grantType: AuthorizationCodeGrantIdentifier;
208
+ /**
209
+ * PKCE Code verifier that was used in the authorization request.
210
+ */
211
+ pkceCodeVerifier: string;
212
+ /**
213
+ * Redirect uri to include in the access token request.
214
+ * It MUST be set as in the Request Object.
215
+ */
216
+ redirectUri: string;
217
+ }
218
+ interface RetrieveAccessTokenOptionsPreAuthorizedCode extends BaseRetrieveAccessTokenOptions {
219
+ config: IoWalletSdkConfig<ItWalletSpecsVersion.APTITUDE>;
220
+ /** The pre_authorized_code grant type. */
221
+ grantType: PreAuthorizedCodeGrantIdentifier;
222
+ /** The pre-authorized code received in the credential offer. */
223
+ preAuthorizedCode: string;
224
+ /** Required when the credential offer contains a tx_code object. */
225
+ txCode?: string;
226
+ }
227
+ interface RetrieveAccessTokenOptionsRefreshToken<V extends ItWalletSpecsVersion> extends BaseRetrieveAccessTokenOptions {
228
+ config: IoWalletSdkConfig<V>;
229
+ /** The refresh_token grant type. */
230
+ grantType: RefreshTokenGrantIdentifier;
231
+ /** The refresh token received in the credential offer. */
232
+ refreshToken: string;
233
+ /** The refresh token OPTIONAL scope. */
234
+ scope?: string;
235
+ }
236
+ type RetrieveAccessTokenOptionsShared<V extends ItWalletSpecsVersion> = RetrieveAccessTokenOptionsAuthCode<V> | RetrieveAccessTokenOptionsRefreshToken<V>;
237
+ type RetrieveAccessTokenOptions = RetrieveAccessTokenOptionsShared<ItWalletSpecsVersion.V1_0 | ItWalletSpecsVersion.V1_3 | ItWalletSpecsVersion.V1_4>;
238
+ type RetrieveAccessTokenOptionsAPTITUDE = RetrieveAccessTokenOptionsPreAuthorizedCode | RetrieveAccessTokenOptionsShared<ItWalletSpecsVersion.APTITUDE>;
239
+ type CreateTokenRequestOptions = RetrieveAccessTokenOptions | RetrieveAccessTokenOptionsAPTITUDE;
240
+ type CreateTokenRequestReturnType = AuthorizationCodeGrantType | PreAuthorizedCodeGrantType | RefreshTokenGrantType;
241
+ declare const createTokenRequestV1_4: <V extends ItWalletSpecsVersion>(options: RetrieveAccessTokenOptionsShared<V>) => {
242
+ grant_type: "refresh_token";
243
+ refresh_token: string;
244
+ scope: string | undefined;
245
+ } | {
246
+ code: string;
247
+ code_verifier: string;
248
+ grant_type: "authorization_code";
249
+ redirect_uri: string;
250
+ };
251
+ declare function createTokenRequestAPTITUDE(options: RetrieveAccessTokenOptionsAPTITUDE): CreateTokenRequestReturnType;
252
+ /**
253
+ * Creates an authorization-code or pre-authorized_code access token request body.
254
+ *
255
+ * Authorization-code requests retain the existing default grant and require PKCE
256
+ * and a redirect URI.
257
+ *
258
+ * * * Version Differences:
259
+ * - v1.4: only support authorization_code grant type.
260
+ * - APTITUDE: add support for pre-authorized_code grant type. Pre Authorized
261
+ * requests use preAuthorizedCode and optional txCode, without PKCE or a redirect URI.
262
+ *
263
+ * @param options - Access token request inputs and version config.
264
+ * @param options.config - The IoWalletSdkConfig instance to use.
265
+ * @param options.grantType - The grant type to use.
266
+ * @param options.additionalRequestPayload - Extra form fields to include in the token request.
267
+ *
268
+ * **authorization_code grant type parameters:**
269
+ * @param options.authorizationCode - Authorization code received from the authorization response.
270
+ * @param options.pkceCodeVerifier - PKCE verifier associated with the authorization request.
271
+ * @param options.redirectUri - Redirect URI used in the authorization request.
272
+ *
273
+ * **refresh_token grant type parameters (APTITUDE only):**
274
+ * @param options.refreshToken - Refresh token.
275
+ * @param options.scope - The refresh token OPTIONAL scope.
276
+ *
277
+ * **pre-authorized_code grant type parameters (APTITUDE only):**
278
+ * @param options.preAuthorizedCode - Pre-authorized code received in the credential offer.
279
+ * @param options.txCode - Transaction code required when the credential offer contains a `tx_code` object.
280
+ *
281
+ * @returns URL-form-encodable grant request data.
282
+ */
283
+ declare function createTokenRequest(options: RetrieveAccessTokenOptions): AuthorizationCodeGrantType | RefreshTokenGrantType;
284
+ declare function createTokenRequest(options: RetrieveAccessTokenOptionsAPTITUDE): AuthorizationCodeGrantType | PreAuthorizedCodeGrantType | RefreshTokenGrantType;
285
+ declare function createTokenRequest(options: CreateTokenRequestOptions): CreateTokenRequestReturnType;
111
286
 
112
287
  interface CreateAccessTokenResponseOptions {
113
288
  /**
@@ -132,6 +307,7 @@ interface CreateAccessTokenResponseOptions {
132
307
  * OAuth client identifier (`client_id` claim).
133
308
  */
134
309
  clientId: string;
310
+ config: IoWalletSdkConfig;
135
311
  /**
136
312
  * DPoP public key used to bind the access token (`cnf.jkt` claim).
137
313
  */
@@ -169,7 +345,7 @@ interface CreateAccessTokenResponseOptions {
169
345
  /**
170
346
  * Signer used to produce the access token JWT.
171
347
  */
172
- signer: JwtSigner$1;
348
+ signer: JwtSigner;
173
349
  /**
174
350
  * Subject identifier represented by the access token (`sub` claim).
175
351
  */
@@ -194,7 +370,7 @@ interface CreateAccessTokenResponseOptions {
194
370
  * public key, and results in `nbf` equal to the Access Token `exp` and `exp`
195
371
  * later than that.
196
372
  *
197
- * @param options - Access token response creation options.
373
+ * @param options - Access token response creation options and version config.
198
374
  * @returns OAuth token response with a signed access token JWT, and a signed Refresh Token JWT when requested.
199
375
  * @throws {CreateTokenResponseError} If DPoP binding is required but missing, if Refresh Token issuance is requested without a valid DPoP configuration or lifetime, if the signer has no resolvable `kid` for the Refresh Token, or if response creation otherwise fails, including validation failures from the generated JWT headers or payloads.
200
376
  * @throws {ValidationError} If the generated JWT header or payload fails validation.
@@ -213,158 +389,12 @@ declare function createAccessTokenResponse(options: CreateAccessTokenResponseOpt
213
389
  refresh_token?: string | undefined;
214
390
  }>;
215
391
 
216
- declare const zAccessTokenRequest: z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
217
- code: z$1.ZodString;
218
- code_verifier: z$1.ZodString;
219
- grant_type: z$1.ZodLiteral<"authorization_code">;
220
- redirect_uri: z$1.ZodString;
221
- }, z$1.core.$strip>, z$1.ZodObject<{
222
- grant_type: z$1.ZodLiteral<"refresh_token">;
223
- refresh_token: z$1.ZodString;
224
- scope: z$1.ZodOptional<z$1.ZodString>;
225
- }, z$1.core.$strip>], "grant_type">;
226
- type AccessTokenRequest = z$1.infer<typeof zAccessTokenRequest>;
227
- type AuthorizationCodeGrantType = Extract<AccessTokenRequest, {
228
- grant_type: "authorization_code";
229
- }>;
230
- type RefreshTokenGrantType = Extract<AccessTokenRequest, {
231
- grant_type: "refresh_token";
232
- }>;
233
- declare const zAccessTokenResponse: z$1.ZodObject<{
234
- access_token: z$1.ZodString;
235
- authorization_details: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
236
- credential_configuration_id: z$1.ZodOptional<z$1.ZodString>;
237
- credential_identifiers: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
238
- type: z$1.ZodLiteral<"openid_credential">;
239
- }, z$1.core.$loose>>>;
240
- expires_in: z$1.ZodOptional<z$1.ZodNumber>;
241
- refresh_token: z$1.ZodOptional<z$1.ZodString>;
242
- token_type: z$1.ZodUnion<readonly [z$1.ZodLiteral<"Bearer">, z$1.ZodLiteral<"DPoP">]>;
243
- }, z$1.core.$loose>;
244
- type AccessTokenResponse = z$1.infer<typeof zAccessTokenResponse>;
245
- declare const zAccessTokenProfileJwtHeader: z$1.ZodObject<{
246
- typ: z$1.ZodEnum<{
247
- "application/at+jwt": "application/at+jwt";
248
- "at+jwt": "at+jwt";
249
- }>;
250
- alg: z$1.ZodString;
251
- jwk: z$1.ZodOptional<z$1.ZodObject<{
252
- alg: z$1.ZodOptional<z$1.ZodString>;
253
- crv: z$1.ZodOptional<z$1.ZodString>;
254
- d: z$1.ZodOptional<z$1.ZodString>;
255
- dp: z$1.ZodOptional<z$1.ZodString>;
256
- dq: z$1.ZodOptional<z$1.ZodString>;
257
- e: z$1.ZodOptional<z$1.ZodString>;
258
- ext: z$1.ZodOptional<z$1.ZodBoolean>;
259
- k: z$1.ZodOptional<z$1.ZodString>;
260
- key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
261
- kid: z$1.ZodOptional<z$1.ZodString>;
262
- kty: z$1.ZodString;
263
- n: z$1.ZodOptional<z$1.ZodString>;
264
- oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
265
- d: z$1.ZodOptional<z$1.ZodString>;
266
- r: z$1.ZodOptional<z$1.ZodString>;
267
- t: z$1.ZodOptional<z$1.ZodString>;
268
- }, z$1.core.$loose>>>;
269
- p: z$1.ZodOptional<z$1.ZodString>;
270
- q: z$1.ZodOptional<z$1.ZodString>;
271
- qi: z$1.ZodOptional<z$1.ZodString>;
272
- use: z$1.ZodOptional<z$1.ZodString>;
273
- x: z$1.ZodOptional<z$1.ZodString>;
274
- x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
275
- x5t: z$1.ZodOptional<z$1.ZodString>;
276
- "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
277
- x5u: z$1.ZodOptional<z$1.ZodString>;
278
- y: z$1.ZodOptional<z$1.ZodString>;
279
- }, z$1.core.$loose>>;
280
- kid: z$1.ZodOptional<z$1.ZodString>;
281
- trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
282
- x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
283
- }, z$1.core.$loose>;
284
- type AccessTokenProfileJwtHeader = z$1.infer<typeof zAccessTokenProfileJwtHeader>;
285
- declare const zAccessTokenProfileJwtPayload: z$1.ZodObject<{
286
- aud: z$1.ZodString;
287
- client_id: z$1.ZodString;
288
- cnf: z$1.ZodOptional<z$1.ZodObject<{
289
- jkt: z$1.ZodString;
290
- }, z$1.core.$strip>>;
291
- exp: z$1.ZodNumber;
292
- iat: z$1.ZodNumber;
293
- iss: z$1.ZodString;
294
- jti: z$1.ZodString;
295
- nbf: z$1.ZodOptional<z$1.ZodNumber>;
296
- scope: z$1.ZodOptional<z$1.ZodString>;
297
- sub: z$1.ZodString;
298
- nonce: z$1.ZodOptional<z$1.ZodString>;
299
- status: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
300
- trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
301
- }, z$1.core.$loose>;
302
- type AccessTokenProfileJwtPayload = z$1.infer<typeof zAccessTokenProfileJwtPayload>;
303
- declare const zRefreshTokenProfileJwtHeader: z$1.ZodObject<{
304
- kid: z$1.ZodString;
305
- typ: z$1.ZodLiteral<"rt+jwt">;
306
- alg: z$1.ZodString;
307
- jwk: z$1.ZodOptional<z$1.ZodObject<{
308
- alg: z$1.ZodOptional<z$1.ZodString>;
309
- crv: z$1.ZodOptional<z$1.ZodString>;
310
- d: z$1.ZodOptional<z$1.ZodString>;
311
- dp: z$1.ZodOptional<z$1.ZodString>;
312
- dq: z$1.ZodOptional<z$1.ZodString>;
313
- e: z$1.ZodOptional<z$1.ZodString>;
314
- ext: z$1.ZodOptional<z$1.ZodBoolean>;
315
- k: z$1.ZodOptional<z$1.ZodString>;
316
- key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
317
- kid: z$1.ZodOptional<z$1.ZodString>;
318
- kty: z$1.ZodString;
319
- n: z$1.ZodOptional<z$1.ZodString>;
320
- oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
321
- d: z$1.ZodOptional<z$1.ZodString>;
322
- r: z$1.ZodOptional<z$1.ZodString>;
323
- t: z$1.ZodOptional<z$1.ZodString>;
324
- }, z$1.core.$loose>>>;
325
- p: z$1.ZodOptional<z$1.ZodString>;
326
- q: z$1.ZodOptional<z$1.ZodString>;
327
- qi: z$1.ZodOptional<z$1.ZodString>;
328
- use: z$1.ZodOptional<z$1.ZodString>;
329
- x: z$1.ZodOptional<z$1.ZodString>;
330
- x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
331
- x5t: z$1.ZodOptional<z$1.ZodString>;
332
- "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
333
- x5u: z$1.ZodOptional<z$1.ZodString>;
334
- y: z$1.ZodOptional<z$1.ZodString>;
335
- }, z$1.core.$loose>>;
336
- trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
337
- x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
338
- }, z$1.core.$loose>;
339
- type RefreshTokenProfileJwtHeader = z$1.infer<typeof zRefreshTokenProfileJwtHeader>;
340
- declare const zRefreshTokenProfileJwtPayload: z$1.ZodObject<{
341
- aud: z$1.ZodString;
342
- client_id: z$1.ZodString;
343
- cnf: z$1.ZodObject<{
344
- jkt: z$1.ZodString;
345
- }, z$1.core.$strip>;
346
- exp: z$1.ZodNumber;
347
- iat: z$1.ZodNumber;
348
- iss: z$1.ZodString;
349
- jti: z$1.ZodString;
350
- nbf: z$1.ZodNumber;
351
- sub: z$1.ZodString;
352
- nonce: z$1.ZodOptional<z$1.ZodString>;
353
- status: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
354
- trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
355
- }, z$1.core.$loose>;
356
- type RefreshTokenProfileJwtPayload = z$1.infer<typeof zRefreshTokenProfileJwtPayload>;
357
-
358
- interface FetchTokenResponseOptions {
392
+ interface BaseFetchTokenResponseOptions {
359
393
  /**
360
394
  * The endpoint URL where the access token request will be sent
361
395
  * This should be the authorization server's token endpoint
362
396
  */
363
397
  accessTokenEndpoint: string;
364
- /**
365
- * The access token request payload
366
- */
367
- accessTokenRequest: AccessTokenRequest;
368
398
  /**
369
399
  * Callbacks to use for requesting access token
370
400
  */
@@ -374,6 +404,7 @@ interface FetchTokenResponseOptions {
374
404
  * Used for OAuth-Client-Attestation-PoP header to prove possession of the client key
375
405
  */
376
406
  clientAttestationDPoP: string;
407
+ config: IoWalletSdkConfig;
377
408
  /**
378
409
  * DPoP proof for the token request
379
410
  */
@@ -384,33 +415,47 @@ interface FetchTokenResponseOptions {
384
415
  */
385
416
  walletAttestation: string;
386
417
  }
387
- /**
388
- * Sends an access token request to the authorization server and returns the response
389
- *
390
- * @param options - Configuration options for the access token request
391
- * @returns Promise that resolves to the parsed access token response
392
- * @throws {UnexpectedStatusCodeError} When the server returns a non-200 status code
393
- * @throws {ValidationError} When the response cannot be parsed as a valid access token response
394
- * @throws {FetchTokenResponseError} When an unexpected error occurs during the request
395
- */
396
- declare function fetchTokenResponse(options: FetchTokenResponseOptions): Promise<AccessTokenResponse>;
418
+ interface FetchTokenResponseOptionsShared<V extends ItWalletSpecsVersion = ItWalletSpecsVersion.V1_0 | ItWalletSpecsVersion.V1_3 | ItWalletSpecsVersion.V1_4> extends BaseFetchTokenResponseOptions {
419
+ /**
420
+ * The authorization-code or refresh-token request payload.
421
+ */
422
+ accessTokenRequest: AccessTokenRequest;
423
+ config: IoWalletSdkConfig<V>;
424
+ }
425
+ interface FetchTokenResponseOptionsAPTITUDE extends BaseFetchTokenResponseOptions {
426
+ /**
427
+ * The authorization-code, pre-authorized-code or refresh-token request payload.
428
+ */
429
+ accessTokenRequest: AccessTokenRequestAPTITUDE;
430
+ config: IoWalletSdkConfig<ItWalletSpecsVersion.APTITUDE>;
431
+ }
432
+ type FetchTokenResponseOptions = FetchTokenResponseOptionsAPTITUDE | FetchTokenResponseOptionsShared;
397
433
  /**
398
434
  * Converts an access token request object into URL-encoded form parameters.
399
435
  *
400
436
  * Object values are JSON-stringified so structured extension parameters such as
401
437
  * `authorization_details` can be sent in `application/x-www-form-urlencoded` requests.
402
438
  *
439
+ * Version Differences:
440
+ * - APTITUDE: extracts `authorization_server` (OPTIONAL), `pre-authorized_code` (REQUIRED), and `tx_code` (OPTIONAL)
441
+ *
403
442
  * @param data - Access token request payload.
404
443
  * @returns URLSearchParams containing all defined request fields.
405
444
  */
406
- declare function toURLSearchParams(data: AccessTokenRequest): URLSearchParams;
407
-
408
- declare const zAuthorizationCodeGrantIdentifier: z$1.ZodLiteral<"authorization_code">;
409
- declare const authorizationCodeGrantIdentifier: "authorization_code";
410
- type AuthorizationCodeGrantIdentifier = z$1.infer<typeof zAuthorizationCodeGrantIdentifier>;
411
- declare const zRefreshTokenGrantIdentifier: z$1.ZodLiteral<"refresh_token">;
412
- declare const refreshTokenGrantIdentifier: "refresh_token";
413
- type RefreshTokenGrantIdentifier = z$1.infer<typeof zRefreshTokenGrantIdentifier>;
445
+ declare function toURLSearchParams(data: FetchTokenResponseOptions["accessTokenRequest"]): URLSearchParams;
446
+ /**
447
+ * Sends an access token request to the authorization server and returns the response
448
+ *
449
+ * * Version Differences:
450
+ * - APTITUDE: add support for pre-authorized-code grant type.
451
+ *
452
+ * @param options - Configuration options for the access token request and version config.
453
+ * @returns Promise that resolves to the parsed access token response
454
+ * @throws {UnexpectedStatusCodeError} When the server returns a non-200 status code
455
+ * @throws {ValidationError} When the response cannot be parsed as a valid access token response
456
+ * @throws {FetchTokenResponseError} When an unexpected error occurs during the request
457
+ */
458
+ declare function fetchTokenResponse(options: FetchTokenResponseOptions): Promise<AccessTokenResponse>;
414
459
 
415
460
  interface ParsedAccessTokenAuthorizationCodeRequestGrant {
416
461
  code: string;
@@ -420,9 +465,14 @@ interface ParsedAccessTokenRefreshTokenRequestGrant {
420
465
  grantType: RefreshTokenGrantIdentifier;
421
466
  refreshToken: string;
422
467
  }
423
- type ParsedAccessTokenRequestGrant = ParsedAccessTokenAuthorizationCodeRequestGrant | ParsedAccessTokenRefreshTokenRequestGrant;
424
- interface ParseAccessTokenRequestResult {
425
- accessTokenRequest: AccessTokenRequest;
468
+ interface ParsedAccessTokenPreAuthorizedCodeRequestGrant {
469
+ grantType: PreAuthorizedCodeGrantIdentifier;
470
+ preAuthorizedCode: string;
471
+ txCode?: string;
472
+ }
473
+ type ParsedAccessTokenRequestGrantV1_4 = ParsedAccessTokenAuthorizationCodeRequestGrant | ParsedAccessTokenRefreshTokenRequestGrant;
474
+ type ParsedAccessTokenRequestGrantAPTITUDE = ParsedAccessTokenAuthorizationCodeRequestGrant | ParsedAccessTokenPreAuthorizedCodeRequestGrant | ParsedAccessTokenRefreshTokenRequestGrant;
475
+ interface BaseParseAccessTokenRequestResult {
426
476
  /**
427
477
  * The client attestation jwts from the access token request headers
428
478
  */
@@ -436,33 +486,57 @@ interface ParseAccessTokenRequestResult {
436
486
  dpop: {
437
487
  jwt: string;
438
488
  };
439
- grant: ParsedAccessTokenRequestGrant;
489
+ }
490
+ interface ParseAccessTokenRequestResultV1_4 extends BaseParseAccessTokenRequestResult {
491
+ accessTokenRequest: AccessTokenRequest;
492
+ grant: ParsedAccessTokenRequestGrantV1_4;
440
493
  /**
441
494
  * The pkce code verifier from the access token request
442
495
  */
443
496
  pkceCodeVerifier?: string;
444
497
  }
498
+ interface ParseAccessTokenRequestResultAPTITUDE extends BaseParseAccessTokenRequestResult {
499
+ accessTokenRequest: AccessTokenRequestAPTITUDE;
500
+ grant: ParsedAccessTokenRequestGrantAPTITUDE;
501
+ }
445
502
  interface ParseAccessTokenRequestOptions {
446
503
  /**
447
504
  * The access token request as a JSON object. Your server should decode the
448
505
  * `x-www-url-form-urlencoded` body into an object (e.g. using `bodyParser.urlEncoded()` in express)
449
506
  */
450
507
  accessTokenRequest: Record<string, unknown>;
451
- request: RequestLike$1;
508
+ config: IoWalletSdkConfig;
509
+ request: RequestLike;
510
+ }
511
+ interface ParseAccessTokenRequestOptionsShared<V extends ItWalletSpecsVersion = ItWalletSpecsVersion.V1_0 | ItWalletSpecsVersion.V1_3 | ItWalletSpecsVersion.V1_4> extends ParseAccessTokenRequestOptions {
512
+ /**
513
+ * The IT-Wallet specs version to use for parsing the access token request.
514
+ */
515
+ config: IoWalletSdkConfig<V>;
516
+ }
517
+ interface ParseAccessTokenRequestOptionsAPTITUDE extends ParseAccessTokenRequestOptions {
518
+ /**
519
+ * The IT-Wallet specs version to use for parsing the access token request.
520
+ */
521
+ config: IoWalletSdkConfig<ItWalletSpecsVersion.APTITUDE>;
452
522
  }
523
+ type ParseAccessTokenRequestResult = ParseAccessTokenRequestResultAPTITUDE | ParseAccessTokenRequestResultV1_4;
453
524
  /**
454
525
  * Parses and validates an OAuth 2.0 access token request.
455
526
  *
456
527
  * This function performs the following steps:
457
528
  * 1. Validates the request body against the access token request schema
458
- * 2. Extracts and validates grant-specific parameters (authorization code or refresh token)
529
+ * 2. Extracts grant parameters for authorization code, pre-authorized code or refresh token
459
530
  * 3. Parses security headers (DPoP and Client Attestation JWTs)
460
- * 4. Extracts PKCE code verifier if present
531
+ * 4. Extracts PKCE code verifier if present (V1_4 only)
461
532
  *
462
533
  * Note: This function only parses and validates the structure of the request.
463
534
  * Cryptographic verification of JWTs and tokens should be performed separately.
464
535
  *
465
- * @param options - Configuration object containing the access token request body and HTTP request
536
+ * * * Version Differences:
537
+ * - APTITUDE: add support for pre-authorized-code grant type.
538
+ *
539
+ * @param options - Configuration object containing the access token request body and HTTP request, and version config
466
540
  * @returns Parsed access token request with typed grant parameters and extracted security headers
467
541
  * @throws {Oauth2Error} If validation fails or required parameters are missing
468
542
  *
@@ -479,8 +553,62 @@ interface ParseAccessTokenRequestOptions {
479
553
  * });
480
554
  * ```
481
555
  */
556
+ declare function parseAccessTokenRequest<V extends ItWalletSpecsVersion = ItWalletSpecsVersion.V1_0 | ItWalletSpecsVersion.V1_3 | ItWalletSpecsVersion.V1_4>(options: ParseAccessTokenRequestOptionsShared<V>): ParseAccessTokenRequestResultV1_4;
557
+ declare function parseAccessTokenRequest(options: ParseAccessTokenRequestOptionsAPTITUDE): ParseAccessTokenRequestResultAPTITUDE;
482
558
  declare function parseAccessTokenRequest(options: ParseAccessTokenRequestOptions): ParseAccessTokenRequestResult;
483
559
 
560
+ /**
561
+ * Lean Authorization Server Metadata interface consumed by the oauth2 package.
562
+ *
563
+ * This interface captures only the fields that this package actually reads,
564
+ * keeping it free of any dependency on the `oid-federation` package and preventing
565
+ * a circular build dependency between the two packages.
566
+ *
567
+ * In practice callers pass the richer types produced by `@pagopa/io-wallet-oid-federation`
568
+ * (e.g. `ItWalletAuthorizationServerMetadataV1_3`); those types satisfy this interface
569
+ * structurally, so no explicit cast is required at call sites.
570
+ *
571
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8414 RFC 8414 – OAuth 2.0 Authorization Server Metadata}
572
+ */
573
+ interface BaseAuthorizationServerMetadata {
574
+ /**
575
+ * List of PKCE code-challenge transformation methods supported by the server.
576
+ *
577
+ * IT-Wallet mandates that `"S256"` be present.
578
+ *
579
+ * @see {@link https://www.rfc-editor.org/rfc/rfc7636#section-4.3 RFC 7636 §4.3}
580
+ */
581
+ code_challenge_methods_supported: string[];
582
+ /**
583
+ * URL that uniquely identifies the Authorization Server.
584
+ *
585
+ * Used as the expected `aud` claim when verifying JAR request objects and as the
586
+ * `authorization_server` value when creating Client Attestation PoP JWTs.
587
+ *
588
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8414#section-2 RFC 8414 §2}
589
+ */
590
+ issuer: string;
591
+ /**
592
+ * When `true` the server mandates that every authorization request be sent as a
593
+ * signed JWT (JAR). Unsigned PAR bodies are rejected in that case.
594
+ *
595
+ * Defaults to `false` when absent (permissive mode).
596
+ *
597
+ * @default false
598
+ * @see {@link https://www.rfc-editor.org/rfc/rfc9101#section-10.5 RFC 9101 §10.5}
599
+ */
600
+ require_signed_request_object?: boolean;
601
+ /**
602
+ * Client authentication methods supported by the token endpoint.
603
+ *
604
+ * The oauth2 package inspects this array for the `"attest_jwt_client_auth"` value
605
+ * to determine whether Wallet Attestation–based client authentication is available.
606
+ *
607
+ * @see {@link https://www.rfc-editor.org/rfc/rfc8414#section-2 RFC 8414 §2}
608
+ */
609
+ token_endpoint_auth_methods_supported?: string[];
610
+ }
611
+
484
612
  interface VerifyClientAttestationPopJwtOptions {
485
613
  /**
486
614
  * The issuer identifier of the authorization server handling the client attestation
@@ -609,9 +737,10 @@ declare function verifyClientAttestationPopJwt(options: VerifyClientAttestationP
609
737
  } | undefined;
610
738
  nbf?: number | undefined;
611
739
  status?: Record<string, any> | undefined;
740
+ sub?: string | undefined;
612
741
  trust_chain?: [string, ...string[]] | undefined;
613
742
  };
614
- signer: _openid4vc_oauth2.JwtSignerWithJwk;
743
+ signer: _pagopa_io_wallet_utils.JwtSignerWithJwk;
615
744
  }>;
616
745
  interface BaseCreateClientAttestationPopJwtOptions<V extends ItWalletSpecsVersion> {
617
746
  /**
@@ -646,7 +775,7 @@ interface BaseCreateClientAttestationPopJwtOptions<V extends ItWalletSpecsVersio
646
775
  * If not provided, the signer will be derived based on the
647
776
  * `cnf.jwk` and `alg` in the client attestation.
648
777
  */
649
- signer?: JwtSignerJwk$1;
778
+ signer?: JwtSignerJwk;
650
779
  }
651
780
  type NoClientAttestationPopJwtExtraOptions = Record<never, never>;
652
781
  interface CreateClientAttestationPopJwtVersionOptions {
@@ -703,7 +832,7 @@ interface VerifyClientAttestationOptions {
703
832
  /**
704
833
  * The authorization server metadata.
705
834
  */
706
- authorizationServerMetadata: ItWalletAuthorizationServerMetadata;
835
+ authorizationServerMetadata: BaseAuthorizationServerMetadata;
707
836
  /**
708
837
  * Callbacks for hashing and JWT verification.
709
838
  */
@@ -834,14 +963,14 @@ declare function verifyClientAttestation(options: VerifyClientAttestationOptions
834
963
  sub: string;
835
964
  wallet_link?: string | undefined;
836
965
  wallet_name?: string | undefined;
837
- aud?: string | undefined;
966
+ aud?: string | string[] | undefined;
838
967
  jti?: string | undefined;
839
968
  nbf?: number | undefined;
840
969
  nonce?: string | undefined;
841
970
  status?: Record<string, any> | undefined;
842
971
  trust_chain?: [string, ...string[]] | undefined;
843
972
  };
844
- signer: _openid4vc_oauth2.JwtSignerWithJwk;
973
+ signer: _pagopa_io_wallet_utils.JwtSignerWithJwk;
845
974
  };
846
975
  clientAttestationPop: {
847
976
  header: {
@@ -928,9 +1057,10 @@ declare function verifyClientAttestation(options: VerifyClientAttestationOptions
928
1057
  } | undefined;
929
1058
  nbf?: number | undefined;
930
1059
  status?: Record<string, any> | undefined;
1060
+ sub?: string | undefined;
931
1061
  trust_chain?: [string, ...string[]] | undefined;
932
1062
  };
933
- signer: _openid4vc_oauth2.JwtSignerWithJwk;
1063
+ signer: _pagopa_io_wallet_utils.JwtSignerWithJwk;
934
1064
  };
935
1065
  }>;
936
1066
 
@@ -944,15 +1074,15 @@ interface BaseVerifyWalletAttestationJwtOptions {
944
1074
  */
945
1075
  interface BaseWalletAttestationOptions {
946
1076
  callbacks: Pick<CallbackContext, "hash" | "signJwt">;
947
- dpopJwkPublic: ClientAttestationJwtPayload["cnf"]["jwk"];
1077
+ dpopJwkPublic: NonNullable<NonNullable<JwtPayload["cnf"]>["jwk"]>;
948
1078
  expiresAt?: Date;
949
1079
  issuer: string;
950
1080
  walletLink?: string;
951
1081
  walletName?: string;
952
1082
  }
953
- declare const zOauthClientAttestationHeader: z.ZodLiteral<"OAuth-Client-Attestation">;
1083
+ declare const zOauthClientAttestationHeader: z$1.ZodLiteral<"OAuth-Client-Attestation">;
954
1084
  declare const oauthClientAttestationHeader: "OAuth-Client-Attestation";
955
- declare const zOauthClientAttestationPopHeader: z.ZodLiteral<"OAuth-Client-Attestation-PoP">;
1085
+ declare const zOauthClientAttestationPopHeader: z$1.ZodLiteral<"OAuth-Client-Attestation-PoP">;
956
1086
  declare const oauthClientAttestationPopHeader: "OAuth-Client-Attestation-PoP";
957
1087
 
958
1088
  interface VerifyWalletAttestationJwtOptionsV1_0 extends BaseVerifyWalletAttestationJwtOptions {
@@ -965,7 +1095,7 @@ type VerifiedWalletAttestationJwtV1_0 = Awaited<ReturnType<typeof verifyWalletAt
965
1095
  * @param options - v1.0 verification options.
966
1096
  * @returns Decoded and verified wallet attestation JWT data.
967
1097
  * @throws {ValidationError} If the JWT header or payload does not satisfy the v1.0 schema.
968
- * @throws {Oauth2JwtParseError} If the JWT cannot be decoded.
1098
+ * @throws {JwtParseError} If the JWT cannot be decoded.
969
1099
  * @throws {Oauth2JwtVerificationError} If signature verification fails.
970
1100
  */
971
1101
  declare function verifyWalletAttestationJwt$3(options: VerifyWalletAttestationJwtOptionsV1_0): Promise<{
@@ -1050,14 +1180,14 @@ declare function verifyWalletAttestationJwt$3(options: VerifyWalletAttestationJw
1050
1180
  sub: string;
1051
1181
  wallet_link?: string | undefined;
1052
1182
  wallet_name?: string | undefined;
1053
- aud?: string | undefined;
1183
+ aud?: string | string[] | undefined;
1054
1184
  jti?: string | undefined;
1055
1185
  nbf?: number | undefined;
1056
1186
  nonce?: string | undefined;
1057
1187
  status?: Record<string, any> | undefined;
1058
1188
  trust_chain?: [string, ...string[]] | undefined;
1059
1189
  };
1060
- signer: _openid4vc_oauth2.JwtSignerWithJwk;
1190
+ signer: _pagopa_io_wallet_utils.JwtSignerWithJwk;
1061
1191
  }>;
1062
1192
 
1063
1193
  interface VerifyWalletAttestationJwtOptionsV1_3 extends BaseVerifyWalletAttestationJwtOptions {
@@ -1070,7 +1200,7 @@ type VerifiedWalletAttestationJwtV1_3 = Awaited<ReturnType<typeof verifyWalletAt
1070
1200
  * @param options - v1.3 verification options.
1071
1201
  * @returns Decoded and verified wallet attestation JWT data.
1072
1202
  * @throws {ValidationError} If the JWT header or payload does not satisfy the v1.3 schema.
1073
- * @throws {Oauth2JwtParseError} If the JWT cannot be decoded.
1203
+ * @throws {JwtParseError} If the JWT cannot be decoded.
1074
1204
  * @throws {Oauth2JwtVerificationError} If signature verification fails.
1075
1205
  */
1076
1206
  declare function verifyWalletAttestationJwt$2(options: VerifyWalletAttestationJwtOptionsV1_3): Promise<{
@@ -1161,12 +1291,12 @@ declare function verifyWalletAttestationJwt$2(options: VerifyWalletAttestationJw
1161
1291
  } | undefined;
1162
1292
  wallet_link?: string | undefined;
1163
1293
  wallet_name?: string | undefined;
1164
- aud?: string | undefined;
1294
+ aud?: string | string[] | undefined;
1165
1295
  jti?: string | undefined;
1166
1296
  nonce?: string | undefined;
1167
1297
  trust_chain?: [string, ...string[]] | undefined;
1168
1298
  };
1169
- signer: _openid4vc_oauth2.JwtSignerWithJwk;
1299
+ signer: _pagopa_io_wallet_utils.JwtSignerWithJwk;
1170
1300
  }>;
1171
1301
 
1172
1302
  interface VerifyWalletAttestationJwtOptionsV1_4 extends BaseVerifyWalletAttestationJwtOptions {
@@ -1179,7 +1309,7 @@ type VerifiedWalletAttestationJwtV1_4 = Awaited<ReturnType<typeof verifyWalletAt
1179
1309
  * @param options - v1.4 verification options.
1180
1310
  * @returns Decoded and verified wallet attestation JWT data.
1181
1311
  * @throws {ValidationError} If the JWT header or payload does not satisfy the v1.4 schema.
1182
- * @throws {Oauth2JwtParseError} If the JWT cannot be decoded.
1312
+ * @throws {JwtParseError} If the JWT cannot be decoded.
1183
1313
  * @throws {Oauth2JwtVerificationError} If signature verification fails.
1184
1314
  */
1185
1315
  declare function verifyWalletAttestationJwt$1(options: VerifyWalletAttestationJwtOptionsV1_4): Promise<{
@@ -1264,13 +1394,13 @@ declare function verifyWalletAttestationJwt$1(options: VerifyWalletAttestationJw
1264
1394
  wallet_link: string;
1265
1395
  wallet_name: string;
1266
1396
  nbf?: number | undefined;
1267
- aud?: string | undefined;
1397
+ aud?: string | string[] | undefined;
1268
1398
  jti?: string | undefined;
1269
1399
  nonce?: string | undefined;
1270
1400
  status?: Record<string, any> | undefined;
1271
1401
  trust_chain?: [string, ...string[]] | undefined;
1272
1402
  };
1273
- signer: _openid4vc_oauth2.JwtSignerWithJwk;
1403
+ signer: _pagopa_io_wallet_utils.JwtSignerWithJwk;
1274
1404
  }>;
1275
1405
 
1276
1406
  type VerifiedWalletAttestationJwt = VerifiedWalletAttestationJwtV1_0 | VerifiedWalletAttestationJwtV1_3 | VerifiedWalletAttestationJwtV1_4;
@@ -1281,7 +1411,7 @@ type VerifyWalletAttestationJwtOptions = VerifyWalletAttestationJwtOptionsV1_0 |
1281
1411
  * @param options - Version-specific wallet attestation verification options.
1282
1412
  * @returns Decoded and verified wallet attestation data for the configured version.
1283
1413
  * @throws {ValidationError} If JWT header or payload validation fails.
1284
- * @throws {Oauth2JwtParseError} If the attestation JWT cannot be decoded.
1414
+ * @throws {JwtParseError} If the attestation JWT cannot be decoded.
1285
1415
  * @throws {Oauth2JwtVerificationError} If signature verification fails.
1286
1416
  * @throws {ItWalletSpecsVersionError} If the configured version is unsupported.
1287
1417
  */
@@ -1389,15 +1519,11 @@ interface VerifyAccessTokenRequestDpop {
1389
1519
  */
1390
1520
  jwt: string;
1391
1521
  }
1392
- interface VerifyAccessTokenRequestOptions {
1393
- /**
1394
- * The access token request to verify
1395
- */
1396
- accessTokenRequest: AccessTokenRequest;
1522
+ interface BaseVerifyAccessTokenRequestOptions {
1397
1523
  /**
1398
1524
  * The authorization server metadata
1399
1525
  */
1400
- authorizationServerMetadata: ItWalletAuthorizationServerMetadata;
1526
+ authorizationServerMetadata: BaseAuthorizationServerMetadata;
1401
1527
  /**
1402
1528
  * Callbacks used during verification
1403
1529
  */
@@ -1406,15 +1532,29 @@ interface VerifyAccessTokenRequestOptions {
1406
1532
  * Options for verifying the client attestation
1407
1533
  */
1408
1534
  clientAttestation: ClientAttestationOptions;
1409
- /**
1410
- * The expiration date of the authorization code
1411
- */
1412
- codeExpiresAt?: Date;
1413
1535
  config: IoWalletSdkConfig;
1414
1536
  /**
1415
1537
  * The dpop verification options
1416
1538
  */
1417
1539
  dpop: VerifyAccessTokenRequestDpop;
1540
+ /**
1541
+ * The current time to use when verifying the JWTs.
1542
+ * If not provided current time will be used.
1543
+ *
1544
+ * @default new Date()
1545
+ */
1546
+ now?: Date;
1547
+ /**
1548
+ * The HTTP request information
1549
+ */
1550
+ request: RequestLike;
1551
+ }
1552
+ interface VerifyAccessTokenRequestOptions<V extends ItWalletSpecsVersion = ItWalletSpecsVersion.V1_0> extends BaseVerifyAccessTokenRequestOptions {
1553
+ /**
1554
+ * The expiration date of the authorization code
1555
+ */
1556
+ codeExpiresAt?: Date;
1557
+ config: IoWalletSdkConfig<V>;
1418
1558
  /**
1419
1559
  * The expected authorization code
1420
1560
  */
@@ -1423,22 +1563,25 @@ interface VerifyAccessTokenRequestOptions {
1423
1563
  * The parsed authorization code grant
1424
1564
  */
1425
1565
  grant: ParsedAccessTokenAuthorizationCodeRequestGrant;
1426
- /**
1427
- * The current time to use when verifying the JWTs.
1428
- * If not provided current time will be used.
1429
- *
1430
- * @default new Date()
1431
- */
1432
- now?: Date;
1433
1566
  /**
1434
1567
  * The pkce options including code verifier, challenge and method
1435
1568
  */
1436
1569
  pkce: VerifyAccessTokenRequestPkce;
1437
- /**
1438
- * The HTTP request information
1439
- */
1440
- request: RequestLike$1;
1441
1570
  }
1571
+ interface VerifyPreAuthorizedCodeAccessTokenRequestOptions extends BaseVerifyAccessTokenRequestOptions {
1572
+ config: IoWalletSdkConfig<ItWalletSpecsVersion.APTITUDE>;
1573
+ /** The pre-authorized code stored by the authorization server. */
1574
+ expectedPreAuthorizedCode: string;
1575
+ /** The stored transaction code, if one was required by the credential offer. */
1576
+ expectedTxCode?: string;
1577
+ /** The parsed pre-authorized code grant */
1578
+ grant: ParsedAccessTokenPreAuthorizedCodeRequestGrant;
1579
+ /** The expiration date stored with the pre-authorized code. */
1580
+ preAuthorizedCodeExpiresAt?: Date;
1581
+ }
1582
+ type SupportedAccessTokenVerificationOptionsV1_4 = VerifyAccessTokenRequestOptions<ItWalletSpecsVersion.V1_0 | ItWalletSpecsVersion.V1_3 | ItWalletSpecsVersion.V1_4>;
1583
+ type SupportedAccessTokenVerificationOptionsAPTITUDE = VerifyAccessTokenRequestOptions<ItWalletSpecsVersion.APTITUDE> | VerifyPreAuthorizedCodeAccessTokenRequestOptions;
1584
+ type SupportedAccessTokenVerificationOptions = SupportedAccessTokenVerificationOptionsAPTITUDE | SupportedAccessTokenVerificationOptionsV1_4;
1442
1585
  interface VerifyAccessTokenRequestResult {
1443
1586
  clientAttestation: {
1444
1587
  clientAttestation: VerifiedWalletAttestationJwt;
@@ -1454,18 +1597,26 @@ interface VerifyAccessTokenRequestResult {
1454
1597
  };
1455
1598
  }
1456
1599
  /**
1457
- * Verifies an authorization code token request by validating PKCE, DPoP, and client attestation.
1600
+ * Verifies an authorization-code or pre-authorized-code token request.
1458
1601
  *
1459
- * This function performs comprehensive validation of an OAuth 2.0 authorization code token request
1460
- * according to Italian IT-Wallet specifications, including:
1461
- * - PKCE code verifier validation against the stored code challenge
1602
+ * Both grants retain the SDK's IT-Wallet DPoP and client attestation requirements:
1603
+ * - PKCE verification against the stored code challenge for authorization-code requests only
1462
1604
  * - DPoP proof JWT verification and JWK thumbprint extraction
1463
1605
  * - Client attestation JWT and attestation PoP JWT verification
1464
- * - Authorization code validity and expiration checks
1465
- *
1466
- * @param options - Configuration options for token request verification
1606
+ * - Authorization code or pre-authorized code validity and expiration checks
1607
+ * - Transaction code verification when required by the credential offer
1608
+ *
1609
+ * The caller must enforce single-use redemption of codes atomically when issuing
1610
+ * the token, and limit transaction-code attempts. This verifier does not store state.
1611
+ * The upstream verifier allows optional DPoP and client attestation; the local
1612
+ * implementation retains the SDK's required security checks and error types.
1613
+ *
1614
+ * * Version Differences:
1615
+ * - APTITUDE: add support for pre-authorized-code grant type.
1616
+ * *
1617
+ * @param options - Configuration options for token request verification and version config
1467
1618
  * @returns A promise that resolves with verified client attestation and DPoP information
1468
- * @throws {Oauth2Error} If the authorization code is invalid or expired
1619
+ * @throws {Oauth2Error} If the grant code is invalid or expired, or the transaction code is missing, unexpected or invalid
1469
1620
  * @throws {Oauth2Error} If PKCE verification fails
1470
1621
  * @throws {Oauth2Error} If DPoP verification fails
1471
1622
  * @throws {Oauth2Error} If client attestation verification fails
@@ -1490,108 +1641,108 @@ interface VerifyAccessTokenRequestResult {
1490
1641
  * });
1491
1642
  * ```
1492
1643
  */
1493
- declare function verifyAccessTokenRequest(options: VerifyAccessTokenRequestOptions): Promise<VerifyAccessTokenRequestResult>;
1644
+ declare function verifyAccessTokenRequest(options: SupportedAccessTokenVerificationOptionsAPTITUDE | SupportedAccessTokenVerificationOptionsV1_4): Promise<VerifyAccessTokenRequestResult>;
1494
1645
 
1495
- declare const zAuthorizationRequestV1_0: z.ZodObject<{
1496
- authorization_details: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1497
- credential_configuration_id: z.ZodString;
1498
- type: z.ZodLiteral<"openid_credential">;
1499
- }, z.core.$strip>, z.ZodObject<{
1500
- challenge_method: z.ZodLiteral<"mrtd+ias">;
1501
- challenge_redirect_uri: z.ZodURL;
1502
- idphinting: z.ZodURL;
1503
- type: z.ZodLiteral<"it_l2+document_proof">;
1504
- }, z.core.$strip>], "type">>>;
1505
- client_id: z.ZodString;
1506
- code_challenge: z.ZodString;
1507
- code_challenge_method: z.ZodString;
1508
- issuer_state: z.ZodOptional<z.ZodString>;
1509
- jti: z.ZodString;
1510
- redirect_uri: z.ZodURL;
1511
- response_type: z.ZodString;
1512
- scope: z.ZodOptional<z.ZodString>;
1513
- state: z.ZodString;
1514
- response_mode: z.ZodString;
1515
- }, z.core.$loose>;
1516
- type AuthorizationRequestV1_0 = z.infer<typeof zAuthorizationRequestV1_0>;
1517
- declare const zAuthorizationRequestV1_3: z.ZodObject<{
1518
- authorization_details: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1519
- credential_configuration_id: z.ZodString;
1520
- type: z.ZodLiteral<"openid_credential">;
1521
- }, z.core.$strip>, z.ZodObject<{
1522
- challenge_method: z.ZodLiteral<"mrtd+ias">;
1523
- challenge_redirect_uri: z.ZodURL;
1524
- idphinting: z.ZodURL;
1525
- type: z.ZodLiteral<"it_l2+document_proof">;
1526
- }, z.core.$strip>], "type">>>;
1527
- client_id: z.ZodString;
1528
- code_challenge: z.ZodString;
1529
- code_challenge_method: z.ZodString;
1530
- issuer_state: z.ZodOptional<z.ZodString>;
1531
- jti: z.ZodString;
1532
- redirect_uri: z.ZodURL;
1533
- response_type: z.ZodString;
1534
- scope: z.ZodOptional<z.ZodString>;
1535
- state: z.ZodString;
1536
- }, z.core.$loose>;
1537
- type AuthorizationRequestV1_3 = z.infer<typeof zAuthorizationRequestV1_3>;
1538
- declare const zPushedAuthorizationRequestSigned: z.ZodObject<{
1539
- client_id: z.ZodString;
1540
- pkceCodeVerifier: z.ZodString;
1541
- request: z.ZodString;
1542
- }, z.core.$loose>;
1543
- type PushedAuthorizationRequestSigned = z.infer<typeof zPushedAuthorizationRequestSigned>;
1544
- declare const zPushedAuthorizationRequestUnsignedV1_0: z.ZodObject<{
1545
- authorizationRequest: z.ZodObject<{
1546
- authorization_details: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1547
- credential_configuration_id: z.ZodString;
1548
- type: z.ZodLiteral<"openid_credential">;
1549
- }, z.core.$strip>, z.ZodObject<{
1550
- challenge_method: z.ZodLiteral<"mrtd+ias">;
1551
- challenge_redirect_uri: z.ZodURL;
1552
- idphinting: z.ZodURL;
1553
- type: z.ZodLiteral<"it_l2+document_proof">;
1554
- }, z.core.$strip>], "type">>>;
1555
- client_id: z.ZodString;
1556
- code_challenge: z.ZodString;
1557
- code_challenge_method: z.ZodString;
1558
- issuer_state: z.ZodOptional<z.ZodString>;
1559
- jti: z.ZodString;
1560
- redirect_uri: z.ZodURL;
1561
- response_type: z.ZodString;
1562
- scope: z.ZodOptional<z.ZodString>;
1563
- state: z.ZodString;
1564
- response_mode: z.ZodString;
1565
- }, z.core.$loose>;
1566
- client_id: z.ZodString;
1567
- pkceCodeVerifier: z.ZodString;
1568
- }, z.core.$loose>;
1569
- type PushedAuthorizationRequestUnsignedV1_0 = z.infer<typeof zPushedAuthorizationRequestUnsignedV1_0>;
1570
- declare const zPushedAuthorizationRequestUnsignedV1_3: z.ZodObject<{
1571
- authorizationRequest: z.ZodObject<{
1572
- authorization_details: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
1573
- credential_configuration_id: z.ZodString;
1574
- type: z.ZodLiteral<"openid_credential">;
1575
- }, z.core.$strip>, z.ZodObject<{
1576
- challenge_method: z.ZodLiteral<"mrtd+ias">;
1577
- challenge_redirect_uri: z.ZodURL;
1578
- idphinting: z.ZodURL;
1579
- type: z.ZodLiteral<"it_l2+document_proof">;
1580
- }, z.core.$strip>], "type">>>;
1581
- client_id: z.ZodString;
1582
- code_challenge: z.ZodString;
1583
- code_challenge_method: z.ZodString;
1584
- issuer_state: z.ZodOptional<z.ZodString>;
1585
- jti: z.ZodString;
1586
- redirect_uri: z.ZodURL;
1587
- response_type: z.ZodString;
1588
- scope: z.ZodOptional<z.ZodString>;
1589
- state: z.ZodString;
1590
- }, z.core.$loose>;
1591
- client_id: z.ZodString;
1592
- pkceCodeVerifier: z.ZodString;
1593
- }, z.core.$loose>;
1594
- type PushedAuthorizationRequestUnsignedV1_3 = z.infer<typeof zPushedAuthorizationRequestUnsignedV1_3>;
1646
+ declare const zAuthorizationRequestV1_0: z$1.ZodObject<{
1647
+ authorization_details: z$1.ZodOptional<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
1648
+ credential_configuration_id: z$1.ZodString;
1649
+ type: z$1.ZodLiteral<"openid_credential">;
1650
+ }, z$1.core.$strip>, z$1.ZodObject<{
1651
+ challenge_method: z$1.ZodLiteral<"mrtd+ias">;
1652
+ challenge_redirect_uri: z$1.ZodURL;
1653
+ idphinting: z$1.ZodURL;
1654
+ type: z$1.ZodLiteral<"it_l2+document_proof">;
1655
+ }, z$1.core.$strip>], "type">>>;
1656
+ client_id: z$1.ZodString;
1657
+ code_challenge: z$1.ZodString;
1658
+ code_challenge_method: z$1.ZodString;
1659
+ issuer_state: z$1.ZodOptional<z$1.ZodString>;
1660
+ jti: z$1.ZodString;
1661
+ redirect_uri: z$1.ZodURL;
1662
+ response_type: z$1.ZodString;
1663
+ scope: z$1.ZodOptional<z$1.ZodString>;
1664
+ state: z$1.ZodString;
1665
+ response_mode: z$1.ZodString;
1666
+ }, z$1.core.$loose>;
1667
+ type AuthorizationRequestV1_0 = z$1.infer<typeof zAuthorizationRequestV1_0>;
1668
+ declare const zAuthorizationRequestV1_3: z$1.ZodObject<{
1669
+ authorization_details: z$1.ZodOptional<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
1670
+ credential_configuration_id: z$1.ZodString;
1671
+ type: z$1.ZodLiteral<"openid_credential">;
1672
+ }, z$1.core.$strip>, z$1.ZodObject<{
1673
+ challenge_method: z$1.ZodLiteral<"mrtd+ias">;
1674
+ challenge_redirect_uri: z$1.ZodURL;
1675
+ idphinting: z$1.ZodURL;
1676
+ type: z$1.ZodLiteral<"it_l2+document_proof">;
1677
+ }, z$1.core.$strip>], "type">>>;
1678
+ client_id: z$1.ZodString;
1679
+ code_challenge: z$1.ZodString;
1680
+ code_challenge_method: z$1.ZodString;
1681
+ issuer_state: z$1.ZodOptional<z$1.ZodString>;
1682
+ jti: z$1.ZodString;
1683
+ redirect_uri: z$1.ZodURL;
1684
+ response_type: z$1.ZodString;
1685
+ scope: z$1.ZodOptional<z$1.ZodString>;
1686
+ state: z$1.ZodString;
1687
+ }, z$1.core.$loose>;
1688
+ type AuthorizationRequestV1_3 = z$1.infer<typeof zAuthorizationRequestV1_3>;
1689
+ declare const zPushedAuthorizationRequestSigned: z$1.ZodObject<{
1690
+ client_id: z$1.ZodString;
1691
+ pkceCodeVerifier: z$1.ZodString;
1692
+ request: z$1.ZodString;
1693
+ }, z$1.core.$loose>;
1694
+ type PushedAuthorizationRequestSigned = z$1.infer<typeof zPushedAuthorizationRequestSigned>;
1695
+ declare const zPushedAuthorizationRequestUnsignedV1_0: z$1.ZodObject<{
1696
+ authorizationRequest: z$1.ZodObject<{
1697
+ authorization_details: z$1.ZodOptional<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
1698
+ credential_configuration_id: z$1.ZodString;
1699
+ type: z$1.ZodLiteral<"openid_credential">;
1700
+ }, z$1.core.$strip>, z$1.ZodObject<{
1701
+ challenge_method: z$1.ZodLiteral<"mrtd+ias">;
1702
+ challenge_redirect_uri: z$1.ZodURL;
1703
+ idphinting: z$1.ZodURL;
1704
+ type: z$1.ZodLiteral<"it_l2+document_proof">;
1705
+ }, z$1.core.$strip>], "type">>>;
1706
+ client_id: z$1.ZodString;
1707
+ code_challenge: z$1.ZodString;
1708
+ code_challenge_method: z$1.ZodString;
1709
+ issuer_state: z$1.ZodOptional<z$1.ZodString>;
1710
+ jti: z$1.ZodString;
1711
+ redirect_uri: z$1.ZodURL;
1712
+ response_type: z$1.ZodString;
1713
+ scope: z$1.ZodOptional<z$1.ZodString>;
1714
+ state: z$1.ZodString;
1715
+ response_mode: z$1.ZodString;
1716
+ }, z$1.core.$loose>;
1717
+ client_id: z$1.ZodString;
1718
+ pkceCodeVerifier: z$1.ZodString;
1719
+ }, z$1.core.$loose>;
1720
+ type PushedAuthorizationRequestUnsignedV1_0 = z$1.infer<typeof zPushedAuthorizationRequestUnsignedV1_0>;
1721
+ declare const zPushedAuthorizationRequestUnsignedV1_3: z$1.ZodObject<{
1722
+ authorizationRequest: z$1.ZodObject<{
1723
+ authorization_details: z$1.ZodOptional<z$1.ZodArray<z$1.ZodDiscriminatedUnion<[z$1.ZodObject<{
1724
+ credential_configuration_id: z$1.ZodString;
1725
+ type: z$1.ZodLiteral<"openid_credential">;
1726
+ }, z$1.core.$strip>, z$1.ZodObject<{
1727
+ challenge_method: z$1.ZodLiteral<"mrtd+ias">;
1728
+ challenge_redirect_uri: z$1.ZodURL;
1729
+ idphinting: z$1.ZodURL;
1730
+ type: z$1.ZodLiteral<"it_l2+document_proof">;
1731
+ }, z$1.core.$strip>], "type">>>;
1732
+ client_id: z$1.ZodString;
1733
+ code_challenge: z$1.ZodString;
1734
+ code_challenge_method: z$1.ZodString;
1735
+ issuer_state: z$1.ZodOptional<z$1.ZodString>;
1736
+ jti: z$1.ZodString;
1737
+ redirect_uri: z$1.ZodURL;
1738
+ response_type: z$1.ZodString;
1739
+ scope: z$1.ZodOptional<z$1.ZodString>;
1740
+ state: z$1.ZodString;
1741
+ }, z$1.core.$loose>;
1742
+ client_id: z$1.ZodString;
1743
+ pkceCodeVerifier: z$1.ZodString;
1744
+ }, z$1.core.$loose>;
1745
+ type PushedAuthorizationRequestUnsignedV1_3 = z$1.infer<typeof zPushedAuthorizationRequestUnsignedV1_3>;
1595
1746
  /**
1596
1747
  * Union type for Pushed Authorization Request - can be either signed (JAR) or unsigned.
1597
1748
  * The variant depends on the Authorization Server's require_signed_request_object metadata.
@@ -1611,11 +1762,11 @@ declare function isPushedAuthorizationRequestSigned(par: PushedAuthorizationRequ
1611
1762
  * @returns True when the request contains version-specific `authorizationRequest` data.
1612
1763
  */
1613
1764
  declare function isPushedAuthorizationRequestUnsigned(par: PushedAuthorizationRequest): par is PushedAuthorizationRequestUnsignedV1_0 | PushedAuthorizationRequestUnsignedV1_3;
1614
- declare const zPushedAuthorizationResponse: z.ZodObject<{
1615
- expires_in: z.ZodNumber;
1616
- request_uri: z.ZodString;
1617
- }, z.core.$loose>;
1618
- type PushedAuthorizationResponse = z.infer<typeof zPushedAuthorizationResponse>;
1765
+ declare const zPushedAuthorizationResponse: z$1.ZodObject<{
1766
+ expires_in: z$1.ZodNumber;
1767
+ request_uri: z$1.ZodString;
1768
+ }, z$1.core.$loose>;
1769
+ type PushedAuthorizationResponse = z$1.infer<typeof zPushedAuthorizationResponse>;
1619
1770
 
1620
1771
  type AuthorizationRequest$1 = AuthorizationRequestV1_0 | AuthorizationRequestV1_3;
1621
1772
  interface BaseCreatePushedAuthorizationRequestOptions<V extends ItWalletSpecsVersion> {
@@ -1646,7 +1797,7 @@ interface BaseCreatePushedAuthorizationRequestOptions<V extends ItWalletSpecsVer
1646
1797
  * MUST be set to the thumbprint of the jwk value in the cnf parameter inside the Wallet Attestation.
1647
1798
  */
1648
1799
  clientId: string;
1649
- codeChallengeMethodsSupported: ItWalletAuthorizationServerMetadata["code_challenge_methods_supported"];
1800
+ codeChallengeMethodsSupported: BaseAuthorizationServerMetadata["code_challenge_methods_supported"];
1650
1801
  config: IoWalletSdkConfig<V>;
1651
1802
  /**
1652
1803
  * DPoP options. Required when `require_signed_request_object` is `true`
@@ -1877,7 +2028,7 @@ interface fetchPushedAuthorizationResponseOptions {
1877
2028
  declare function fetchPushedAuthorizationResponse(options: fetchPushedAuthorizationResponseOptions): Promise<PushedAuthorizationResponse>;
1878
2029
 
1879
2030
  interface ParseAuthorizationRequestOptions {
1880
- request: RequestLike$1;
2031
+ request: RequestLike;
1881
2032
  }
1882
2033
  interface ParseAuthorizationRequestResult {
1883
2034
  /**
@@ -1920,7 +2071,7 @@ interface ParsePushedAuthorizationRequestOptions {
1920
2071
  authorizationRequest: unknown;
1921
2072
  callbacks: Pick<CallbackContext, "fetch">;
1922
2073
  config: IoWalletSdkConfig;
1923
- request: RequestLike$1;
2074
+ request: RequestLike;
1924
2075
  }
1925
2076
  interface ParsePushedAuthorizationRequestResult extends ParseAuthorizationRequestResult {
1926
2077
  authorizationRequest: AuthorizationRequest;
@@ -1990,7 +2141,7 @@ interface VerifyAuthorizationRequestOptions {
1990
2141
  authorizationRequest: {
1991
2142
  client_id?: string;
1992
2143
  };
1993
- authorizationServerMetadata: ItWalletAuthorizationServerMetadata;
2144
+ authorizationServerMetadata: BaseAuthorizationServerMetadata;
1994
2145
  callbacks: Pick<CallbackContext, "hash" | "verifyJwt">;
1995
2146
  clientAttestation: ClientAttestationOptions;
1996
2147
  config: IoWalletSdkConfig;
@@ -2002,7 +2153,7 @@ interface VerifyAuthorizationRequestOptions {
2002
2153
  * @default new Date()
2003
2154
  */
2004
2155
  now?: Date;
2005
- request: RequestLike$1;
2156
+ request: RequestLike;
2006
2157
  }
2007
2158
  /**
2008
2159
  * Verifies an authorization request by validating DPoP and client attestation credentials.
@@ -2060,375 +2211,139 @@ interface VerifyAuthorizationRequestOptions {
2060
2211
  */
2061
2212
  declare function verifyAuthorizationRequest(options: VerifyAuthorizationRequestOptions): Promise<VerifyAuthorizationRequestResult>;
2062
2213
 
2063
- declare const zTrustChain: z.ZodTuple<[z.ZodString], z.ZodString>;
2064
- type TrustChain = z.infer<typeof zTrustChain>;
2065
- declare const zCertificateChain: z.ZodArray<z.ZodString>;
2066
- type CertificateChain = z.infer<typeof zCertificateChain>;
2067
- declare const zAlgValueNotNone: z.ZodString;
2068
- interface RequestLike {
2069
- headers: FetchHeaders;
2070
- method: HttpMethod;
2071
- url: string;
2072
- }
2214
+ declare const zJarAuthorizationRequest: z$1.ZodObject<{
2215
+ client_id: z$1.ZodOptional<z$1.ZodString>;
2216
+ request: z$1.ZodOptional<z$1.ZodString>;
2217
+ request_uri: z$1.ZodOptional<z$1.ZodURL>;
2218
+ }, z$1.core.$loose>;
2219
+ type JarAuthorizationRequest = z$1.infer<typeof zJarAuthorizationRequest>;
2220
+ declare const zJarRequestObjectPayload: z$1.ZodObject<{
2221
+ client_id: z$1.ZodString;
2222
+ aud: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodString, z$1.ZodArray<z$1.ZodString>]>>;
2223
+ cnf: z$1.ZodOptional<z$1.ZodObject<{
2224
+ jkt: z$1.ZodOptional<z$1.ZodString>;
2225
+ jwk: z$1.ZodOptional<z$1.ZodObject<{
2226
+ alg: z$1.ZodOptional<z$1.ZodString>;
2227
+ crv: z$1.ZodOptional<z$1.ZodString>;
2228
+ d: z$1.ZodOptional<z$1.ZodString>;
2229
+ dp: z$1.ZodOptional<z$1.ZodString>;
2230
+ dq: z$1.ZodOptional<z$1.ZodString>;
2231
+ e: z$1.ZodOptional<z$1.ZodString>;
2232
+ ext: z$1.ZodOptional<z$1.ZodBoolean>;
2233
+ k: z$1.ZodOptional<z$1.ZodString>;
2234
+ key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2235
+ kid: z$1.ZodOptional<z$1.ZodString>;
2236
+ kty: z$1.ZodString;
2237
+ n: z$1.ZodOptional<z$1.ZodString>;
2238
+ oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2239
+ d: z$1.ZodOptional<z$1.ZodString>;
2240
+ r: z$1.ZodOptional<z$1.ZodString>;
2241
+ t: z$1.ZodOptional<z$1.ZodString>;
2242
+ }, z$1.core.$loose>>>;
2243
+ p: z$1.ZodOptional<z$1.ZodString>;
2244
+ q: z$1.ZodOptional<z$1.ZodString>;
2245
+ qi: z$1.ZodOptional<z$1.ZodString>;
2246
+ use: z$1.ZodOptional<z$1.ZodString>;
2247
+ x: z$1.ZodOptional<z$1.ZodString>;
2248
+ x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2249
+ x5t: z$1.ZodOptional<z$1.ZodString>;
2250
+ "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
2251
+ x5u: z$1.ZodOptional<z$1.ZodString>;
2252
+ y: z$1.ZodOptional<z$1.ZodString>;
2253
+ }, z$1.core.$loose>>;
2254
+ }, z$1.core.$loose>>;
2255
+ exp: z$1.ZodOptional<z$1.ZodNumber>;
2256
+ iat: z$1.ZodOptional<z$1.ZodNumber>;
2257
+ iss: z$1.ZodOptional<z$1.ZodString>;
2258
+ jti: z$1.ZodOptional<z$1.ZodString>;
2259
+ nbf: z$1.ZodOptional<z$1.ZodNumber>;
2260
+ nonce: z$1.ZodOptional<z$1.ZodString>;
2261
+ status: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
2262
+ sub: z$1.ZodOptional<z$1.ZodString>;
2263
+ trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
2264
+ }, z$1.core.$loose>;
2265
+ type JarRequestObjectPayload = z$1.infer<typeof zJarRequestObjectPayload>;
2266
+ declare const zSignedAuthorizationRequestJwtHeaderTyp: z$1.ZodLiteral<"oauth-authz-req+jwt">;
2267
+ declare const zJarRequestObjectHeader: z$1.ZodObject<{
2268
+ typ: z$1.ZodLiteral<"oauth-authz-req+jwt">;
2269
+ alg: z$1.ZodString;
2270
+ jwk: z$1.ZodOptional<z$1.ZodObject<{
2271
+ alg: z$1.ZodOptional<z$1.ZodString>;
2272
+ crv: z$1.ZodOptional<z$1.ZodString>;
2273
+ d: z$1.ZodOptional<z$1.ZodString>;
2274
+ dp: z$1.ZodOptional<z$1.ZodString>;
2275
+ dq: z$1.ZodOptional<z$1.ZodString>;
2276
+ e: z$1.ZodOptional<z$1.ZodString>;
2277
+ ext: z$1.ZodOptional<z$1.ZodBoolean>;
2278
+ k: z$1.ZodOptional<z$1.ZodString>;
2279
+ key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2280
+ kid: z$1.ZodOptional<z$1.ZodString>;
2281
+ kty: z$1.ZodString;
2282
+ n: z$1.ZodOptional<z$1.ZodString>;
2283
+ oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2284
+ d: z$1.ZodOptional<z$1.ZodString>;
2285
+ r: z$1.ZodOptional<z$1.ZodString>;
2286
+ t: z$1.ZodOptional<z$1.ZodString>;
2287
+ }, z$1.core.$loose>>>;
2288
+ p: z$1.ZodOptional<z$1.ZodString>;
2289
+ q: z$1.ZodOptional<z$1.ZodString>;
2290
+ qi: z$1.ZodOptional<z$1.ZodString>;
2291
+ use: z$1.ZodOptional<z$1.ZodString>;
2292
+ x: z$1.ZodOptional<z$1.ZodString>;
2293
+ x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2294
+ x5t: z$1.ZodOptional<z$1.ZodString>;
2295
+ "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
2296
+ x5u: z$1.ZodOptional<z$1.ZodString>;
2297
+ y: z$1.ZodOptional<z$1.ZodString>;
2298
+ }, z$1.core.$loose>>;
2299
+ kid: z$1.ZodOptional<z$1.ZodString>;
2300
+ trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
2301
+ x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2302
+ }, z$1.core.$loose>;
2303
+ type JarRequestObjectHeader = z$1.infer<typeof zJarRequestObjectHeader>;
2304
+ declare const signedAuthorizationRequestJwtHeaderTyp: "oauth-authz-req+jwt";
2305
+ declare const jwtAuthorizationRequestJwtHeaderTyp: "jwt";
2073
2306
 
2074
- declare const MAX_JTI_LENGTH = 256;
2075
- interface JwtSignerDid {
2076
- alg: string;
2077
- didUrl: string;
2078
- /**
2079
- * The key id that should be used for signing. You need to make sure the kid actually matches
2080
- * with the key associated with the didUrl.
2081
- */
2082
- kid?: string;
2083
- method: "did";
2307
+ interface VerifyJarRequestOptions {
2308
+ authorizationRequestJwt: string;
2309
+ callbacks: Pick<CallbackContext, "verifyJwt">;
2310
+ jarRequestParams: {
2311
+ client_id?: string;
2312
+ };
2313
+ jwtSigner: JwtSigner;
2314
+ now?: Date;
2084
2315
  }
2085
- interface JwtSignerJwk {
2086
- alg: string;
2087
- /**
2088
- * The key id that should be used for signing. You need to make sure the kid actually matches
2089
- * with the key associated with the jwk.
2090
- *
2091
- * If not provided the kid can also be extracted from the `publicJwk`. Providing it here means the `kid` won't
2092
- * be included in the JWT header.
2093
- */
2094
- kid?: string;
2095
- method: "jwk";
2096
- publicJwk: Jwk;
2316
+ interface VerifiedJarRequest {
2317
+ authorizationRequestPayload: JarRequestObjectPayload;
2318
+ jwt: {
2319
+ payload: JarRequestObjectPayload;
2320
+ } & Omit<ReturnType<typeof decodeJwt>, "payload">;
2321
+ signer: JwtSignerWithJwk;
2097
2322
  }
2098
- interface JwtSignerX5c {
2099
- alg: string;
2323
+ /**
2324
+ * Verifies a JAR (JWT Secured Authorization Request) request by validating and verifying signatures.
2325
+ *
2326
+ * @param options - The input parameters
2327
+ * @param options.jarRequestParams - The JAR authorization request parameters
2328
+ * @param options.callbacks - Context containing the relevant Jose crypto operations
2329
+ * @returns The verified authorization request parameters and metadata
2330
+ */
2331
+ declare function verifyJarRequest(options: VerifyJarRequestOptions): Promise<VerifiedJarRequest>;
2332
+
2333
+ interface VerifyPushedAuthorizationRequestReturn extends VerifyAuthorizationRequestResult {
2100
2334
  /**
2101
- * The key id that should be used for signing. You need to make sure the kid actually matches
2102
- * with the key associated with the leaf certificate.
2335
+ * The verified JAR request, if `authorizationRequestJwt` was provided
2103
2336
  */
2104
- kid?: string;
2105
- method: "x5c";
2106
- trustChain?: TrustChain;
2107
- x5c: string[];
2337
+ jar?: VerifiedJarRequest;
2108
2338
  }
2109
- interface JwtSignerFederation {
2110
- alg: string;
2339
+ interface VerifyPushedAuthorizationRequestOptions extends Omit<VerifyAuthorizationRequestOptions, "authorizationServerMetadata"> {
2111
2340
  /**
2112
- * The key id that should be used for signing. You need to make sure the kid actually matches
2113
- * with a key present in the federation.
2114
- */
2115
- kid: string;
2116
- method: "federation";
2117
- trustChain?: TrustChain;
2118
- }
2119
- interface JwtSignerCustom {
2120
- alg: string;
2121
- /**
2122
- * The key id that should be used for signing.
2123
- */
2124
- kid?: string;
2125
- method: "custom";
2126
- }
2127
- type JwtSigner = JwtSignerCustom | JwtSignerDid | JwtSignerFederation | JwtSignerJwk | JwtSignerX5c;
2128
- type JwtSignerWithJwk = {
2129
- publicJwk: Jwk;
2130
- } & JwtSigner;
2131
- type JweEncryptor = {
2132
- /**
2133
- * base64-url encoded apu
2134
- */
2135
- apu?: string;
2136
- /**
2137
- * base64-url encoded apv
2138
- */
2139
- apv?: string;
2140
- enc: string;
2141
- } & JwtSignerJwk;
2142
- declare const zCompactJwt: z.ZodString;
2143
- declare const zJwtConfirmationPayload: z.ZodObject<{
2144
- jkt: z.ZodOptional<z.ZodString>;
2145
- jwk: z.ZodOptional<z.ZodObject<{
2146
- alg: z.ZodOptional<z.ZodString>;
2147
- crv: z.ZodOptional<z.ZodString>;
2148
- d: z.ZodOptional<z.ZodString>;
2149
- dp: z.ZodOptional<z.ZodString>;
2150
- dq: z.ZodOptional<z.ZodString>;
2151
- e: z.ZodOptional<z.ZodString>;
2152
- ext: z.ZodOptional<z.ZodBoolean>;
2153
- k: z.ZodOptional<z.ZodString>;
2154
- key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
2155
- kid: z.ZodOptional<z.ZodString>;
2156
- kty: z.ZodString;
2157
- n: z.ZodOptional<z.ZodString>;
2158
- oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
2159
- d: z.ZodOptional<z.ZodString>;
2160
- r: z.ZodOptional<z.ZodString>;
2161
- t: z.ZodOptional<z.ZodString>;
2162
- }, z.core.$loose>>>;
2163
- p: z.ZodOptional<z.ZodString>;
2164
- q: z.ZodOptional<z.ZodString>;
2165
- qi: z.ZodOptional<z.ZodString>;
2166
- use: z.ZodOptional<z.ZodString>;
2167
- x: z.ZodOptional<z.ZodString>;
2168
- x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2169
- x5t: z.ZodOptional<z.ZodString>;
2170
- "x5t#S256": z.ZodOptional<z.ZodString>;
2171
- x5u: z.ZodOptional<z.ZodString>;
2172
- y: z.ZodOptional<z.ZodString>;
2173
- }, z.core.$loose>>;
2174
- }, z.core.$loose>;
2175
- declare const zJwtPayload: z.ZodObject<{
2176
- aud: z.ZodOptional<z.ZodString>;
2177
- cnf: z.ZodOptional<z.ZodObject<{
2178
- jkt: z.ZodOptional<z.ZodString>;
2179
- jwk: z.ZodOptional<z.ZodObject<{
2180
- alg: z.ZodOptional<z.ZodString>;
2181
- crv: z.ZodOptional<z.ZodString>;
2182
- d: z.ZodOptional<z.ZodString>;
2183
- dp: z.ZodOptional<z.ZodString>;
2184
- dq: z.ZodOptional<z.ZodString>;
2185
- e: z.ZodOptional<z.ZodString>;
2186
- ext: z.ZodOptional<z.ZodBoolean>;
2187
- k: z.ZodOptional<z.ZodString>;
2188
- key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
2189
- kid: z.ZodOptional<z.ZodString>;
2190
- kty: z.ZodString;
2191
- n: z.ZodOptional<z.ZodString>;
2192
- oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
2193
- d: z.ZodOptional<z.ZodString>;
2194
- r: z.ZodOptional<z.ZodString>;
2195
- t: z.ZodOptional<z.ZodString>;
2196
- }, z.core.$loose>>>;
2197
- p: z.ZodOptional<z.ZodString>;
2198
- q: z.ZodOptional<z.ZodString>;
2199
- qi: z.ZodOptional<z.ZodString>;
2200
- use: z.ZodOptional<z.ZodString>;
2201
- x: z.ZodOptional<z.ZodString>;
2202
- x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2203
- x5t: z.ZodOptional<z.ZodString>;
2204
- "x5t#S256": z.ZodOptional<z.ZodString>;
2205
- x5u: z.ZodOptional<z.ZodString>;
2206
- y: z.ZodOptional<z.ZodString>;
2207
- }, z.core.$loose>>;
2208
- }, z.core.$loose>>;
2209
- exp: z.ZodOptional<z.ZodNumber>;
2210
- iat: z.ZodOptional<z.ZodNumber>;
2211
- iss: z.ZodOptional<z.ZodString>;
2212
- jti: z.ZodOptional<z.ZodString>;
2213
- nbf: z.ZodOptional<z.ZodNumber>;
2214
- nonce: z.ZodOptional<z.ZodString>;
2215
- status: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2216
- trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
2217
- }, z.core.$loose>;
2218
- type JwtPayload = z.infer<typeof zJwtPayload>;
2219
- declare const zJwtHeader: z.ZodObject<{
2220
- alg: z.ZodString;
2221
- jwk: z.ZodOptional<z.ZodObject<{
2222
- alg: z.ZodOptional<z.ZodString>;
2223
- crv: z.ZodOptional<z.ZodString>;
2224
- d: z.ZodOptional<z.ZodString>;
2225
- dp: z.ZodOptional<z.ZodString>;
2226
- dq: z.ZodOptional<z.ZodString>;
2227
- e: z.ZodOptional<z.ZodString>;
2228
- ext: z.ZodOptional<z.ZodBoolean>;
2229
- k: z.ZodOptional<z.ZodString>;
2230
- key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
2231
- kid: z.ZodOptional<z.ZodString>;
2232
- kty: z.ZodString;
2233
- n: z.ZodOptional<z.ZodString>;
2234
- oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
2235
- d: z.ZodOptional<z.ZodString>;
2236
- r: z.ZodOptional<z.ZodString>;
2237
- t: z.ZodOptional<z.ZodString>;
2238
- }, z.core.$loose>>>;
2239
- p: z.ZodOptional<z.ZodString>;
2240
- q: z.ZodOptional<z.ZodString>;
2241
- qi: z.ZodOptional<z.ZodString>;
2242
- use: z.ZodOptional<z.ZodString>;
2243
- x: z.ZodOptional<z.ZodString>;
2244
- x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2245
- x5t: z.ZodOptional<z.ZodString>;
2246
- "x5t#S256": z.ZodOptional<z.ZodString>;
2247
- x5u: z.ZodOptional<z.ZodString>;
2248
- y: z.ZodOptional<z.ZodString>;
2249
- }, z.core.$loose>>;
2250
- kid: z.ZodOptional<z.ZodString>;
2251
- trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
2252
- typ: z.ZodOptional<z.ZodString>;
2253
- x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2254
- }, z.core.$loose>;
2255
- type JwtHeader = z.infer<typeof zJwtHeader>;
2256
-
2257
- interface DecodeJwtOptions<HeaderSchema extends BaseSchema | undefined, PayloadSchema extends BaseSchema | undefined> {
2258
- /**
2259
- * Optional prefix for error messages thrown during decoding, to provide more context on where the error occurred
2260
- */
2261
- errorMessagePrefix?: string;
2262
- /**
2263
- * Schema to use for validating the header. If not provided the
2264
- * default `zJwtHeader` schema will be used
2265
- */
2266
- headerSchema?: HeaderSchema;
2267
- /**
2268
- * The compact encoded jwt
2269
- */
2270
- jwt: string;
2271
- /**
2272
- * Schema to use for validating the payload. If not provided the
2273
- * default `zJwtPayload` schema will be used
2274
- */
2275
- payloadSchema?: PayloadSchema;
2276
- }
2277
- interface DecodeJwtResult<HeaderSchema extends BaseSchema | undefined = undefined, PayloadSchema extends BaseSchema | undefined = undefined> {
2278
- header: InferSchemaOrDefaultOutput<HeaderSchema, typeof zJwtHeader>;
2279
- payload: InferSchemaOrDefaultOutput<PayloadSchema, typeof zJwtPayload>;
2280
- signature: string;
2281
- }
2282
- /**
2283
- * Decodes a compact JWT and validates its header and payload with Zod schemas.
2284
- *
2285
- * This helper does not verify the JWT signature.
2286
- *
2287
- * @param options - Decode options.
2288
- * @param options.errorMessagePrefix - Optional context prefix for thrown parse/validation errors.
2289
- * @param options.headerSchema - Optional schema for the JWT header; defaults to `zJwtHeader`.
2290
- * @param options.jwt - Compact JWT to decode.
2291
- * @param options.payloadSchema - Optional schema for the JWT payload; defaults to `zJwtPayload`.
2292
- * @returns Decoded and schema-validated JWT header, payload, and signature segment.
2293
- * @throws {Oauth2JwtParseError} If the JWT shape or base64url JSON segments are invalid.
2294
- * @throws {ValidationError} If header or payload schema validation fails.
2295
- */
2296
- declare function decodeJwt<HeaderSchema extends BaseSchema | undefined = undefined, PayloadSchema extends BaseSchema | undefined = undefined>(options: DecodeJwtOptions<HeaderSchema, PayloadSchema>): DecodeJwtResult<HeaderSchema, PayloadSchema>;
2297
- type IsSchemaProvided<T> = T extends undefined ? false : true;
2298
- type InferSchemaOrDefaultOutput<ProvidedSchema extends BaseSchema | undefined, DefaultSchema extends BaseSchema> = IsSchemaProvided<ProvidedSchema> extends true ? ProvidedSchema extends BaseSchema ? z.infer<ProvidedSchema> : never : z.infer<DefaultSchema>;
2299
-
2300
- declare const zJarAuthorizationRequest: z.ZodObject<{
2301
- client_id: z.ZodOptional<z.ZodString>;
2302
- request: z.ZodOptional<z.ZodString>;
2303
- request_uri: z.ZodOptional<z.ZodURL>;
2304
- }, z.core.$loose>;
2305
- type JarAuthorizationRequest = z.infer<typeof zJarAuthorizationRequest>;
2306
- declare const zJarRequestObjectPayload: z.ZodObject<{
2307
- client_id: z.ZodString;
2308
- aud: z.ZodOptional<z.ZodString>;
2309
- cnf: z.ZodOptional<z.ZodObject<{
2310
- jkt: z.ZodOptional<z.ZodString>;
2311
- jwk: z.ZodOptional<z.ZodObject<{
2312
- alg: z.ZodOptional<z.ZodString>;
2313
- crv: z.ZodOptional<z.ZodString>;
2314
- d: z.ZodOptional<z.ZodString>;
2315
- dp: z.ZodOptional<z.ZodString>;
2316
- dq: z.ZodOptional<z.ZodString>;
2317
- e: z.ZodOptional<z.ZodString>;
2318
- ext: z.ZodOptional<z.ZodBoolean>;
2319
- k: z.ZodOptional<z.ZodString>;
2320
- key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
2321
- kid: z.ZodOptional<z.ZodString>;
2322
- kty: z.ZodString;
2323
- n: z.ZodOptional<z.ZodString>;
2324
- oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
2325
- d: z.ZodOptional<z.ZodString>;
2326
- r: z.ZodOptional<z.ZodString>;
2327
- t: z.ZodOptional<z.ZodString>;
2328
- }, z.core.$loose>>>;
2329
- p: z.ZodOptional<z.ZodString>;
2330
- q: z.ZodOptional<z.ZodString>;
2331
- qi: z.ZodOptional<z.ZodString>;
2332
- use: z.ZodOptional<z.ZodString>;
2333
- x: z.ZodOptional<z.ZodString>;
2334
- x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2335
- x5t: z.ZodOptional<z.ZodString>;
2336
- "x5t#S256": z.ZodOptional<z.ZodString>;
2337
- x5u: z.ZodOptional<z.ZodString>;
2338
- y: z.ZodOptional<z.ZodString>;
2339
- }, z.core.$loose>>;
2340
- }, z.core.$loose>>;
2341
- exp: z.ZodOptional<z.ZodNumber>;
2342
- iat: z.ZodOptional<z.ZodNumber>;
2343
- iss: z.ZodOptional<z.ZodString>;
2344
- jti: z.ZodOptional<z.ZodString>;
2345
- nbf: z.ZodOptional<z.ZodNumber>;
2346
- nonce: z.ZodOptional<z.ZodString>;
2347
- status: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2348
- trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
2349
- }, z.core.$loose>;
2350
- type JarRequestObjectPayload = z.infer<typeof zJarRequestObjectPayload>;
2351
- declare const zSignedAuthorizationRequestJwtHeaderTyp: z.ZodLiteral<"oauth-authz-req+jwt">;
2352
- declare const zJarRequestObjectHeader: z.ZodObject<{
2353
- typ: z.ZodLiteral<"oauth-authz-req+jwt">;
2354
- alg: z.ZodString;
2355
- jwk: z.ZodOptional<z.ZodObject<{
2356
- alg: z.ZodOptional<z.ZodString>;
2357
- crv: z.ZodOptional<z.ZodString>;
2358
- d: z.ZodOptional<z.ZodString>;
2359
- dp: z.ZodOptional<z.ZodString>;
2360
- dq: z.ZodOptional<z.ZodString>;
2361
- e: z.ZodOptional<z.ZodString>;
2362
- ext: z.ZodOptional<z.ZodBoolean>;
2363
- k: z.ZodOptional<z.ZodString>;
2364
- key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
2365
- kid: z.ZodOptional<z.ZodString>;
2366
- kty: z.ZodString;
2367
- n: z.ZodOptional<z.ZodString>;
2368
- oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
2369
- d: z.ZodOptional<z.ZodString>;
2370
- r: z.ZodOptional<z.ZodString>;
2371
- t: z.ZodOptional<z.ZodString>;
2372
- }, z.core.$loose>>>;
2373
- p: z.ZodOptional<z.ZodString>;
2374
- q: z.ZodOptional<z.ZodString>;
2375
- qi: z.ZodOptional<z.ZodString>;
2376
- use: z.ZodOptional<z.ZodString>;
2377
- x: z.ZodOptional<z.ZodString>;
2378
- x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2379
- x5t: z.ZodOptional<z.ZodString>;
2380
- "x5t#S256": z.ZodOptional<z.ZodString>;
2381
- x5u: z.ZodOptional<z.ZodString>;
2382
- y: z.ZodOptional<z.ZodString>;
2383
- }, z.core.$loose>>;
2384
- kid: z.ZodOptional<z.ZodString>;
2385
- trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
2386
- x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2387
- }, z.core.$loose>;
2388
- type JarRequestObjectHeader = z.infer<typeof zJarRequestObjectHeader>;
2389
- declare const signedAuthorizationRequestJwtHeaderTyp: "oauth-authz-req+jwt";
2390
- declare const jwtAuthorizationRequestJwtHeaderTyp: "jwt";
2391
-
2392
- interface VerifyJarRequestOptions {
2393
- authorizationRequestJwt: string;
2394
- callbacks: Pick<CallbackContext, "verifyJwt">;
2395
- jarRequestParams: {
2396
- client_id?: string;
2397
- };
2398
- jwtSigner: JwtSigner$1;
2399
- now?: Date;
2400
- }
2401
- interface VerifiedJarRequest {
2402
- authorizationRequestPayload: JarRequestObjectPayload;
2403
- jwt: {
2404
- payload: JarRequestObjectPayload;
2405
- } & Omit<ReturnType<typeof decodeJwt>, "payload">;
2406
- signer: JwtSignerWithJwk$1;
2407
- }
2408
- /**
2409
- * Verifies a JAR (JWT Secured Authorization Request) request by validating and verifying signatures.
2410
- *
2411
- * @param options - The input parameters
2412
- * @param options.jarRequestParams - The JAR authorization request parameters
2413
- * @param options.callbacks - Context containing the relevant Jose crypto operations
2414
- * @returns The verified authorization request parameters and metadata
2415
- */
2416
- declare function verifyJarRequest(options: VerifyJarRequestOptions): Promise<VerifiedJarRequest>;
2417
-
2418
- interface VerifyPushedAuthorizationRequestReturn extends VerifyAuthorizationRequestResult {
2419
- /**
2420
- * The verified JAR request, if `authorizationRequestJwt` was provided
2421
- */
2422
- jar?: VerifiedJarRequest;
2423
- }
2424
- interface VerifyPushedAuthorizationRequestOptions extends Omit<VerifyAuthorizationRequestOptions, "authorizationServerMetadata"> {
2425
- /**
2426
- * The authorization request JWT to verify. If this value was returned from `parsePushedAuthorizationRequest`
2427
- * you MUST provide this value to ensure the JWT is verified.
2341
+ * The authorization request JWT to verify. If this value was returned from `parsePushedAuthorizationRequest`
2342
+ * you MUST provide this value to ensure the JWT is verified.
2428
2343
  */
2429
2344
  authorizationRequestJwt?: {
2430
2345
  jwt: string;
2431
- signer: JwtSigner$1;
2346
+ signer: JwtSigner;
2432
2347
  };
2433
2348
  /**
2434
2349
  * Authorization Server metadata for enforcing JAR signing policy.
@@ -2555,7 +2470,7 @@ type SupportedClientAuthenticationMethod = (typeof SupportedClientAuthentication
2555
2470
  */
2556
2471
  interface IsClientAttestationSupportedOptions {
2557
2472
  /** Authorization server metadata containing supported authentication methods. */
2558
- authorizationServerMetadata: ItWalletAuthorizationServerMetadata;
2473
+ authorizationServerMetadata: BaseAuthorizationServerMetadata;
2559
2474
  }
2560
2475
  /**
2561
2476
  * Checks whether the authorization server supports client attestation authentication.
@@ -2566,39 +2481,8 @@ interface IsClientAttestationSupportedOptions {
2566
2481
  declare function isClientAttestationSupported(options: IsClientAttestationSupportedOptions): {
2567
2482
  supported: boolean;
2568
2483
  };
2569
- /**
2570
- * Options for client authentication
2571
- */
2572
- interface ClientAuthenticationCallbackOptions {
2573
- /**
2574
- * Metadata of the authorization server
2575
- */
2576
- authorizationServerMetadata: ItWalletAuthorizationServerMetadata;
2577
- /**
2578
- * The body as a JSON object. If content type `x-www-form-urlencoded`
2579
- * is used, it will be encoded after this call.
2580
- *
2581
- * You can modify this object
2582
- */
2583
- body: Record<string, unknown>;
2584
- contentType: ContentType;
2585
- /**
2586
- * Headers for the request. You can modify this object
2587
- */
2588
- headers: FetchHeaders;
2589
- /**
2590
- * http method that will be used
2591
- */
2592
- method: HttpMethod;
2593
- /**
2594
- * URL to which the request will be made
2595
- */
2596
- url: string;
2597
- }
2598
- /**
2599
- * Callback method to determine the client authentication for a request.
2600
- */
2601
- type ClientAuthenticationCallback = (options: ClientAuthenticationCallbackOptions) => Promise<void> | void;
2484
+ type ClientAuthenticationCallbackOptions = ClientAuthenticationCallbackOptions$1<BaseAuthorizationServerMetadata>;
2485
+ type ClientAuthenticationCallback = ClientAuthenticationCallback$1<ClientAuthenticationCallbackOptions>;
2602
2486
  /**
2603
2487
  * Creates a client authentication callback that leaves the request unchanged.
2604
2488
  *
@@ -2630,42 +2514,42 @@ declare function clientAuthenticationWalletAttestationJwt<V extends ItWalletSpec
2630
2514
  * - trust_chain is REQUIRED
2631
2515
  * - x5c is NOT supported
2632
2516
  */
2633
- declare const zWalletAttestationJwtHeaderV1_0: z$1.ZodObject<{
2634
- trust_chain: z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>;
2635
- typ: z$1.ZodLiteral<"oauth-client-attestation+jwt">;
2636
- alg: z$1.ZodString;
2637
- jwk: z$1.ZodOptional<z$1.ZodObject<{
2638
- alg: z$1.ZodOptional<z$1.ZodString>;
2639
- crv: z$1.ZodOptional<z$1.ZodString>;
2640
- d: z$1.ZodOptional<z$1.ZodString>;
2641
- dp: z$1.ZodOptional<z$1.ZodString>;
2642
- dq: z$1.ZodOptional<z$1.ZodString>;
2643
- e: z$1.ZodOptional<z$1.ZodString>;
2644
- ext: z$1.ZodOptional<z$1.ZodBoolean>;
2645
- k: z$1.ZodOptional<z$1.ZodString>;
2646
- key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2647
- kid: z$1.ZodOptional<z$1.ZodString>;
2648
- kty: z$1.ZodString;
2649
- n: z$1.ZodOptional<z$1.ZodString>;
2650
- oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2651
- d: z$1.ZodOptional<z$1.ZodString>;
2652
- r: z$1.ZodOptional<z$1.ZodString>;
2653
- t: z$1.ZodOptional<z$1.ZodString>;
2654
- }, z$1.core.$loose>>>;
2655
- p: z$1.ZodOptional<z$1.ZodString>;
2656
- q: z$1.ZodOptional<z$1.ZodString>;
2657
- qi: z$1.ZodOptional<z$1.ZodString>;
2658
- use: z$1.ZodOptional<z$1.ZodString>;
2659
- x: z$1.ZodOptional<z$1.ZodString>;
2660
- x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2661
- x5t: z$1.ZodOptional<z$1.ZodString>;
2662
- "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
2663
- x5u: z$1.ZodOptional<z$1.ZodString>;
2664
- y: z$1.ZodOptional<z$1.ZodString>;
2665
- }, z$1.core.$loose>>;
2666
- kid: z$1.ZodOptional<z$1.ZodString>;
2667
- x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2668
- }, z$1.core.$loose>;
2517
+ declare const zWalletAttestationJwtHeaderV1_0: z.ZodObject<{
2518
+ trust_chain: z.ZodTuple<[z.ZodString], z.ZodString>;
2519
+ typ: z.ZodLiteral<"oauth-client-attestation+jwt">;
2520
+ alg: z.ZodString;
2521
+ jwk: z.ZodOptional<z.ZodObject<{
2522
+ alg: z.ZodOptional<z.ZodString>;
2523
+ crv: z.ZodOptional<z.ZodString>;
2524
+ d: z.ZodOptional<z.ZodString>;
2525
+ dp: z.ZodOptional<z.ZodString>;
2526
+ dq: z.ZodOptional<z.ZodString>;
2527
+ e: z.ZodOptional<z.ZodString>;
2528
+ ext: z.ZodOptional<z.ZodBoolean>;
2529
+ k: z.ZodOptional<z.ZodString>;
2530
+ key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
2531
+ kid: z.ZodOptional<z.ZodString>;
2532
+ kty: z.ZodString;
2533
+ n: z.ZodOptional<z.ZodString>;
2534
+ oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
2535
+ d: z.ZodOptional<z.ZodString>;
2536
+ r: z.ZodOptional<z.ZodString>;
2537
+ t: z.ZodOptional<z.ZodString>;
2538
+ }, z.core.$loose>>>;
2539
+ p: z.ZodOptional<z.ZodString>;
2540
+ q: z.ZodOptional<z.ZodString>;
2541
+ qi: z.ZodOptional<z.ZodString>;
2542
+ use: z.ZodOptional<z.ZodString>;
2543
+ x: z.ZodOptional<z.ZodString>;
2544
+ x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2545
+ x5t: z.ZodOptional<z.ZodString>;
2546
+ "x5t#S256": z.ZodOptional<z.ZodString>;
2547
+ x5u: z.ZodOptional<z.ZodString>;
2548
+ y: z.ZodOptional<z.ZodString>;
2549
+ }, z.core.$loose>>;
2550
+ kid: z.ZodOptional<z.ZodString>;
2551
+ x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2552
+ }, z.core.$loose>;
2669
2553
  /**
2670
2554
  * JWT Payload schema for IT-Wallet v1.0 Wallet Attestation
2671
2555
  *
@@ -2673,52 +2557,52 @@ declare const zWalletAttestationJwtHeaderV1_0: z$1.ZodObject<{
2673
2557
  * - Standard claims only
2674
2558
  * - No nbf or status support
2675
2559
  */
2676
- declare const zWalletAttestationJwtPayloadV1_0: z$1.ZodObject<{
2677
- aal: z$1.ZodString;
2678
- cnf: z$1.ZodObject<{
2679
- jwk: z$1.ZodObject<{
2680
- alg: z$1.ZodOptional<z$1.ZodString>;
2681
- crv: z$1.ZodOptional<z$1.ZodString>;
2682
- d: z$1.ZodOptional<z$1.ZodString>;
2683
- dp: z$1.ZodOptional<z$1.ZodString>;
2684
- dq: z$1.ZodOptional<z$1.ZodString>;
2685
- e: z$1.ZodOptional<z$1.ZodString>;
2686
- ext: z$1.ZodOptional<z$1.ZodBoolean>;
2687
- k: z$1.ZodOptional<z$1.ZodString>;
2688
- key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2689
- kid: z$1.ZodOptional<z$1.ZodString>;
2690
- kty: z$1.ZodString;
2691
- n: z$1.ZodOptional<z$1.ZodString>;
2692
- oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2693
- d: z$1.ZodOptional<z$1.ZodString>;
2694
- r: z$1.ZodOptional<z$1.ZodString>;
2695
- t: z$1.ZodOptional<z$1.ZodString>;
2696
- }, z$1.core.$loose>>>;
2697
- p: z$1.ZodOptional<z$1.ZodString>;
2698
- q: z$1.ZodOptional<z$1.ZodString>;
2699
- qi: z$1.ZodOptional<z$1.ZodString>;
2700
- use: z$1.ZodOptional<z$1.ZodString>;
2701
- x: z$1.ZodOptional<z$1.ZodString>;
2702
- x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2703
- x5t: z$1.ZodOptional<z$1.ZodString>;
2704
- "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
2705
- x5u: z$1.ZodOptional<z$1.ZodString>;
2706
- y: z$1.ZodOptional<z$1.ZodString>;
2707
- }, z$1.core.$loose>;
2708
- }, z$1.core.$strip>;
2709
- exp: z$1.ZodNumber;
2710
- iat: z$1.ZodNumber;
2711
- iss: z$1.ZodString;
2712
- sub: z$1.ZodString;
2713
- wallet_link: z$1.ZodOptional<z$1.ZodURL>;
2714
- wallet_name: z$1.ZodOptional<z$1.ZodString>;
2715
- aud: z$1.ZodOptional<z$1.ZodString>;
2716
- jti: z$1.ZodOptional<z$1.ZodString>;
2717
- nbf: z$1.ZodOptional<z$1.ZodNumber>;
2718
- nonce: z$1.ZodOptional<z$1.ZodString>;
2719
- status: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
2720
- trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
2721
- }, z$1.core.$loose>;
2560
+ declare const zWalletAttestationJwtPayloadV1_0: z.ZodObject<{
2561
+ aal: z.ZodString;
2562
+ cnf: z.ZodObject<{
2563
+ jwk: z.ZodObject<{
2564
+ alg: z.ZodOptional<z.ZodString>;
2565
+ crv: z.ZodOptional<z.ZodString>;
2566
+ d: z.ZodOptional<z.ZodString>;
2567
+ dp: z.ZodOptional<z.ZodString>;
2568
+ dq: z.ZodOptional<z.ZodString>;
2569
+ e: z.ZodOptional<z.ZodString>;
2570
+ ext: z.ZodOptional<z.ZodBoolean>;
2571
+ k: z.ZodOptional<z.ZodString>;
2572
+ key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
2573
+ kid: z.ZodOptional<z.ZodString>;
2574
+ kty: z.ZodString;
2575
+ n: z.ZodOptional<z.ZodString>;
2576
+ oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
2577
+ d: z.ZodOptional<z.ZodString>;
2578
+ r: z.ZodOptional<z.ZodString>;
2579
+ t: z.ZodOptional<z.ZodString>;
2580
+ }, z.core.$loose>>>;
2581
+ p: z.ZodOptional<z.ZodString>;
2582
+ q: z.ZodOptional<z.ZodString>;
2583
+ qi: z.ZodOptional<z.ZodString>;
2584
+ use: z.ZodOptional<z.ZodString>;
2585
+ x: z.ZodOptional<z.ZodString>;
2586
+ x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2587
+ x5t: z.ZodOptional<z.ZodString>;
2588
+ "x5t#S256": z.ZodOptional<z.ZodString>;
2589
+ x5u: z.ZodOptional<z.ZodString>;
2590
+ y: z.ZodOptional<z.ZodString>;
2591
+ }, z.core.$loose>;
2592
+ }, z.core.$strip>;
2593
+ exp: z.ZodNumber;
2594
+ iat: z.ZodNumber;
2595
+ iss: z.ZodString;
2596
+ sub: z.ZodString;
2597
+ wallet_link: z.ZodOptional<z.ZodURL>;
2598
+ wallet_name: z.ZodOptional<z.ZodString>;
2599
+ aud: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>;
2600
+ jti: z.ZodOptional<z.ZodString>;
2601
+ nbf: z.ZodOptional<z.ZodNumber>;
2602
+ nonce: z.ZodOptional<z.ZodString>;
2603
+ status: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2604
+ trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
2605
+ }, z.core.$loose>;
2722
2606
  /**
2723
2607
  * Wallet Attestation JWT type for v1.0
2724
2608
  * The JWT is returned as a compact string
@@ -2728,7 +2612,7 @@ type WalletAttestationJwtV1_0 = string;
2728
2612
  * Zod schema for wallet attestation JWT validation (v1.0)
2729
2613
  * Validates that the result is a non-empty string
2730
2614
  */
2731
- declare const zWalletAttestationJwtV1_0: z$1.ZodString;
2615
+ declare const zWalletAttestationJwtV1_0: z.ZodString;
2732
2616
 
2733
2617
  /**
2734
2618
  * Options for creating a wallet attestation with v1.0
@@ -2767,42 +2651,42 @@ declare const createWalletAttestationJwt$2: (options: WalletAttestationOptionsV1
2767
2651
  * - x5c is REQUIRED
2768
2652
  * - trust_chain is OPTIONAL
2769
2653
  */
2770
- declare const zWalletAttestationJwtHeaderV1_3: z$1.ZodObject<{
2771
- trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
2772
- typ: z$1.ZodLiteral<"oauth-client-attestation+jwt">;
2773
- x5c: z$1.ZodArray<z$1.ZodString>;
2774
- alg: z$1.ZodString;
2775
- jwk: z$1.ZodOptional<z$1.ZodObject<{
2776
- alg: z$1.ZodOptional<z$1.ZodString>;
2777
- crv: z$1.ZodOptional<z$1.ZodString>;
2778
- d: z$1.ZodOptional<z$1.ZodString>;
2779
- dp: z$1.ZodOptional<z$1.ZodString>;
2780
- dq: z$1.ZodOptional<z$1.ZodString>;
2781
- e: z$1.ZodOptional<z$1.ZodString>;
2782
- ext: z$1.ZodOptional<z$1.ZodBoolean>;
2783
- k: z$1.ZodOptional<z$1.ZodString>;
2784
- key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2785
- kid: z$1.ZodOptional<z$1.ZodString>;
2786
- kty: z$1.ZodString;
2787
- n: z$1.ZodOptional<z$1.ZodString>;
2788
- oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2789
- d: z$1.ZodOptional<z$1.ZodString>;
2790
- r: z$1.ZodOptional<z$1.ZodString>;
2791
- t: z$1.ZodOptional<z$1.ZodString>;
2792
- }, z$1.core.$loose>>>;
2793
- p: z$1.ZodOptional<z$1.ZodString>;
2794
- q: z$1.ZodOptional<z$1.ZodString>;
2795
- qi: z$1.ZodOptional<z$1.ZodString>;
2796
- use: z$1.ZodOptional<z$1.ZodString>;
2797
- x: z$1.ZodOptional<z$1.ZodString>;
2798
- x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2799
- x5t: z$1.ZodOptional<z$1.ZodString>;
2800
- "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
2801
- x5u: z$1.ZodOptional<z$1.ZodString>;
2802
- y: z$1.ZodOptional<z$1.ZodString>;
2803
- }, z$1.core.$loose>>;
2804
- kid: z$1.ZodOptional<z$1.ZodString>;
2805
- }, z$1.core.$loose>;
2654
+ declare const zWalletAttestationJwtHeaderV1_3: z.ZodObject<{
2655
+ trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
2656
+ typ: z.ZodLiteral<"oauth-client-attestation+jwt">;
2657
+ x5c: z.ZodArray<z.ZodString>;
2658
+ alg: z.ZodString;
2659
+ jwk: z.ZodOptional<z.ZodObject<{
2660
+ alg: z.ZodOptional<z.ZodString>;
2661
+ crv: z.ZodOptional<z.ZodString>;
2662
+ d: z.ZodOptional<z.ZodString>;
2663
+ dp: z.ZodOptional<z.ZodString>;
2664
+ dq: z.ZodOptional<z.ZodString>;
2665
+ e: z.ZodOptional<z.ZodString>;
2666
+ ext: z.ZodOptional<z.ZodBoolean>;
2667
+ k: z.ZodOptional<z.ZodString>;
2668
+ key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
2669
+ kid: z.ZodOptional<z.ZodString>;
2670
+ kty: z.ZodString;
2671
+ n: z.ZodOptional<z.ZodString>;
2672
+ oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
2673
+ d: z.ZodOptional<z.ZodString>;
2674
+ r: z.ZodOptional<z.ZodString>;
2675
+ t: z.ZodOptional<z.ZodString>;
2676
+ }, z.core.$loose>>>;
2677
+ p: z.ZodOptional<z.ZodString>;
2678
+ q: z.ZodOptional<z.ZodString>;
2679
+ qi: z.ZodOptional<z.ZodString>;
2680
+ use: z.ZodOptional<z.ZodString>;
2681
+ x: z.ZodOptional<z.ZodString>;
2682
+ x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2683
+ x5t: z.ZodOptional<z.ZodString>;
2684
+ "x5t#S256": z.ZodOptional<z.ZodString>;
2685
+ x5u: z.ZodOptional<z.ZodString>;
2686
+ y: z.ZodOptional<z.ZodString>;
2687
+ }, z.core.$loose>>;
2688
+ kid: z.ZodOptional<z.ZodString>;
2689
+ }, z.core.$loose>;
2806
2690
  /**
2807
2691
  * JWT Payload schema for IT-Wallet v1.3 Wallet Attestation
2808
2692
  *
@@ -2810,56 +2694,56 @@ declare const zWalletAttestationJwtHeaderV1_3: z$1.ZodObject<{
2810
2694
  * - Supports nbf (not before) claim
2811
2695
  * - Supports status claim for revocation mechanisms
2812
2696
  */
2813
- declare const zWalletAttestationJwtPayloadV1_3: z$1.ZodObject<{
2814
- cnf: z$1.ZodObject<{
2815
- jwk: z$1.ZodObject<{
2816
- alg: z$1.ZodOptional<z$1.ZodString>;
2817
- crv: z$1.ZodOptional<z$1.ZodString>;
2818
- d: z$1.ZodOptional<z$1.ZodString>;
2819
- dp: z$1.ZodOptional<z$1.ZodString>;
2820
- dq: z$1.ZodOptional<z$1.ZodString>;
2821
- e: z$1.ZodOptional<z$1.ZodString>;
2822
- ext: z$1.ZodOptional<z$1.ZodBoolean>;
2823
- k: z$1.ZodOptional<z$1.ZodString>;
2824
- key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2825
- kid: z$1.ZodOptional<z$1.ZodString>;
2826
- kty: z$1.ZodString;
2827
- n: z$1.ZodOptional<z$1.ZodString>;
2828
- oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2829
- d: z$1.ZodOptional<z$1.ZodString>;
2830
- r: z$1.ZodOptional<z$1.ZodString>;
2831
- t: z$1.ZodOptional<z$1.ZodString>;
2832
- }, z$1.core.$loose>>>;
2833
- p: z$1.ZodOptional<z$1.ZodString>;
2834
- q: z$1.ZodOptional<z$1.ZodString>;
2835
- qi: z$1.ZodOptional<z$1.ZodString>;
2836
- use: z$1.ZodOptional<z$1.ZodString>;
2837
- x: z$1.ZodOptional<z$1.ZodString>;
2838
- x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2839
- x5t: z$1.ZodOptional<z$1.ZodString>;
2840
- "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
2841
- x5u: z$1.ZodOptional<z$1.ZodString>;
2842
- y: z$1.ZodOptional<z$1.ZodString>;
2843
- }, z$1.core.$loose>;
2844
- }, z$1.core.$strip>;
2845
- exp: z$1.ZodNumber;
2846
- iat: z$1.ZodNumber;
2847
- iss: z$1.ZodString;
2848
- nbf: z$1.ZodOptional<z$1.ZodNumber>;
2849
- status: z$1.ZodOptional<z$1.ZodObject<{
2850
- status_list: z$1.ZodObject<{
2851
- idx: z$1.ZodNumber;
2852
- uri: z$1.ZodString;
2853
- }, z$1.core.$strip>;
2854
- }, z$1.core.$strip>>;
2855
- sub: z$1.ZodString;
2856
- wallet_link: z$1.ZodOptional<z$1.ZodURL>;
2857
- wallet_name: z$1.ZodOptional<z$1.ZodString>;
2858
- aud: z$1.ZodOptional<z$1.ZodString>;
2859
- jti: z$1.ZodOptional<z$1.ZodString>;
2860
- nonce: z$1.ZodOptional<z$1.ZodString>;
2861
- trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
2862
- }, z$1.core.$loose>;
2697
+ declare const zWalletAttestationJwtPayloadV1_3: z.ZodObject<{
2698
+ cnf: z.ZodObject<{
2699
+ jwk: z.ZodObject<{
2700
+ alg: z.ZodOptional<z.ZodString>;
2701
+ crv: z.ZodOptional<z.ZodString>;
2702
+ d: z.ZodOptional<z.ZodString>;
2703
+ dp: z.ZodOptional<z.ZodString>;
2704
+ dq: z.ZodOptional<z.ZodString>;
2705
+ e: z.ZodOptional<z.ZodString>;
2706
+ ext: z.ZodOptional<z.ZodBoolean>;
2707
+ k: z.ZodOptional<z.ZodString>;
2708
+ key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
2709
+ kid: z.ZodOptional<z.ZodString>;
2710
+ kty: z.ZodString;
2711
+ n: z.ZodOptional<z.ZodString>;
2712
+ oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
2713
+ d: z.ZodOptional<z.ZodString>;
2714
+ r: z.ZodOptional<z.ZodString>;
2715
+ t: z.ZodOptional<z.ZodString>;
2716
+ }, z.core.$loose>>>;
2717
+ p: z.ZodOptional<z.ZodString>;
2718
+ q: z.ZodOptional<z.ZodString>;
2719
+ qi: z.ZodOptional<z.ZodString>;
2720
+ use: z.ZodOptional<z.ZodString>;
2721
+ x: z.ZodOptional<z.ZodString>;
2722
+ x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2723
+ x5t: z.ZodOptional<z.ZodString>;
2724
+ "x5t#S256": z.ZodOptional<z.ZodString>;
2725
+ x5u: z.ZodOptional<z.ZodString>;
2726
+ y: z.ZodOptional<z.ZodString>;
2727
+ }, z.core.$loose>;
2728
+ }, z.core.$strip>;
2729
+ exp: z.ZodNumber;
2730
+ iat: z.ZodNumber;
2731
+ iss: z.ZodString;
2732
+ nbf: z.ZodOptional<z.ZodNumber>;
2733
+ status: z.ZodOptional<z.ZodObject<{
2734
+ status_list: z.ZodObject<{
2735
+ idx: z.ZodNumber;
2736
+ uri: z.ZodString;
2737
+ }, z.core.$strip>;
2738
+ }, z.core.$strip>>;
2739
+ sub: z.ZodString;
2740
+ wallet_link: z.ZodOptional<z.ZodURL>;
2741
+ wallet_name: z.ZodOptional<z.ZodString>;
2742
+ aud: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>;
2743
+ jti: z.ZodOptional<z.ZodString>;
2744
+ nonce: z.ZodOptional<z.ZodString>;
2745
+ trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
2746
+ }, z.core.$loose>;
2863
2747
  /**
2864
2748
  * Wallet Attestation JWT type for v1.3
2865
2749
  * The JWT is returned as a compact string
@@ -2869,7 +2753,7 @@ type WalletAttestationJwtV1_3 = string;
2869
2753
  * Zod schema for wallet attestation JWT validation (v1.3)
2870
2754
  * Validates that the result is a non-empty string
2871
2755
  */
2872
- declare const zWalletAttestationJwtV1_3: z$1.ZodString;
2756
+ declare const zWalletAttestationJwtV1_3: z.ZodString;
2873
2757
 
2874
2758
  /**
2875
2759
  * Options for creating a wallet attestation with v1.3
@@ -2907,166 +2791,11 @@ interface WalletAttestationOptionsV1_3 extends BaseWalletAttestationOptions {
2907
2791
  */
2908
2792
  declare const createWalletAttestationJwt$1: (options: WalletAttestationOptionsV1_3) => Promise<WalletAttestationJwtV1_3>;
2909
2793
 
2910
- declare const zWalletAttestationJwtHeaderV1_4: z$1.ZodObject<{
2911
- kid: z$1.ZodString;
2912
- trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
2913
- typ: z$1.ZodLiteral<"oauth-client-attestation+jwt">;
2914
- x5c: z$1.ZodArray<z$1.ZodString>;
2915
- alg: z$1.ZodString;
2916
- jwk: z$1.ZodOptional<z$1.ZodObject<{
2917
- alg: z$1.ZodOptional<z$1.ZodString>;
2918
- crv: z$1.ZodOptional<z$1.ZodString>;
2919
- d: z$1.ZodOptional<z$1.ZodString>;
2920
- dp: z$1.ZodOptional<z$1.ZodString>;
2921
- dq: z$1.ZodOptional<z$1.ZodString>;
2922
- e: z$1.ZodOptional<z$1.ZodString>;
2923
- ext: z$1.ZodOptional<z$1.ZodBoolean>;
2924
- k: z$1.ZodOptional<z$1.ZodString>;
2925
- key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2926
- kid: z$1.ZodOptional<z$1.ZodString>;
2927
- kty: z$1.ZodString;
2928
- n: z$1.ZodOptional<z$1.ZodString>;
2929
- oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2930
- d: z$1.ZodOptional<z$1.ZodString>;
2931
- r: z$1.ZodOptional<z$1.ZodString>;
2932
- t: z$1.ZodOptional<z$1.ZodString>;
2933
- }, z$1.core.$loose>>>;
2934
- p: z$1.ZodOptional<z$1.ZodString>;
2935
- q: z$1.ZodOptional<z$1.ZodString>;
2936
- qi: z$1.ZodOptional<z$1.ZodString>;
2937
- use: z$1.ZodOptional<z$1.ZodString>;
2938
- x: z$1.ZodOptional<z$1.ZodString>;
2939
- x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2940
- x5t: z$1.ZodOptional<z$1.ZodString>;
2941
- "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
2942
- x5u: z$1.ZodOptional<z$1.ZodString>;
2943
- y: z$1.ZodOptional<z$1.ZodString>;
2944
- }, z$1.core.$loose>>;
2945
- }, z$1.core.$loose>;
2946
- declare const zWalletAttestationJwtPayloadV1_4: z$1.ZodObject<{
2947
- cnf: z$1.ZodObject<{
2948
- jwk: z$1.ZodObject<{
2949
- alg: z$1.ZodOptional<z$1.ZodString>;
2950
- crv: z$1.ZodOptional<z$1.ZodString>;
2951
- d: z$1.ZodOptional<z$1.ZodString>;
2952
- dp: z$1.ZodOptional<z$1.ZodString>;
2953
- dq: z$1.ZodOptional<z$1.ZodString>;
2954
- e: z$1.ZodOptional<z$1.ZodString>;
2955
- ext: z$1.ZodOptional<z$1.ZodBoolean>;
2956
- k: z$1.ZodOptional<z$1.ZodString>;
2957
- key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2958
- kid: z$1.ZodOptional<z$1.ZodString>;
2959
- kty: z$1.ZodString;
2960
- n: z$1.ZodOptional<z$1.ZodString>;
2961
- oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2962
- d: z$1.ZodOptional<z$1.ZodString>;
2963
- r: z$1.ZodOptional<z$1.ZodString>;
2964
- t: z$1.ZodOptional<z$1.ZodString>;
2965
- }, z$1.core.$loose>>>;
2966
- p: z$1.ZodOptional<z$1.ZodString>;
2967
- q: z$1.ZodOptional<z$1.ZodString>;
2968
- qi: z$1.ZodOptional<z$1.ZodString>;
2969
- use: z$1.ZodOptional<z$1.ZodString>;
2970
- x: z$1.ZodOptional<z$1.ZodString>;
2971
- x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2972
- x5t: z$1.ZodOptional<z$1.ZodString>;
2973
- "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
2974
- x5u: z$1.ZodOptional<z$1.ZodString>;
2975
- y: z$1.ZodOptional<z$1.ZodString>;
2976
- }, z$1.core.$loose>;
2977
- }, z$1.core.$strip>;
2978
- exp: z$1.ZodNumber;
2979
- iat: z$1.ZodNumber;
2980
- iss: z$1.ZodString;
2981
- nbf: z$1.ZodOptional<z$1.ZodNumber>;
2982
- sub: z$1.ZodString;
2983
- wallet_link: z$1.ZodURL;
2984
- wallet_name: z$1.ZodString;
2985
- aud: z$1.ZodOptional<z$1.ZodString>;
2986
- jti: z$1.ZodOptional<z$1.ZodString>;
2987
- nonce: z$1.ZodOptional<z$1.ZodString>;
2988
- status: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
2989
- trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
2990
- }, z$1.core.$loose>;
2991
- type WalletAttestationJwtV1_4 = string;
2992
- declare const zWalletAttestationJwtV1_4: z$1.ZodString;
2993
-
2994
- interface WalletAttestationOptionsV1_4 extends Omit<BaseWalletAttestationOptions, "walletLink" | "walletName"> {
2995
- nbf?: Date;
2996
- signer: {
2997
- alg: string;
2998
- kid: string;
2999
- method: "x5c";
3000
- trustChain?: [string, ...string[]];
3001
- x5c: [string, ...string[]];
3002
- };
3003
- walletLink: string;
3004
- walletName: string;
3005
- }
3006
- /**
3007
- * Creates a wallet attestation JWT for IT-Wallet v1.4.
3008
- *
3009
- * @param options - v1.4 wallet attestation creation options.
3010
- * @returns Signed wallet attestation JWT.
3011
- * @throws {ValidationError} If temporal constraints or generated JWT validation fail.
3012
- * @throws {ClientAttestationError} For unexpected errors during attestation creation.
3013
- */
3014
- declare const createWalletAttestationJwt: (options: WalletAttestationOptionsV1_4) => Promise<WalletAttestationJwtV1_4>;
3015
-
3016
- declare const IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES: readonly ["ES256", "ES384", "ES512"];
3017
- declare const zItWalletClientAttestationPopJwtAlg: z.ZodEnum<{
3018
- ES256: "ES256";
3019
- ES384: "ES384";
3020
- ES512: "ES512";
3021
- }>;
3022
- type ItWalletClientAttestationPopJwtAlg = z.infer<typeof zItWalletClientAttestationPopJwtAlg>;
3023
- declare const zItWalletClientAttestationPopJwtPayload: z.ZodObject<{
3024
- aud: z.ZodString;
3025
- exp: z.ZodOptional<z.ZodNumber>;
3026
- iat: z.ZodNumber;
3027
- iss: z.ZodString;
3028
- jti: z.ZodString;
3029
- nonce: z.ZodOptional<z.ZodString>;
3030
- cnf: z.ZodOptional<z.ZodObject<{
3031
- jkt: z.ZodOptional<z.ZodString>;
3032
- jwk: z.ZodOptional<z.ZodObject<{
3033
- alg: z.ZodOptional<z.ZodString>;
3034
- crv: z.ZodOptional<z.ZodString>;
3035
- d: z.ZodOptional<z.ZodString>;
3036
- dp: z.ZodOptional<z.ZodString>;
3037
- dq: z.ZodOptional<z.ZodString>;
3038
- e: z.ZodOptional<z.ZodString>;
3039
- ext: z.ZodOptional<z.ZodBoolean>;
3040
- k: z.ZodOptional<z.ZodString>;
3041
- key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
3042
- kid: z.ZodOptional<z.ZodString>;
3043
- kty: z.ZodString;
3044
- n: z.ZodOptional<z.ZodString>;
3045
- oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
3046
- d: z.ZodOptional<z.ZodString>;
3047
- r: z.ZodOptional<z.ZodString>;
3048
- t: z.ZodOptional<z.ZodString>;
3049
- }, z.core.$loose>>>;
3050
- p: z.ZodOptional<z.ZodString>;
3051
- q: z.ZodOptional<z.ZodString>;
3052
- qi: z.ZodOptional<z.ZodString>;
3053
- use: z.ZodOptional<z.ZodString>;
3054
- x: z.ZodOptional<z.ZodString>;
3055
- x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
3056
- x5t: z.ZodOptional<z.ZodString>;
3057
- "x5t#S256": z.ZodOptional<z.ZodString>;
3058
- x5u: z.ZodOptional<z.ZodString>;
3059
- y: z.ZodOptional<z.ZodString>;
3060
- }, z.core.$loose>>;
3061
- }, z.core.$loose>>;
3062
- nbf: z.ZodOptional<z.ZodNumber>;
3063
- status: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
2794
+ declare const zWalletAttestationJwtHeaderV1_4: z.ZodObject<{
2795
+ kid: z.ZodString;
3064
2796
  trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
3065
- }, z.core.$loose>;
3066
- type ItWalletClientAttestationPopJwtPayload = z.infer<typeof zItWalletClientAttestationPopJwtPayload>;
3067
- declare const zItWalletClientAttestationPopJwtTyp: z.ZodLiteral<"oauth-client-attestation-pop+jwt">;
3068
- declare const zItWalletClientAttestationPopJwtHeader: z.ZodObject<{
3069
- typ: z.ZodLiteral<"oauth-client-attestation-pop+jwt">;
2797
+ typ: z.ZodLiteral<"oauth-client-attestation+jwt">;
2798
+ x5c: z.ZodArray<z.ZodString>;
3070
2799
  alg: z.ZodString;
3071
2800
  jwk: z.ZodOptional<z.ZodObject<{
3072
2801
  alg: z.ZodOptional<z.ZodString>;
@@ -3097,113 +2826,167 @@ declare const zItWalletClientAttestationPopJwtHeader: z.ZodObject<{
3097
2826
  x5u: z.ZodOptional<z.ZodString>;
3098
2827
  y: z.ZodOptional<z.ZodString>;
3099
2828
  }, z.core.$loose>>;
3100
- kid: z.ZodOptional<z.ZodString>;
2829
+ }, z.core.$loose>;
2830
+ declare const zWalletAttestationJwtPayloadV1_4: z.ZodObject<{
2831
+ cnf: z.ZodObject<{
2832
+ jwk: z.ZodObject<{
2833
+ alg: z.ZodOptional<z.ZodString>;
2834
+ crv: z.ZodOptional<z.ZodString>;
2835
+ d: z.ZodOptional<z.ZodString>;
2836
+ dp: z.ZodOptional<z.ZodString>;
2837
+ dq: z.ZodOptional<z.ZodString>;
2838
+ e: z.ZodOptional<z.ZodString>;
2839
+ ext: z.ZodOptional<z.ZodBoolean>;
2840
+ k: z.ZodOptional<z.ZodString>;
2841
+ key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
2842
+ kid: z.ZodOptional<z.ZodString>;
2843
+ kty: z.ZodString;
2844
+ n: z.ZodOptional<z.ZodString>;
2845
+ oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
2846
+ d: z.ZodOptional<z.ZodString>;
2847
+ r: z.ZodOptional<z.ZodString>;
2848
+ t: z.ZodOptional<z.ZodString>;
2849
+ }, z.core.$loose>>>;
2850
+ p: z.ZodOptional<z.ZodString>;
2851
+ q: z.ZodOptional<z.ZodString>;
2852
+ qi: z.ZodOptional<z.ZodString>;
2853
+ use: z.ZodOptional<z.ZodString>;
2854
+ x: z.ZodOptional<z.ZodString>;
2855
+ x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
2856
+ x5t: z.ZodOptional<z.ZodString>;
2857
+ "x5t#S256": z.ZodOptional<z.ZodString>;
2858
+ x5u: z.ZodOptional<z.ZodString>;
2859
+ y: z.ZodOptional<z.ZodString>;
2860
+ }, z.core.$loose>;
2861
+ }, z.core.$strip>;
2862
+ exp: z.ZodNumber;
2863
+ iat: z.ZodNumber;
2864
+ iss: z.ZodString;
2865
+ nbf: z.ZodOptional<z.ZodNumber>;
2866
+ sub: z.ZodString;
2867
+ wallet_link: z.ZodURL;
2868
+ wallet_name: z.ZodString;
2869
+ aud: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString>]>>;
2870
+ jti: z.ZodOptional<z.ZodString>;
2871
+ nonce: z.ZodOptional<z.ZodString>;
2872
+ status: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
3101
2873
  trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
3102
- x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
3103
2874
  }, z.core.$loose>;
3104
- type ItWalletClientAttestationPopJwtHeader = z.infer<typeof zItWalletClientAttestationPopJwtHeader>;
2875
+ type WalletAttestationJwtV1_4 = string;
2876
+ declare const zWalletAttestationJwtV1_4: z.ZodString;
3105
2877
 
3106
- interface DecodeJwtHeaderOptions<HeaderSchema extends BaseSchema | undefined> {
3107
- /**
3108
- * Optional prefix for error messages thrown during decoding, to provide more context on where the error occurred
3109
- */
3110
- errorMessagePrefix?: string;
3111
- /**
3112
- * Schema to use for validating the header. If not provided the
3113
- * default `zJwtHeader` schema will be used
3114
- */
3115
- headerSchema?: HeaderSchema;
3116
- /**
3117
- * The compact encoded jwt
3118
- */
3119
- jwt: string;
3120
- }
3121
- interface DecodeJwtHeaderResult<HeaderSchema extends BaseSchema | undefined = undefined> {
3122
- header: InferSchemaOrDefaultOutput<HeaderSchema, typeof zJwtHeader>;
2878
+ interface WalletAttestationOptionsV1_4 extends Omit<BaseWalletAttestationOptions, "walletLink" | "walletName"> {
2879
+ nbf?: Date;
2880
+ signer: {
2881
+ alg: string;
2882
+ kid: string;
2883
+ method: "x5c";
2884
+ trustChain?: [string, ...string[]];
2885
+ x5c: [string, ...string[]];
2886
+ };
2887
+ walletLink: string;
2888
+ walletName: string;
3123
2889
  }
3124
2890
  /**
3125
- * Decodes and validates the header of a compact JWT.
3126
- *
3127
- * This helper does not verify the JWT signature or parse the payload.
3128
- *
3129
- * @param options - Header decode options.
3130
- * @param options.errorMessagePrefix - Optional context prefix for thrown parse/validation errors.
3131
- * @param options.headerSchema - Optional schema for the JWT header; defaults to `zJwtHeader`.
3132
- * @param options.jwt - Compact JWT to decode.
3133
- * @returns Decoded and schema-validated JWT header.
3134
- * @throws {Oauth2JwtParseError} If the JWT shape or header JSON is invalid.
3135
- * @throws {ValidationError} If header schema validation fails.
3136
- */
3137
- declare function decodeJwtHeader<HeaderSchema extends BaseSchema | undefined = undefined>(options: DecodeJwtHeaderOptions<HeaderSchema>): DecodeJwtHeaderResult<HeaderSchema>;
3138
- /**
3139
- * Builds a JWT header from an SDK signer descriptor.
2891
+ * Creates a wallet attestation JWT for IT-Wallet v1.4.
3140
2892
  *
3141
- * @param signer - Signer descriptor used by SDK signing callbacks.
3142
- * @returns Header fields required by the signer method.
2893
+ * @param options - v1.4 wallet attestation creation options.
2894
+ * @returns Signed wallet attestation JWT.
2895
+ * @throws {ValidationError} If temporal constraints or generated JWT validation fail.
2896
+ * @throws {ClientAttestationError} For unexpected errors during attestation creation.
3143
2897
  */
3144
- declare function jwtHeaderFromJwtSigner(signer: JwtSigner): {
3145
- alg: string;
3146
- kid: string;
3147
- trust_chain?: undefined;
3148
- jwk?: undefined;
3149
- x5c?: undefined;
3150
- } | {
3151
- alg: string;
3152
- kid: string;
3153
- trust_chain: [string, ...string[]] | undefined;
3154
- jwk?: undefined;
3155
- x5c?: undefined;
3156
- } | {
3157
- alg: string;
3158
- jwk: {
3159
- [x: string]: unknown;
3160
- kty: string;
3161
- alg?: string | undefined;
3162
- crv?: string | undefined;
3163
- d?: string | undefined;
3164
- dp?: string | undefined;
3165
- dq?: string | undefined;
3166
- e?: string | undefined;
3167
- ext?: boolean | undefined;
3168
- k?: string | undefined;
3169
- key_ops?: string[] | undefined;
3170
- kid?: string | undefined;
3171
- n?: string | undefined;
3172
- oth?: {
3173
- [x: string]: unknown;
3174
- d?: string | undefined;
3175
- r?: string | undefined;
3176
- t?: string | undefined;
3177
- }[] | undefined;
3178
- p?: string | undefined;
3179
- q?: string | undefined;
3180
- qi?: string | undefined;
3181
- use?: string | undefined;
3182
- x?: string | undefined;
3183
- x5c?: string[] | undefined;
3184
- x5t?: string | undefined;
3185
- "x5t#S256"?: string | undefined;
3186
- x5u?: string | undefined;
3187
- y?: string | undefined;
3188
- };
3189
- kid?: undefined;
3190
- trust_chain?: undefined;
3191
- x5c?: undefined;
3192
- } | {
3193
- alg: string;
3194
- kid: string | undefined;
3195
- trust_chain: [string, ...string[]] | undefined;
3196
- x5c: string[];
3197
- jwk?: undefined;
3198
- } | {
3199
- alg: string;
3200
- kid?: undefined;
3201
- trust_chain?: undefined;
3202
- jwk?: undefined;
3203
- x5c?: undefined;
3204
- };
2898
+ declare const createWalletAttestationJwt: (options: WalletAttestationOptionsV1_4) => Promise<WalletAttestationJwtV1_4>;
3205
2899
 
3206
- declare const zCompactJwe: z$1.ZodString;
2900
+ declare const IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES: readonly ["ES256", "ES384", "ES512"];
2901
+ declare const zItWalletClientAttestationPopJwtAlg: z$1.ZodEnum<{
2902
+ ES256: "ES256";
2903
+ ES384: "ES384";
2904
+ ES512: "ES512";
2905
+ }>;
2906
+ type ItWalletClientAttestationPopJwtAlg = z$1.infer<typeof zItWalletClientAttestationPopJwtAlg>;
2907
+ declare const zItWalletClientAttestationPopJwtPayload: z$1.ZodObject<{
2908
+ aud: z$1.ZodString;
2909
+ exp: z$1.ZodOptional<z$1.ZodNumber>;
2910
+ iat: z$1.ZodNumber;
2911
+ iss: z$1.ZodString;
2912
+ jti: z$1.ZodString;
2913
+ nonce: z$1.ZodOptional<z$1.ZodString>;
2914
+ cnf: z$1.ZodOptional<z$1.ZodObject<{
2915
+ jkt: z$1.ZodOptional<z$1.ZodString>;
2916
+ jwk: z$1.ZodOptional<z$1.ZodObject<{
2917
+ alg: z$1.ZodOptional<z$1.ZodString>;
2918
+ crv: z$1.ZodOptional<z$1.ZodString>;
2919
+ d: z$1.ZodOptional<z$1.ZodString>;
2920
+ dp: z$1.ZodOptional<z$1.ZodString>;
2921
+ dq: z$1.ZodOptional<z$1.ZodString>;
2922
+ e: z$1.ZodOptional<z$1.ZodString>;
2923
+ ext: z$1.ZodOptional<z$1.ZodBoolean>;
2924
+ k: z$1.ZodOptional<z$1.ZodString>;
2925
+ key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2926
+ kid: z$1.ZodOptional<z$1.ZodString>;
2927
+ kty: z$1.ZodString;
2928
+ n: z$1.ZodOptional<z$1.ZodString>;
2929
+ oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2930
+ d: z$1.ZodOptional<z$1.ZodString>;
2931
+ r: z$1.ZodOptional<z$1.ZodString>;
2932
+ t: z$1.ZodOptional<z$1.ZodString>;
2933
+ }, z$1.core.$loose>>>;
2934
+ p: z$1.ZodOptional<z$1.ZodString>;
2935
+ q: z$1.ZodOptional<z$1.ZodString>;
2936
+ qi: z$1.ZodOptional<z$1.ZodString>;
2937
+ use: z$1.ZodOptional<z$1.ZodString>;
2938
+ x: z$1.ZodOptional<z$1.ZodString>;
2939
+ x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2940
+ x5t: z$1.ZodOptional<z$1.ZodString>;
2941
+ "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
2942
+ x5u: z$1.ZodOptional<z$1.ZodString>;
2943
+ y: z$1.ZodOptional<z$1.ZodString>;
2944
+ }, z$1.core.$loose>>;
2945
+ }, z$1.core.$loose>>;
2946
+ nbf: z$1.ZodOptional<z$1.ZodNumber>;
2947
+ status: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
2948
+ sub: z$1.ZodOptional<z$1.ZodString>;
2949
+ trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
2950
+ }, z$1.core.$loose>;
2951
+ type ItWalletClientAttestationPopJwtPayload = z$1.infer<typeof zItWalletClientAttestationPopJwtPayload>;
2952
+ declare const zItWalletClientAttestationPopJwtTyp: z$1.ZodLiteral<"oauth-client-attestation-pop+jwt">;
2953
+ declare const zItWalletClientAttestationPopJwtHeader: z$1.ZodObject<{
2954
+ typ: z$1.ZodLiteral<"oauth-client-attestation-pop+jwt">;
2955
+ alg: z$1.ZodString;
2956
+ jwk: z$1.ZodOptional<z$1.ZodObject<{
2957
+ alg: z$1.ZodOptional<z$1.ZodString>;
2958
+ crv: z$1.ZodOptional<z$1.ZodString>;
2959
+ d: z$1.ZodOptional<z$1.ZodString>;
2960
+ dp: z$1.ZodOptional<z$1.ZodString>;
2961
+ dq: z$1.ZodOptional<z$1.ZodString>;
2962
+ e: z$1.ZodOptional<z$1.ZodString>;
2963
+ ext: z$1.ZodOptional<z$1.ZodBoolean>;
2964
+ k: z$1.ZodOptional<z$1.ZodString>;
2965
+ key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2966
+ kid: z$1.ZodOptional<z$1.ZodString>;
2967
+ kty: z$1.ZodString;
2968
+ n: z$1.ZodOptional<z$1.ZodString>;
2969
+ oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
2970
+ d: z$1.ZodOptional<z$1.ZodString>;
2971
+ r: z$1.ZodOptional<z$1.ZodString>;
2972
+ t: z$1.ZodOptional<z$1.ZodString>;
2973
+ }, z$1.core.$loose>>>;
2974
+ p: z$1.ZodOptional<z$1.ZodString>;
2975
+ q: z$1.ZodOptional<z$1.ZodString>;
2976
+ qi: z$1.ZodOptional<z$1.ZodString>;
2977
+ use: z$1.ZodOptional<z$1.ZodString>;
2978
+ x: z$1.ZodOptional<z$1.ZodString>;
2979
+ x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2980
+ x5t: z$1.ZodOptional<z$1.ZodString>;
2981
+ "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
2982
+ x5u: z$1.ZodOptional<z$1.ZodString>;
2983
+ y: z$1.ZodOptional<z$1.ZodString>;
2984
+ }, z$1.core.$loose>>;
2985
+ kid: z$1.ZodOptional<z$1.ZodString>;
2986
+ trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
2987
+ x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
2988
+ }, z$1.core.$loose>;
2989
+ type ItWalletClientAttestationPopJwtHeader = z$1.infer<typeof zItWalletClientAttestationPopJwtHeader>;
3207
2990
 
3208
2991
  /**
3209
2992
  * Generic error thrown on OAuth2 operations
@@ -3419,7 +3202,7 @@ interface GetJwtFromFormPostOptions<T> {
3419
3202
  /**
3420
3203
  * Schema for parsing and validating
3421
3204
  */
3422
- schema: z.ZodSchema<T>;
3205
+ schema: z$1.ZodSchema<T>;
3423
3206
  }
3424
3207
  /**
3425
3208
  * Decode a form_post.jwt and return the final JWT.
@@ -3460,7 +3243,7 @@ interface GetJwtFromFormPostOptions<T> {
3460
3243
  * ```
3461
3244
  */
3462
3245
  declare const getJwtFromFormPost: <T>(options: GetJwtFromFormPostOptions<T>) => Promise<{
3463
- decodedJwt: DecodeJwtResult<undefined, z.ZodSchema<T>>;
3246
+ decodedJwt: DecodeJwtResult<undefined, z$1.ZodSchema<T>>;
3464
3247
  jwt: string;
3465
3248
  }>;
3466
3249
 
@@ -3496,7 +3279,7 @@ interface CreateMrtdValidationJwtOptions {
3496
3279
  /** NFC-read document evidence */
3497
3280
  documentData: MrtdDocumentData;
3498
3281
  issuedAt?: Date;
3499
- signer: JwtSignerJwk$1;
3282
+ signer: JwtSignerJwk;
3500
3283
  }
3501
3284
  /**
3502
3285
  * Creates a signed JWT containing MRTD validation data for Phase 3 of L2+ flow.
@@ -3527,7 +3310,7 @@ interface FetchMrtdPopInitOptions {
3527
3310
  * Optional custom signer for verifying the MRTD PoP init response JWT.
3528
3311
  * If not provided, the library will attempt to verify using JWT header.
3529
3312
  */
3530
- signer?: JwtSigner$1;
3313
+ signer?: JwtSigner;
3531
3314
  /**
3532
3315
  * Attestation header value for the wallet's own attestation, to be included in the request.
3533
3316
  */
@@ -3539,7 +3322,7 @@ interface FetchMrtdPopInitResult {
3539
3322
  mrz?: string;
3540
3323
  /** htu from the init response — the verify endpoint */
3541
3324
  popVerifyEndpoint: string;
3542
- signer: JwtSigner$1;
3325
+ signer: JwtSigner;
3543
3326
  }
3544
3327
  /**
3545
3328
  * Initiates MRTD Proof of Possession validation (Phase 3.2 of L2+ flow).
@@ -3598,81 +3381,81 @@ declare function fetchMrtdPopVerify(options: FetchMrtdPopVerifyOptions): Promise
3598
3381
  * @see IT-Wallet L2+ specification Section 12.1.3 (eID Substantial Authentication with MRTD Verification)
3599
3382
  */
3600
3383
  /** JWT header for MRTD challenge (Phase 3.1) */
3601
- declare const zMrtdChallengeJwtHeader: z.ZodObject<{
3602
- alg: z.ZodString;
3603
- kid: z.ZodString;
3604
- typ: z.ZodLiteral<"mrtd-ias+jwt">;
3605
- }, z.core.$loose>;
3606
- type MrtdChallengeJwtHeader = z.infer<typeof zMrtdChallengeJwtHeader>;
3384
+ declare const zMrtdChallengeJwtHeader: z$1.ZodObject<{
3385
+ alg: z$1.ZodString;
3386
+ kid: z$1.ZodString;
3387
+ typ: z$1.ZodLiteral<"mrtd-ias+jwt">;
3388
+ }, z$1.core.$loose>;
3389
+ type MrtdChallengeJwtHeader = z$1.infer<typeof zMrtdChallengeJwtHeader>;
3607
3390
  /** JWT payload for MRTD challenge containing session correlation and endpoint parameters */
3608
- declare const zMrtdChallengeJwtPayload: z.ZodObject<{
3609
- aud: z.ZodString;
3610
- exp: z.ZodNumber;
3611
- htm: z.ZodLiteral<"POST">;
3612
- htu: z.ZodURL;
3613
- iat: z.ZodNumber;
3614
- iss: z.ZodString;
3615
- mrtd_auth_session: z.ZodString;
3616
- mrtd_pop_jwt_nonce: z.ZodString;
3617
- state: z.ZodString;
3618
- status: z.ZodLiteral<"require_interaction">;
3619
- type: z.ZodLiteral<"mrtd+ias">;
3620
- }, z.core.$loose>;
3621
- type MrtdChallengeJwtPayload = z.infer<typeof zMrtdChallengeJwtPayload>;
3391
+ declare const zMrtdChallengeJwtPayload: z$1.ZodObject<{
3392
+ aud: z$1.ZodString;
3393
+ exp: z$1.ZodNumber;
3394
+ htm: z$1.ZodLiteral<"POST">;
3395
+ htu: z$1.ZodURL;
3396
+ iat: z$1.ZodNumber;
3397
+ iss: z$1.ZodString;
3398
+ mrtd_auth_session: z$1.ZodString;
3399
+ mrtd_pop_jwt_nonce: z$1.ZodString;
3400
+ state: z$1.ZodString;
3401
+ status: z$1.ZodLiteral<"require_interaction">;
3402
+ type: z$1.ZodLiteral<"mrtd+ias">;
3403
+ }, z$1.core.$loose>;
3404
+ type MrtdChallengeJwtPayload = z$1.infer<typeof zMrtdChallengeJwtPayload>;
3622
3405
  /** JWT header for MRTD PoP initialization response (Phase 3.3) */
3623
- declare const zMrtdPopInitResponseJwtHeader: z.ZodObject<{
3624
- alg: z.ZodString;
3625
- kid: z.ZodString;
3626
- typ: z.ZodLiteral<"mrtd-ias-pop+jwt">;
3627
- }, z.core.$loose>;
3628
- type MrtdPopInitResponseJwtHeader = z.infer<typeof zMrtdPopInitResponseJwtHeader>;
3406
+ declare const zMrtdPopInitResponseJwtHeader: z$1.ZodObject<{
3407
+ alg: z$1.ZodString;
3408
+ kid: z$1.ZodString;
3409
+ typ: z$1.ZodLiteral<"mrtd-ias-pop+jwt">;
3410
+ }, z$1.core.$loose>;
3411
+ type MrtdPopInitResponseJwtHeader = z$1.infer<typeof zMrtdPopInitResponseJwtHeader>;
3629
3412
  /** JWT payload for MRTD PoP initialization response containing challenge and nonce */
3630
- declare const zMrtdPopInitResponseJwtPayload: z.ZodObject<{
3631
- aud: z.ZodString;
3632
- challenge: z.ZodString;
3633
- exp: z.ZodNumber;
3634
- htm: z.ZodLiteral<"POST">;
3635
- htu: z.ZodURL;
3636
- iat: z.ZodNumber;
3637
- iss: z.ZodString;
3638
- mrtd_pop_nonce: z.ZodString;
3639
- mrz: z.ZodOptional<z.ZodString>;
3640
- }, z.core.$loose>;
3641
- type MrtdPopInitResponseJwtPayload = z.infer<typeof zMrtdPopInitResponseJwtPayload>;
3413
+ declare const zMrtdPopInitResponseJwtPayload: z$1.ZodObject<{
3414
+ aud: z$1.ZodString;
3415
+ challenge: z$1.ZodString;
3416
+ exp: z$1.ZodNumber;
3417
+ htm: z$1.ZodLiteral<"POST">;
3418
+ htu: z$1.ZodURL;
3419
+ iat: z$1.ZodNumber;
3420
+ iss: z$1.ZodString;
3421
+ mrtd_pop_nonce: z$1.ZodString;
3422
+ mrz: z$1.ZodOptional<z$1.ZodString>;
3423
+ }, z$1.core.$loose>;
3424
+ type MrtdPopInitResponseJwtPayload = z$1.infer<typeof zMrtdPopInitResponseJwtPayload>;
3642
3425
  /** JWT header for MRTD validation (signed by Wallet Instance) */
3643
- declare const zMrtdValidationJwtHeader: z.ZodObject<{
3644
- alg: z.ZodString;
3645
- kid: z.ZodString;
3646
- typ: z.ZodLiteral<"mrtd-ias+jwt">;
3647
- }, z.core.$loose>;
3648
- type MrtdValidationJwtHeader = z.infer<typeof zMrtdValidationJwtHeader>;
3426
+ declare const zMrtdValidationJwtHeader: z$1.ZodObject<{
3427
+ alg: z$1.ZodString;
3428
+ kid: z$1.ZodString;
3429
+ typ: z$1.ZodLiteral<"mrtd-ias+jwt">;
3430
+ }, z$1.core.$loose>;
3431
+ type MrtdValidationJwtHeader = z$1.infer<typeof zMrtdValidationJwtHeader>;
3649
3432
  /** JWT payload for MRTD validation containing NFC-read document evidence */
3650
- declare const zMrtdValidationJwtPayload: z.ZodObject<{
3651
- aud: z.ZodString;
3652
- document_type: z.ZodLiteral<"cie">;
3653
- exp: z.ZodNumber;
3654
- ias: z.ZodObject<{
3655
- challenge_signed: z.ZodString;
3656
- ias_pk: z.ZodString;
3657
- sod_ias: z.ZodString;
3658
- }, z.core.$loose>;
3659
- iat: z.ZodNumber;
3660
- iss: z.ZodString;
3661
- mrtd: z.ZodObject<{
3662
- dg1: z.ZodString;
3663
- dg11: z.ZodString;
3664
- sod_mrtd: z.ZodString;
3665
- }, z.core.$loose>;
3666
- }, z.core.$loose>;
3667
- type MrtdValidationJwtPayload = z.infer<typeof zMrtdValidationJwtPayload>;
3433
+ declare const zMrtdValidationJwtPayload: z$1.ZodObject<{
3434
+ aud: z$1.ZodString;
3435
+ document_type: z$1.ZodLiteral<"cie">;
3436
+ exp: z$1.ZodNumber;
3437
+ ias: z$1.ZodObject<{
3438
+ challenge_signed: z$1.ZodString;
3439
+ ias_pk: z$1.ZodString;
3440
+ sod_ias: z$1.ZodString;
3441
+ }, z$1.core.$loose>;
3442
+ iat: z$1.ZodNumber;
3443
+ iss: z$1.ZodString;
3444
+ mrtd: z$1.ZodObject<{
3445
+ dg1: z$1.ZodString;
3446
+ dg11: z$1.ZodString;
3447
+ sod_mrtd: z$1.ZodString;
3448
+ }, z$1.core.$loose>;
3449
+ }, z$1.core.$loose>;
3450
+ type MrtdValidationJwtPayload = z$1.infer<typeof zMrtdValidationJwtPayload>;
3668
3451
  /** Response from MRTD PoP verification endpoint (Phase 3.8) */
3669
- declare const zMrtdPopVerifyResponse: z.ZodObject<{
3670
- mrtd_val_pop_nonce: z.ZodString;
3671
- redirect_uri: z.ZodURL;
3672
- status: z.ZodLiteral<"require_interaction">;
3673
- type: z.ZodLiteral<"redirect_to_web">;
3674
- }, z.core.$loose>;
3675
- type MrtdPopVerifyResponse = z.infer<typeof zMrtdPopVerifyResponse>;
3452
+ declare const zMrtdPopVerifyResponse: z$1.ZodObject<{
3453
+ mrtd_val_pop_nonce: z$1.ZodString;
3454
+ redirect_uri: z$1.ZodURL;
3455
+ status: z$1.ZodLiteral<"require_interaction">;
3456
+ type: z$1.ZodLiteral<"redirect_to_web">;
3457
+ }, z$1.core.$loose>;
3458
+ type MrtdPopVerifyResponse = z$1.infer<typeof zMrtdPopVerifyResponse>;
3676
3459
 
3677
3460
  interface ParseMrtdChallengeOptions {
3678
3461
  /** The full redirect URL containing ?challenge_info=<jwt> */
@@ -3707,12 +3490,12 @@ interface VerifyMrtdChallengeOptions {
3707
3490
  * Optional custom signer for verifying the MRTD challenge JWT.
3708
3491
  * If not provided, the library will attempt to verify using JWT header.
3709
3492
  */
3710
- signer?: JwtSigner$1;
3493
+ signer?: JwtSigner;
3711
3494
  }
3712
3495
  interface VerifyMrtdChallengeResult {
3713
3496
  header: MrtdChallengeJwtHeader;
3714
3497
  payload: MrtdChallengeJwtPayload;
3715
- signer: JwtSigner$1;
3498
+ signer: JwtSigner;
3716
3499
  }
3717
3500
  /**
3718
3501
  * Verifies the MRTD challenge JWT signature and validates claims.
@@ -3755,12 +3538,12 @@ interface CreateTokenDPoPOptions {
3755
3538
  /**
3756
3539
  * The signer of the dpop jwt. Only jwk signer allowed.
3757
3540
  */
3758
- signer: JwtSignerJwk$1;
3541
+ signer: JwtSignerJwk;
3759
3542
  /**
3760
3543
  * The request for which to create the dpop jwt
3761
3544
  */
3762
3545
  tokenRequest: {
3763
- method: HttpMethod$1;
3546
+ method: HttpMethod;
3764
3547
  url: string;
3765
3548
  };
3766
3549
  }
@@ -3775,7 +3558,7 @@ interface CreateTokenDPoPOptions {
3775
3558
  */
3776
3559
  declare function createTokenDPoP(options: CreateTokenDPoPOptions): Promise<{
3777
3560
  jwt: string;
3778
- signerJwk: _openid4vc_oauth2.Jwk;
3561
+ signerJwk: _pagopa_io_wallet_utils.Jwk;
3779
3562
  }>;
3780
3563
  /**
3781
3564
  * Extracts and validates the DPoP JWT from request headers.
@@ -3840,7 +3623,7 @@ interface VerifyTokenDPoPOptions {
3840
3623
  /**
3841
3624
  * The request for which to verify the dpop jwt
3842
3625
  */
3843
- request: RequestLike$1;
3626
+ request: RequestLike;
3844
3627
  }
3845
3628
  /**
3846
3629
  * Verifies a DPoP proof JWT against an HTTP request and optional token binding data.
@@ -3900,12 +3683,12 @@ declare function verifyTokenDPoP(options: VerifyTokenDPoPOptions): Promise<{
3900
3683
  jwkThumbprint: string;
3901
3684
  payload: {
3902
3685
  [x: string]: unknown;
3903
- htm: "GET" | "POST" | "PUT" | "DELETE" | "HEAD" | "OPTIONS" | "TRACE" | "CONNECT" | "PATCH";
3686
+ htm: "POST" | "GET" | "PUT" | "DELETE" | "HEAD" | "OPTIONS" | "TRACE" | "CONNECT" | "PATCH";
3904
3687
  htu: string;
3905
3688
  iat: number;
3906
3689
  jti: string;
3907
3690
  ath?: string | undefined;
3908
- aud?: string | undefined;
3691
+ aud?: string | string[] | undefined;
3909
3692
  cnf?: {
3910
3693
  [x: string]: unknown;
3911
3694
  jkt?: string | undefined;
@@ -3946,13 +3729,14 @@ declare function verifyTokenDPoP(options: VerifyTokenDPoPOptions): Promise<{
3946
3729
  nbf?: number | undefined;
3947
3730
  nonce?: string | undefined;
3948
3731
  status?: Record<string, any> | undefined;
3732
+ sub?: string | undefined;
3949
3733
  trust_chain?: [string, ...string[]] | undefined;
3950
3734
  };
3951
3735
  }>;
3952
3736
 
3953
- declare const zDpopJwtPayload: z.ZodObject<{
3954
- ath: z.ZodOptional<z.ZodString>;
3955
- htm: z.ZodEnum<{
3737
+ declare const zDpopJwtPayload: z$1.ZodObject<{
3738
+ ath: z$1.ZodOptional<z$1.ZodString>;
3739
+ htm: z$1.ZodEnum<{
3956
3740
  GET: "GET";
3957
3741
  POST: "POST";
3958
3742
  PUT: "PUT";
@@ -3963,86 +3747,87 @@ declare const zDpopJwtPayload: z.ZodObject<{
3963
3747
  CONNECT: "CONNECT";
3964
3748
  PATCH: "PATCH";
3965
3749
  }>;
3966
- htu: z.ZodURL;
3967
- iat: z.ZodNumber;
3968
- jti: z.ZodString;
3969
- aud: z.ZodOptional<z.ZodString>;
3970
- cnf: z.ZodOptional<z.ZodObject<{
3971
- jkt: z.ZodOptional<z.ZodString>;
3972
- jwk: z.ZodOptional<z.ZodObject<{
3973
- alg: z.ZodOptional<z.ZodString>;
3974
- crv: z.ZodOptional<z.ZodString>;
3975
- d: z.ZodOptional<z.ZodString>;
3976
- dp: z.ZodOptional<z.ZodString>;
3977
- dq: z.ZodOptional<z.ZodString>;
3978
- e: z.ZodOptional<z.ZodString>;
3979
- ext: z.ZodOptional<z.ZodBoolean>;
3980
- k: z.ZodOptional<z.ZodString>;
3981
- key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
3982
- kid: z.ZodOptional<z.ZodString>;
3983
- kty: z.ZodString;
3984
- n: z.ZodOptional<z.ZodString>;
3985
- oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
3986
- d: z.ZodOptional<z.ZodString>;
3987
- r: z.ZodOptional<z.ZodString>;
3988
- t: z.ZodOptional<z.ZodString>;
3989
- }, z.core.$loose>>>;
3990
- p: z.ZodOptional<z.ZodString>;
3991
- q: z.ZodOptional<z.ZodString>;
3992
- qi: z.ZodOptional<z.ZodString>;
3993
- use: z.ZodOptional<z.ZodString>;
3994
- x: z.ZodOptional<z.ZodString>;
3995
- x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
3996
- x5t: z.ZodOptional<z.ZodString>;
3997
- "x5t#S256": z.ZodOptional<z.ZodString>;
3998
- x5u: z.ZodOptional<z.ZodString>;
3999
- y: z.ZodOptional<z.ZodString>;
4000
- }, z.core.$loose>>;
4001
- }, z.core.$loose>>;
4002
- exp: z.ZodOptional<z.ZodNumber>;
4003
- iss: z.ZodOptional<z.ZodString>;
4004
- nbf: z.ZodOptional<z.ZodNumber>;
4005
- nonce: z.ZodOptional<z.ZodString>;
4006
- status: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
4007
- trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
4008
- }, z.core.$loose>;
4009
- type DpopJwtPayload = z.infer<typeof zDpopJwtPayload>;
4010
- declare const zDpopJwtHeader: z.ZodObject<{
4011
- jwk: z.ZodObject<{
4012
- alg: z.ZodOptional<z.ZodString>;
4013
- crv: z.ZodOptional<z.ZodString>;
4014
- d: z.ZodOptional<z.ZodString>;
4015
- dp: z.ZodOptional<z.ZodString>;
4016
- dq: z.ZodOptional<z.ZodString>;
4017
- e: z.ZodOptional<z.ZodString>;
4018
- ext: z.ZodOptional<z.ZodBoolean>;
4019
- k: z.ZodOptional<z.ZodString>;
4020
- key_ops: z.ZodOptional<z.ZodArray<z.ZodString>>;
4021
- kid: z.ZodOptional<z.ZodString>;
4022
- kty: z.ZodString;
4023
- n: z.ZodOptional<z.ZodString>;
4024
- oth: z.ZodOptional<z.ZodArray<z.ZodObject<{
4025
- d: z.ZodOptional<z.ZodString>;
4026
- r: z.ZodOptional<z.ZodString>;
4027
- t: z.ZodOptional<z.ZodString>;
4028
- }, z.core.$loose>>>;
4029
- p: z.ZodOptional<z.ZodString>;
4030
- q: z.ZodOptional<z.ZodString>;
4031
- qi: z.ZodOptional<z.ZodString>;
4032
- use: z.ZodOptional<z.ZodString>;
4033
- x: z.ZodOptional<z.ZodString>;
4034
- x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
4035
- x5t: z.ZodOptional<z.ZodString>;
4036
- "x5t#S256": z.ZodOptional<z.ZodString>;
4037
- x5u: z.ZodOptional<z.ZodString>;
4038
- y: z.ZodOptional<z.ZodString>;
4039
- }, z.core.$loose>;
4040
- typ: z.ZodLiteral<"dpop+jwt">;
4041
- alg: z.ZodString;
4042
- kid: z.ZodOptional<z.ZodString>;
4043
- trust_chain: z.ZodOptional<z.ZodTuple<[z.ZodString], z.ZodString>>;
4044
- x5c: z.ZodOptional<z.ZodArray<z.ZodString>>;
4045
- }, z.core.$loose>;
4046
- type DpopJwtHeader = z.infer<typeof zDpopJwtHeader>;
3750
+ htu: z$1.ZodURL;
3751
+ iat: z$1.ZodNumber;
3752
+ jti: z$1.ZodString;
3753
+ aud: z$1.ZodOptional<z$1.ZodUnion<[z$1.ZodString, z$1.ZodArray<z$1.ZodString>]>>;
3754
+ cnf: z$1.ZodOptional<z$1.ZodObject<{
3755
+ jkt: z$1.ZodOptional<z$1.ZodString>;
3756
+ jwk: z$1.ZodOptional<z$1.ZodObject<{
3757
+ alg: z$1.ZodOptional<z$1.ZodString>;
3758
+ crv: z$1.ZodOptional<z$1.ZodString>;
3759
+ d: z$1.ZodOptional<z$1.ZodString>;
3760
+ dp: z$1.ZodOptional<z$1.ZodString>;
3761
+ dq: z$1.ZodOptional<z$1.ZodString>;
3762
+ e: z$1.ZodOptional<z$1.ZodString>;
3763
+ ext: z$1.ZodOptional<z$1.ZodBoolean>;
3764
+ k: z$1.ZodOptional<z$1.ZodString>;
3765
+ key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
3766
+ kid: z$1.ZodOptional<z$1.ZodString>;
3767
+ kty: z$1.ZodString;
3768
+ n: z$1.ZodOptional<z$1.ZodString>;
3769
+ oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
3770
+ d: z$1.ZodOptional<z$1.ZodString>;
3771
+ r: z$1.ZodOptional<z$1.ZodString>;
3772
+ t: z$1.ZodOptional<z$1.ZodString>;
3773
+ }, z$1.core.$loose>>>;
3774
+ p: z$1.ZodOptional<z$1.ZodString>;
3775
+ q: z$1.ZodOptional<z$1.ZodString>;
3776
+ qi: z$1.ZodOptional<z$1.ZodString>;
3777
+ use: z$1.ZodOptional<z$1.ZodString>;
3778
+ x: z$1.ZodOptional<z$1.ZodString>;
3779
+ x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
3780
+ x5t: z$1.ZodOptional<z$1.ZodString>;
3781
+ "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
3782
+ x5u: z$1.ZodOptional<z$1.ZodString>;
3783
+ y: z$1.ZodOptional<z$1.ZodString>;
3784
+ }, z$1.core.$loose>>;
3785
+ }, z$1.core.$loose>>;
3786
+ exp: z$1.ZodOptional<z$1.ZodNumber>;
3787
+ iss: z$1.ZodOptional<z$1.ZodString>;
3788
+ nbf: z$1.ZodOptional<z$1.ZodNumber>;
3789
+ nonce: z$1.ZodOptional<z$1.ZodString>;
3790
+ status: z$1.ZodOptional<z$1.ZodRecord<z$1.ZodString, z$1.ZodAny>>;
3791
+ sub: z$1.ZodOptional<z$1.ZodString>;
3792
+ trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
3793
+ }, z$1.core.$loose>;
3794
+ type DpopJwtPayload = z$1.infer<typeof zDpopJwtPayload>;
3795
+ declare const zDpopJwtHeader: z$1.ZodObject<{
3796
+ jwk: z$1.ZodObject<{
3797
+ alg: z$1.ZodOptional<z$1.ZodString>;
3798
+ crv: z$1.ZodOptional<z$1.ZodString>;
3799
+ d: z$1.ZodOptional<z$1.ZodString>;
3800
+ dp: z$1.ZodOptional<z$1.ZodString>;
3801
+ dq: z$1.ZodOptional<z$1.ZodString>;
3802
+ e: z$1.ZodOptional<z$1.ZodString>;
3803
+ ext: z$1.ZodOptional<z$1.ZodBoolean>;
3804
+ k: z$1.ZodOptional<z$1.ZodString>;
3805
+ key_ops: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
3806
+ kid: z$1.ZodOptional<z$1.ZodString>;
3807
+ kty: z$1.ZodString;
3808
+ n: z$1.ZodOptional<z$1.ZodString>;
3809
+ oth: z$1.ZodOptional<z$1.ZodArray<z$1.ZodObject<{
3810
+ d: z$1.ZodOptional<z$1.ZodString>;
3811
+ r: z$1.ZodOptional<z$1.ZodString>;
3812
+ t: z$1.ZodOptional<z$1.ZodString>;
3813
+ }, z$1.core.$loose>>>;
3814
+ p: z$1.ZodOptional<z$1.ZodString>;
3815
+ q: z$1.ZodOptional<z$1.ZodString>;
3816
+ qi: z$1.ZodOptional<z$1.ZodString>;
3817
+ use: z$1.ZodOptional<z$1.ZodString>;
3818
+ x: z$1.ZodOptional<z$1.ZodString>;
3819
+ x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
3820
+ x5t: z$1.ZodOptional<z$1.ZodString>;
3821
+ "x5t#S256": z$1.ZodOptional<z$1.ZodString>;
3822
+ x5u: z$1.ZodOptional<z$1.ZodString>;
3823
+ y: z$1.ZodOptional<z$1.ZodString>;
3824
+ }, z$1.core.$loose>;
3825
+ typ: z$1.ZodLiteral<"dpop+jwt">;
3826
+ alg: z$1.ZodString;
3827
+ kid: z$1.ZodOptional<z$1.ZodString>;
3828
+ trust_chain: z$1.ZodOptional<z$1.ZodTuple<[z$1.ZodString], z$1.ZodString>>;
3829
+ x5c: z$1.ZodOptional<z$1.ZodArray<z$1.ZodString>>;
3830
+ }, z$1.core.$loose>;
3831
+ type DpopJwtHeader = z$1.infer<typeof zDpopJwtHeader>;
4047
3832
 
4048
- export { type AccessTokenProfileJwtHeader, type AccessTokenProfileJwtPayload, type AccessTokenRequest, type AccessTokenResponse, type AuthorizationCodeGrantIdentifier, type AuthorizationCodeGrantType, type AuthorizationRequestV1_0, type AuthorizationRequestV1_3, type BaseVerifyWalletAttestationJwtOptions, type BaseWalletAttestationOptions, type CertificateChain, ClientAttestationError, type ClientAttestationOptions, type ClientAuthenticationCallback, type ClientAuthenticationCallbackOptions, type ClientAuthenticationWalletAttestationJwtOptions, type CreateAccessTokenResponseOptions, type CreateClientAttestationPopJwtOptions, type CreateClientAttestationPopJwtOptionsForVersion, type CreateClientAttestationPopJwtOptionsV1_0, type CreateClientAttestationPopJwtOptionsV1_3, type CreateClientAttestationPopJwtOptionsV1_4, type CreateJarRequestOptions, type CreateJarRequestResult, type CreateMrtdValidationJwtOptions, type CreatePkceOptions, type CreatePkceReturn, type CreatePushedAuthorizationRequestOptions, type CreatePushedAuthorizationRequestOptionsV1_0, type CreatePushedAuthorizationRequestOptionsV1_3, type CreatePushedAuthorizationRequestOptionsV1_4, CreateTokenDPoPError, type CreateTokenDPoPOptions, CreateTokenResponseError, type DecodeJwtHeaderOptions, type DecodeJwtHeaderResult, type DecodeJwtOptions, type DecodeJwtResult, type DpopJwtHeader, type DpopJwtPayload, type FetchMrtdPopInitOptions, type FetchMrtdPopInitResult, type FetchMrtdPopVerifyOptions, type FetchMrtdPopVerifyResult, FetchTokenResponseError, type FetchTokenResponseOptions, type GetJwtFromFormPostOptions, IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES, type InferSchemaOrDefaultOutput, type IsClientAttestationSupportedOptions, type ItWalletClientAttestationPopJwtAlg, type ItWalletClientAttestationPopJwtHeader, type ItWalletClientAttestationPopJwtPayload, type JarAuthorizationRequest, type JarRequestObjectHeader, type JarRequestObjectPayload, type Jwk, type JwkSet, type JwtHeader, type JwtPayload, type JwtSignerCustom, type JwtSignerDid, type JwtSignerFederation, type JwtSignerWithJwk, type JwtSignerX5c, MAX_JTI_LENGTH, type MrtdChallengeJwtHeader, type MrtdChallengeJwtPayload, type MrtdDocumentData, MrtdPopError, type MrtdPopInitResponseJwtHeader, type MrtdPopInitResponseJwtPayload, type MrtdPopVerifyResponse, type MrtdValidationJwtHeader, type MrtdValidationJwtPayload, Oauth2Error, type ParseAccessTokenRequestOptions, type ParseAccessTokenRequestResult, type ParseAuthorizationRequestOptions, type ParseAuthorizationRequestResult, type ParseMrtdChallengeOptions, type ParseMrtdChallengeResult, type ParsePushedAuthorizationRequestOptions, type ParsePushedAuthorizationRequestResult, type ParsedAccessTokenAuthorizationCodeRequestGrant, type ParsedAccessTokenRefreshTokenRequestGrant, type ParsedJarRequest, type ParsedJarRequestOptions, PkceCodeChallengeMethod, type PushedAuthorizationRequest, PushedAuthorizationRequestError, type PushedAuthorizationRequestSigned, type PushedAuthorizationRequestUnsignedV1_0, type PushedAuthorizationRequestUnsignedV1_3, type PushedAuthorizationResponse, type RefreshTokenGrantIdentifier, type RefreshTokenGrantType, type RefreshTokenProfileJwtHeader, type RefreshTokenProfileJwtPayload, type RequestLike, type RetrieveAuthorizationCodeAccessTokenOptions, SupportedClientAuthenticationMethod, type TrustChain, type VerifiedClientAttestationPopJwt, type VerifiedJarRequest, type VerifiedWalletAttestationJwt, type VerifiedWalletAttestationJwtV1_0, type VerifiedWalletAttestationJwtV1_3, type VerifiedWalletAttestationJwtV1_4, type VerifyAccessTokenRequestDpop, type VerifyAccessTokenRequestOptions, type VerifyAccessTokenRequestPkce, type VerifyAccessTokenRequestResult, type VerifyAuthorizationRequestDPoP, type VerifyAuthorizationRequestOptions, type VerifyAuthorizationRequestResult, type VerifyClientAttestationOptions, type VerifyClientAttestationPopJwtOptions, type VerifyJarRequestOptions, type VerifyMrtdChallengeOptions, type VerifyMrtdChallengeResult, type VerifyPkceOptions, type VerifyPushedAuthorizationRequestOptions, type VerifyPushedAuthorizationRequestReturn, type VerifyTokenDPoPOptions, type VerifyWalletAttestationJwtOptions, type VerifyWalletAttestationJwtOptionsV1_0, type VerifyWalletAttestationJwtOptionsV1_3, type VerifyWalletAttestationJwtOptionsV1_4, type WalletAttestationJwtV1_0, type WalletAttestationJwtV1_3, type WalletAttestationJwtV1_4, type WalletAttestationOptionsV1_0, type WalletAttestationOptionsV1_3, type WalletAttestationOptionsV1_4, authorizationCodeGrantIdentifier, clientAuthenticationAnonymous, clientAuthenticationWalletAttestationJwt, createAccessTokenResponse, createClientAttestationPopJwt, createJarRequest, createMrtdValidationJwt, createPkce, createPushedAuthorizationRequest, createTokenDPoP, createTokenRequest, createWalletAttestationJwt$2 as createWalletAttestationJwtV1_0, createWalletAttestationJwt$1 as createWalletAttestationJwtV1_3, createWalletAttestationJwt as createWalletAttestationJwtV1_4, decodeJwt, decodeJwtHeader, extractClientAttestationJwtsFromHeaders, extractDpopJwtFromHeaders, fetchJarRequestObject, fetchMrtdPopInit, fetchMrtdPopVerify, fetchPushedAuthorizationResponse, type fetchPushedAuthorizationResponseOptions, fetchTokenResponse, getJwtFromFormPost, htuFromRequestUrl, isClientAttestationSupported, isJarAuthorizationRequest, isPushedAuthorizationRequestSigned, isPushedAuthorizationRequestUnsigned, jwtAuthorizationRequestJwtHeaderTyp, jwtHeaderFromJwtSigner, oauthClientAttestationHeader, oauthClientAttestationPopHeader, parseAccessTokenRequest, parseAuthorizationRequest, parseJarRequest, parseMrtdChallenge, parsePushedAuthorizationRequest, refreshTokenGrantIdentifier, signedAuthorizationRequestJwtHeaderTyp, toURLSearchParams, validateJarRequestParams, verifyAccessTokenRequest, verifyAuthorizationRequest, verifyClientAttestation, verifyClientAttestationPopJwt, verifyJarRequest, verifyMrtdChallenge, verifyPkce, verifyPushedAuthorizationRequest, verifyTokenDPoP, verifyWalletAttestationJwt, verifyWalletAttestationJwt$3 as verifyWalletAttestationJwtV1_0, verifyWalletAttestationJwt$2 as verifyWalletAttestationJwtV1_3, verifyWalletAttestationJwt$1 as verifyWalletAttestationJwtV1_4, zAccessTokenProfileJwtHeader, zAccessTokenProfileJwtPayload, zAccessTokenRequest, zAccessTokenResponse, zAlgValueNotNone, zAuthorizationCodeGrantIdentifier, zAuthorizationRequestV1_0, zAuthorizationRequestV1_3, zCertificateChain, zCompactJwe, zCompactJwt, zDpopJwtHeader, zDpopJwtPayload, zItWalletClientAttestationPopJwtAlg, zItWalletClientAttestationPopJwtHeader, zItWalletClientAttestationPopJwtPayload, zItWalletClientAttestationPopJwtTyp, zJarAuthorizationRequest, zJarRequestObjectHeader, zJarRequestObjectPayload, zJwk, zJwkSet, zJwtConfirmationPayload, zJwtHeader, zJwtPayload, zMrtdChallengeJwtHeader, zMrtdChallengeJwtPayload, zMrtdPopInitResponseJwtHeader, zMrtdPopInitResponseJwtPayload, zMrtdPopVerifyResponse, zMrtdValidationJwtHeader, zMrtdValidationJwtPayload, zOauthClientAttestationHeader, zOauthClientAttestationPopHeader, zPushedAuthorizationRequestSigned, zPushedAuthorizationRequestUnsignedV1_0, zPushedAuthorizationRequestUnsignedV1_3, zPushedAuthorizationResponse, zRefreshTokenGrantIdentifier, zRefreshTokenProfileJwtHeader, zRefreshTokenProfileJwtPayload, zSignedAuthorizationRequestJwtHeaderTyp, zTrustChain, zWalletAttestationJwtHeaderV1_0, zWalletAttestationJwtHeaderV1_3, zWalletAttestationJwtHeaderV1_4, zWalletAttestationJwtPayloadV1_0, zWalletAttestationJwtPayloadV1_3, zWalletAttestationJwtPayloadV1_4, zWalletAttestationJwtV1_0, zWalletAttestationJwtV1_3, zWalletAttestationJwtV1_4 };
3833
+ export { type AccessTokenProfileJwtHeader, type AccessTokenProfileJwtPayload, type AccessTokenRequest, type AccessTokenRequestAPTITUDE, type AccessTokenResponse, type AuthorizationCodeGrantIdentifier, type AuthorizationCodeGrantType, type AuthorizationRequestV1_0, type AuthorizationRequestV1_3, type BaseAuthorizationServerMetadata, type BaseFetchTokenResponseOptions, type BaseParseAccessTokenRequestResult, type BaseRetrieveAccessTokenOptions, type BaseVerifyAccessTokenRequestOptions, type BaseVerifyWalletAttestationJwtOptions, type BaseWalletAttestationOptions, ClientAttestationError, type ClientAttestationOptions, type ItWalletClientAttestationPopJwtHeader as ClientAttestationPopJwtHeader, type ItWalletClientAttestationPopJwtPayload as ClientAttestationPopJwtPayload, type ClientAuthenticationCallback, type ClientAuthenticationCallbackOptions, type ClientAuthenticationWalletAttestationJwtOptions, type CreateAccessTokenResponseOptions, type CreateClientAttestationPopJwtOptions, type CreateClientAttestationPopJwtOptionsForVersion, type CreateClientAttestationPopJwtOptionsV1_0, type CreateClientAttestationPopJwtOptionsV1_3, type CreateClientAttestationPopJwtOptionsV1_4, type CreateJarRequestOptions, type CreateJarRequestResult, type CreateMrtdValidationJwtOptions, type CreatePkceOptions, type CreatePkceReturn, type CreatePushedAuthorizationRequestOptions, type CreatePushedAuthorizationRequestOptionsV1_0, type CreatePushedAuthorizationRequestOptionsV1_3, type CreatePushedAuthorizationRequestOptionsV1_4, CreateTokenDPoPError, type CreateTokenDPoPOptions, type CreateTokenRequestOptions, type CreateTokenRequestReturnType, CreateTokenResponseError, type DpopJwtHeader, type DpopJwtPayload, type FetchMrtdPopInitOptions, type FetchMrtdPopInitResult, type FetchMrtdPopVerifyOptions, type FetchMrtdPopVerifyResult, FetchTokenResponseError, type FetchTokenResponseOptions, type FetchTokenResponseOptionsAPTITUDE, type FetchTokenResponseOptionsShared, type GetJwtFromFormPostOptions, IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES, type IsClientAttestationSupportedOptions, type ItWalletClientAttestationPopJwtAlg, type ItWalletClientAttestationPopJwtHeader, type ItWalletClientAttestationPopJwtPayload, type JarAuthorizationRequest, type JarRequestObjectHeader, type JarRequestObjectPayload, type MrtdChallengeJwtHeader, type MrtdChallengeJwtPayload, type MrtdDocumentData, MrtdPopError, type MrtdPopInitResponseJwtHeader, type MrtdPopInitResponseJwtPayload, type MrtdPopVerifyResponse, type MrtdValidationJwtHeader, type MrtdValidationJwtPayload, Oauth2Error, type ParseAccessTokenRequestOptions, type ParseAccessTokenRequestOptionsAPTITUDE, type ParseAccessTokenRequestOptionsShared, type ParseAccessTokenRequestResult, type ParseAccessTokenRequestResultAPTITUDE, type ParseAccessTokenRequestResultV1_4, type ParseAuthorizationRequestOptions, type ParseAuthorizationRequestResult, type ParseMrtdChallengeOptions, type ParseMrtdChallengeResult, type ParsePushedAuthorizationRequestOptions, type ParsePushedAuthorizationRequestResult, type ParsedAccessTokenAuthorizationCodeRequestGrant, type ParsedAccessTokenPreAuthorizedCodeRequestGrant, type ParsedAccessTokenRefreshTokenRequestGrant, type ParsedAccessTokenRequestGrantAPTITUDE, type ParsedAccessTokenRequestGrantV1_4, type ParsedJarRequest, type ParsedJarRequestOptions, PkceCodeChallengeMethod, type PreAuthorizedCodeGrantIdentifier, type PreAuthorizedCodeGrantType, type PushedAuthorizationRequest, PushedAuthorizationRequestError, type PushedAuthorizationRequestSigned, type PushedAuthorizationRequestUnsignedV1_0, type PushedAuthorizationRequestUnsignedV1_3, type PushedAuthorizationResponse, type RefreshTokenGrantIdentifier, type RefreshTokenGrantType, type RefreshTokenProfileJwtHeader, type RefreshTokenProfileJwtPayload, type RetrieveAccessTokenOptions, type RetrieveAccessTokenOptionsAPTITUDE, type RetrieveAccessTokenOptionsAuthCode, type RetrieveAccessTokenOptionsPreAuthorizedCode, type RetrieveAccessTokenOptionsRefreshToken, type RetrieveAccessTokenOptionsShared, type SupportedAccessTokenVerificationOptions, type SupportedAccessTokenVerificationOptionsAPTITUDE, type SupportedAccessTokenVerificationOptionsV1_4, SupportedClientAuthenticationMethod, type VerifiedClientAttestationPopJwt, type VerifiedJarRequest, type VerifiedWalletAttestationJwt, type VerifiedWalletAttestationJwtV1_0, type VerifiedWalletAttestationJwtV1_3, type VerifiedWalletAttestationJwtV1_4, type VerifyAccessTokenRequestDpop, type VerifyAccessTokenRequestOptions, type VerifyAccessTokenRequestPkce, type VerifyAccessTokenRequestResult, type VerifyAuthorizationRequestDPoP, type VerifyAuthorizationRequestOptions, type VerifyAuthorizationRequestResult, type VerifyClientAttestationOptions, type VerifyClientAttestationPopJwtOptions, type VerifyJarRequestOptions, type VerifyMrtdChallengeOptions, type VerifyMrtdChallengeResult, type VerifyPkceOptions, type VerifyPreAuthorizedCodeAccessTokenRequestOptions, type VerifyPushedAuthorizationRequestOptions, type VerifyPushedAuthorizationRequestReturn, type VerifyTokenDPoPOptions, type VerifyWalletAttestationJwtOptions, type VerifyWalletAttestationJwtOptionsV1_0, type VerifyWalletAttestationJwtOptionsV1_3, type VerifyWalletAttestationJwtOptionsV1_4, type WalletAttestationJwtV1_0, type WalletAttestationJwtV1_3, type WalletAttestationJwtV1_4, type WalletAttestationOptionsV1_0, type WalletAttestationOptionsV1_3, type WalletAttestationOptionsV1_4, authorizationCodeGrantIdentifier, clientAuthenticationAnonymous, clientAuthenticationWalletAttestationJwt, createAccessTokenResponse, createClientAttestationPopJwt, createJarRequest, createMrtdValidationJwt, createPkce, createPushedAuthorizationRequest, createTokenDPoP, createTokenRequest, createTokenRequestAPTITUDE, createTokenRequestV1_4, createWalletAttestationJwt$2 as createWalletAttestationJwtV1_0, createWalletAttestationJwt$1 as createWalletAttestationJwtV1_3, createWalletAttestationJwt as createWalletAttestationJwtV1_4, extractClientAttestationJwtsFromHeaders, extractDpopJwtFromHeaders, fetchJarRequestObject, fetchMrtdPopInit, fetchMrtdPopVerify, fetchPushedAuthorizationResponse, type fetchPushedAuthorizationResponseOptions, fetchTokenResponse, getJwtFromFormPost, htuFromRequestUrl, isClientAttestationSupported, isJarAuthorizationRequest, isPushedAuthorizationRequestSigned, isPushedAuthorizationRequestUnsigned, jwtAuthorizationRequestJwtHeaderTyp, oauthClientAttestationHeader, oauthClientAttestationPopHeader, parseAccessTokenRequest, parseAuthorizationRequest, parseJarRequest, parseMrtdChallenge, parsePushedAuthorizationRequest, preAuthorizedCodeGrantIdentifier, refreshTokenGrantIdentifier, signedAuthorizationRequestJwtHeaderTyp, toURLSearchParams, validateJarRequestParams, verifyAccessTokenRequest, verifyAuthorizationRequest, verifyClientAttestation, verifyClientAttestationPopJwt, verifyJarRequest, verifyMrtdChallenge, verifyPkce, verifyPushedAuthorizationRequest, verifyTokenDPoP, verifyWalletAttestationJwt, verifyWalletAttestationJwt$3 as verifyWalletAttestationJwtV1_0, verifyWalletAttestationJwt$2 as verifyWalletAttestationJwtV1_3, verifyWalletAttestationJwt$1 as verifyWalletAttestationJwtV1_4, zAccessTokenProfileJwtHeader, zAccessTokenProfileJwtPayload, zAccessTokenRequest, zAccessTokenRequestAPTITUDE, zAccessTokenResponse, zAuthorizationCodeGrantIdentifier, zAuthorizationCodeTokenRequest, zAuthorizationRequestV1_0, zAuthorizationRequestV1_3, zDpopJwtHeader, zDpopJwtPayload, zItWalletClientAttestationPopJwtAlg, zItWalletClientAttestationPopJwtHeader, zItWalletClientAttestationPopJwtPayload, zItWalletClientAttestationPopJwtTyp, zJarAuthorizationRequest, zJarRequestObjectHeader, zJarRequestObjectPayload, zMrtdChallengeJwtHeader, zMrtdChallengeJwtPayload, zMrtdPopInitResponseJwtHeader, zMrtdPopInitResponseJwtPayload, zMrtdPopVerifyResponse, zMrtdValidationJwtHeader, zMrtdValidationJwtPayload, zOauthClientAttestationHeader, zOauthClientAttestationPopHeader, zPreAuthorizedCodeGrantIdentifier, zPreAuthorizedCodeTokenRequest, zPushedAuthorizationRequestSigned, zPushedAuthorizationRequestUnsignedV1_0, zPushedAuthorizationRequestUnsignedV1_3, zPushedAuthorizationResponse, zRefreshTokenGrantIdentifier, zRefreshTokenProfileJwtHeader, zRefreshTokenProfileJwtPayload, zRefreshTokenTokenRequest, zSignedAuthorizationRequestJwtHeaderTyp, zWalletAttestationJwtHeaderV1_0, zWalletAttestationJwtHeaderV1_3, zWalletAttestationJwtHeaderV1_4, zWalletAttestationJwtPayloadV1_0, zWalletAttestationJwtPayloadV1_3, zWalletAttestationJwtPayloadV1_4, zWalletAttestationJwtV1_0, zWalletAttestationJwtV1_3, zWalletAttestationJwtV1_4 };