@pagopa/io-react-native-wallet 2.0.0-next.4 → 2.0.0-next.5
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/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +3 -3
- package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/commonjs/credential/status/{02-status-attestation.js → 02-status-assertion.js} +28 -22
- package/lib/commonjs/credential/status/02-status-assertion.js.map +1 -0
- package/lib/commonjs/credential/status/03-verify-and-parse-status-assertion.js +85 -0
- package/lib/commonjs/credential/status/03-verify-and-parse-status-assertion.js.map +1 -0
- package/lib/commonjs/credential/status/README.md +22 -20
- package/lib/commonjs/credential/status/index.js +6 -6
- package/lib/commonjs/credential/status/index.js.map +1 -1
- package/lib/commonjs/credential/status/types.js +48 -15
- package/lib/commonjs/credential/status/types.js.map +1 -1
- package/lib/commonjs/utils/credentials.js +33 -0
- package/lib/commonjs/utils/credentials.js.map +1 -0
- package/lib/commonjs/utils/crypto.js +1 -7
- package/lib/commonjs/utils/crypto.js.map +1 -1
- package/lib/commonjs/utils/jwk.js +12 -0
- package/lib/commonjs/utils/jwk.js.map +1 -1
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js +4 -4
- package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
- package/lib/module/credential/status/{02-status-attestation.js → 02-status-assertion.js} +28 -22
- package/lib/module/credential/status/02-status-assertion.js.map +1 -0
- package/lib/module/credential/status/03-verify-and-parse-status-assertion.js +78 -0
- package/lib/module/credential/status/03-verify-and-parse-status-assertion.js.map +1 -0
- package/lib/module/credential/status/README.md +22 -20
- package/lib/module/credential/status/index.js +3 -3
- package/lib/module/credential/status/index.js.map +1 -1
- package/lib/module/credential/status/types.js +43 -12
- package/lib/module/credential/status/types.js.map +1 -1
- package/lib/module/utils/credentials.js +26 -0
- package/lib/module/utils/credentials.js.map +1 -0
- package/lib/module/utils/crypto.js +2 -8
- package/lib/module/utils/crypto.js.map +1 -1
- package/lib/module/utils/jwk.js +11 -1
- package/lib/module/utils/jwk.js.map +1 -1
- package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
- package/lib/typescript/credential/status/02-status-assertion.d.ts +23 -0
- package/lib/typescript/credential/status/02-status-assertion.d.ts.map +1 -0
- package/lib/typescript/credential/status/03-verify-and-parse-status-assertion.d.ts +21 -0
- package/lib/typescript/credential/status/03-verify-and-parse-status-assertion.d.ts.map +1 -0
- package/lib/typescript/credential/status/index.d.ts +4 -4
- package/lib/typescript/credential/status/index.d.ts.map +1 -1
- package/lib/typescript/credential/status/types.d.ts +495 -18
- package/lib/typescript/credential/status/types.d.ts.map +1 -1
- package/lib/typescript/utils/credentials.d.ts +11 -0
- package/lib/typescript/utils/credentials.d.ts.map +1 -0
- package/lib/typescript/utils/crypto.d.ts.map +1 -1
- package/lib/typescript/utils/jwk.d.ts +7 -0
- package/lib/typescript/utils/jwk.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/credential/issuance/07-verify-and-parse-credential.ts +4 -6
- package/src/credential/status/{02-status-attestation.ts → 02-status-assertion.ts} +37 -28
- package/src/credential/status/03-verify-and-parse-status-assertion.ts +109 -0
- package/src/credential/status/README.md +22 -20
- package/src/credential/status/index.ts +7 -14
- package/src/credential/status/types.ts +62 -15
- package/src/utils/credentials.ts +29 -0
- package/src/utils/crypto.ts +12 -20
- package/src/utils/jwk.ts +15 -1
- package/lib/commonjs/credential/status/02-status-attestation.js.map +0 -1
- package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js +0 -55
- package/lib/commonjs/credential/status/03-verify-and-parse-status-attestation.js.map +0 -1
- package/lib/module/credential/status/02-status-attestation.js.map +0 -1
- package/lib/module/credential/status/03-verify-and-parse-status-attestation.js +0 -49
- package/lib/module/credential/status/03-verify-and-parse-status-attestation.js.map +0 -1
- package/lib/typescript/credential/status/02-status-attestation.d.ts +0 -19
- package/lib/typescript/credential/status/02-status-attestation.d.ts.map +0 -1
- package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts +0 -24
- package/lib/typescript/credential/status/03-verify-and-parse-status-attestation.d.ts.map +0 -1
- package/src/credential/status/03-verify-and-parse-status-attestation.ts +0 -70
@@ -5,9 +5,9 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.verifyAndParseCredential = void 0;
|
7
7
|
var _errors = require("../../utils/errors");
|
8
|
-
var _types = require("../../sd-jwt/types");
|
9
8
|
var _sdJwt = require("../../sd-jwt");
|
10
9
|
var _converters = require("../../sd-jwt/converters");
|
10
|
+
var _jwk = require("../../utils/jwk");
|
11
11
|
var _logging = require("../../utils/logging");
|
12
12
|
// The credential as a collection of attributes in plain value
|
13
13
|
|
@@ -121,11 +121,11 @@ const parseCredentialSdJwt = function (credentialConfig, _ref) {
|
|
121
121
|
async function verifyCredentialSdJwt(rawCredential, issuerKeys, holderBindingContext) {
|
122
122
|
const [decodedCredential, holderBindingKey] =
|
123
123
|
// parallel for optimization
|
124
|
-
await Promise.all([(0, _sdJwt.verify)(rawCredential, issuerKeys,
|
124
|
+
await Promise.all([(0, _sdJwt.verify)(rawCredential, issuerKeys, _sdJwt.SdJwt4VC), holderBindingContext.getPublicKey()]);
|
125
125
|
const {
|
126
126
|
cnf
|
127
127
|
} = decodedCredential.sdJwt.payload;
|
128
|
-
if (!
|
128
|
+
if (!(await (0, _jwk.isSameThumbprint)(cnf.jwk, holderBindingKey))) {
|
129
129
|
const message = `Failed to verify holder binding, expected kid: ${holderBindingKey.kid}, got: ${decodedCredential.sdJwt.payload.cnf.jwk.kid}`;
|
130
130
|
_logging.Logger.log(_logging.LogLevel.ERROR, message);
|
131
131
|
throw new _errors.IoWalletError(message);
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_errors","require","
|
1
|
+
{"version":3,"names":["_errors","require","_sdJwt","_converters","_jwk","_logging","parseCredentialSdJwt","credentialConfig","_ref","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","includeUndefinedAttributes","format","header","typ","message","Logger","log","LogLevel","ERROR","IoWalletError","claims","attrDefinitions","attrsNotInDisclosures","filter","definition","some","_ref2","name","path","missing","map","_","join","received","definedValues","Object","fromEntries","_ref3","_disclosures$find","value","find","_ref4","attrKey","display","reduce","names","_ref5","locale","undefinedValues","keys","includes","_ref6","key","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","verifySdJwt","SdJwt4VC","getPublicKey","cnf","payload","isSameThumbprint","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","credentialConfigurationId","_ref7","credentialCryptoContext","decoded","openid_credential_issuer","jwks","DEBUG","JSON","stringify","credential_configurations_supported","parsedCredential","maybeIssuedAt","getValueFromDisclosures","expiration","Date","exp","issuedAt","verifyAndParseCredential","context","_issuerConf$openid_cr","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/07-verify-and-parse-credential.ts"],"mappings":";;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,IAAA,GAAAH,OAAA;AAEA,IAAAI,QAAA,GAAAJ,OAAA;AA2BA;;AAkBA;;AAKA,MAAMK,oBAAoB,GAAG,SAAAA,CAE3BC,gBAAgC,EAAAC,IAAA,EAIX;EAAA,IAHrB;IAAEC,KAAK;IAAEC;EAAoC,CAAC,GAAAF,IAAA;EAAA,IAC9CG,uBAAgC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAAA,IACxCG,0BAAmC,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAE3C,IAAIL,gBAAgB,CAACS,MAAM,KAAKP,KAAK,CAACQ,MAAM,CAACC,GAAG,EAAE;IAChD,MAAMC,OAAO,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BAAA;EACH,MAAMhF,MAAM,IAAAgF,qBAAA,GACVrB,UAAU,CAACM,wBAAwB,CAACK,mCAAmC,CACrET,yBAAyB,CAC1B,cAAAmB,qBAAA,uBAFDA,qBAAA,CAEGhF,MAAM;EAEX,IAAIA,MAAM,KAAK,WAAW,EAAE;IAC1BI,eAAM,CAACC,GAAG,CAACC,iBAAQ,CAAC6D,KAAK,EAAE,wCAAwC,CAAC;IACpE,OAAOT,6BAA6B,CAClCC,UAAU,EACVC,UAAU,EACVC,yBAAyB,EACzBkB,OACF,CAAC;EACH;EAEA,MAAM5E,OAAO,GAAI,kCAAiCH,MAAO,EAAC;EAC1DI,eAAM,CAACC,GAAG,CAACC,iBAAQ,CAACC,KAAK,EAAEJ,OAAO,CAAC;EACnC,MAAM,IAAIK,qBAAa,CAACL,OAAO,CAAC;AAClC,CAAC;AAAC8E,OAAA,CAAAH,wBAAA,GAAAA,wBAAA"}
|
@@ -3,40 +3,48 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.statusAssertion = void 0;
|
7
7
|
var _misc = require("../../utils/misc");
|
8
8
|
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
9
9
|
var _uuid = require("uuid");
|
10
10
|
var _types = require("./types");
|
11
11
|
var _errors = require("../../utils/errors");
|
12
12
|
var _logging = require("../../utils/logging");
|
13
|
+
var _credentials = require("../../utils/credentials");
|
13
14
|
/**
|
14
|
-
*
|
15
|
-
* Verify the status of the credential attestation.
|
15
|
+
* Get the status assertion of a digital credential.
|
16
16
|
* @param issuerConf - The issuer's configuration
|
17
17
|
* @param credential - The credential to be verified
|
18
|
-
* @param
|
18
|
+
* @param format - The format of the credential, e.g. "sd-jwt"
|
19
|
+
* @param context.credentialCryptoContext - The credential's crypto context
|
20
|
+
* @param context.wiaCryptoContext - The Wallet Attestation's crypto context
|
19
21
|
* @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
|
20
22
|
* @throws {IssuerResponseError} with a specific code for more context
|
21
|
-
* @returns The credential status
|
23
|
+
* @returns The credential status assertion
|
22
24
|
*/
|
23
|
-
const
|
24
|
-
|
25
|
-
|
25
|
+
const statusAssertion = async (issuerConf, credential, format, ctx) => {
|
26
|
+
const {
|
27
|
+
credentialCryptoContext,
|
28
|
+
wiaCryptoContext,
|
29
|
+
appFetch = fetch
|
30
|
+
} = ctx;
|
31
|
+
const jwk = await (0, _credentials.extractJwkFromCredential)(credential, format);
|
32
|
+
const issuerJwk = await wiaCryptoContext.getPublicKey();
|
26
33
|
const credentialHash = await (0, _misc.getCredentialHashWithouDiscloures)(credential);
|
27
34
|
const statusAttUrl = issuerConf.openid_credential_issuer.status_attestation_endpoint;
|
28
35
|
const credentialPop = await new _ioReactNativeJwt.SignJWT(credentialCryptoContext).setPayload({
|
36
|
+
iss: issuerJwk.kid,
|
29
37
|
aud: statusAttUrl,
|
30
38
|
jti: (0, _uuid.v4)().toString(),
|
31
39
|
credential_hash: credentialHash,
|
32
|
-
credential_hash_alg: "
|
40
|
+
credential_hash_alg: "sha-256"
|
33
41
|
}).setProtectedHeader({
|
34
42
|
alg: "ES256",
|
35
|
-
typ: "status-
|
43
|
+
typ: "status-assertion-request+jwt",
|
36
44
|
kid: jwk.kid
|
37
45
|
}).setIssuedAt().setExpirationTime("5m").sign();
|
38
46
|
const body = {
|
39
|
-
|
47
|
+
status_assertion_requests: [credentialPop]
|
40
48
|
};
|
41
49
|
_logging.Logger.log(_logging.LogLevel.DEBUG, `Credential pop: ${credentialPop}`);
|
42
50
|
const result = await appFetch(statusAttUrl, {
|
@@ -45,29 +53,27 @@ const statusAttestation = async function (issuerConf, credential, credentialCryp
|
|
45
53
|
"Content-Type": "application/json"
|
46
54
|
},
|
47
55
|
body: JSON.stringify(body)
|
48
|
-
}).then((0, _misc.hasStatusOrThrow)(
|
56
|
+
}).then((0, _misc.hasStatusOrThrow)(200)).then(raw => raw.json()).then(json => _types.StatusAssertionResponse.parse(json)).catch(handleStatusAssertionError);
|
57
|
+
const [statusAttestationJwt] = result.status_assertion_responses;
|
49
58
|
return {
|
50
|
-
|
59
|
+
statusAssertion: statusAttestationJwt
|
51
60
|
};
|
52
61
|
};
|
53
62
|
|
54
63
|
/**
|
55
|
-
* Handle the status
|
64
|
+
* Handle the status assertion error by mapping it to a custom exception.
|
56
65
|
* If the error is not an instance of {@link UnexpectedStatusCodeError}, it is thrown as is.
|
57
66
|
* @param e - The error to be handled
|
58
67
|
* @throws {IssuerResponseError} with a specific code for more context
|
59
68
|
*/
|
60
|
-
exports.
|
61
|
-
const
|
69
|
+
exports.statusAssertion = statusAssertion;
|
70
|
+
const handleStatusAssertionError = e => {
|
62
71
|
if (!(e instanceof _errors.UnexpectedStatusCodeError)) {
|
63
72
|
throw e;
|
64
73
|
}
|
65
|
-
throw new _errors.ResponseErrorBuilder(_errors.IssuerResponseError).handle(
|
66
|
-
code: _errors.IssuerResponseErrorCodes.CredentialInvalidStatus,
|
67
|
-
message: "Invalid status found for the given credential"
|
68
|
-
}).handle("*", {
|
74
|
+
throw new _errors.ResponseErrorBuilder(_errors.IssuerResponseError).handle("*", {
|
69
75
|
code: _errors.IssuerResponseErrorCodes.StatusAttestationRequestFailed,
|
70
|
-
message: `Unable to obtain the status
|
76
|
+
message: `Unable to obtain the status assertion for the given credential`
|
71
77
|
}).buildFrom(e);
|
72
78
|
};
|
73
|
-
//# sourceMappingURL=02-status-
|
79
|
+
//# sourceMappingURL=02-status-assertion.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_misc","require","_ioReactNativeJwt","_uuid","_types","_errors","_logging","_credentials","statusAssertion","issuerConf","credential","format","ctx","credentialCryptoContext","wiaCryptoContext","appFetch","fetch","jwk","extractJwkFromCredential","issuerJwk","getPublicKey","credentialHash","getCredentialHashWithouDiscloures","statusAttUrl","openid_credential_issuer","status_attestation_endpoint","credentialPop","SignJWT","setPayload","iss","kid","aud","jti","uuidv4","toString","credential_hash","credential_hash_alg","setProtectedHeader","alg","typ","setIssuedAt","setExpirationTime","sign","body","status_assertion_requests","Logger","log","LogLevel","DEBUG","result","method","headers","JSON","stringify","then","hasStatusOrThrow","raw","json","StatusAssertionResponse","parse","catch","handleStatusAssertionError","statusAttestationJwt","status_assertion_responses","exports","e","UnexpectedStatusCodeError","ResponseErrorBuilder","IssuerResponseError","handle","code","IssuerResponseErrorCodes","StatusAttestationRequestFailed","message","buildFrom"],"sourceRoot":"../../../../src","sources":["credential/status/02-status-assertion.ts"],"mappings":";;;;;;AAAA,IAAAA,KAAA,GAAAC,OAAA;AAMA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAMA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAeA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMO,eAAgC,GAAG,MAAAA,CAC9CC,UAAU,EACVC,UAAU,EACVC,MAAM,EACNC,GAAG,KACA;EACH,MAAM;IAAEC,uBAAuB;IAAEC,gBAAgB;IAAEC,QAAQ,GAAGC;EAAM,CAAC,GAAGJ,GAAG;EAE3E,MAAMK,GAAG,GAAG,MAAM,IAAAC,qCAAwB,EAACR,UAAU,EAAEC,MAAM,CAAC;EAC9D,MAAMQ,SAAS,GAAG,MAAML,gBAAgB,CAACM,YAAY,CAAC,CAAC;EACvD,MAAMC,cAAc,GAAG,MAAM,IAAAC,uCAAiC,EAACZ,UAAU,CAAC;EAC1E,MAAMa,YAAY,GAChBd,UAAU,CAACe,wBAAwB,CAACC,2BAA2B;EAEjE,MAAMC,aAAa,GAAG,MAAM,IAAIC,yBAAO,CAACd,uBAAuB,CAAC,CAC7De,UAAU,CAAC;IACVC,GAAG,EAAEV,SAAS,CAACW,GAAG;IAClBC,GAAG,EAAER,YAAY;IACjBS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MAAMD,CAAC;EACT;EAEA,MAAM,IAAIE,4BAAoB,CAACC,2BAAmB,CAAC,CAChDC,MAAM,CAAC,GAAG,EAAE;IACXC,IAAI,EAAEC,gCAAwB,CAACC,8BAA8B;IAC7DC,OAAO,EAAG;EACZ,CAAC,CAAC,CACDC,SAAS,CAACT,CAAC,CAAC;AACjB,CAAC"}
|
@@ -0,0 +1,85 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.verifyAndParseStatusAssertion = void 0;
|
7
|
+
var _errors = require("../../utils/errors");
|
8
|
+
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
9
|
+
var _types = require("./types");
|
10
|
+
var _logging = require("../../utils/logging");
|
11
|
+
var _credentials = require("../../utils/credentials");
|
12
|
+
var _jwk = require("../../utils/jwk");
|
13
|
+
/**
|
14
|
+
* Given a status assertion, verifies that:
|
15
|
+
* - It's in the supported format;
|
16
|
+
* - The assertion is correctly signed;
|
17
|
+
* - It's bound to the given key.
|
18
|
+
* @param issuerConf The Issuer configuration returned by {@link evaluateIssuerTrust}
|
19
|
+
* @param statusAssertion The encoded status assertion returned by {@link statusAssertion}
|
20
|
+
* @param context.credentialCryptoContext The crypto context used to obtain the credential in {@link obtainCredential}
|
21
|
+
* @returns A parsed status assertion
|
22
|
+
* @throws {IoWalletError} If the credential signature is not verified with the Issuer key set
|
23
|
+
* @throws {IssuerResponseError} If the status assertion contains an error or the credential status is invalid
|
24
|
+
*/
|
25
|
+
const verifyAndParseStatusAssertion = async (issuerConf, rawStatusAssertion, credential, format) => {
|
26
|
+
const {
|
27
|
+
statusAssertion
|
28
|
+
} = rawStatusAssertion;
|
29
|
+
await (0, _ioReactNativeJwt.verify)(statusAssertion, issuerConf.openid_credential_issuer.jwks.keys);
|
30
|
+
const decodedJwt = (0, _ioReactNativeJwt.decode)(statusAssertion);
|
31
|
+
const parsedStatusAssertion = _types.ParsedStatusAssertionResponse.parse({
|
32
|
+
header: decodedJwt.protectedHeader,
|
33
|
+
payload: decodedJwt.payload
|
34
|
+
});
|
35
|
+
_logging.Logger.log(_logging.LogLevel.DEBUG, `Parsed status assertion: ${JSON.stringify(parsedStatusAssertion)}`);
|
36
|
+
|
37
|
+
// Errors are transmitted in the JWT and use a 200 HTTP status code
|
38
|
+
if (isStatusAssertionError(parsedStatusAssertion)) {
|
39
|
+
throw new _errors.IssuerResponseError({
|
40
|
+
code: _errors.IssuerResponseErrorCodes.CredentialInvalidStatus,
|
41
|
+
message: "The status assertion contains an error",
|
42
|
+
statusCode: 200,
|
43
|
+
reason: buildErrorReason(parsedStatusAssertion)
|
44
|
+
});
|
45
|
+
}
|
46
|
+
const {
|
47
|
+
cnf,
|
48
|
+
credential_status_type
|
49
|
+
} = parsedStatusAssertion.payload;
|
50
|
+
const holderBindingKey = await (0, _credentials.extractJwkFromCredential)(credential, format);
|
51
|
+
if (!(await (0, _jwk.isSameThumbprint)(cnf.jwk, holderBindingKey))) {
|
52
|
+
const errorMessage = `Failed to verify holder binding for status assertion: the thumbprints of keys ${cnf.jwk.kid} and ${holderBindingKey.kid} do not match`;
|
53
|
+
_logging.Logger.log(_logging.LogLevel.ERROR, errorMessage);
|
54
|
+
throw new _errors.IoWalletError(errorMessage);
|
55
|
+
}
|
56
|
+
if (credential_status_type !== _types.StatusType.VALID) {
|
57
|
+
throw new _errors.IssuerResponseError({
|
58
|
+
code: _errors.IssuerResponseErrorCodes.CredentialInvalidStatus,
|
59
|
+
message: "Invalid status found for the given credential",
|
60
|
+
statusCode: 200,
|
61
|
+
reason: buildErrorReason(parsedStatusAssertion)
|
62
|
+
});
|
63
|
+
}
|
64
|
+
return {
|
65
|
+
parsedStatusAssertion
|
66
|
+
};
|
67
|
+
};
|
68
|
+
exports.verifyAndParseStatusAssertion = verifyAndParseStatusAssertion;
|
69
|
+
const isStatusAssertionError = assertion => assertion.header.typ === "status-assertion-error+jwt";
|
70
|
+
|
71
|
+
/**
|
72
|
+
* Build an object containing the details on the error to use as the IssuerResponseError's reason
|
73
|
+
* @param assertion The status assertion response, both success or failure
|
74
|
+
* @returns The error's reason object
|
75
|
+
*/
|
76
|
+
const buildErrorReason = _ref => {
|
77
|
+
let {
|
78
|
+
payload
|
79
|
+
} = _ref;
|
80
|
+
return "error" in payload ? payload : {
|
81
|
+
error: payload.credential_status_detail.state,
|
82
|
+
error_description: payload.credential_status_detail.description
|
83
|
+
};
|
84
|
+
};
|
85
|
+
//# sourceMappingURL=03-verify-and-parse-status-assertion.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_errors","require","_ioReactNativeJwt","_types","_logging","_credentials","_jwk","verifyAndParseStatusAssertion","issuerConf","rawStatusAssertion","credential","format","statusAssertion","verify","openid_credential_issuer","jwks","keys","decodedJwt","decodeJwt","parsedStatusAssertion","ParsedStatusAssertionResponse","parse","header","protectedHeader","payload","Logger","log","LogLevel","DEBUG","JSON","stringify","isStatusAssertionError","IssuerResponseError","code","IssuerResponseErrorCodes","CredentialInvalidStatus","message","statusCode","reason","buildErrorReason","cnf","credential_status_type","holderBindingKey","extractJwkFromCredential","isSameThumbprint","jwk","errorMessage","kid","ERROR","IoWalletError","StatusType","VALID","exports","assertion","typ","_ref","error","credential_status_detail","state","error_description","description"],"sourceRoot":"../../../../src","sources":["credential/status/03-verify-and-parse-status-assertion.ts"],"mappings":";;;;;;AACA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,iBAAA,GAAAD,OAAA;AAEA,IAAAE,MAAA,GAAAF,OAAA;AAOA,IAAAG,QAAA,GAAAH,OAAA;AAEA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,IAAA,GAAAL,OAAA;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,6BAA4D,GACvE,MAAAA,CAAOC,UAAU,EAAEC,kBAAkB,EAAEC,UAAU,EAAEC,MAAM,KAAK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,iBAAU,CAACC,KAAK,EAAE;IAC/C,MAAM,IAAInB,2BAAmB,CAAC;MAC5BC,IAAI,EAAEC,gCAAwB,CAACC,uBAAuB;MACtDC,OAAO,EAAE,+CAA+C;MACxDC,UAAU,EAAE,GAAG;MACfC,MAAM,EAAEC,gBAAgB,CAACpB,qBAAqB;IAChD,CAAC,CAAC;EACJ;EAEA,OAAO;IAAEA;EAAsB,CAAC;AAClC,CAAC;AAACiC,OAAA,CAAA7C,6BAAA,GAAAA,6BAAA;AAEJ,MAAMwB,sBAAsB,GAC1BsB,SAAwC,IAExCA,SAAS,CAAC/B,MAAM,CAACgC,GAAG,KAAK,4BAA4B;;AAEvD;AACA;AACA;AACA;AACA;AACA,MAAMf,gBAAgB,GAAGgB,IAAA;EAAA,IAAC;IACxB/B;EAC6B,CAAC,GAAA+B,IAAA;EAAA,OAC9B,OAAO,IAAI/B,OAAO,GACdA,OAAO,GACP;IACEgC,KAAK,EAAEhC,OAAO,CAACiC,wBAAwB,CAAEC,KAAK;IAC9CC,iBAAiB,EAAEnC,OAAO,CAACiC,wBAAwB,CAAEG;EACvD,CAAC;AAAA"}
|
@@ -1,16 +1,16 @@
|
|
1
|
-
# Credential Status
|
1
|
+
# Credential Status Assertion
|
2
2
|
|
3
|
-
This flow is used to obtain a credential status
|
4
|
-
The credential status
|
5
|
-
The status
|
3
|
+
This flow is used to obtain a credential status assertion from its credential issuer. Each step in the flow is imported from the related file which is named with a sequential number.
|
4
|
+
The credential status assertion is a JWT which contains the credential status which indicates if the credential is valid or not (see [OAuth Status Assertions](https://italia.github.io/eid-wallet-it-docs/versione-corrente/en/credential-revocation.html#oauth-status-assertions)).
|
5
|
+
The status assertion is supposed to be stored securely along with the credential. It has a limited lifetime and should be refreshed periodically according to the `exp` field in the JWT payload.
|
6
6
|
|
7
7
|
## Sequence Diagram
|
8
8
|
|
9
9
|
```mermaid
|
10
10
|
graph TD;
|
11
11
|
0[startFlow]
|
12
|
-
1[
|
13
|
-
2[
|
12
|
+
1[statusAssertion]
|
13
|
+
2[verifyAndParseStatusAssertion]
|
14
14
|
|
15
15
|
0 --> 1
|
16
16
|
1 --> 2
|
@@ -21,14 +21,14 @@ graph TD;
|
|
21
21
|
|
22
22
|
The following errors are mapped to a `IssuerResponseError` with specific codes.
|
23
23
|
|
24
|
-
|
|
25
|
-
|
26
|
-
|`
|
24
|
+
|Error Code|Description|
|
25
|
+
|----------|-----------|
|
26
|
+
|`ERR_CREDENTIAL_INVALID_STATUS`|This error is thrown when the status assertion for a given credential is invalid. It might contain more details in the `reason` property.|
|
27
27
|
|
28
28
|
## Example
|
29
29
|
|
30
30
|
<details>
|
31
|
-
<summary>Credential status
|
31
|
+
<summary>Credential status assertion flow</summary>
|
32
32
|
|
33
33
|
```ts
|
34
34
|
// Start the issuance flow
|
@@ -42,24 +42,26 @@ const { issuerUrl } = startFlow();
|
|
42
42
|
// Evaluate issuer trust
|
43
43
|
const { issuerConf } = await Credential.Status.evaluateIssuerTrust(issuerUrl);
|
44
44
|
|
45
|
-
// Get the credential
|
46
|
-
const res = await Credential.Status.
|
45
|
+
// Get the credential assertion
|
46
|
+
const res = await Credential.Status.statusAssertion(
|
47
47
|
issuerConf,
|
48
48
|
credential,
|
49
|
-
|
49
|
+
format,
|
50
|
+
{ credentialCryptoContext, wiaCryptoContext }
|
50
51
|
);
|
51
52
|
|
52
|
-
// Verify and parse the status
|
53
|
-
const {
|
54
|
-
await Credential.Status.
|
53
|
+
// Verify and parse the status assertion
|
54
|
+
const { parsedStatusAssertion } =
|
55
|
+
await Credential.Status.verifyAndParseStatusAssertion(
|
55
56
|
issuerConf,
|
56
|
-
res.
|
57
|
-
|
57
|
+
res.statusAssertion,
|
58
|
+
credential,
|
59
|
+
format
|
58
60
|
);
|
59
61
|
|
60
62
|
return {
|
61
|
-
|
62
|
-
|
63
|
+
statusAssertion: res.statusAssertion,
|
64
|
+
parsedStatusAssertion,
|
63
65
|
};
|
64
66
|
```
|
65
67
|
|
@@ -9,19 +9,19 @@ Object.defineProperty(exports, "evaluateIssuerTrust", {
|
|
9
9
|
return _issuance.evaluateIssuerTrust;
|
10
10
|
}
|
11
11
|
});
|
12
|
-
Object.defineProperty(exports, "
|
12
|
+
Object.defineProperty(exports, "statusAssertion", {
|
13
13
|
enumerable: true,
|
14
14
|
get: function () {
|
15
|
-
return
|
15
|
+
return _statusAssertion.statusAssertion;
|
16
16
|
}
|
17
17
|
});
|
18
|
-
Object.defineProperty(exports, "
|
18
|
+
Object.defineProperty(exports, "verifyAndParseStatusAssertion", {
|
19
19
|
enumerable: true,
|
20
20
|
get: function () {
|
21
|
-
return
|
21
|
+
return _verifyAndParseStatusAssertion.verifyAndParseStatusAssertion;
|
22
22
|
}
|
23
23
|
});
|
24
|
-
var
|
24
|
+
var _statusAssertion = require("./02-status-assertion");
|
25
25
|
var _issuance = require("../issuance");
|
26
|
-
var
|
26
|
+
var _verifyAndParseStatusAssertion = require("./03-verify-and-parse-status-assertion");
|
27
27
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["
|
1
|
+
{"version":3,"names":["_statusAssertion","require","_issuance","_verifyAndParseStatusAssertion"],"sourceRoot":"../../../../src","sources":["credential/status/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,gBAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,8BAAA,GAAAF,OAAA"}
|
@@ -3,38 +3,40 @@
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
4
4
|
value: true
|
5
5
|
});
|
6
|
-
exports.
|
6
|
+
exports.StatusType = exports.StatusAssertionResponse = exports.ParsedStatusAssertionResponse = exports.ParsedStatusAssertionError = exports.ParsedStatusAssertion = void 0;
|
7
7
|
var _types = require("../../sd-jwt/types");
|
8
8
|
var _jwk = require("../../utils/jwk");
|
9
9
|
var z = _interopRequireWildcard(require("zod"));
|
10
10
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
11
11
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
12
12
|
/**
|
13
|
-
* Shape from parsing a status
|
13
|
+
* Shape from parsing a status assertion response in case of 201.
|
14
14
|
*/
|
15
|
-
const
|
16
|
-
|
15
|
+
const StatusAssertionResponse = z.object({
|
16
|
+
status_assertion_responses: z.array(z.string())
|
17
17
|
});
|
18
18
|
|
19
19
|
/**
|
20
|
-
* Type from parsing a status
|
21
|
-
* Inferred from {@link
|
20
|
+
* Type from parsing a status assertion response in case of 201.
|
21
|
+
* Inferred from {@link StatusAssertionResponse}.
|
22
22
|
*/
|
23
|
-
|
24
|
-
/**
|
25
|
-
* Type for a parsed status attestation.
|
26
|
-
*/
|
27
|
-
exports.StatusAttestationResponse = StatusAttestationResponse;
|
23
|
+
exports.StatusAssertionResponse = StatusAssertionResponse;
|
28
24
|
/**
|
29
|
-
* Shape for parsing a status
|
25
|
+
* Shape for parsing a successful status assertion in a JWT.
|
30
26
|
*/
|
31
|
-
const
|
27
|
+
const ParsedStatusAssertion = z.object({
|
32
28
|
header: z.object({
|
33
|
-
typ: z.literal("status-
|
29
|
+
typ: z.literal("status-assertion+jwt"),
|
34
30
|
alg: z.string(),
|
35
31
|
kid: z.string().optional()
|
36
32
|
}),
|
37
33
|
payload: z.object({
|
34
|
+
iss: z.string(),
|
35
|
+
credential_status_type: z.string(),
|
36
|
+
credential_status_detail: z.object({
|
37
|
+
state: z.string(),
|
38
|
+
description: z.string()
|
39
|
+
}).optional(),
|
38
40
|
credential_hash_alg: z.string(),
|
39
41
|
credential_hash: z.string(),
|
40
42
|
cnf: z.object({
|
@@ -44,5 +46,36 @@ const ParsedStatusAttestation = z.object({
|
|
44
46
|
iat: _types.UnixTime
|
45
47
|
})
|
46
48
|
});
|
47
|
-
exports.
|
49
|
+
exports.ParsedStatusAssertion = ParsedStatusAssertion;
|
50
|
+
/**
|
51
|
+
* The JWT that contains the errors occurred for the status assertion request.
|
52
|
+
* @see https://italia.github.io/eid-wallet-it-docs/versione-corrente/en/credential-revocation.html#http-status-assertion-response
|
53
|
+
*/
|
54
|
+
const ParsedStatusAssertionError = z.object({
|
55
|
+
header: z.object({
|
56
|
+
typ: z.literal("status-assertion-error+jwt"),
|
57
|
+
alg: z.string(),
|
58
|
+
kid: z.string().optional()
|
59
|
+
}),
|
60
|
+
payload: z.object({
|
61
|
+
credential_hash_alg: z.string(),
|
62
|
+
credential_hash: z.string(),
|
63
|
+
error: z.string(),
|
64
|
+
error_description: z.string()
|
65
|
+
})
|
66
|
+
});
|
67
|
+
|
68
|
+
/**
|
69
|
+
* The status assertion response that might include either a successful assertion or an error
|
70
|
+
*/
|
71
|
+
exports.ParsedStatusAssertionError = ParsedStatusAssertionError;
|
72
|
+
const ParsedStatusAssertionResponse = z.union([ParsedStatusAssertion, ParsedStatusAssertionError]);
|
73
|
+
exports.ParsedStatusAssertionResponse = ParsedStatusAssertionResponse;
|
74
|
+
let StatusType = /*#__PURE__*/function (StatusType) {
|
75
|
+
StatusType["VALID"] = "0x00";
|
76
|
+
StatusType["INVALID"] = "0x01";
|
77
|
+
StatusType["SUSPENDED"] = "0x02";
|
78
|
+
return StatusType;
|
79
|
+
}({});
|
80
|
+
exports.StatusType = StatusType;
|
48
81
|
//# sourceMappingURL=types.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","
|
1
|
+
{"version":3,"names":["_types","require","_jwk","z","_interopRequireWildcard","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","StatusAssertionResponse","object","status_assertion_responses","array","string","exports","ParsedStatusAssertion","header","typ","literal","alg","kid","optional","payload","iss","credential_status_type","credential_status_detail","state","description","credential_hash_alg","credential_hash","cnf","jwk","JWK","exp","UnixTime","iat","ParsedStatusAssertionError","error","error_description","ParsedStatusAssertionResponse","union","StatusType"],"sourceRoot":"../../../../src","sources":["credential/status/types.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AACA,IAAAE,CAAA,GAAAC,uBAAA,CAAAH,OAAA;AAAyB,SAAAI,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QAAAE,gBAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,WAAA,WAAAA,WAAA,GAAAG,gBAAA,GAAAD,iBAAA,KAAAF,WAAA;AAAA,SAAAF,wBAAAM,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAA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CAAC4B,MAAM,CAAC,CAAC;IACjByB,iBAAiB,EAAErD,CAAC,CAAC4B,MAAM,CAAC;EAC9B,CAAC;AACH,CAAC,CAAC;;AAEF;AACA;AACA;AAFAC,OAAA,CAAAsB,0BAAA,GAAAA,0BAAA;AAMO,MAAMG,6BAA6B,GAAGtD,CAAC,CAACuD,KAAK,CAAC,CACnDzB,qBAAqB,EACrBqB,0BAA0B,CAC3B,CAAC;AAACtB,OAAA,CAAAyB,6BAAA,GAAAA,6BAAA;AAAA,IAESE,UAAU,0BAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAVA,UAAU;EAAA,OAAVA,UAAU;AAAA;AAAA3B,OAAA,CAAA2B,UAAA,GAAAA,UAAA"}
|
@@ -0,0 +1,33 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.extractJwkFromCredential = void 0;
|
7
|
+
var _sdJwt = require("../sd-jwt");
|
8
|
+
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
9
|
+
var _errors = require("./errors");
|
10
|
+
const SD_JWT = ["vc+sd-jwt", "dc+sd-jwt"];
|
11
|
+
|
12
|
+
/**
|
13
|
+
* Extracts a JWK from a credential.
|
14
|
+
* @param credential - The credential string, which can be in SD-JWT or CBOR format.
|
15
|
+
* @param format - The format of the credential
|
16
|
+
* @return A Promise that resolves to a JWK object if the credential is in SD-JWT format and contains a JWK, or undefined otherwise.
|
17
|
+
*/
|
18
|
+
const extractJwkFromCredential = async (credential, format) => {
|
19
|
+
if (SD_JWT.includes(format)) {
|
20
|
+
// 1. SD-JWT case
|
21
|
+
const decoded = (0, _sdJwt.decode)(credential);
|
22
|
+
const jwk = decoded.sdJwt.payload.cnf.jwk;
|
23
|
+
if (jwk) {
|
24
|
+
return {
|
25
|
+
...jwk,
|
26
|
+
kid: await (0, _ioReactNativeJwt.thumbprint)(jwk)
|
27
|
+
};
|
28
|
+
}
|
29
|
+
}
|
30
|
+
throw new _errors.IoWalletError(`Credential format ${format} not supported`);
|
31
|
+
};
|
32
|
+
exports.extractJwkFromCredential = extractJwkFromCredential;
|
33
|
+
//# sourceMappingURL=credentials.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"names":["_sdJwt","require","_ioReactNativeJwt","_errors","SD_JWT","extractJwkFromCredential","credential","format","includes","decoded","decode","jwk","sdJwt","payload","cnf","kid","thumbprint","IoWalletError","exports"],"sourceRoot":"../../../src","sources":["utils/credentials.ts"],"mappings":";;;;;;AAAA,IAAAA,MAAA,GAAAC,OAAA;AACA,IAAAC,iBAAA,GAAAD,OAAA;AAIA,IAAAE,OAAA,GAAAF,OAAA;AAEA,MAAMG,MAAM,GAAG,CAAC,WAAW,EAAE,WAAW,CAAC;;AAEzC;AACA;AACA;AACA;AACA;AACA;AACO,MAAMC,wBAAwB,GAAG,MAAAA,CACtCC,UAA+C,EAC/CC,MAAuC,KACtB;EACjB,IAAIH,MAAM,CAACI,QAAQ,CAACD,MAAM,CAAC,EAAE;IAC3B;IACA,MAAME,OAAO,GAAG,IAAAC,aAAM,EAACJ,UAAU,CAAC;IAClC,MAAMK,GAAG,GAAGF,OAAO,CAACG,KAAK,CAACC,OAAO,CAACC,GAAG,CAACH,GAAG;IACzC,IAAIA,GAAG,EAAE;MACP,OAAO;QAAE,GAAGA,GAAG;QAAEI,GAAG,EAAE,MAAM,IAAAC,4BAAU,EAACL,GAAG;MAAE,CAAC;IAC/C;EACF;EACA,MAAM,IAAIM,qBAAa,CAAE,qBAAoBV,MAAO,gBAAe,CAAC;AACtE,CAAC;AAACW,OAAA,CAAAb,wBAAA,GAAAA,wBAAA"}
|
@@ -7,7 +7,6 @@ exports.withEphemeralKey = exports.createCryptoContextFor = void 0;
|
|
7
7
|
var _ioReactNativeCrypto = require("@pagopa/io-react-native-crypto");
|
8
8
|
var _uuid = require("uuid");
|
9
9
|
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
10
|
-
var _jwk = require("./jwk");
|
11
10
|
/**
|
12
11
|
* Create a CryptoContext bound to a key pair.
|
13
12
|
* Key pair is supposed to exist already in the device's keychain.
|
@@ -17,13 +16,8 @@ var _jwk = require("./jwk");
|
|
17
16
|
*/
|
18
17
|
const createCryptoContextFor = keytag => {
|
19
18
|
return {
|
20
|
-
/**
|
21
|
-
* Retrieve the public key of the pair.
|
22
|
-
* If the key pair doesn't exist yet, an error is raised
|
23
|
-
* @returns The public key.
|
24
|
-
*/
|
25
19
|
async getPublicKey() {
|
26
|
-
return (0, _ioReactNativeCrypto.
|
20
|
+
return (0, _ioReactNativeCrypto.getPublicKeyFixed)(keytag).then(async jwk => ({
|
27
21
|
...jwk,
|
28
22
|
// Keys in the TEE are not stored with their KID, which is supposed to be assigned when they are included in JWK sets.
|
29
23
|
// (that is, KID is not a propoerty of the key itself, but it's property used to identify a key in a set).
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeCrypto","require","_uuid","_ioReactNativeJwt","
|
1
|
+
{"version":3,"names":["_ioReactNativeCrypto","require","_uuid","_ioReactNativeJwt","createCryptoContextFor","keytag","getPublicKey","getPublicKeyFixed","then","jwk","kid","thumbprint","getSignature","value","sign","exports","withEphemeralKey","fn","uuidv4","generate","ephemeralContext","finally","deleteKey"],"sourceRoot":"../../../src","sources":["utils/crypto.ts"],"mappings":";;;;;;AAAA,IAAAA,oBAAA,GAAAC,OAAA;AAMA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMG,sBAAsB,GAAIC,MAAc,IAAoB;EACvE,OAAO;IACL,MAAMC,YAAYA,CAAA,EAAG;MACnB,OAAO,IAAAC,sCAAiB,EAACF,MAAM,CAAC,CAACG,IAAI,CAAC,MAAOC,GAAG,KAAM;QACpD,GAAGA,GAAG;QACN;QACA;QACA;QACA;QACAC,GAAG,EAAE,MAAM,IAAAC,4BAAU,EAACF,GAAG;MAC3B,CAAC,CAAC,CAAC;IACL,CAAC;IACD;AACJ;AACA;AACA;AACA;AACA;IACI,MAAMG,YAAYA,CAACC,KAAa,EAAE;MAChC,OAAO,IAAAC,yBAAI,EAACD,KAAK,EAAER,MAAM,CAAC;IAC5B;EACF,CAAC;AACH,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPAU,OAAA,CAAAX,sBAAA,GAAAA,sBAAA;AAQO,MAAMY,gBAAgB,GAAG,MAC9BC,EAAmD,IACpC;EACf;EACA,MAAMZ,MAAM,GAAI,aAAY,IAAAa,QAAM,EAAC,CAAE,EAAC;EACtC,MAAM,IAAAC,6BAAQ,EAACd,MAAM,CAAC;EACtB,MAAMe,gBAAgB,GAAGhB,sBAAsB,CAACC,MAAM,CAAC;EACvD,OAAOY,EAAE,CAACG,gBAAgB,CAAC,CAACC,OAAO,CAAC,MAAM,IAAAC,8BAAS,EAACjB,MAAM,CAAC,CAAC;AAC9D,CAAC;AAACU,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
});
|
6
6
|
exports.JWKS = exports.JWK = void 0;
|
7
7
|
exports.fixBase64EncodingOnKey = fixBase64EncodingOnKey;
|
8
|
+
exports.isSameThumbprint = void 0;
|
8
9
|
var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
|
9
10
|
var _zod = require("zod");
|
10
11
|
const JWK = _zod.z.object({
|
@@ -81,4 +82,15 @@ const JWKS = _zod.z.object({
|
|
81
82
|
keys: _zod.z.array(JWK)
|
82
83
|
});
|
83
84
|
exports.JWKS = JWKS;
|
85
|
+
/**
|
86
|
+
* Utility function that checks if two JWKs have the same thumbprint.
|
87
|
+
* @param jwkA The first JWK
|
88
|
+
* @param jwkB The second JWK
|
89
|
+
* @returns Whether the thumbprints match
|
90
|
+
*/
|
91
|
+
const isSameThumbprint = async (jwkA, jwkB) => {
|
92
|
+
const [thumbprintJwkA, thumbprintJwkB] = await Promise.all([(0, _ioReactNativeJwt.thumbprint)(jwkA), (0, _ioReactNativeJwt.thumbprint)(jwkB)]);
|
93
|
+
return thumbprintJwkA === thumbprintJwkB;
|
94
|
+
};
|
95
|
+
exports.isSameThumbprint = isSameThumbprint;
|
84
96
|
//# sourceMappingURL=jwk.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_ioReactNativeJwt","require","_zod","JWK","z","object","alg","string","optional","crv","d","dp","dq","e","ext","boolean","k","key_ops","array","kid","kty","union","literal","n","p","q","qi","use","x","y","x5c","x5t","x5u","exports","fixBase64EncodingOnKey","key","pk","removePadding","JWKS","keys"],"sourceRoot":"../../../src","sources":["utils/jwk.ts"],"mappings":"
|
1
|
+
{"version":3,"names":["_ioReactNativeJwt","require","_zod","JWK","z","object","alg","string","optional","crv","d","dp","dq","e","ext","boolean","k","key_ops","array","kid","kty","union","literal","n","p","q","qi","use","x","y","x5c","x5t","x5u","exports","fixBase64EncodingOnKey","key","pk","removePadding","JWKS","keys","isSameThumbprint","jwkA","jwkB","thumbprintJwkA","thumbprintJwkB","Promise","all","thumbprint"],"sourceRoot":"../../../src","sources":["utils/jwk.ts"],"mappings":";;;;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AACA,IAAAC,IAAA,GAAAD,OAAA;AAGO,MAAME,GAAG,GAAGC,MAAC,CAACC,MAAM,CAAC;EAC1B;EACAC,GAAG,EAAEF,MAAC,CAACG,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC1BC,GAAG,EAAEL,MAAC,CAACG,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EAC1BE,CAAC,EAAEN,MAAC,CAACG,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EACxBG,EAAE,EAAEP,MAAC,CAACG,MAAM,CAAC,CAAC,CAACC,QAAQ,CAAC,CAAC;EACzBI,EAAE,EAAER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