@pagopa/io-wallet-oauth2 1.3.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +238 -52
- package/dist/index.d.ts +238 -52
- package/dist/index.js +280 -147
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +283 -149
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -34,11 +34,12 @@ __export(index_exports, {
|
|
|
34
34
|
CreateTokenDPoPError: () => CreateTokenDPoPError,
|
|
35
35
|
CreateTokenResponseError: () => CreateTokenResponseError,
|
|
36
36
|
FetchTokenResponseError: () => FetchTokenResponseError,
|
|
37
|
-
HashAlgorithm: () =>
|
|
37
|
+
HashAlgorithm: () => import_oauth216.HashAlgorithm,
|
|
38
|
+
IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES: () => IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES,
|
|
38
39
|
MAX_JTI_LENGTH: () => MAX_JTI_LENGTH,
|
|
39
40
|
MrtdPopError: () => MrtdPopError,
|
|
40
41
|
Oauth2Error: () => Oauth2Error,
|
|
41
|
-
Oauth2JwtParseError: () =>
|
|
42
|
+
Oauth2JwtParseError: () => import_oauth216.Oauth2JwtParseError,
|
|
42
43
|
PkceCodeChallengeMethod: () => PkceCodeChallengeMethod,
|
|
43
44
|
PushedAuthorizationRequestError: () => PushedAuthorizationRequestError,
|
|
44
45
|
SupportedClientAuthenticationMethod: () => SupportedClientAuthenticationMethod,
|
|
@@ -87,7 +88,7 @@ __export(index_exports, {
|
|
|
87
88
|
verifyClientAttestation: () => verifyClientAttestation,
|
|
88
89
|
verifyClientAttestationPopJwt: () => verifyClientAttestationPopJwt,
|
|
89
90
|
verifyJarRequest: () => verifyJarRequest,
|
|
90
|
-
verifyJwt: () =>
|
|
91
|
+
verifyJwt: () => import_oauth216.verifyJwt,
|
|
91
92
|
verifyMrtdChallenge: () => verifyMrtdChallenge,
|
|
92
93
|
verifyPkce: () => verifyPkce,
|
|
93
94
|
verifyPushedAuthorizationRequest: () => verifyPushedAuthorizationRequest,
|
|
@@ -102,12 +103,17 @@ __export(index_exports, {
|
|
|
102
103
|
zAccessTokenResponse: () => zAccessTokenResponse,
|
|
103
104
|
zAlgValueNotNone: () => zAlgValueNotNone,
|
|
104
105
|
zAuthorizationCodeGrantIdentifier: () => zAuthorizationCodeGrantIdentifier,
|
|
105
|
-
|
|
106
|
+
zAuthorizationRequestV1_0: () => zAuthorizationRequestV1_0,
|
|
107
|
+
zAuthorizationRequestV1_3: () => zAuthorizationRequestV1_3,
|
|
106
108
|
zCertificateChain: () => zCertificateChain,
|
|
107
109
|
zCompactJwe: () => zCompactJwe2,
|
|
108
110
|
zCompactJwt: () => zCompactJwt,
|
|
109
111
|
zDpopJwtHeader: () => zDpopJwtHeader,
|
|
110
112
|
zDpopJwtPayload: () => zDpopJwtPayload,
|
|
113
|
+
zItWalletClientAttestationPopJwtAlg: () => zItWalletClientAttestationPopJwtAlg,
|
|
114
|
+
zItWalletClientAttestationPopJwtHeader: () => zItWalletClientAttestationPopJwtHeader,
|
|
115
|
+
zItWalletClientAttestationPopJwtPayload: () => zItWalletClientAttestationPopJwtPayload,
|
|
116
|
+
zItWalletClientAttestationPopJwtTyp: () => zItWalletClientAttestationPopJwtTyp,
|
|
111
117
|
zJarAuthorizationRequest: () => zJarAuthorizationRequest,
|
|
112
118
|
zJarRequestObjectHeader: () => zJarRequestObjectHeader,
|
|
113
119
|
zJarRequestObjectPayload: () => zJarRequestObjectPayload,
|
|
@@ -124,7 +130,8 @@ __export(index_exports, {
|
|
|
124
130
|
zMrtdValidationJwtHeader: () => zMrtdValidationJwtHeader,
|
|
125
131
|
zMrtdValidationJwtPayload: () => zMrtdValidationJwtPayload,
|
|
126
132
|
zPushedAuthorizationRequestSigned: () => zPushedAuthorizationRequestSigned,
|
|
127
|
-
|
|
133
|
+
zPushedAuthorizationRequestUnsignedV1_0: () => zPushedAuthorizationRequestUnsignedV1_0,
|
|
134
|
+
zPushedAuthorizationRequestUnsignedV1_3: () => zPushedAuthorizationRequestUnsignedV1_3,
|
|
128
135
|
zPushedAuthorizationResponse: () => zPushedAuthorizationResponse,
|
|
129
136
|
zRefreshTokenGrantIdentifier: () => zRefreshTokenGrantIdentifier,
|
|
130
137
|
zSignedAuthorizationRequestJwtHeaderTyp: () => zSignedAuthorizationRequestJwtHeaderTyp,
|
|
@@ -954,20 +961,55 @@ var import_oauth28 = require("@openid4vc/oauth2");
|
|
|
954
961
|
// src/client-attestation/client-attestation-pop.ts
|
|
955
962
|
var import_oauth27 = require("@openid4vc/oauth2");
|
|
956
963
|
var import_io_wallet_utils9 = require("@pagopa/io-wallet-utils");
|
|
964
|
+
|
|
965
|
+
// src/client-attestation/z-client-attestation-pop.ts
|
|
966
|
+
var import_zod11 = __toESM(require("zod"));
|
|
967
|
+
var IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES = [
|
|
968
|
+
"ES256",
|
|
969
|
+
"ES384",
|
|
970
|
+
"ES512"
|
|
971
|
+
];
|
|
972
|
+
var zItWalletClientAttestationPopJwtAlg = import_zod11.default.enum(
|
|
973
|
+
IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES
|
|
974
|
+
);
|
|
975
|
+
var zItWalletClientAttestationPopJwtPayload = import_zod11.default.looseObject({
|
|
976
|
+
...zJwtPayload.shape,
|
|
977
|
+
aud: import_zod11.default.string(),
|
|
978
|
+
exp: import_zod11.default.number().int().optional(),
|
|
979
|
+
iat: import_zod11.default.number().int(),
|
|
980
|
+
iss: import_zod11.default.string(),
|
|
981
|
+
jti: import_zod11.default.string().max(MAX_JTI_LENGTH),
|
|
982
|
+
nonce: import_zod11.default.string().optional()
|
|
983
|
+
});
|
|
984
|
+
var zItWalletClientAttestationPopJwtTyp = import_zod11.default.literal(
|
|
985
|
+
"oauth-client-attestation-pop+jwt"
|
|
986
|
+
);
|
|
987
|
+
var zItWalletClientAttestationPopJwtHeader = import_zod11.default.looseObject({
|
|
988
|
+
...zJwtHeader.shape,
|
|
989
|
+
typ: zItWalletClientAttestationPopJwtTyp
|
|
990
|
+
});
|
|
991
|
+
|
|
992
|
+
// src/client-attestation/client-attestation-pop.ts
|
|
993
|
+
function assertSupportedClientAttestationPopAlg(alg) {
|
|
994
|
+
if (!zItWalletClientAttestationPopJwtAlg.safeParse(alg).success) {
|
|
995
|
+
throw new Oauth2Error(
|
|
996
|
+
`Unsupported alg '${alg}' in client attestation PoP JWT: must be one of ${IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES.join(", ")}`
|
|
997
|
+
);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
957
1000
|
async function verifyClientAttestationPopJwt(options) {
|
|
958
1001
|
try {
|
|
959
1002
|
const { header, payload } = decodeJwt({
|
|
960
1003
|
errorMessagePrefix: "Error decoding client attestation PoP JWT:",
|
|
961
|
-
|
|
1004
|
+
headerSchema: zItWalletClientAttestationPopJwtHeader,
|
|
1005
|
+
jwt: options.clientAttestationPopJwt,
|
|
1006
|
+
payloadSchema: zItWalletClientAttestationPopJwtPayload
|
|
962
1007
|
});
|
|
963
|
-
|
|
964
|
-
throw new Oauth2Error(
|
|
965
|
-
`Client Attestation Pop jwt contains 'aud' value '${payload.aud}', but expected authorization server identifier '${options.authorizationServer}'`
|
|
966
|
-
);
|
|
967
|
-
}
|
|
1008
|
+
assertSupportedClientAttestationPopAlg(header.alg);
|
|
968
1009
|
const { signer } = await (0, import_oauth27.verifyJwt)({
|
|
969
1010
|
compact: options.clientAttestationPopJwt,
|
|
970
1011
|
errorMessage: "client attestation pop jwt verification failed",
|
|
1012
|
+
expectedAudience: options.authorizationServer,
|
|
971
1013
|
expectedNonce: options.expectedNonce,
|
|
972
1014
|
header,
|
|
973
1015
|
now: options.now,
|
|
@@ -1014,25 +1056,32 @@ async function createClientAttestationPopJwt(options) {
|
|
|
1014
1056
|
method: "jwk",
|
|
1015
1057
|
publicJwk: jwk
|
|
1016
1058
|
};
|
|
1059
|
+
assertSupportedClientAttestationPopAlg(signer.alg);
|
|
1017
1060
|
const header = {
|
|
1018
1061
|
alg: signer.alg,
|
|
1019
|
-
typ:
|
|
1062
|
+
typ: zItWalletClientAttestationPopJwtTyp.value
|
|
1020
1063
|
};
|
|
1021
1064
|
const issuedAt = options.issuedAt ?? /* @__PURE__ */ new Date();
|
|
1022
|
-
const expiresAt = options.expiresAt ?? (0, import_io_wallet_utils9.addSecondsToDate)(issuedAt, 1 * 60);
|
|
1023
1065
|
const jti = options.jti ?? (options.callbacks.generateRandom ? (0, import_io_wallet_utils9.encodeToBase64Url)(await options.callbacks.generateRandom(32)) : void 0);
|
|
1024
1066
|
if (!jti) {
|
|
1025
1067
|
throw new Oauth2Error(
|
|
1026
1068
|
"Error: neither a default jti nor a generateRandom callback have been provided"
|
|
1027
1069
|
);
|
|
1028
1070
|
}
|
|
1029
|
-
const payload =
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1071
|
+
const payload = (0, import_io_wallet_utils9.parseWithErrorHandling)(
|
|
1072
|
+
zItWalletClientAttestationPopJwtPayload,
|
|
1073
|
+
{
|
|
1074
|
+
aud: options.authorizationServer,
|
|
1075
|
+
iat: (0, import_io_wallet_utils9.dateToSeconds)(issuedAt),
|
|
1076
|
+
iss: sub,
|
|
1077
|
+
jti,
|
|
1078
|
+
...options.config.itWalletSpecsVersion === import_io_wallet_utils9.ItWalletSpecsVersion.V1_0 ? {
|
|
1079
|
+
exp: (0, import_io_wallet_utils9.dateToSeconds)(
|
|
1080
|
+
"expiresAt" in options && options.expiresAt ? options.expiresAt : (0, import_io_wallet_utils9.addSecondsToDate)(issuedAt, 1 * 60)
|
|
1081
|
+
)
|
|
1082
|
+
} : {}
|
|
1083
|
+
}
|
|
1084
|
+
);
|
|
1036
1085
|
const { jwt } = await options.callbacks.signJwt(signer, {
|
|
1037
1086
|
header,
|
|
1038
1087
|
payload
|
|
@@ -1298,34 +1347,43 @@ async function verifyAccessTokenRequest(options) {
|
|
|
1298
1347
|
var import_io_wallet_utils12 = require("@pagopa/io-wallet-utils");
|
|
1299
1348
|
|
|
1300
1349
|
// src/authorization-request/z-authorization-request.ts
|
|
1301
|
-
var
|
|
1302
|
-
var zOpenidCredentialAuthorizationDetails =
|
|
1303
|
-
credential_configuration_id:
|
|
1304
|
-
type:
|
|
1350
|
+
var import_zod12 = __toESM(require("zod"));
|
|
1351
|
+
var zOpenidCredentialAuthorizationDetails = import_zod12.default.object({
|
|
1352
|
+
credential_configuration_id: import_zod12.default.string(),
|
|
1353
|
+
type: import_zod12.default.literal("openid_credential")
|
|
1305
1354
|
});
|
|
1306
|
-
var zItL2DocumentProofAuthorizationDetails =
|
|
1307
|
-
challenge_method:
|
|
1308
|
-
challenge_redirect_uri:
|
|
1309
|
-
idphinting:
|
|
1310
|
-
type:
|
|
1355
|
+
var zItL2DocumentProofAuthorizationDetails = import_zod12.default.object({
|
|
1356
|
+
challenge_method: import_zod12.default.literal("mrtd+ias"),
|
|
1357
|
+
challenge_redirect_uri: import_zod12.default.url(),
|
|
1358
|
+
idphinting: import_zod12.default.url(),
|
|
1359
|
+
type: import_zod12.default.literal("it_l2+document_proof")
|
|
1311
1360
|
});
|
|
1312
|
-
var
|
|
1313
|
-
authorization_details:
|
|
1314
|
-
|
|
1361
|
+
var zAuthorizationRequestBaseObject = import_zod12.default.looseObject({
|
|
1362
|
+
authorization_details: import_zod12.default.array(
|
|
1363
|
+
import_zod12.default.discriminatedUnion("type", [
|
|
1315
1364
|
zOpenidCredentialAuthorizationDetails,
|
|
1316
1365
|
zItL2DocumentProofAuthorizationDetails
|
|
1317
1366
|
])
|
|
1318
1367
|
).optional(),
|
|
1319
|
-
client_id:
|
|
1320
|
-
code_challenge:
|
|
1321
|
-
code_challenge_method:
|
|
1322
|
-
issuer_state:
|
|
1323
|
-
jti:
|
|
1324
|
-
redirect_uri:
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1368
|
+
client_id: import_zod12.default.string(),
|
|
1369
|
+
code_challenge: import_zod12.default.string(),
|
|
1370
|
+
code_challenge_method: import_zod12.default.string(),
|
|
1371
|
+
issuer_state: import_zod12.default.optional(import_zod12.default.string()),
|
|
1372
|
+
jti: import_zod12.default.string().max(MAX_JTI_LENGTH),
|
|
1373
|
+
redirect_uri: import_zod12.default.url(),
|
|
1374
|
+
response_type: import_zod12.default.string(),
|
|
1375
|
+
scope: import_zod12.default.string().optional(),
|
|
1376
|
+
state: import_zod12.default.string()
|
|
1377
|
+
});
|
|
1378
|
+
var zAuthorizationRequestBase = zAuthorizationRequestBaseObject.refine(
|
|
1379
|
+
(data) => data.authorization_details !== void 0 || data.scope !== void 0,
|
|
1380
|
+
{
|
|
1381
|
+
message: "Either 'authorization_details' or 'scope' must be provided.",
|
|
1382
|
+
path: ["authorization_details"]
|
|
1383
|
+
}
|
|
1384
|
+
);
|
|
1385
|
+
var zAuthorizationRequestV1_0 = zAuthorizationRequestBaseObject.extend({
|
|
1386
|
+
response_mode: import_zod12.default.string()
|
|
1329
1387
|
}).refine(
|
|
1330
1388
|
(data) => data.authorization_details !== void 0 || data.scope !== void 0,
|
|
1331
1389
|
{
|
|
@@ -1333,35 +1391,40 @@ var zAuthorizationRequest = import_zod11.default.looseObject({
|
|
|
1333
1391
|
path: ["authorization_details"]
|
|
1334
1392
|
}
|
|
1335
1393
|
);
|
|
1336
|
-
var
|
|
1337
|
-
|
|
1394
|
+
var zAuthorizationRequestV1_3 = zAuthorizationRequestBase;
|
|
1395
|
+
var zPushedAuthorizationRequestSigned = import_zod12.default.looseObject({
|
|
1396
|
+
client_id: import_zod12.default.string().describe(
|
|
1338
1397
|
"MUST be set to the thumbprint of the jwk value in the cnf parameter inside the Wallet Attestation."
|
|
1339
1398
|
),
|
|
1340
|
-
pkceCodeVerifier:
|
|
1399
|
+
pkceCodeVerifier: import_zod12.default.string().describe(
|
|
1341
1400
|
"Code verifier for PKCE. If not provided in CreatePushedAuthorizationRequestOptions, SDK will generate one."
|
|
1342
1401
|
),
|
|
1343
|
-
request:
|
|
1402
|
+
request: import_zod12.default.string().describe(
|
|
1344
1403
|
"It MUST be a signed JWT. The private key corresponding to the public one in the cnf parameter inside the Wallet Attestation MUST be used for signing the Request Object."
|
|
1345
1404
|
)
|
|
1346
1405
|
});
|
|
1347
|
-
var
|
|
1348
|
-
authorizationRequest:
|
|
1406
|
+
var zPushedAuthorizationRequestUnsignedBase = (authorizationRequest) => import_zod12.default.looseObject({
|
|
1407
|
+
authorizationRequest: authorizationRequest.describe(
|
|
1349
1408
|
"The authorization request parameters as a plain object. Used when require_signed_request_object is false."
|
|
1350
1409
|
),
|
|
1351
|
-
client_id:
|
|
1410
|
+
client_id: import_zod12.default.string().describe(
|
|
1352
1411
|
"Thumbprint of the jwk value in the cnf parameter inside Wallet Attestation."
|
|
1353
1412
|
),
|
|
1354
|
-
pkceCodeVerifier:
|
|
1413
|
+
pkceCodeVerifier: import_zod12.default.string().describe(
|
|
1414
|
+
"PKCE code verifier. Auto-generated if not provided in options."
|
|
1415
|
+
)
|
|
1355
1416
|
});
|
|
1417
|
+
var zPushedAuthorizationRequestUnsignedV1_0 = zPushedAuthorizationRequestUnsignedBase(zAuthorizationRequestV1_0);
|
|
1418
|
+
var zPushedAuthorizationRequestUnsignedV1_3 = zPushedAuthorizationRequestUnsignedBase(zAuthorizationRequestV1_3);
|
|
1356
1419
|
function isPushedAuthorizationRequestSigned(par) {
|
|
1357
1420
|
return "request" in par && typeof par.request === "string";
|
|
1358
1421
|
}
|
|
1359
1422
|
function isPushedAuthorizationRequestUnsigned(par) {
|
|
1360
1423
|
return "authorizationRequest" in par;
|
|
1361
1424
|
}
|
|
1362
|
-
var zPushedAuthorizationResponse =
|
|
1363
|
-
expires_in:
|
|
1364
|
-
request_uri:
|
|
1425
|
+
var zPushedAuthorizationResponse = import_zod12.default.looseObject({
|
|
1426
|
+
expires_in: import_zod12.default.number().int(),
|
|
1427
|
+
request_uri: import_zod12.default.string()
|
|
1365
1428
|
});
|
|
1366
1429
|
|
|
1367
1430
|
// src/authorization-request/create-authorization-request.ts
|
|
@@ -1373,7 +1436,7 @@ async function createPushedAuthorizationRequest(options) {
|
|
|
1373
1436
|
callbacks: options.callbacks,
|
|
1374
1437
|
codeVerifier: options.pkceCodeVerifier
|
|
1375
1438
|
});
|
|
1376
|
-
const
|
|
1439
|
+
const baseAuthorizationRequest = {
|
|
1377
1440
|
authorization_details: options.authorization_details,
|
|
1378
1441
|
client_id: options.clientId,
|
|
1379
1442
|
code_challenge: pkce.codeChallenge,
|
|
@@ -1382,13 +1445,16 @@ async function createPushedAuthorizationRequest(options) {
|
|
|
1382
1445
|
await options.callbacks.generateRandom(RANDOM_BYTES_SIZE)
|
|
1383
1446
|
),
|
|
1384
1447
|
redirect_uri: options.redirectUri,
|
|
1385
|
-
response_mode: options.responseMode,
|
|
1386
1448
|
response_type: "code",
|
|
1387
1449
|
scope: options.scope,
|
|
1388
1450
|
state: options.state ?? (0, import_io_wallet_utils12.encodeToBase64Url)(
|
|
1389
1451
|
await options.callbacks.generateRandom(RANDOM_BYTES_SIZE)
|
|
1390
1452
|
)
|
|
1391
|
-
}
|
|
1453
|
+
};
|
|
1454
|
+
const authorizationRequest = parseAuthorizationRequestByVersion(
|
|
1455
|
+
options,
|
|
1456
|
+
baseAuthorizationRequest
|
|
1457
|
+
);
|
|
1392
1458
|
const requireSigned = options.authorizationServerMetadata?.require_signed_request_object ?? false;
|
|
1393
1459
|
if (requireSigned) {
|
|
1394
1460
|
const { dpop } = options;
|
|
@@ -1418,13 +1484,31 @@ async function createPushedAuthorizationRequest(options) {
|
|
|
1418
1484
|
pkceCodeVerifier: pkce.codeVerifier,
|
|
1419
1485
|
request: requestJwt.jwt
|
|
1420
1486
|
};
|
|
1421
|
-
} else {
|
|
1422
|
-
return {
|
|
1423
|
-
authorizationRequest,
|
|
1424
|
-
client_id: options.clientId,
|
|
1425
|
-
pkceCodeVerifier: pkce.codeVerifier
|
|
1426
|
-
};
|
|
1427
1487
|
}
|
|
1488
|
+
return {
|
|
1489
|
+
authorizationRequest,
|
|
1490
|
+
client_id: options.clientId,
|
|
1491
|
+
pkceCodeVerifier: pkce.codeVerifier
|
|
1492
|
+
};
|
|
1493
|
+
}
|
|
1494
|
+
function parseAuthorizationRequestByVersion(options, baseAuthorizationRequest) {
|
|
1495
|
+
const version = options.config.itWalletSpecsVersion;
|
|
1496
|
+
if ((0, import_io_wallet_utils12.hasConfigVersion)(options, import_io_wallet_utils12.ItWalletSpecsVersion.V1_0)) {
|
|
1497
|
+
return zAuthorizationRequestV1_0.parse({
|
|
1498
|
+
...baseAuthorizationRequest,
|
|
1499
|
+
response_mode: options.responseMode
|
|
1500
|
+
});
|
|
1501
|
+
}
|
|
1502
|
+
if ((0, import_io_wallet_utils12.hasConfigVersion)(options, import_io_wallet_utils12.ItWalletSpecsVersion.V1_3)) {
|
|
1503
|
+
return zAuthorizationRequestV1_3.parse(
|
|
1504
|
+
baseAuthorizationRequest
|
|
1505
|
+
);
|
|
1506
|
+
}
|
|
1507
|
+
throw new import_io_wallet_utils12.ItWalletSpecsVersionError(
|
|
1508
|
+
"createPushedAuthorizationRequest",
|
|
1509
|
+
version,
|
|
1510
|
+
[import_io_wallet_utils12.ItWalletSpecsVersion.V1_0, import_io_wallet_utils12.ItWalletSpecsVersion.V1_3]
|
|
1511
|
+
);
|
|
1428
1512
|
}
|
|
1429
1513
|
|
|
1430
1514
|
// src/authorization-request/fetch-authorization-response.ts
|
|
@@ -1510,7 +1594,7 @@ function parseAuthorizationRequest(options) {
|
|
|
1510
1594
|
|
|
1511
1595
|
// src/authorization-request/parse-pushed-authorization-request.ts
|
|
1512
1596
|
var import_io_wallet_utils15 = require("@pagopa/io-wallet-utils");
|
|
1513
|
-
var
|
|
1597
|
+
var import_zod14 = __toESM(require("zod"));
|
|
1514
1598
|
|
|
1515
1599
|
// src/jar/fetch-jar-request-object.ts
|
|
1516
1600
|
var import_io_wallet_utils14 = require("@pagopa/io-wallet-utils");
|
|
@@ -1571,31 +1655,34 @@ async function parseJarRequest(options) {
|
|
|
1571
1655
|
}
|
|
1572
1656
|
|
|
1573
1657
|
// src/jar/z-jar.ts
|
|
1574
|
-
var
|
|
1575
|
-
var zJarAuthorizationRequest =
|
|
1576
|
-
client_id:
|
|
1577
|
-
request:
|
|
1578
|
-
request_uri:
|
|
1658
|
+
var import_zod13 = __toESM(require("zod"));
|
|
1659
|
+
var zJarAuthorizationRequest = import_zod13.default.looseObject({
|
|
1660
|
+
client_id: import_zod13.default.optional(import_zod13.default.string()),
|
|
1661
|
+
request: import_zod13.default.optional(import_zod13.default.string()),
|
|
1662
|
+
request_uri: import_zod13.default.url().optional()
|
|
1579
1663
|
});
|
|
1580
|
-
var zJarRequestObjectPayload =
|
|
1664
|
+
var zJarRequestObjectPayload = import_zod13.default.looseObject({
|
|
1581
1665
|
...zJwtPayload.shape,
|
|
1582
|
-
client_id:
|
|
1666
|
+
client_id: import_zod13.default.string()
|
|
1583
1667
|
});
|
|
1584
|
-
var zSignedAuthorizationRequestJwtHeaderTyp =
|
|
1668
|
+
var zSignedAuthorizationRequestJwtHeaderTyp = import_zod13.default.literal(
|
|
1585
1669
|
"oauth-authz-req+jwt"
|
|
1586
1670
|
);
|
|
1587
|
-
var zJarRequestObjectHeader =
|
|
1671
|
+
var zJarRequestObjectHeader = import_zod13.default.looseObject({
|
|
1588
1672
|
...zJwtHeader.shape,
|
|
1589
1673
|
typ: zSignedAuthorizationRequestJwtHeaderTyp
|
|
1590
1674
|
});
|
|
1591
1675
|
var signedAuthorizationRequestJwtHeaderTyp = zSignedAuthorizationRequestJwtHeaderTyp.value;
|
|
1592
|
-
var zJwtAuthorizationRequestJwtHeaderTyp =
|
|
1676
|
+
var zJwtAuthorizationRequestJwtHeaderTyp = import_zod13.default.literal("jwt");
|
|
1593
1677
|
var jwtAuthorizationRequestJwtHeaderTyp = zJwtAuthorizationRequestJwtHeaderTyp.value;
|
|
1594
1678
|
|
|
1595
1679
|
// src/authorization-request/parse-pushed-authorization-request.ts
|
|
1596
1680
|
async function parsePushedAuthorizationRequest(options) {
|
|
1681
|
+
const authorizationRequestSchema = getAuthorizationRequestSchema(
|
|
1682
|
+
options.config
|
|
1683
|
+
);
|
|
1597
1684
|
const parsed = (0, import_io_wallet_utils15.parseWithErrorHandling)(
|
|
1598
|
-
|
|
1685
|
+
import_zod14.default.union([authorizationRequestSchema, zJarAuthorizationRequest]),
|
|
1599
1686
|
options.authorizationRequest,
|
|
1600
1687
|
"Invalid authorization request. Could not parse authorization request or jar."
|
|
1601
1688
|
);
|
|
@@ -1610,7 +1697,9 @@ async function parsePushedAuthorizationRequest(options) {
|
|
|
1610
1697
|
errorMessagePrefix: "Error decoding pushed authorization request JWT:",
|
|
1611
1698
|
jwt: parsedJar.authorizationRequestJwt
|
|
1612
1699
|
});
|
|
1613
|
-
parsedAuthorizationRequest =
|
|
1700
|
+
parsedAuthorizationRequest = authorizationRequestSchema.safeParse(
|
|
1701
|
+
jwt.payload
|
|
1702
|
+
);
|
|
1614
1703
|
if (!parsedAuthorizationRequest.success) {
|
|
1615
1704
|
throw new Oauth2Error(
|
|
1616
1705
|
`Invalid authorization request. Could not parse jar request payload.
|
|
@@ -1619,7 +1708,7 @@ ${(0, import_io_wallet_utils15.formatZodError)(parsedAuthorizationRequest.error)
|
|
|
1619
1708
|
}
|
|
1620
1709
|
authorizationRequestJwt = parsedJar.authorizationRequestJwt;
|
|
1621
1710
|
} else {
|
|
1622
|
-
parsedAuthorizationRequest =
|
|
1711
|
+
parsedAuthorizationRequest = authorizationRequestSchema.safeParse(
|
|
1623
1712
|
options.authorizationRequest
|
|
1624
1713
|
);
|
|
1625
1714
|
if (!parsedAuthorizationRequest.success) {
|
|
@@ -1640,6 +1729,19 @@ ${(0, import_io_wallet_utils15.formatZodError)(parsedAuthorizationRequest.error)
|
|
|
1640
1729
|
dpop
|
|
1641
1730
|
};
|
|
1642
1731
|
}
|
|
1732
|
+
function getAuthorizationRequestSchema(config) {
|
|
1733
|
+
if (config.isVersion(import_io_wallet_utils15.ItWalletSpecsVersion.V1_0)) {
|
|
1734
|
+
return zAuthorizationRequestV1_0;
|
|
1735
|
+
}
|
|
1736
|
+
if (config.isVersion(import_io_wallet_utils15.ItWalletSpecsVersion.V1_3)) {
|
|
1737
|
+
return zAuthorizationRequestV1_3;
|
|
1738
|
+
}
|
|
1739
|
+
throw new import_io_wallet_utils15.ItWalletSpecsVersionError(
|
|
1740
|
+
"parsePushedAuthorizationRequest",
|
|
1741
|
+
config.itWalletSpecsVersion,
|
|
1742
|
+
[import_io_wallet_utils15.ItWalletSpecsVersion.V1_0, import_io_wallet_utils15.ItWalletSpecsVersion.V1_3]
|
|
1743
|
+
);
|
|
1744
|
+
}
|
|
1643
1745
|
|
|
1644
1746
|
// src/authorization-request/verify-authorization-request.ts
|
|
1645
1747
|
async function verifyAuthorizationRequest(options) {
|
|
@@ -1870,7 +1972,8 @@ function clientAuthenticationWalletAttestationJwt(options) {
|
|
|
1870
1972
|
const clientAttestationPop = await createClientAttestationPopJwt({
|
|
1871
1973
|
authorizationServer: authorizationServerMetadata.issuer,
|
|
1872
1974
|
callbacks: options.callbacks,
|
|
1873
|
-
clientAttestation: options.walletAttestationJwt
|
|
1975
|
+
clientAttestation: options.walletAttestationJwt,
|
|
1976
|
+
config: options.config
|
|
1874
1977
|
});
|
|
1875
1978
|
headers.set(oauthClientAttestationHeader, options.walletAttestationJwt);
|
|
1876
1979
|
headers.set(oauthClientAttestationPopHeader, clientAttestationPop);
|
|
@@ -1879,17 +1982,38 @@ function clientAuthenticationWalletAttestationJwt(options) {
|
|
|
1879
1982
|
|
|
1880
1983
|
// src/client-attestation/v1.0/create-wallet-attestation-jwt.ts
|
|
1881
1984
|
var import_io_wallet_utils17 = require("@pagopa/io-wallet-utils");
|
|
1985
|
+
|
|
1986
|
+
// src/client-attestation/jwk-thumbprint.ts
|
|
1987
|
+
var import_oauth212 = require("@openid4vc/oauth2");
|
|
1988
|
+
var SUPPORTED_KTY = ["RSA", "EC"];
|
|
1989
|
+
var calculateDpopJwkThumbprint = (options) => {
|
|
1990
|
+
if (!SUPPORTED_KTY.includes(
|
|
1991
|
+
options.dpopJwkPublic.kty
|
|
1992
|
+
)) {
|
|
1993
|
+
throw new ClientAttestationError(
|
|
1994
|
+
`Unsupported JWK key type "${options.dpopJwkPublic.kty}" for thumbprint computation. Supported types: ${SUPPORTED_KTY.join(", ")}.`
|
|
1995
|
+
);
|
|
1996
|
+
}
|
|
1997
|
+
return (0, import_oauth212.calculateJwkThumbprint)({
|
|
1998
|
+
hashAlgorithm: import_oauth212.HashAlgorithm.Sha256,
|
|
1999
|
+
hashCallback: options.callbacks.hash,
|
|
2000
|
+
jwk: options.dpopJwkPublic
|
|
2001
|
+
});
|
|
2002
|
+
};
|
|
2003
|
+
|
|
2004
|
+
// src/client-attestation/v1.0/create-wallet-attestation-jwt.ts
|
|
1882
2005
|
var createWalletAttestationJwt = async (options) => {
|
|
1883
2006
|
try {
|
|
1884
2007
|
const { signJwt } = options.callbacks;
|
|
1885
2008
|
const iat = /* @__PURE__ */ new Date();
|
|
1886
2009
|
const exp = options.expiresAt ?? (0, import_io_wallet_utils17.addSecondsToDate)(iat, 3600);
|
|
2010
|
+
const dpopJwkThumbprint = await calculateDpopJwkThumbprint(options);
|
|
1887
2011
|
const payload = {
|
|
1888
2012
|
cnf: { jwk: options.dpopJwkPublic },
|
|
1889
2013
|
exp: (0, import_io_wallet_utils17.dateToSeconds)(exp),
|
|
1890
2014
|
iat: (0, import_io_wallet_utils17.dateToSeconds)(iat),
|
|
1891
2015
|
iss: options.issuer,
|
|
1892
|
-
sub:
|
|
2016
|
+
sub: dpopJwkThumbprint,
|
|
1893
2017
|
...options.walletLink && { wallet_link: options.walletLink },
|
|
1894
2018
|
...options.walletName && { wallet_name: options.walletName },
|
|
1895
2019
|
aal: options.authenticatorAssuranceLevel
|
|
@@ -1931,12 +2055,13 @@ var createWalletAttestationJwt2 = async (options) => {
|
|
|
1931
2055
|
if (options.nbf && options.nbf >= exp) {
|
|
1932
2056
|
throw new import_io_wallet_utils18.ValidationError("nbf must be before exp");
|
|
1933
2057
|
}
|
|
2058
|
+
const dpopJwkThumbprint = await calculateDpopJwkThumbprint(options);
|
|
1934
2059
|
const payload = {
|
|
1935
2060
|
cnf: { jwk: options.dpopJwkPublic },
|
|
1936
2061
|
exp: (0, import_io_wallet_utils18.dateToSeconds)(exp),
|
|
1937
2062
|
iat: (0, import_io_wallet_utils18.dateToSeconds)(iat),
|
|
1938
2063
|
iss: options.issuer,
|
|
1939
|
-
sub:
|
|
2064
|
+
sub: dpopJwkThumbprint,
|
|
1940
2065
|
...options.nbf && { nbf: (0, import_io_wallet_utils18.dateToSeconds)(options.nbf) },
|
|
1941
2066
|
...options.status && { status: options.status },
|
|
1942
2067
|
...options.walletLink && { wallet_link: options.walletLink },
|
|
@@ -1983,13 +2108,14 @@ var createWalletAttestationJwt3 = async (options) => {
|
|
|
1983
2108
|
if (options.nbf && options.nbf >= exp) {
|
|
1984
2109
|
throw new import_io_wallet_utils19.ValidationError("nbf must be before exp");
|
|
1985
2110
|
}
|
|
2111
|
+
const dpopJwkThumbprint = await calculateDpopJwkThumbprint(options);
|
|
1986
2112
|
const payload = {
|
|
1987
2113
|
cnf: { jwk: options.dpopJwkPublic },
|
|
1988
2114
|
exp: (0, import_io_wallet_utils19.dateToSeconds)(exp),
|
|
1989
2115
|
iat: (0, import_io_wallet_utils19.dateToSeconds)(iat),
|
|
1990
2116
|
iss: options.issuer,
|
|
1991
2117
|
status: options.status,
|
|
1992
|
-
sub:
|
|
2118
|
+
sub: dpopJwkThumbprint,
|
|
1993
2119
|
wallet_link: options.walletLink,
|
|
1994
2120
|
wallet_name: options.walletName,
|
|
1995
2121
|
...options.nbf && { nbf: (0, import_io_wallet_utils19.dateToSeconds)(options.nbf) },
|
|
@@ -2028,8 +2154,8 @@ var createWalletAttestationJwt3 = async (options) => {
|
|
|
2028
2154
|
};
|
|
2029
2155
|
|
|
2030
2156
|
// src/common/jwt/z-jwe.ts
|
|
2031
|
-
var
|
|
2032
|
-
var zCompactJwe2 =
|
|
2157
|
+
var import_zod15 = require("zod");
|
|
2158
|
+
var zCompactJwe2 = import_zod15.z.string().regex(
|
|
2033
2159
|
/^[A-Za-z0-9_-]+\.[A-Za-z0-9_-]*\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+$/,
|
|
2034
2160
|
{
|
|
2035
2161
|
message: "Not a valid compact jwe"
|
|
@@ -2123,70 +2249,70 @@ var getJwtFromFormPost = async (options) => {
|
|
|
2123
2249
|
var import_io_wallet_utils21 = require("@pagopa/io-wallet-utils");
|
|
2124
2250
|
|
|
2125
2251
|
// src/mrtd-pop/z-mrtd-pop.ts
|
|
2126
|
-
var
|
|
2127
|
-
var zMrtdChallengeJwtHeader =
|
|
2128
|
-
alg:
|
|
2129
|
-
kid:
|
|
2130
|
-
typ:
|
|
2252
|
+
var import_zod16 = __toESM(require("zod"));
|
|
2253
|
+
var zMrtdChallengeJwtHeader = import_zod16.default.looseObject({
|
|
2254
|
+
alg: import_zod16.default.string(),
|
|
2255
|
+
kid: import_zod16.default.string(),
|
|
2256
|
+
typ: import_zod16.default.literal("mrtd-ias+jwt")
|
|
2131
2257
|
});
|
|
2132
|
-
var zMrtdChallengeJwtPayload =
|
|
2133
|
-
aud:
|
|
2134
|
-
exp:
|
|
2135
|
-
htm:
|
|
2136
|
-
htu:
|
|
2137
|
-
iat:
|
|
2138
|
-
iss:
|
|
2139
|
-
mrtd_auth_session:
|
|
2140
|
-
mrtd_pop_jwt_nonce:
|
|
2141
|
-
state:
|
|
2142
|
-
status:
|
|
2143
|
-
type:
|
|
2258
|
+
var zMrtdChallengeJwtPayload = import_zod16.default.looseObject({
|
|
2259
|
+
aud: import_zod16.default.string(),
|
|
2260
|
+
exp: import_zod16.default.number(),
|
|
2261
|
+
htm: import_zod16.default.literal("POST"),
|
|
2262
|
+
htu: import_zod16.default.url(),
|
|
2263
|
+
iat: import_zod16.default.number(),
|
|
2264
|
+
iss: import_zod16.default.string(),
|
|
2265
|
+
mrtd_auth_session: import_zod16.default.string(),
|
|
2266
|
+
mrtd_pop_jwt_nonce: import_zod16.default.string(),
|
|
2267
|
+
state: import_zod16.default.string(),
|
|
2268
|
+
status: import_zod16.default.literal("require_interaction"),
|
|
2269
|
+
type: import_zod16.default.literal("mrtd+ias")
|
|
2144
2270
|
});
|
|
2145
|
-
var zMrtdPopInitResponseJwtHeader =
|
|
2146
|
-
alg:
|
|
2147
|
-
kid:
|
|
2148
|
-
typ:
|
|
2271
|
+
var zMrtdPopInitResponseJwtHeader = import_zod16.default.looseObject({
|
|
2272
|
+
alg: import_zod16.default.string(),
|
|
2273
|
+
kid: import_zod16.default.string(),
|
|
2274
|
+
typ: import_zod16.default.literal("mrtd-ias-pop+jwt")
|
|
2149
2275
|
});
|
|
2150
|
-
var zMrtdPopInitResponseJwtPayload =
|
|
2151
|
-
aud:
|
|
2152
|
-
challenge:
|
|
2153
|
-
exp:
|
|
2154
|
-
htm:
|
|
2155
|
-
htu:
|
|
2156
|
-
iat:
|
|
2157
|
-
iss:
|
|
2158
|
-
mrtd_pop_nonce:
|
|
2159
|
-
mrz:
|
|
2276
|
+
var zMrtdPopInitResponseJwtPayload = import_zod16.default.looseObject({
|
|
2277
|
+
aud: import_zod16.default.string(),
|
|
2278
|
+
challenge: import_zod16.default.string(),
|
|
2279
|
+
exp: import_zod16.default.number(),
|
|
2280
|
+
htm: import_zod16.default.literal("POST"),
|
|
2281
|
+
htu: import_zod16.default.url(),
|
|
2282
|
+
iat: import_zod16.default.number(),
|
|
2283
|
+
iss: import_zod16.default.string(),
|
|
2284
|
+
mrtd_pop_nonce: import_zod16.default.string(),
|
|
2285
|
+
mrz: import_zod16.default.string().optional()
|
|
2160
2286
|
});
|
|
2161
|
-
var zMrtdData =
|
|
2162
|
-
dg1:
|
|
2163
|
-
dg11:
|
|
2164
|
-
sod_mrtd:
|
|
2287
|
+
var zMrtdData = import_zod16.default.looseObject({
|
|
2288
|
+
dg1: import_zod16.default.string(),
|
|
2289
|
+
dg11: import_zod16.default.string(),
|
|
2290
|
+
sod_mrtd: import_zod16.default.string()
|
|
2165
2291
|
});
|
|
2166
|
-
var zIasData =
|
|
2167
|
-
challenge_signed:
|
|
2168
|
-
ias_pk:
|
|
2169
|
-
sod_ias:
|
|
2292
|
+
var zIasData = import_zod16.default.looseObject({
|
|
2293
|
+
challenge_signed: import_zod16.default.string(),
|
|
2294
|
+
ias_pk: import_zod16.default.string(),
|
|
2295
|
+
sod_ias: import_zod16.default.string()
|
|
2170
2296
|
});
|
|
2171
|
-
var zMrtdValidationJwtHeader =
|
|
2172
|
-
alg:
|
|
2173
|
-
kid:
|
|
2174
|
-
typ:
|
|
2297
|
+
var zMrtdValidationJwtHeader = import_zod16.default.looseObject({
|
|
2298
|
+
alg: import_zod16.default.string(),
|
|
2299
|
+
kid: import_zod16.default.string(),
|
|
2300
|
+
typ: import_zod16.default.literal("mrtd-ias+jwt")
|
|
2175
2301
|
});
|
|
2176
|
-
var zMrtdValidationJwtPayload =
|
|
2177
|
-
aud:
|
|
2178
|
-
document_type:
|
|
2179
|
-
exp:
|
|
2302
|
+
var zMrtdValidationJwtPayload = import_zod16.default.looseObject({
|
|
2303
|
+
aud: import_zod16.default.string(),
|
|
2304
|
+
document_type: import_zod16.default.literal("cie"),
|
|
2305
|
+
exp: import_zod16.default.number(),
|
|
2180
2306
|
ias: zIasData,
|
|
2181
|
-
iat:
|
|
2182
|
-
iss:
|
|
2307
|
+
iat: import_zod16.default.number(),
|
|
2308
|
+
iss: import_zod16.default.string(),
|
|
2183
2309
|
mrtd: zMrtdData
|
|
2184
2310
|
});
|
|
2185
|
-
var zMrtdPopVerifyResponse =
|
|
2186
|
-
mrtd_val_pop_nonce:
|
|
2187
|
-
redirect_uri:
|
|
2188
|
-
status:
|
|
2189
|
-
type:
|
|
2311
|
+
var zMrtdPopVerifyResponse = import_zod16.default.looseObject({
|
|
2312
|
+
mrtd_val_pop_nonce: import_zod16.default.string(),
|
|
2313
|
+
redirect_uri: import_zod16.default.url(),
|
|
2314
|
+
status: import_zod16.default.literal("require_interaction"),
|
|
2315
|
+
type: import_zod16.default.literal("redirect_to_web")
|
|
2190
2316
|
});
|
|
2191
2317
|
|
|
2192
2318
|
// src/mrtd-pop/create-mrtd-validation-jwt.ts
|
|
@@ -2236,7 +2362,7 @@ async function createMrtdValidationJwt(options) {
|
|
|
2236
2362
|
}
|
|
2237
2363
|
|
|
2238
2364
|
// src/mrtd-pop/fetch-mrtd-pop-init.ts
|
|
2239
|
-
var
|
|
2365
|
+
var import_oauth213 = require("@openid4vc/oauth2");
|
|
2240
2366
|
var import_io_wallet_utils22 = require("@pagopa/io-wallet-utils");
|
|
2241
2367
|
async function fetchMrtdPopInit(options) {
|
|
2242
2368
|
try {
|
|
@@ -2261,12 +2387,12 @@ async function fetchMrtdPopInit(options) {
|
|
|
2261
2387
|
jwt: responseJwt,
|
|
2262
2388
|
payloadSchema: zMrtdPopInitResponseJwtPayload
|
|
2263
2389
|
});
|
|
2264
|
-
const { signer } = await (0,
|
|
2390
|
+
const { signer } = await (0, import_oauth213.verifyJwt)({
|
|
2265
2391
|
compact: responseJwt,
|
|
2266
2392
|
errorMessage: "Error verifying MRTD PoP init response JWT",
|
|
2267
2393
|
header: jwt.header,
|
|
2268
2394
|
payload: jwt.payload,
|
|
2269
|
-
signer: options.signer ?? (0,
|
|
2395
|
+
signer: options.signer ?? (0, import_oauth213.jwtSignerFromJwt)({ header: jwt.header, payload: jwt.payload }),
|
|
2270
2396
|
verifyJwtCallback: options.callbacks.verifyJwt
|
|
2271
2397
|
});
|
|
2272
2398
|
return {
|
|
@@ -2325,7 +2451,7 @@ async function fetchMrtdPopVerify(options) {
|
|
|
2325
2451
|
}
|
|
2326
2452
|
|
|
2327
2453
|
// src/mrtd-pop/parse-mrtd-challenge.ts
|
|
2328
|
-
var
|
|
2454
|
+
var import_oauth214 = require("@openid4vc/oauth2");
|
|
2329
2455
|
function parseMrtdChallenge(options) {
|
|
2330
2456
|
const url = new URL(options.redirectUrl);
|
|
2331
2457
|
const challengeJwt = url.searchParams.get("challenge_info");
|
|
@@ -2334,7 +2460,7 @@ function parseMrtdChallenge(options) {
|
|
|
2334
2460
|
"Missing 'challenge_info' query parameter in redirect URL"
|
|
2335
2461
|
);
|
|
2336
2462
|
}
|
|
2337
|
-
if (!
|
|
2463
|
+
if (!import_oauth214.zCompactJwt.safeParse(challengeJwt).success) {
|
|
2338
2464
|
throw new MrtdPopError(
|
|
2339
2465
|
"Invalid JWT format in 'challenge_info' query parameter"
|
|
2340
2466
|
);
|
|
@@ -2349,7 +2475,7 @@ function parseMrtdChallenge(options) {
|
|
|
2349
2475
|
}
|
|
2350
2476
|
|
|
2351
2477
|
// src/mrtd-pop/verify-mrtd-challenge.ts
|
|
2352
|
-
var
|
|
2478
|
+
var import_oauth215 = require("@openid4vc/oauth2");
|
|
2353
2479
|
async function verifyMrtdChallenge(options) {
|
|
2354
2480
|
const { callbacks, challengeJwt, clientId } = options;
|
|
2355
2481
|
const jwt = decodeJwt({
|
|
@@ -2364,19 +2490,19 @@ async function verifyMrtdChallenge(options) {
|
|
|
2364
2490
|
);
|
|
2365
2491
|
}
|
|
2366
2492
|
const payload = jwt.payload;
|
|
2367
|
-
const { signer } = await (0,
|
|
2493
|
+
const { signer } = await (0, import_oauth215.verifyJwt)({
|
|
2368
2494
|
compact: challengeJwt,
|
|
2369
2495
|
errorMessage: "Error verifying MRTD challenge JWT",
|
|
2370
2496
|
header: jwt.header,
|
|
2371
2497
|
payload,
|
|
2372
|
-
signer: options.signer ?? (0,
|
|
2498
|
+
signer: options.signer ?? (0, import_oauth215.jwtSignerFromJwt)({ header: jwt.header, payload }),
|
|
2373
2499
|
verifyJwtCallback: callbacks.verifyJwt
|
|
2374
2500
|
});
|
|
2375
2501
|
return { header: jwt.header, payload: jwt.payload, signer };
|
|
2376
2502
|
}
|
|
2377
2503
|
|
|
2378
2504
|
// src/index.ts
|
|
2379
|
-
var
|
|
2505
|
+
var import_oauth216 = require("@openid4vc/oauth2");
|
|
2380
2506
|
// Annotate the CommonJS export names for ESM import in node:
|
|
2381
2507
|
0 && (module.exports = {
|
|
2382
2508
|
ClientAttestationError,
|
|
@@ -2384,6 +2510,7 @@ var import_oauth215 = require("@openid4vc/oauth2");
|
|
|
2384
2510
|
CreateTokenResponseError,
|
|
2385
2511
|
FetchTokenResponseError,
|
|
2386
2512
|
HashAlgorithm,
|
|
2513
|
+
IT_WALLET_CLIENT_ATTESTATION_POP_ALLOWED_ALG_VALUES,
|
|
2387
2514
|
MAX_JTI_LENGTH,
|
|
2388
2515
|
MrtdPopError,
|
|
2389
2516
|
Oauth2Error,
|
|
@@ -2451,12 +2578,17 @@ var import_oauth215 = require("@openid4vc/oauth2");
|
|
|
2451
2578
|
zAccessTokenResponse,
|
|
2452
2579
|
zAlgValueNotNone,
|
|
2453
2580
|
zAuthorizationCodeGrantIdentifier,
|
|
2454
|
-
|
|
2581
|
+
zAuthorizationRequestV1_0,
|
|
2582
|
+
zAuthorizationRequestV1_3,
|
|
2455
2583
|
zCertificateChain,
|
|
2456
2584
|
zCompactJwe,
|
|
2457
2585
|
zCompactJwt,
|
|
2458
2586
|
zDpopJwtHeader,
|
|
2459
2587
|
zDpopJwtPayload,
|
|
2588
|
+
zItWalletClientAttestationPopJwtAlg,
|
|
2589
|
+
zItWalletClientAttestationPopJwtHeader,
|
|
2590
|
+
zItWalletClientAttestationPopJwtPayload,
|
|
2591
|
+
zItWalletClientAttestationPopJwtTyp,
|
|
2460
2592
|
zJarAuthorizationRequest,
|
|
2461
2593
|
zJarRequestObjectHeader,
|
|
2462
2594
|
zJarRequestObjectPayload,
|
|
@@ -2473,7 +2605,8 @@ var import_oauth215 = require("@openid4vc/oauth2");
|
|
|
2473
2605
|
zMrtdValidationJwtHeader,
|
|
2474
2606
|
zMrtdValidationJwtPayload,
|
|
2475
2607
|
zPushedAuthorizationRequestSigned,
|
|
2476
|
-
|
|
2608
|
+
zPushedAuthorizationRequestUnsignedV1_0,
|
|
2609
|
+
zPushedAuthorizationRequestUnsignedV1_3,
|
|
2477
2610
|
zPushedAuthorizationResponse,
|
|
2478
2611
|
zRefreshTokenGrantIdentifier,
|
|
2479
2612
|
zSignedAuthorizationRequestJwtHeaderTyp,
|