@pagopa/io-react-native-wallet 0.9.2 → 0.10.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. package/lib/commonjs/credential/issuance/06-obtain-credential.js +2 -34
  2. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  3. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +169 -0
  4. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -0
  5. package/lib/commonjs/credential/issuance/08-confirm-credential.js +6 -0
  6. package/lib/commonjs/credential/issuance/08-confirm-credential.js.map +1 -0
  7. package/lib/commonjs/credential/issuance/const.js +6 -1
  8. package/lib/commonjs/credential/issuance/const.js.map +1 -1
  9. package/lib/commonjs/credential/issuance/index.js +7 -0
  10. package/lib/commonjs/credential/issuance/index.js.map +1 -1
  11. package/lib/commonjs/index.js +3 -1
  12. package/lib/commonjs/index.js.map +1 -1
  13. package/lib/commonjs/sd-jwt/__test__/index.test.js +33 -1
  14. package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
  15. package/lib/commonjs/sd-jwt/index.js +15 -6
  16. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  17. package/lib/commonjs/sd-jwt/types.js +1 -1
  18. package/lib/commonjs/trust/types.js +5 -0
  19. package/lib/commonjs/trust/types.js.map +1 -1
  20. package/lib/commonjs/utils/misc.js +2 -2
  21. package/lib/commonjs/utils/misc.js.map +1 -1
  22. package/lib/module/credential/issuance/06-obtain-credential.js +3 -34
  23. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  24. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +163 -0
  25. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -0
  26. package/lib/module/credential/issuance/08-confirm-credential.js +2 -0
  27. package/lib/module/credential/issuance/08-confirm-credential.js.map +1 -0
  28. package/lib/module/credential/issuance/const.js +2 -0
  29. package/lib/module/credential/issuance/const.js.map +1 -1
  30. package/lib/module/credential/issuance/index.js +2 -1
  31. package/lib/module/credential/issuance/index.js.map +1 -1
  32. package/lib/module/index.js +2 -1
  33. package/lib/module/index.js.map +1 -1
  34. package/lib/module/sd-jwt/__test__/index.test.js +33 -1
  35. package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
  36. package/lib/module/sd-jwt/index.js +10 -6
  37. package/lib/module/sd-jwt/index.js.map +1 -1
  38. package/lib/module/sd-jwt/types.js +1 -1
  39. package/lib/module/trust/types.js +5 -0
  40. package/lib/module/trust/types.js.map +1 -1
  41. package/lib/module/utils/misc.js +2 -2
  42. package/lib/module/utils/misc.js.map +1 -1
  43. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +2 -1
  44. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  45. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +36 -0
  46. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -0
  47. package/lib/typescript/credential/issuance/08-confirm-credential.d.ts +11 -0
  48. package/lib/typescript/credential/issuance/08-confirm-credential.d.ts.map +1 -0
  49. package/lib/typescript/credential/issuance/const.d.ts +3 -0
  50. package/lib/typescript/credential/issuance/const.d.ts.map +1 -1
  51. package/lib/typescript/credential/issuance/index.d.ts +4 -3
  52. package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
  53. package/lib/typescript/index.d.ts +2 -1
  54. package/lib/typescript/index.d.ts.map +1 -1
  55. package/lib/typescript/sd-jwt/index.d.ts +222 -5
  56. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  57. package/lib/typescript/sd-jwt/types.d.ts +1 -1
  58. package/lib/typescript/trust/index.d.ts +8 -0
  59. package/lib/typescript/trust/index.d.ts.map +1 -1
  60. package/lib/typescript/trust/types.d.ts +232 -0
  61. package/lib/typescript/trust/types.d.ts.map +1 -1
  62. package/lib/typescript/utils/misc.d.ts +1 -1
  63. package/lib/typescript/utils/misc.d.ts.map +1 -1
  64. package/package.json +1 -1
  65. package/src/credential/issuance/06-obtain-credential.ts +3 -51
  66. package/src/credential/issuance/07-verify-and-parse-credential.ts +229 -0
  67. package/src/credential/issuance/08-confirm-credential.ts +14 -0
  68. package/src/credential/issuance/const.ts +6 -0
  69. package/src/credential/issuance/index.ts +7 -1
  70. package/src/index.ts +2 -0
  71. package/src/sd-jwt/__test__/index.test.ts +32 -1
  72. package/src/sd-jwt/index.ts +14 -8
  73. package/src/sd-jwt/types.ts +1 -1
  74. package/src/trust/types.ts +4 -0
  75. package/src/utils/misc.ts +4 -2
@@ -7,11 +7,9 @@ exports.obtainCredential = exports.createNonceProof = void 0;
7
7
  var z = _interopRequireWildcard(require("zod"));
8
8
  var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
9
9
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
10
- var _sdJwt = require("../../sd-jwt");
11
10
  var _dpop = require("../../utils/dpop");
12
11
  var _misc = require("../../utils/misc");
13
- var _types = require("../../sd-jwt/types");
14
- var _errors = require("../../utils/errors");
12
+ var _const = require("./const");
15
13
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
16
14
  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); }
17
15
  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; }
@@ -26,36 +24,10 @@ const createNonceProof = async (nonce, issuer, audience, ctx) => {
26
24
  type: "openid4vci-proof+jwt"
27
25
  }).setAudience(audience).setIssuer(issuer).setIssuedAt().setExpirationTime("1h").sign();
28
26
  };
29
-
30
- /**
31
- * Given a credential, verify it's in the supported format
32
- * and the credential is correctly signed
33
- * and it's bound to the given key
34
- *
35
- * @param rawCredential The received credential
36
- * @param issuerKeys The set of public keys of the issuer,
37
- * which will be used to verify the signature
38
- * @param holderBindingContext The access to the holder's key
39
- *
40
- * @throws If the signature verification fails
41
- * @throws If the credential is not in the SdJwt4VC format
42
- * @throws If the holder binding is not properly configured
43
- *
44
- */
45
27
  exports.createNonceProof = createNonceProof;
46
- async function verifyCredential(rawCredential, issuerKeys, holderBindingContext) {
47
- const [{
48
- sdJwt
49
- }, holderBindingKey] =
50
- // parallel for optimization
51
- await Promise.all([(0, _sdJwt.verify)(rawCredential, issuerKeys, _types.SdJwt4VC), holderBindingContext.getPublicKey()]);
52
- if (!sdJwt.payload.cnf.jwk.kid || sdJwt.payload.cnf.jwk.kid !== holderBindingKey.kid) {
53
- throw new _errors.IoWalletError(`Failed to verify holder binding, expected kid: ${holderBindingKey.kid}, got: ${sdJwt.payload.cnf.jwk.kid}`);
54
- }
55
- }
56
28
  const CredentialEndpointResponse = z.object({
57
29
  credential: z.string(),
58
- format: z.literal("vc+sd-jwt")
30
+ format: _const.SupportedCredentialFormat
59
31
  });
60
32
  /**
61
33
  * Fetch a credential from the issuer
@@ -115,10 +87,6 @@ const obtainCredential = async (issuerConf, accessToken, nonce, clientId, creden
115
87
  },
116
88
  body: formBody.toString()
117
89
  }).then((0, _misc.hasStatus)(200)).then(res => res.json()).then(CredentialEndpointResponse.parse);
118
-
119
- /** validate the received credential signature
120
- is correct and refers to the public keys of the issuer */
121
- await verifyCredential(credential, issuerConf.openid_credential_issuer.jwks.keys, credentialCryptoContext);
122
90
  return {
123
91
  credential,
124
92
  format
@@ -1 +1 @@
1
- {"version":3,"names":["z","_interopRequireWildcard","require","_reactNativeUuid","_interopRequireDefault","_ioReactNativeJwt","_sdJwt","_dpop","_misc","_types","_errors","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","createNonceProof","nonce","issuer","audience","ctx","SignJWT","setPayload","jwk","getPublicKey","setProtectedHeader","type","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","exports","verifyCredential","rawCredential","issuerKeys","holderBindingContext","sdJwt","holderBindingKey","Promise","all","verifySdJwt","SdJwt4VC","payload","cnf","kid","IoWalletError","CredentialEndpointResponse","object","credential","string","format","literal","obtainCredential","issuerConf","accessToken","clientId","credentialType","context","credentialCryptoContext","walletProviderBaseUrl","appFetch","fetch","credentialUrl","openid_credential_issuer","credential_endpoint","signedDPopForPid","createDPopToken","htm","htu","jti","uuid","v4","signedNonceProof","formBody","URLSearchParams","credential_definition","JSON","stringify","proof","jwt","proof_type","method","headers","DPoP","Authorization","body","toString","then","hasStatus","res","json","parse","jwks","keys"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,KAAA,GAAAL,OAAA;AAGA,IAAAM,KAAA,GAAAN,OAAA;AAGA,IAAAO,MAAA,GAAAP,OAAA;AACA,IAAAQ,OAAA,GAAAR,OAAA;AAAmD,SAAAE,uBAAAO,GAAA,WAAAA,GAAA,IAAAA,GAAA,CAAAC,UAAA,GAAAD,GAAA,KAAAE,OAAA,EAAAF,GAAA;A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AC;EAC1B,CAAC,CAAC,CACCC,IAAI,CAAC,IAAAC,eAAS,EAAC,GAAG,CAAC,CAAC,CACpBD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAACzC,0BAA0B,CAAC6C,KAAK,CAAC;;EAEzC;AACF;EACE,MAAM3D,gBAAgB,CACpBgB,UAAU,EACVK,UAAU,CAACU,wBAAwB,CAAC6B,IAAI,CAACC,IAAI,EAC7CnC,uBACF,CAAC;EAED,OAAO;IAAEV,UAAU;IAAEE;EAAO,CAAC;AAC/B,CAAC;AAACnB,OAAA,CAAAqB,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["z","_interopRequireWildcard","require","_reactNativeUuid","_interopRequireDefault","_ioReactNativeJwt","_dpop","_misc","_const","obj","__esModule","default","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","createNonceProof","nonce","issuer","audience","ctx","SignJWT","setPayload","jwk","getPublicKey","setProtectedHeader","type","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","exports","CredentialEndpointResponse","object","credential","string","format","SupportedCredentialFormat","obtainCredential","issuerConf","accessToken","clientId","credentialType","context","credentialCryptoContext","walletProviderBaseUrl","appFetch","fetch","credentialUrl","openid_credential_issuer","credential_endpoint","signedDPopForPid","createDPopToken","htm","htu","jti","uuid","v4","signedNonceProof","formBody","URLSearchParams","credential_definition","JSON","stringify","proof","jwt","proof_type","method","headers","DPoP","Authorization","body","toString","then","hasStatus","res","json","parse"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,gBAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;A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,CAAE;EACpB,CAAC,EACDb,uBACF,CAAC;;EAED;AACF;AACA;EACE,MAAMc,gBAAgB,GAAG,MAAM3C,gBAAgB,CAC7CC,KAAK,EACLyB,QAAQ,EACRI,qBAAqB,EACrBD,uBACF,CAAC;;EAED;EACA,MAAMe,QAAQ,GAAG,IAAIC,eAAe,CAAC;IACnCC,qBAAqB,EAAEC,IAAI,CAACC,SAAS,CAAC;MACpCtC,IAAI,EAAE,CAACiB,cAAc;IACvB,CAAC,CAAC;IACFN,MAAM,EAAE,WAAW;IACnB4B,KAAK,EAAEF,IAAI,CAACC,SAAS,CAAC;MACpBE,GAAG,EAAEP,gBAAgB;MACrBQ,UAAU,EAAE;IACd,CAAC;EACH,CAAC,CAAC;EAEF,MAAM;IAAEhC,UAAU;IAAEE;EAAO,CAAC,GAAG,MAAMU,QAAQ,CAACE,aAAa,EAAE;IAC3DmB,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MACP,cAAc,EAAE,mCAAmC;MACnDC,IAAI,EAAElB,gBAAgB;MACtBmB,aAAa,EAAE9B;IACjB,CAAC;IACD+B,IAAI,EAAEZ,QAAQ,CAACa,QAAQ,CAAC;EAC1B,CAAC,CAAC,CACCC,IAAI,CAAC,IAAAC,eAAS,EAAC,GAAG,CAAC,CAAC,CACpBD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAACzC,0BAA0B,CAAC6C,KAAK,CAAC;EAEzC,OAAO;IAAE3C,UAAU;IAAEE;EAAO,CAAC;AAC/B,CAAC;AAACL,OAAA,CAAAO,gBAAA,GAAAA,gBAAA"}
@@ -0,0 +1,169 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.verifyAndParseCredential = void 0;
7
+ var _errors = require("../../utils/errors");
8
+ var _types = require("../../sd-jwt/types");
9
+ var _sdJwt = require("../../sd-jwt");
10
+ // The credential as a collection of attributes in plain value
11
+
12
+ // handy alias
13
+
14
+ const parseCredentialSdJwt = function (credentials_supported, _ref) {
15
+ var _credentials_supporte;
16
+ let {
17
+ sdJwt,
18
+ disclosures
19
+ } = _ref;
20
+ let ignoreMissingAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
21
+ // find the definition that matches the received credential's type
22
+ // warning: if more then a defintion is found, the first is retrieved
23
+ const credentialSubject = (_credentials_supporte = credentials_supported.find(c => c.credential_definition.type.includes(sdJwt.payload.type))) === null || _credentials_supporte === void 0 ? void 0 : _credentials_supporte.credential_definition.credentialSubject;
24
+
25
+ // the received credential matches no supported credential, throw an exception
26
+ if (!credentialSubject) {
27
+ const expected = credentials_supported.flatMap(_ => _.credential_definition.type).join(", ");
28
+ throw new _errors.IoWalletError(`Received credential is of an unknwown type. Expected one of [${expected}], received '${sdJwt.payload.type}', `);
29
+ }
30
+
31
+ // transfrom a record { key: value } in an iterable of pairs [key, value]
32
+ const attrDefinitions = Object.entries(credentialSubject);
33
+
34
+ // every mandatory attribute must be present in the credential's disclosures
35
+ // the key of the attribute defintion must match the disclosure's name
36
+ const attrsNotInDisclosures = attrDefinitions.filter(_ref2 => {
37
+ let [attrKey, {
38
+ mandatory
39
+ }] = _ref2;
40
+ return mandatory && !disclosures.some(_ref3 => {
41
+ let [, name] = _ref3;
42
+ return name === attrKey;
43
+ });
44
+ });
45
+ if (attrsNotInDisclosures.length > 0) {
46
+ const missing = attrsNotInDisclosures.map(_ => _[0 /* key */]).join(", ");
47
+ const received = disclosures.map(_ => _[1 /* name */]).join(", ");
48
+ // the rationale of this condition is that we may want to be permissive
49
+ // on incomplete credentials in the test phase of the project.
50
+ // we might want to be strict once in production, hence remove this condition
51
+ if (!ignoreMissingAttributes) {
52
+ throw new _errors.IoWalletError(`Some attributes are missing in the credential. Missing: [${missing}], received: [${received}]`);
53
+ }
54
+ }
55
+
56
+ // attributes that are defined in the issuer configuration
57
+ // and are present in the disclosure set
58
+ const definedValues = attrDefinitions
59
+ // retrieve the value from the disclosure set
60
+ .map(_ref4 => {
61
+ var _disclosures$find;
62
+ let [attrKey, definition] = _ref4;
63
+ return [attrKey, {
64
+ ...definition,
65
+ value: (_disclosures$find = disclosures.find(_ => _[1 /* name */] === attrKey)) === null || _disclosures$find === void 0 ? void 0 : _disclosures$find[2 /* value */]
66
+ }];
67
+ })
68
+ // add a human readable attribute name, with i18n, in the form { locale: name }
69
+ // example: { "it-IT": "Nome", "en-EN": "Name", "es-ES": "Nombre" }
70
+ .map(_ref5 => {
71
+ let [attrKey, {
72
+ display,
73
+ ...definition
74
+ }] = _ref5;
75
+ return [attrKey, {
76
+ ...definition,
77
+ name: display.reduce((names, _ref6) => {
78
+ let {
79
+ locale,
80
+ name
81
+ } = _ref6;
82
+ return {
83
+ ...names,
84
+ [locale]: name
85
+ };
86
+ }, {})
87
+ }];
88
+ });
89
+
90
+ // attributes that are in the disclosure set
91
+ // but are not defined in the issuer configuration
92
+ const undefinedValues = disclosures.filter(_ => !Object.keys(definedValues).includes(_[1])).map(_ref7 => {
93
+ let [, key, value] = _ref7;
94
+ return [key, {
95
+ value,
96
+ mandatory: false,
97
+ name: key
98
+ }];
99
+ });
100
+ return {
101
+ ...Object.fromEntries(definedValues),
102
+ ...Object.fromEntries(undefinedValues)
103
+ };
104
+ };
105
+
106
+ /**
107
+ * Given a credential, verify it's in the supported format
108
+ * and the credential is correctly signed
109
+ * and it's bound to the given key
110
+ *
111
+ * @param rawCredential The received credential
112
+ * @param issuerKeys The set of public keys of the issuer,
113
+ * which will be used to verify the signature
114
+ * @param holderBindingContext The access to the holder's key
115
+ *
116
+ * @throws If the signature verification fails
117
+ * @throws If the credential is not in the SdJwt4VC format
118
+ * @throws If the holder binding is not properly configured
119
+ *
120
+ */
121
+ async function verifyCredentialSdJwt(rawCredential, issuerKeys, holderBindingContext) {
122
+ const [decodedCredential, holderBindingKey] =
123
+ // parallel for optimization
124
+ await Promise.all([(0, _sdJwt.verify)(rawCredential, issuerKeys, _types.SdJwt4VC), holderBindingContext.getPublicKey()]);
125
+ const {
126
+ cnf
127
+ } = decodedCredential.sdJwt.payload;
128
+ if (!cnf.jwk.kid || cnf.jwk.kid !== holderBindingKey.kid) {
129
+ throw new _errors.IoWalletError(`Failed to verify holder binding, expected kid: ${holderBindingKey.kid}, got: ${decodedCredential.sdJwt.payload.cnf.jwk.kid}`);
130
+ }
131
+ return decodedCredential;
132
+ }
133
+
134
+ // utility type that specialize VerifyAndParseCredential for given format
135
+
136
+ const verifyAndParseCredentialSdJwt = async (issuerConf, credential, _, _ref8) => {
137
+ let {
138
+ credentialCryptoContext,
139
+ ignoreMissingAttributes
140
+ } = _ref8;
141
+ const decoded = await verifyCredentialSdJwt(credential, issuerConf.openid_credential_issuer.jwks.keys, credentialCryptoContext);
142
+ const parsedCredential = parseCredentialSdJwt(issuerConf.openid_credential_issuer.credentials_supported, decoded, ignoreMissingAttributes);
143
+ return {
144
+ parsedCredential
145
+ };
146
+ };
147
+
148
+ /**
149
+ * Verify and parse an encoded credential
150
+ *
151
+ * @param issuerConf The Issuer configuration
152
+ * @param credential The encoded credential
153
+ * @param format The format of the credentual
154
+ * @param context.credentialCryptoContext The context to access the key the Credential will be bound to
155
+ * @param context.ignoreMissingAttributes (optional) Whether to fail if a defined attribute is note present in the credentual. Default: false
156
+ * @returns A parsed credential with attributes in plain value
157
+ * @throws If the credential signature is not verified with the Issuer key set
158
+ * @throws If the credential is not bound to the provided user key
159
+ * @throws If the credential data fail to parse
160
+ */
161
+ const verifyAndParseCredential = async (issuerConf, credential, format, context) => {
162
+ if (format === "vc+sd-jwt") {
163
+ return verifyAndParseCredentialSdJwt(issuerConf, credential, format, context);
164
+ }
165
+ const _ = format;
166
+ throw new _errors.IoWalletError(`Unsupported credential format: ${_}`);
167
+ };
168
+ exports.verifyAndParseCredential = verifyAndParseCredential;
169
+ //# sourceMappingURL=07-verify-and-parse-credential.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_errors","require","_types","_sdJwt","parseCredentialSdJwt","credentials_supported","_ref","_credentials_supporte","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","credentialSubject","find","c","credential_definition","type","includes","payload","expected","flatMap","_","join","IoWalletError","attrDefinitions","Object","entries","attrsNotInDisclosures","filter","_ref2","attrKey","mandatory","some","_ref3","name","missing","map","received","definedValues","_ref4","_disclosures$find","definition","value","_ref5","display","reduce","names","_ref6","locale","undefinedValues","keys","_ref7","key","fromEntries","verifyCredentialSdJwt","rawCredential","issuerKeys","holderBindingContext","decodedCredential","holderBindingKey","Promise","all","verifySdJwt","SdJwt4VC","getPublicKey","cnf","jwk","kid","verifyAndParseCredentialSdJwt","issuerConf","credential","_ref8","credentialCryptoContext","decoded","openid_credential_issuer","jwks","parsedCredential","verifyAndParseCredential","format","context","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,MAAA,GAAAF,OAAA;AAcA;;AAmBA;;AAKA,MAAMG,oBAAoB,GAAG,SAAAA,CAE3BC,qBAAkH,EAAAC,IAAA,EAG7F;EAAA,IAAAC,qBAAA;EAAA,IAFrB;IAAEC,KAAK;IAAEC;EAAoC,CAAC,GAAAH,IAAA;EAAA,IAC9CI,uBAAgC,GAAAC,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,KAAK;EAExC;EACA;EACA,MAAMG,iBAAiB,IAAAP,qBAAA,GAAGF,qBAAqB,CAACU,IAAI,CAAEC,CAAC,IACrDA,CAAC,CAACC,qBAAqB,CAACC,IAAI,CAACC,QAAQ,CAACX,KAAK,CAACY,OAAO,CAACF,IAAI,CAC1D,CAAC,cAAAX,qBAAA,uBAFyBA,qBAAA,CAEvBU,qBAAqB,CAACH,iBAAiB;;EAE1C;EACA,IAAI,CAACA,iBAAiB,EAAE;IACtB,MAAMO,QAAQ,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AkD,GAAG,MAAAA,CAChER,UAAU,EACVC,UAAU,EACVQ,MAAM,EACNC,OAAO,KACJ;EACH,IAAID,MAAM,KAAK,WAAW,EAAE;IAC1B,OAAOV,6BAA6B,CAClCC,UAAU,EACVC,UAAU,EACVQ,MAAM,EACNC,OACF,CAAC;EACH;EAEA,MAAM1D,CAAQ,GAAGyD,MAAM;EACvB,MAAM,IAAIvD,qBAAa,CAAE,kCAAiCF,CAAE,EAAC,CAAC;AAChE,CAAC;AAAC2D,OAAA,CAAAH,wBAAA,GAAAA,wBAAA"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ //# sourceMappingURL=08-confirm-credential.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":[],"sourceRoot":"../../../../src","sources":["credential/issuance/08-confirm-credential.ts"],"mappings":""}
@@ -3,7 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.ASSERTION_TYPE = void 0;
6
+ exports.SupportedCredentialFormat = exports.ASSERTION_TYPE = void 0;
7
+ var z = _interopRequireWildcard(require("zod"));
8
+ 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); }
9
+ 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; }
7
10
  const ASSERTION_TYPE = "urn:ietf:params:oauth:client-assertion-type:jwt-client-attestation";
8
11
  exports.ASSERTION_TYPE = ASSERTION_TYPE;
12
+ const SupportedCredentialFormat = z.literal("vc+sd-jwt");
13
+ exports.SupportedCredentialFormat = SupportedCredentialFormat;
9
14
  //# sourceMappingURL=const.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["ASSERTION_TYPE","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/const.ts"],"mappings":";;;;;;AAAO,MAAMA,cAAc,GACzB,oEAAoE;AAACC,OAAA,CAAAD,cAAA,GAAAA,cAAA"}
1
+ {"version":3,"names":["z","_interopRequireWildcard","require","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","ASSERTION_TYPE","exports","SupportedCredentialFormat","literal"],"sourceRoot":"../../../../src","sources":["credential/issuance/const.ts"],"mappings":";;;;;;AAAA,IAAAA,CAAA,GAAAC,uBAAA,CAAAC,OAAA;AAAyB,SAAAC,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,SAAAH,wBAAAO,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA;AAClB,MAAMW,cAAc,GACzB,oEAAoE;AAACC,OAAA,CAAAD,cAAA,GAAAA,cAAA;AAKhE,MAAME,yBAAyB,GAAG3B,CAAC,CAAC4B,OAAO,CAAC,WAAW,CAAC;AAACF,OAAA,CAAAC,yBAAA,GAAAA,yBAAA"}
@@ -27,8 +27,15 @@ Object.defineProperty(exports, "startUserAuthorization", {
27
27
  return _startUserAuthorization.startUserAuthorization;
28
28
  }
29
29
  });
30
+ Object.defineProperty(exports, "verifyAndParseCredential", {
31
+ enumerable: true,
32
+ get: function () {
33
+ return _verifyAndParseCredential.verifyAndParseCredential;
34
+ }
35
+ });
30
36
  var _evaluateIssuerTrust = require("./02-evaluate-issuer-trust");
31
37
  var _startUserAuthorization = require("./03-start-user-authorization");
32
38
  var _authorizeAccess = require("./05-authorize-access");
33
39
  var _obtainCredential = require("./06-obtain-credential");
40
+ var _verifyAndParseCredential = require("./07-verify-and-parse-credential");
34
41
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_authorizeAccess","_obtainCredential"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAIA,IAAAC,uBAAA,GAAAD,OAAA;AAKA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA"}
1
+ {"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_authorizeAccess","_obtainCredential","_verifyAndParseCredential"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAIA,IAAAC,uBAAA,GAAAD,OAAA;AAKA,IAAAE,gBAAA,GAAAF,OAAA;AACA,IAAAG,iBAAA,GAAAH,OAAA;AAIA,IAAAI,yBAAA,GAAAJ,OAAA"}
@@ -15,7 +15,7 @@ Object.defineProperty(exports, "AuthorizationDetails", {
15
15
  return _par.AuthorizationDetails;
16
16
  }
17
17
  });
18
- exports.WalletInstanceAttestation = exports.Trust = exports.PID = exports.Errors = exports.Credential = void 0;
18
+ exports.WalletInstanceAttestation = exports.Trust = exports.SdJwt = exports.PID = exports.Errors = exports.Credential = void 0;
19
19
  Object.defineProperty(exports, "createCryptoContextFor", {
20
20
  enumerable: true,
21
21
  get: function () {
@@ -27,6 +27,8 @@ var Credential = _interopRequireWildcard(require("./credential"));
27
27
  exports.Credential = Credential;
28
28
  var PID = _interopRequireWildcard(require("./pid"));
29
29
  exports.PID = PID;
30
+ var SdJwt = _interopRequireWildcard(require("./sd-jwt"));
31
+ exports.SdJwt = SdJwt;
30
32
  var Errors = _interopRequireWildcard(require("./utils/errors"));
31
33
  exports.Errors = Errors;
32
34
  var WalletInstanceAttestation = _interopRequireWildcard(require("./wallet-instance-attestation"));
@@ -1 +1 @@
1
- {"version":3,"names":["require","Credential","_interopRequireWildcard","exports","PID","Errors","WalletInstanceAttestation","Trust","_par","_crypto","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEAA,OAAA;AAEA,IAAAC,UAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA2CG,OAAA,CAAAF,UAAA,GAAAA,UAAA;AAC3C,IAAAG,GAAA,GAAAF,uBAAA,CAAAF,OAAA;AAA6BG,OAAA,CAAAC,GAAA,GAAAA,GAAA;AAC7B,IAAAC,MAAA,GAAAH,uBAAA,CAAAF,OAAA;AAAyCG,OAAA,CAAAE,MAAA,GAAAA,MAAA;AACzC,IAAAC,yBAAA,GAAAJ,uBAAA,CAAAF,OAAA;AAA2EG,OAAA,CAAAG,yBAAA,GAAAA,yBAAA;AAC3E,IAAAC,KAAA,GAAAL,uBAAA,CAAAF,OAAA;AAAiCG,OAAA,CAAAI,KAAA,GAAAA,KAAA;AACjC,IAAAC,IAAA,GAAAR,OAAA;AACA,IAAAS,OAAA,GAAAT,OAAA;AAAwD,SAAAU,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,SAAAT,wBAAAa,GAAA,EAAAJ,WAAA,SAAAA,WAAA,IAAAI,GAAA,IAAAA,GAAA,CAAAC,UAAA,WAAAD,GAAA,QAAAA,GAAA,oBAAAA,GAAA,wBAAAA,GAAA,4BAAAE,OAAA,EAAAF,GAAA,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
1
+ {"version":3,"names":["require","Credential","_interopRequireWildcard","exports","PID","SdJwt","Errors","WalletInstanceAttestation","Trust","_par","_crypto","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set"],"sourceRoot":"../../src","sources":["index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAEAA,OAAA;AAEA,IAAAC,UAAA,GAAAC,uBAAA,CAAAF,OAAA;AAA2CG,OAAA,CAAAF,UAAA,GAAAA,UAAA;AAC3C,IAAAG,GAAA,GAAAF,uBAAA,CAAAF,OAAA;AAA6BG,OAAA,CAAAC,GAAA,GAAAA,GAAA;AAC7B,IAAAC,KAAA,GAAAH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A,CAAAC,GAAA,KAAAR,MAAA,CAAAC,cAAA,CAAAH,MAAA,EAAAK,GAAA,EAAAI,IAAA,YAAAT,MAAA,CAAAK,GAAA,IAAAX,GAAA,CAAAW,GAAA,SAAAL,MAAA,CAAAJ,OAAA,GAAAF,GAAA,MAAAG,KAAA,IAAAA,KAAA,CAAAa,GAAA,CAAAhB,GAAA,EAAAM,MAAA,YAAAA,MAAA"}
@@ -1,9 +1,10 @@
1
1
  "use strict";
2
2
 
3
+ var _zod = require("zod");
3
4
  var _index = require("../index");
4
5
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
5
6
  var _types = require("../types");
6
- // Examples from https://www.ietf.org/id/draft-terbu-sd-jwt-vc-02.html#name-example-4
7
+ // Examples from https://www.ietf.org/archive/id/draft-terbu-sd-jwt-vc-02.html#name-example-4
7
8
  // but adapted to adhere to format declared in https://italia.github.io/eudi-wallet-it-docs/versione-corrente/en/pid-eaa-data-model.html#id2
8
9
  // In short, the token is a Frankenstein composed as follows:
9
10
  // - the header is taken from the italian specification, with kid and alg valued according to the signing keys
@@ -76,6 +77,37 @@ describe("decode", () => {
76
77
  }))
77
78
  });
78
79
  });
80
+ it("should decode with default decoder", () => {
81
+ const result = (0, _index.decode)(token);
82
+ expect(result).toEqual({
83
+ sdJwt,
84
+ disclosures: disclosures.map((decoded, i) => ({
85
+ decoded,
86
+ encoded: tokenizedDisclosures[i]
87
+ }))
88
+ });
89
+ });
90
+ it("should accept only decoders that extend SdJwt4VC", () => {
91
+ const validDecoder = _types.SdJwt4VC.and(_zod.z.object({
92
+ payload: _zod.z.object({
93
+ customField: _zod.z.string()
94
+ })
95
+ }));
96
+ const invalidDecoder = _zod.z.object({
97
+ payload: _zod.z.object({
98
+ customField: _zod.z.string()
99
+ })
100
+ });
101
+ try {
102
+ // ts is fine
103
+ (0, _index.decode)(token, validDecoder);
104
+ // @ts-expect-error break types
105
+ (0, _index.decode)(token, invalidDecoder);
106
+ } catch (error) {
107
+ // ignore actual result, just focus on types
108
+ // spot the error during type checking phase
109
+ }
110
+ });
79
111
  });
80
112
  describe("disclose", () => {
81
113
  it("should encode a valid sdjwt (one claim)", async () => {
@@ -1 +1 @@
1
- {"version":3,"names":["_index","require","_ioReactNativeJwt","_types","token","unsigned","signature","signed","tokenizedDisclosures","sdJwt","header","typ","alg","kid","trust_chain","payload","iss","sub","jti","iat","exp","status","cnf","jwk","kty","use","n","e","type","verified_claims","verification","_sd","trust_framework","assurance_level","claims","_sd_alg","disclosures","street_address","locality","region","country","it","expect","JSON","parse","decodeBase64","encodeBase64","stringify","toEqual","join","toBe","describe","result","decode","SdJwt4VC","map","decoded","i","encoded","disclose","expected","paths","claim","path","fn","rejects","any","Error"],"sourceRoot":"../../../../src","sources":["sd-jwt/__test__/index.test.ts"],"mappings":";;AAAA,IAAAA,MAAA,GAAAC,OAAA;AAEA,IAAAC,iBAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMG,KAAK,GACT,kvEAAkvE;AAEpvE,MAAMC,QAAQ,GACZ,87CAA87C;AAEh8C,MAAMC,SAAS,GACb,wFAAwF;AAE1F,MAAMC,MAAM,GAAI,GAAEF,QAAS,IAAGC,SAAU,EAAC;AAEzC,MAAME,oBAAoB,GAAG,CAC3B,kEAAkE,EAClE,kEAAkE,EAClE,gFAAgF,EAChF,oFAAoF,EACpF,yEAAyE,EACzE,gEAAgE,EAChE,gEAAgE,EAChE,gEAAgE,EAChE,qLAAqL,CACtL;AAED,MAAMC,KAAK,GAAG;EACZC,MAAM,EAAE;IACNC,GAAG,EAAE,WAAW;IAChBC,GAAG,EAAE,OAAO;IACZC,GAAG,EAAE,kCAAkC;IACvCC,WAAW,EAAE,CACX,kCAAkC,EAClC,kCAAkC,EAClC,kCAAkC;EAEtC,CAAC;EACDC,OAAO,EAAE;IACPC,GAAG,EAAE,4BAA4B;IACjCC,GAAG,EAAE,sCAAsC;IAC3C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;EAEFnB,EAAE,CAAC,yCAAyC,EAAE,YAAY;IACxD,MAAMW,MAAM,GAAG,MAAM,IAAAO,eAAQ,EAACvD,KAAK,EAAE,EAAE,CAAC;IACxC,MAAMwD,QAAQ,GAAG;MAAExD,KAAK,EAAG,GAAEG,MAAO,EAAC;MAAEsD,KAAK,EAAE;IAAG,CAAC;IAElDnB,MAAM,CAACU,MAAM,CAAC,CAACJ,OAAO,CAACY,QAAQ,CAAC;EAClC,CAAC,CAAC;EAEFnB,EAAE,CAAC,+CAA+C,EAAE,YAAY;IAC9D,MAAMW,MAAM,GAAG,MAAM,IAAAO,eAAQ,EAACvD,KAAK,EAAE,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;IAC7D,MAAMwD,QAAQ,GAAG;MACfxD,KAAK,EAAG,GAAEG,MAAO,kJAAiJ;MAClKsD,KAAK,EAAE,CACL;QACEC,KAAK,EAAE,YAAY;QACnBC,IAAI,EAAE;MACR,CAAC,EACD;QACED,KAAK,EAAE,OAAO;QACdC,IAAI,EAAE;MACR,CAAC;IAEL,CAAC;IAEDrB,MAAM,CAACU,MAAM,CAAC,CAACJ,OAAO,CAACY,QAAQ,CAAC;EAClC,CAAC,CAAC;EAEFnB,EAAE,CAAC,8BAA8B,EAAE,YAAY;IAC7C,MAAMuB,EAAE,GAAG,MAAAA,CAAA,KAAY,IAAAL,eAAQ,EAACvD,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC;IAEnD,MAAMsC,MAAM,CAACsB,EAAE,CAAC,CAAC,CAAC,CAACC,OAAO,CAACjB,OAAO,CAACN,MAAM,CAACwB,GAAG,CAACC,KAAK,CAAC,CAAC;EACvD,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_zod","require","_index","_ioReactNativeJwt","_types","token","unsigned","signature","signed","tokenizedDisclosures","sdJwt","header","typ","alg","kid","trust_chain","payload","iss","sub","jti","iat","exp","status","cnf","jwk","kty","use","n","e","type","verified_claims","verification","_sd","trust_framework","assurance_level","claims","_sd_alg","disclosures","street_address","locality","region","country","it","expect","JSON","parse","decodeBase64","encodeBase64","stringify","toEqual","join","toBe","describe","result","decode","SdJwt4VC","map","decoded","i","encoded","validDecoder","and","z","object","customField","string","invalidDecoder","error","disclose","expected","paths","claim","path","fn","rejects","any","Error"],"sourceRoot":"../../../../src","sources":["sd-jwt/__test__/index.test.ts"],"mappings":";;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAEA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMI,KAAK,GACT,kvEAAkvE;AAEpvE,MAAMC,QAAQ,GACZ,87CAA87C;AAEh8C,MAAMC,SAAS,GACb,wFAAwF;AAE1F,MAAMC,MAAM,GAAI,GAAEF,QAAS,IAAGC,SAAU,EAAC;AAEzC,MAAME,oBAAoB,GAAG,CAC3B,kEAAkE,EAClE,kEAAkE,EAClE,gFAAgF,EAChF,oFAAoF,EACpF,yEAAyE,EACzE,gEAAgE,EAChE,gEAAgE,EAChE,gEAAgE,EAChE,qLAAqL,CACtL;AAED,MAAMC,KAAK,GAAG;EACZC,MAAM,EAAE;IACNC,GAAG,EAAE,WAAW;IAChBC,GAAG,EAAE,OAAO;IACZC,GAAG,EAAE,kCAAkC;IACvCC,WAAW,EAAE,CACX,kCAAkC,EAClC,kCAAkC,EAClC,kCAAkC;EAEtC,CAAC;EACDC,OAAO,EAAE;IACPC,GAAG,EAAE,4BAA4B;IACjCC,GAAG,EAAE,sCAAsC;IAC3CC,GAAG,EAAE,+CAA+C;IACpDC,GAAG,EAAE,UAAU;IACfC,GAAG,EAAE,UAAU;IACfC,MAAM,EAAE,4BAA4B;IACpCC,GAAG,EAAE;MACHC,GAAG,EAAE;QACHC,GAAG,EAAE,KAAK;QACVC,GAAG,EAAE,KAAK;QACVC,CAAC,EAAE,QAAQ;QACXC,CAAC,E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AG;MACfhE,KAAK,EAAG,GAAEG,MAAO,kJAAiJ;MAClK8D,KAAK,EAAE,CACL;QACEC,KAAK,EAAE,YAAY;QACnBC,IAAI,EAAE;MACR,CAAC,EACD;QACED,KAAK,EAAE,OAAO;QACdC,IAAI,EAAE;MACR,CAAC;IAEL,CAAC;IAED7B,MAAM,CAACU,MAAM,CAAC,CAACJ,OAAO,CAACoB,QAAQ,CAAC;EAClC,CAAC,CAAC;EAEF3B,EAAE,CAAC,8BAA8B,EAAE,YAAY;IAC7C,MAAM+B,EAAE,GAAG,MAAAA,CAAA,KAAY,IAAAL,eAAQ,EAAC/D,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC;IAEnD,MAAMsC,MAAM,CAAC8B,EAAE,CAAC,CAAC,CAAC,CAACC,OAAO,CAACzB,OAAO,CAACN,MAAM,CAACgC,GAAG,CAACC,KAAK,CAAC,CAAC;EACvD,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -3,6 +3,12 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
+ Object.defineProperty(exports, "SdJwt4VC", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _types.SdJwt4VC;
10
+ }
11
+ });
6
12
  exports.verify = exports.disclose = exports.decode = void 0;
7
13
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
8
14
  var _types = require("./types");
@@ -25,12 +31,12 @@ const decodeDisclosure = encoded => {
25
31
  *
26
32
  * @function
27
33
  * @param token The encoded token that represents a valid sd-jwt for verifiable credentials
28
- * @param schema Schema to use to parse the SD-JWT
34
+ * @param customSchema (optional) Schema to use to parse the SD-JWT. Default: SdJwt4VC
29
35
  *
30
36
  * @returns The parsed SD-JWT token and the parsed disclosures
31
37
  *
32
38
  */
33
- const decode = (token, schema) => {
39
+ const decode = (token, customSchema) => {
34
40
  // token are expected in the form "sd-jwt~disclosure0~disclosure1~...~disclosureN~"
35
41
  if (token.slice(-1) === "~") {
36
42
  token = token.slice(0, -1);
@@ -40,7 +46,10 @@ const decode = (token, schema) => {
40
46
  // get the sd-jwt as object
41
47
  // validate it's a valid SD-JWT for Verifiable Credentials
42
48
  const decodedJwt = (0, _ioReactNativeJwt.decode)(rawSdJwt);
43
- const sdJwt = schema.parse({
49
+
50
+ // use a custom parsed if provided, otherwise use base SdJwt4VC
51
+ const parser = customSchema || _types.SdJwt4VC;
52
+ const sdJwt = parser.parse({
44
53
  header: decodedJwt.protectedHeader,
45
54
  payload: decodedJwt.payload
46
55
  });
@@ -134,16 +143,16 @@ const disclose = async (token, claims) => {
134
143
  *
135
144
  * @param token The encoded token that represents a valid sd-jwt for verifiable credentials
136
145
  * @param publicKey The single public key or an array of public keys to validate the signature.
137
- * @param schema Schema to use to parse the SD-JWT
146
+ * @param customSchema Schema to use to parse the SD-JWT
138
147
  *
139
148
  * @returns The parsed SD-JWT token and the parsed disclosures
140
149
  *
141
150
  */
142
151
  exports.disclose = disclose;
143
- const verify = async (token, publicKey, schema) => {
152
+ const verify = async (token, publicKey, customSchema) => {
144
153
  // get decoded data
145
154
  const [rawSdJwt = ""] = token.split("~");
146
- const decoded = decode(token, schema);
155
+ const decoded = decode(token, customSchema);
147
156
 
148
157
  //Check signature
149
158
  await (0, _ioReactNativeJwt.verify)(rawSdJwt, publicKey);
@@ -1 +1 @@
1
- {"version":3,"names":["_ioReactNativeJwt","require","_types","_verifier","_errors","decodeDisclosure","encoded","decoded","Disclosure","parse","JSON","decodeBase64","decode","token","schema","slice","rawSdJwt","rawDisclosures","split","decodedJwt","decodeJwt","sdJwt","header","protectedHeader","payload","disclosures","map","exports","disclose","claims","SdJwt4VC","paths","Promise","all","claim","disclosure","find","_ref","name","ClaimsNotFoundBetweenDislosures","hash","sha256ToBase64","verified_claims","_sd","includes","index","indexOf","path","verification","ClaimsNotFoundInToken","filteredDisclosures","filter","d","disclosedToken","join","verify","publicKey","verifyJwt","verifyDisclosure"],"sourceRoot":"../../../src","sources":["sd-jwt/index.ts"],"mappings":";;;;;;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ACC,GAAG,CACrB,MAAOS,UAAU,IAAK,MAAM,IAAAuB,0BAAgB,EAACvB,UAAU,EAAEN,MAAM,CACjE,CACF,CAAC;EAED,OAAO;IACLR,KAAK,EAAEd,OAAO,CAACc,KAAK;IACpBI,WAAW,EAAElB,OAAO,CAACkB,WAAW,CAACC,GAAG,CAAE0B,CAAC,IAAKA,CAAC,CAAC7C,OAAO;EACvD,CAAC;AACH,CAAC;AAACoB,OAAA,CAAA4B,MAAA,GAAAA,MAAA"}
1
+ {"version":3,"names":["_ioReactNativeJwt","require","_types","_verifier","_errors","decodeDisclosure","encoded","decoded","Disclosure","parse","JSON","decodeBase64","decode","token","customSchema","slice","rawSdJwt","rawDisclosures","split","decodedJwt","decodeJwt","parser","SdJwt4VC","sdJwt","header","protectedHeader","payload","disclosures","map","exports","disclose","claims","paths","Promise","all","claim","disclosure","find","_ref","name","ClaimsNotFoundBetweenDislosures","hash","sha256ToBase64","verified_claims","_sd","includes","index","indexOf","path","verification","ClaimsNotFoundInToken","filteredDisclosures","filter","d","disclosedToken","join","verify","publicKey","verifyJwt","verifyDisclosure"],"sourceRoot":"../../../src","sources":["sd-jwt/index.ts"],"mappings":";;;;;;;;;;;;AAEA,IAAAA,iBAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,SAAA,GAAAF,OAAA;AAEA,IAAAG,OAAA,GAAAH,OAAA;AAKA,MAAMI,gBAAgB,GAAIC,OAAe,IAA4B;EACnE,MAAMC,OAAO,GAAGC,iBAAU,CAACC,KAAK,CAACC,IAAI,CAACD,KAAK,CAAC,IAAAE,8BAAY,EAACL,OAAO,CAAC,CAAC,CAAC;EACnE,OAAO;IAAEC,OAAO;IAAED;EAAQ,CAAC;AAC7B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMM,MAAM,GAAGA,CACpBC,KAAa,EACbC,YAAgB,KAIb;EACH;EACA,IAA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,CAAC,CAACI,IAAI,CAAC,GAAG,CAAC;EAEnE,OAAO;IAAE1C,KAAK,EAAEyC,cAAc;IAAEtB;EAAM,CAAC;AACzC,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAfAH,OAAA,CAAAC,QAAA,GAAAA,QAAA;AAgBO,MAAM0B,MAAM,GAAG,MAAAA,CACpB3C,KAAa,EACb4C,SAAsB,EACtB3C,YAAgB,KAC8C;EAC9D;EACA,MAAM,CAACE,QAAQ,GAAG,EAAE,CAAC,GAAGH,KAAK,CAACK,KAAK,CAAC,GAAG,CAAC;EACxC,MAAMX,OAAO,GAAGK,MAAM,CAACC,KAAK,EAAEC,YAAY,CAAC;;EAE3C;EACA,MAAM,IAAA4C,wBAAS,EAAC1C,QAAQ,EAAEyC,SAAS,CAAC;;EAEpC;EACA,MAAM1B,MAAM,GAAG,CACb,GAAGxB,OAAO,CAACgB,KAAK,CAACG,OAAO,CAACiB,eAAe,CAACM,YAAY,CAACL,GAAG,EACzD,GAAGrC,OAAO,CAACgB,KAAK,CAACG,OAAO,CAACiB,eAAe,CAACZ,MAAM,CAACa,GAAG,CACpD;EAED,MAAMX,OAAO,CAACC,GAAG,CACf3B,OAAO,CAACoB,WAAW,CAACC,GAAG,CACrB,MAAOQ,UAAU,IAAK,MAAM,IAAAuB,0BAAgB,EAACvB,UAAU,EAAEL,MAAM,CACjE,CACF,CAAC;EAED,OAAO;IACLR,KAAK,EAAEhB,OAAO,CAACgB,KAAK;IACpBI,WAAW,EAAEpB,OAAO,CAACoB,WAAW,CAACC,GAAG,CAAEyB,CAAC,IAAKA,CAAC,CAAC9C,OAAO;EACvD,CAAC;AACH,CAAC;AAACsB,OAAA,CAAA2B,MAAA,GAAAA,MAAA"}
@@ -27,7 +27,7 @@ const Disclosure = _zod.z.tuple([/* salt */_zod.z.string(), /* claim name */_zod
27
27
  * For such reason, we may find conveninent to have encoded and decode values stored explicitly in the same structure.
28
28
  * Please note that `encoded` can always decode into `decode`, but `decode` may or may not be encoded with the same value of `encoded`
29
29
  *
30
- * @see https://www.ietf.org/id/draft-ietf-oauth-selective-disclosure-jwt-05.html#name-disclosures-for-object-prop
30
+ * @see https://www.ietf.org/archive/id/draft-ietf-oauth-selective-disclosure-jwt-05.html#name-disclosures-for-object-prop
31
31
  */
32
32
  exports.Disclosure = Disclosure;
33
33
  const SdJwt4VC = _zod.z.object({
@@ -81,6 +81,10 @@ const EntityConfigurationHeader = z.object({
81
81
  alg: z.string(),
82
82
  kid: z.string()
83
83
  });
84
+
85
+ /**
86
+ * @see https://openid.net/specs/openid-connect-federation-1_0-29.html#name-federation-entity
87
+ */
84
88
  exports.EntityConfigurationHeader = EntityConfigurationHeader;
85
89
  const FederationEntityMetadata = z.object({
86
90
  federation_fetch_endpoint: z.string().optional(),
@@ -88,6 +92,7 @@ const FederationEntityMetadata = z.object({
88
92
  federation_resolve_endpoint: z.string().optional(),
89
93
  federation_trust_mark_status_endpoint: z.string().optional(),
90
94
  federation_trust_mark_list_endpoint: z.string().optional(),
95
+ organization_name: z.string().optional(),
91
96
  homepage_uri: z.string().optional(),
92
97
  policy_uri: z.string().optional(),
93
98
  logo_uri: z.string().optional(),
@@ -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","TrustMark","object","id","string","trust_mark","exports","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","JWK","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialDefinitionMetadata","type","credentialSubject","record","mandatory","boolean","display","SupportedCredentialMetadata","format","literal","cryptographic_binding_methods_supported","cryptographic_suites_supported","credential_definition","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","UnixTime","metadata","federation_entity","authority_hints","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","wallet_relying_party","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","attested_security_context_values_supported","grant_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","EntityConfiguration","union","description"],"sourceRoot":"../../../src","sources":["trust/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,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAA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AAgD,EAAE3G,CAAC,CAACqC,KAAK,CACvDrC,CAAC,CAAC2B,MAAM,CAAC,CACX,CAAC;QACDQ,IAAI,EAAEnC,CAAC,CAACyB,MAAM,CAAC;UAAEW,IAAI,EAAEpC,CAAC,CAACqC,KAAK,CAACC,QAAG;QAAE,CAAC;MACvC,CAAC,CAAC,CACD6C,WAAW,CAAC;IACjB,CAAC;EACH,CAAC;AACH,CAAC,CACH,CAAC;;AAED;AAAAtD,OAAA,CAAAyE,iCAAA,GAAAA,iCAAA;AAEO,MAAMM,mBAAmB,GAAG5G,CAAC,CAAC6G,KAAK,CACxC,CACEP,iCAAiC,EACjCZ,mCAAmC,EACnCD,8BAA8B,EAC9BY,+BAA+B,CAChC,EACD;EACES,WAAW,EAAE;AACf,CACF,CAAC;AAACjF,OAAA,CAAA+E,mBAAA,GAAAA,mBAAA"}
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","TrustMark","object","id","string","trust_mark","exports","RelyingPartyMetadata","application_type","optional","client_id","client_name","jwks","keys","array","JWK","contacts","CredentialDisplayMetadata","name","locale","logo","url","alt_text","background_color","text_color","CredentialDefinitionMetadata","type","credentialSubject","record","mandatory","boolean","display","SupportedCredentialMetadata","format","literal","cryptographic_binding_methods_supported","cryptographic_suites_supported","credential_definition","EntityStatement","header","typ","alg","kid","payload","iss","sub","trust_marks","iat","number","exp","EntityConfigurationHeader","FederationEntityMetadata","federation_fetch_endpoint","federation_list_endpoint","federation_resolve_endpoint","federation_trust_mark_status_endpoint","federation_trust_mark_list_endpoint","organization_name","homepage_uri","policy_uri","logo_uri","passthrough","BaseEntityConfiguration","UnixTime","metadata","federation_entity","authority_hints","TrustAnchorEntityConfiguration","CredentialIssuerEntityConfiguration","and","openid_credential_issuer","credential_issuer","authorization_endpoint","token_endpoint","pushed_authorization_request_endpoint","dpop_signing_alg_values_supported","credential_endpoint","credentials_supported","wallet_relying_party","RelyingPartyEntityConfiguration","WalletProviderEntityConfiguration","wallet_provider","attested_security_context_values_supported","grant_types_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","EntityConfiguration","union","description"],"sourceRoot":"../../../src","sources":["trust/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,UAAAG,KAAA,GAAAR,wBAAA,CAAAC,WAAA,OAAAO,KAAA,IAAAA,KAAA,CAAAC,GAAA,CAAAJ,GAAA,YAAAG,KAAA,CAAAE,GAAA,CAAAL,GAAA,SAAAM,MAAA,WAAAC,qBAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,GAAA,IAAAX,GAAA,QAAAW,GAAA,kBAAAH,MAAA,CAAAI,SAAA,CAAAC,cAAA,CAAAC,IAAA,CAAAd,GAAA,EAAAW,GAAA,SAAAI,IAAA,GAAAR,qBAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAV,GAAA,EAAAW,GAAA,cAAAI,IAAA,KAAAA,IAAA,CAAAV,GAAA,IAAAU,IAAA,CAAAC,G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