@pagopa/io-react-native-wallet 0.12.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (205) hide show
  1. package/lib/commonjs/client/generated/wallet-provider.js +22 -22
  2. package/lib/commonjs/client/generated/wallet-provider.js.map +1 -1
  3. package/lib/commonjs/client/index.js +1 -2
  4. package/lib/commonjs/client/index.js.map +1 -1
  5. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js +2 -1
  6. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js.map +1 -1
  7. package/lib/commonjs/credential/issuance/03-start-credential-issuance.js +287 -0
  8. package/lib/commonjs/credential/issuance/03-start-credential-issuance.js.map +1 -0
  9. package/lib/commonjs/credential/issuance/03-start-user-authorization.js +56 -83
  10. package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -1
  11. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +88 -0
  12. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -1
  13. package/lib/commonjs/credential/issuance/05-authorize-access.js +56 -33
  14. package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
  15. package/lib/commonjs/credential/issuance/06-obtain-credential.js +51 -78
  16. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  17. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js +21 -44
  18. package/lib/commonjs/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  19. package/lib/commonjs/credential/issuance/index.js +7 -0
  20. package/lib/commonjs/credential/issuance/index.js.map +1 -1
  21. package/lib/commonjs/credential/issuance/types.js +28 -0
  22. package/lib/commonjs/credential/issuance/types.js.map +1 -0
  23. package/lib/commonjs/index.js.map +1 -1
  24. package/lib/commonjs/pid/sd-jwt/converters.js +5 -9
  25. package/lib/commonjs/pid/sd-jwt/converters.js.map +1 -1
  26. package/lib/commonjs/pid/sd-jwt/types.js +3 -3
  27. package/lib/commonjs/pid/sd-jwt/types.js.map +1 -1
  28. package/lib/commonjs/sd-jwt/__test__/converters.test.js +1 -1
  29. package/lib/commonjs/sd-jwt/__test__/converters.test.js.map +1 -1
  30. package/lib/commonjs/sd-jwt/__test__/index.test.js +30 -43
  31. package/lib/commonjs/sd-jwt/__test__/index.test.js.map +1 -1
  32. package/lib/commonjs/sd-jwt/__test__/types.test.js +16 -24
  33. package/lib/commonjs/sd-jwt/__test__/types.test.js.map +1 -1
  34. package/lib/commonjs/sd-jwt/index.js +3 -9
  35. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  36. package/lib/commonjs/sd-jwt/types.js +11 -16
  37. package/lib/commonjs/sd-jwt/types.js.map +1 -1
  38. package/lib/commonjs/trust/types.js +70 -29
  39. package/lib/commonjs/trust/types.js.map +1 -1
  40. package/lib/commonjs/utils/auth.js +44 -0
  41. package/lib/commonjs/utils/auth.js.map +1 -0
  42. package/lib/commonjs/utils/errors.js +77 -2
  43. package/lib/commonjs/utils/errors.js.map +1 -1
  44. package/lib/commonjs/utils/misc.js +34 -1
  45. package/lib/commonjs/utils/misc.js.map +1 -1
  46. package/lib/commonjs/utils/par.js +23 -15
  47. package/lib/commonjs/utils/par.js.map +1 -1
  48. package/lib/commonjs/utils/pop.js +33 -0
  49. package/lib/commonjs/utils/pop.js.map +1 -0
  50. package/lib/commonjs/wallet-instance-attestation/issuing.js +17 -2
  51. package/lib/commonjs/wallet-instance-attestation/issuing.js.map +1 -1
  52. package/lib/commonjs/wallet-instance-attestation/types.js +7 -7
  53. package/lib/commonjs/wallet-instance-attestation/types.js.map +1 -1
  54. package/lib/module/client/generated/wallet-provider.js +16 -19
  55. package/lib/module/client/generated/wallet-provider.js.map +1 -1
  56. package/lib/module/client/index.js +1 -2
  57. package/lib/module/client/index.js.map +1 -1
  58. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +2 -1
  59. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +1 -1
  60. package/lib/module/credential/issuance/03-start-credential-issuance.js +276 -0
  61. package/lib/module/credential/issuance/03-start-credential-issuance.js.map +1 -0
  62. package/lib/module/credential/issuance/03-start-user-authorization.js +56 -80
  63. package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -1
  64. package/lib/module/credential/issuance/04-complete-user-authorization.js +85 -1
  65. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -1
  66. package/lib/module/credential/issuance/05-authorize-access.js +54 -33
  67. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
  68. package/lib/module/credential/issuance/06-obtain-credential.js +50 -75
  69. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  70. package/lib/module/credential/issuance/07-verify-and-parse-credential.js +21 -44
  71. package/lib/module/credential/issuance/07-verify-and-parse-credential.js.map +1 -1
  72. package/lib/module/credential/issuance/index.js +2 -1
  73. package/lib/module/credential/issuance/index.js.map +1 -1
  74. package/lib/module/credential/issuance/types.js +18 -0
  75. package/lib/module/credential/issuance/types.js.map +1 -0
  76. package/lib/module/index.js.map +1 -1
  77. package/lib/module/pid/sd-jwt/converters.js +5 -9
  78. package/lib/module/pid/sd-jwt/converters.js.map +1 -1
  79. package/lib/module/pid/sd-jwt/types.js +3 -3
  80. package/lib/module/pid/sd-jwt/types.js.map +1 -1
  81. package/lib/module/sd-jwt/__test__/converters.test.js +1 -1
  82. package/lib/module/sd-jwt/__test__/converters.test.js.map +1 -1
  83. package/lib/module/sd-jwt/__test__/index.test.js +30 -43
  84. package/lib/module/sd-jwt/__test__/index.test.js.map +1 -1
  85. package/lib/module/sd-jwt/__test__/types.test.js +16 -24
  86. package/lib/module/sd-jwt/__test__/types.test.js.map +1 -1
  87. package/lib/module/sd-jwt/index.js +3 -9
  88. package/lib/module/sd-jwt/index.js.map +1 -1
  89. package/lib/module/sd-jwt/types.js +11 -16
  90. package/lib/module/sd-jwt/types.js.map +1 -1
  91. package/lib/module/sd-jwt/verifier.js.map +1 -1
  92. package/lib/module/trust/types.js +70 -29
  93. package/lib/module/trust/types.js.map +1 -1
  94. package/lib/module/utils/auth.js +35 -0
  95. package/lib/module/utils/auth.js.map +1 -0
  96. package/lib/module/utils/errors.js +71 -0
  97. package/lib/module/utils/errors.js.map +1 -1
  98. package/lib/module/utils/misc.js +31 -0
  99. package/lib/module/utils/misc.js.map +1 -1
  100. package/lib/module/utils/par.js +24 -16
  101. package/lib/module/utils/par.js.map +1 -1
  102. package/lib/module/utils/pop.js +24 -0
  103. package/lib/module/utils/pop.js.map +1 -0
  104. package/lib/module/wallet-instance-attestation/issuing.js +17 -2
  105. package/lib/module/wallet-instance-attestation/issuing.js.map +1 -1
  106. package/lib/module/wallet-instance-attestation/types.js +7 -7
  107. package/lib/module/wallet-instance-attestation/types.js.map +1 -1
  108. package/lib/typescript/client/generated/wallet-provider.d.ts +35 -13
  109. package/lib/typescript/client/generated/wallet-provider.d.ts.map +1 -1
  110. package/lib/typescript/client/index.d.ts.map +1 -1
  111. package/lib/typescript/credential/issuance/01-start-flow.d.ts +1 -0
  112. package/lib/typescript/credential/issuance/01-start-flow.d.ts.map +1 -1
  113. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts +2 -1
  114. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +1 -1
  115. package/lib/typescript/credential/issuance/03-start-credential-issuance.d.ts +41 -0
  116. package/lib/typescript/credential/issuance/03-start-credential-issuance.d.ts.map +1 -0
  117. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +23 -18
  118. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -1
  119. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +24 -12
  120. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -1
  121. package/lib/typescript/credential/issuance/05-authorize-access.d.ts +22 -16
  122. package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -1
  123. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +19 -26
  124. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  125. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts +10 -15
  126. package/lib/typescript/credential/issuance/07-verify-and-parse-credential.d.ts.map +1 -1
  127. package/lib/typescript/credential/issuance/index.d.ts +3 -4
  128. package/lib/typescript/credential/issuance/index.d.ts.map +1 -1
  129. package/lib/typescript/credential/issuance/types.d.ts +63 -0
  130. package/lib/typescript/credential/issuance/types.d.ts.map +1 -0
  131. package/lib/typescript/credential/presentation/types.d.ts +6 -6
  132. package/lib/typescript/index.d.ts +2 -1
  133. package/lib/typescript/index.d.ts.map +1 -1
  134. package/lib/typescript/pid/sd-jwt/converters.d.ts.map +1 -1
  135. package/lib/typescript/pid/sd-jwt/types.d.ts +36 -36
  136. package/lib/typescript/pid/sd-jwt/types.d.ts.map +1 -1
  137. package/lib/typescript/sd-jwt/index.d.ts +40 -68
  138. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  139. package/lib/typescript/sd-jwt/types.d.ts +64 -121
  140. package/lib/typescript/sd-jwt/types.d.ts.map +1 -1
  141. package/lib/typescript/trust/index.d.ts +150 -48
  142. package/lib/typescript/trust/index.d.ts.map +1 -1
  143. package/lib/typescript/trust/types.d.ts +2838 -1740
  144. package/lib/typescript/trust/types.d.ts.map +1 -1
  145. package/lib/typescript/utils/auth.d.ts +52 -0
  146. package/lib/typescript/utils/auth.d.ts.map +1 -0
  147. package/lib/typescript/utils/errors.d.ts +36 -1
  148. package/lib/typescript/utils/errors.d.ts.map +1 -1
  149. package/lib/typescript/utils/integrity.d.ts +1 -1
  150. package/lib/typescript/utils/misc.d.ts +18 -0
  151. package/lib/typescript/utils/misc.d.ts.map +1 -1
  152. package/lib/typescript/utils/par.d.ts +8 -31
  153. package/lib/typescript/utils/par.d.ts.map +1 -1
  154. package/lib/typescript/utils/pop.d.ts +26 -0
  155. package/lib/typescript/utils/pop.d.ts.map +1 -0
  156. package/lib/typescript/wallet-instance-attestation/issuing.d.ts +2 -1
  157. package/lib/typescript/wallet-instance-attestation/issuing.d.ts.map +1 -1
  158. package/lib/typescript/wallet-instance-attestation/types.d.ts +59 -59
  159. package/lib/typescript/wallet-instance-attestation/types.d.ts.map +1 -1
  160. package/package.json +2 -1
  161. package/src/client/generated/wallet-provider.ts +24 -21
  162. package/src/client/index.ts +3 -8
  163. package/src/credential/issuance/01-start-flow.ts +1 -0
  164. package/src/credential/issuance/02-evaluate-issuer-trust.ts +2 -1
  165. package/src/credential/issuance/03-start-credential-issuance.ts +407 -0
  166. package/src/credential/issuance/03-start-user-authorization.ts +91 -92
  167. package/src/credential/issuance/04-complete-user-authorization.ts +114 -13
  168. package/src/credential/issuance/05-authorize-access.ts +74 -49
  169. package/src/credential/issuance/06-obtain-credential.ts +77 -111
  170. package/src/credential/issuance/07-verify-and-parse-credential.ts +30 -67
  171. package/src/credential/issuance/index.ts +6 -4
  172. package/src/credential/issuance/types.ts +25 -0
  173. package/src/index.ts +2 -1
  174. package/src/pid/sd-jwt/converters.ts +5 -11
  175. package/src/pid/sd-jwt/types.ts +8 -6
  176. package/src/sd-jwt/__test__/converters.test.ts +1 -1
  177. package/src/sd-jwt/__test__/index.test.ts +45 -74
  178. package/src/sd-jwt/__test__/types.test.ts +21 -33
  179. package/src/sd-jwt/index.ts +3 -12
  180. package/src/sd-jwt/types.ts +17 -22
  181. package/src/trust/types.ts +64 -32
  182. package/src/utils/auth.ts +37 -0
  183. package/src/utils/errors.ts +85 -1
  184. package/src/utils/integrity.ts +1 -1
  185. package/src/utils/misc.ts +43 -0
  186. package/src/utils/par.ts +29 -17
  187. package/src/utils/pop.ts +34 -0
  188. package/src/wallet-instance-attestation/issuing.ts +39 -2
  189. package/src/wallet-instance-attestation/types.ts +11 -7
  190. package/lib/commonjs/credential/issuance/07-confirm-credential.js +0 -6
  191. package/lib/commonjs/credential/issuance/07-confirm-credential.js.map +0 -1
  192. package/lib/commonjs/credential/issuance/08-confirm-credential.js +0 -6
  193. package/lib/commonjs/credential/issuance/08-confirm-credential.js.map +0 -1
  194. package/lib/module/credential/issuance/07-confirm-credential.js +0 -2
  195. package/lib/module/credential/issuance/07-confirm-credential.js.map +0 -1
  196. package/lib/module/credential/issuance/08-confirm-credential.js +0 -2
  197. package/lib/module/credential/issuance/08-confirm-credential.js.map +0 -1
  198. package/lib/typescript/credential/issuance/07-confirm-credential.d.ts +0 -11
  199. package/lib/typescript/credential/issuance/07-confirm-credential.d.ts.map +0 -1
  200. package/lib/typescript/credential/issuance/08-confirm-credential.d.ts +0 -11
  201. package/lib/typescript/credential/issuance/08-confirm-credential.d.ts.map +0 -1
  202. package/src/credential/issuance/07-confirm-credential.ts +0 -14
  203. package/src/credential/issuance/08-confirm-credential.ts +0 -14
  204. package/src/sd-jwt/__test__/converters.test.js +0 -24
  205. package/src/sd-jwt/verifier.js +0 -12
@@ -4,107 +4,80 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.obtainCredential = exports.createNonceProof = void 0;
7
- var z = _interopRequireWildcard(require("zod"));
8
- var _reactNativeUuid = _interopRequireDefault(require("react-native-uuid"));
9
7
  var _ioReactNativeJwt = require("@pagopa/io-react-native-jwt");
10
- var _dpop = require("../../utils/dpop");
11
- var _misc = require("../../utils/misc");
12
- var _const = require("./const");
13
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
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); }
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; }
16
- /**
17
- * Return the signed jwt for nonce proof of possession
18
- */
8
+ var _misc = require("../../../src/utils/misc");
9
+ var _errors = require("../../../src/utils/errors");
10
+ var _types = require("./types");
19
11
  const createNonceProof = async (nonce, issuer, audience, ctx) => {
12
+ const jwk = await ctx.getPublicKey();
20
13
  return new _ioReactNativeJwt.SignJWT(ctx).setPayload({
21
- nonce,
22
- jwk: await ctx.getPublicKey()
14
+ nonce
23
15
  }).setProtectedHeader({
24
- type: "openid4vci-proof+jwt"
25
- }).setAudience(audience).setIssuer(issuer).setIssuedAt().setExpirationTime("1h").sign();
16
+ typ: "openid4vci-proof+jwt",
17
+ jwk
18
+ }).setAudience(audience).setIssuer(issuer).setIssuedAt().setExpirationTime("5min").sign();
26
19
  };
27
- exports.createNonceProof = createNonceProof;
28
- const CredentialEndpointResponse = z.object({
29
- credential: z.string(),
30
- format: _const.SupportedCredentialFormat,
31
- // nonce used to perform multiple credential requests
32
- // re-using the same authorization profile
33
- c_nonce: z.string(),
34
- c_nonce_expires_in: z.number()
35
- });
36
- // Checks whether in the Entity confoguration at least one credential
37
- // is defined for the given type and format
38
- const isCredentialAvailable = (issuerConf, credentialType, credentialFormat) => issuerConf.openid_credential_issuer.credentials_supported.some(c => c.format === credentialFormat && c.credential_definition.type.includes(credentialType));
39
20
 
40
21
  /**
41
- * Fetch a credential from the issuer
42
- *
43
- * @param issuerConf The Issuer configuration
44
- * @param accessToken The access token to grant access to the credential, obtained with the access authorization step
45
- * @param nonce The nonce value to prevent reply attacks, obtained with the access authorization step
46
- * @param clientId Identifies the current client across all the requests of the issuing flow
47
- * @param credentialType The type of the credential to be requested
48
- * @param credentialFormat The format of the requested credential. @see {SupportedCredentialFormat}
49
- * @param context.credentialCryptoContext The context to access the key the Credential will be bound to
50
- * @param context.walletProviderBaseUrl The base url of the Wallet Provider
22
+ * Obtains the credential from the issuer.
23
+ * The key pair of the credentialCryptoContext is used for Openid4vci proof JWT to be presented with the Access Token and the DPoP Proof JWT at the Credential Endpoint
24
+ * of the Credential Issuer to request the issuance of a credential linked to the public key contained in the JWT proof.
25
+ * The Openid4vci proof JWT incapsulates the nonce extracted from the token response from the {@link authorizeAccess} step.
26
+ * The credential request is sent to the Credential Endpoint of the Credential Issuer via HTTP POST with the type of the credential, its format, the access token and the JWT proof.
27
+ * @param issuerConf The issuer configuration returned by {@link evaluateIssuerTrust}
28
+ * @param accessToken The access token response returned by {@link authorizeAccess}
29
+ * @param clientId The client id returned by {@link startUserAuthorization}
30
+ * @param credentialDefinition The credential definition of the credential to be obtained returned by {@link startUserAuthorization}
31
+ * @param tokenRequestSignedDPop The DPoP signed token request returned by {@link authorizeAccess}
32
+ * @param context.credentialCryptoContext The crypto context used to obtain the credential
51
33
  * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
52
- * @returns The signed credential token
34
+ * @returns The credential response containing the credential
53
35
  */
54
- const obtainCredential = async (issuerConf, accessToken, nonce, clientId, credentialType, credentialFormat, context) => {
36
+ exports.createNonceProof = createNonceProof;
37
+ const obtainCredential = async (issuerConf, accessToken, clientId, credentialDefinition, tokenRequestSignedDPop, context) => {
55
38
  const {
56
39
  credentialCryptoContext,
57
- walletProviderBaseUrl,
58
40
  appFetch = fetch
59
41
  } = context;
60
- if (!isCredentialAvailable(issuerConf, credentialType, credentialFormat)) {
61
- throw new Error(`The Issuer provides no credential for type ${credentialType} and format ${credentialFormat}`);
62
- }
63
42
  const credentialUrl = issuerConf.openid_credential_issuer.credential_endpoint;
64
43
 
65
- /** DPoP token for demonstating the possession
66
- of the key that will bind the holder User with the Credential
67
- @see https://datatracker.ietf.org/doc/html/rfc9449 */
68
- const signedDPopForPid = await (0, _dpop.createDPopToken)({
69
- htm: "POST",
70
- htu: credentialUrl,
71
- jti: `${_reactNativeUuid.default.v4()}`
72
- }, credentialCryptoContext);
44
+ /**
45
+ * JWT proof token to bind the request nonce to the key that will bind the holder User with the Credential
46
+ * This is presented along with the access token to the Credential Endpoint as proof of possession of the private key used to sign the Access Token.
47
+ * @see https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-proof-types
48
+ */
49
+ const signedNonceProof = await createNonceProof(accessToken.c_nonce, clientId, credentialUrl, credentialCryptoContext);
73
50
 
74
- /** JWT proof token to bind the request nonce
75
- to the key that will bind the holder User with the Credential
76
- @see https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-proof-types */
77
- const signedNonceProof = await createNonceProof(nonce, clientId, walletProviderBaseUrl, credentialCryptoContext);
51
+ // Validation of accessTokenResponse.authorization_details if contain credentialDefinition
52
+ const constainsCredentialDefinition = accessToken.authorization_details.some(c => c.credential_configuration_id === credentialDefinition.credential_configuration_id && c.format === credentialDefinition.format && c.type === credentialDefinition.type);
53
+ if (!constainsCredentialDefinition) {
54
+ throw new _errors.ValidationFailed("The access token response does not contain the requested credential");
55
+ }
78
56
 
79
57
  /** The credential request body */
80
- const formBody = new URLSearchParams({
81
- credential_definition: JSON.stringify({
82
- type: [credentialType]
83
- }),
84
- format: credentialFormat,
85
- proof: JSON.stringify({
58
+ const credentialRequestFormBody = {
59
+ credential_definition: {
60
+ type: [credentialDefinition.credential_configuration_id]
61
+ },
62
+ format: credentialDefinition.format,
63
+ proof: {
86
64
  jwt: signedNonceProof,
87
65
  proof_type: "jwt"
88
- })
89
- });
90
- const {
91
- credential,
92
- format,
93
- c_nonce
94
- } = await appFetch(credentialUrl, {
66
+ }
67
+ };
68
+ const credentialRes = await appFetch(credentialUrl, {
95
69
  method: "POST",
96
70
  headers: {
97
- "Content-Type": "application/x-www-form-urlencoded",
98
- DPoP: signedDPopForPid,
99
- Authorization: accessToken
71
+ "Content-Type": "application/json",
72
+ DPoP: tokenRequestSignedDPop,
73
+ Authorization: `${accessToken.token_type} ${accessToken.access_token}`
100
74
  },
101
- body: formBody.toString()
102
- }).then((0, _misc.hasStatus)(200)).then(res => res.json()).then(CredentialEndpointResponse.parse);
103
- return {
104
- credential,
105
- format,
106
- nonce: c_nonce
107
- };
75
+ body: JSON.stringify(credentialRequestFormBody)
76
+ }).then((0, _misc.hasStatus)(200)).then(res => res.json()).then(body => _types.CredentialResponse.safeParse(body));
77
+ if (!credentialRes.success) {
78
+ throw new _errors.ValidationFailed(credentialRes.error.message);
79
+ }
80
+ return credentialRes.data;
108
81
  };
109
82
  exports.obtainCredential = obtainCredential;
110
83
  //# sourceMappingURL=06-obtain-credential.js.map
@@ -1 +1 @@
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","c_nonce","c_nonce_expires_in","number","isCredentialAvailable","issuerConf","credentialType","credentialFormat","openid_credential_issuer","credentials_supported","some","c","credential_definition","includes","obtainCredential","accessToken","clientId","context","credentialCryptoContext","walletProviderBaseUrl","appFetch","fetch","Error","credentialUrl","credential_endpoint","signedDPopForPid","createDPopToken","htm","htu","jti","uuid","v4","signedNonceProof","formBody","URLSearchParams","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;A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Ac,EAAE,mCAAmC;MACnDC,IAAI,EAAEjB,gBAAgB;MACtBkB,aAAa,EAAE5B;IACjB,CAAC;IACD6B,IAAI,EAAEX,QAAQ,CAACY,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,CAACnD,0BAA0B,CAACuD,KAAK,CAAC;EAEzC,OAAO;IAAErD,UAAU;IAAEE,MAAM;IAAEpB,KAAK,EAAEsB;EAAQ,CAAC;AAC/C,CAAC;AAACP,OAAA,CAAAoB,gBAAA,GAAAA,gBAAA"}
1
+ {"version":3,"names":["_ioReactNativeJwt","require","_misc","_errors","_types","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","SignJWT","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","exports","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","tokenRequestSignedDPop","context","credentialCryptoContext","appFetch","fetch","credentialUrl","openid_credential_issuer","credential_endpoint","signedNonceProof","c_nonce","constainsCredentialDefinition","authorization_details","some","c","credential_configuration_id","format","type","ValidationFailed","credentialRequestFormBody","credential_definition","proof","jwt","proof_type","credentialRes","method","headers","DPoP","Authorization","token_type","access_token","body","JSON","stringify","then","hasStatus","res","json","CredentialResponse","safeParse","success","error","message","data"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":";;;;;;AAAA,IAAAA,iBAAA,GAAAC,OAAA;AAGA,IAAAC,KAAA,GAAAD,OAAA;AAEA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAcO,MAAMI,gBAAgB,GAAG,MAAAA,CAC9BC,KAAa,EACbC,MAAc,EACdC,QAAgB,EAChBC,GAAkB,KACE;EACpB,MAAMC,GAAG,GAAG,MAAMD,GAAG,C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IAChCC,qBAAqB,EAAE;MACrBH,IAAI,EAAE,CAACjB,oBAAoB,CAACe,2BAA2B;IACzD,CAAC;IACDC,MAAM,EAAEhB,oBAAoB,CAACgB,MAAM;IACnCK,KAAK,EAAE;MACLC,GAAG,EAAEb,gBAAgB;MACrBc,UAAU,EAAE;IACd;EACF,CAAC;EAED,MAAMC,aAAa,GAAG,MAAMpB,QAAQ,CAACE,aAAa,EAAE;IAClDmB,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MACP,cAAc,EAAE,kBAAkB;MAClCC,IAAI,EAAE1B,sBAAsB;MAC5B2B,aAAa,EAAG,GAAE9B,WAAW,CAAC+B,UAAW,IAAG/B,WAAW,CAACgC,YAAa;IACvE,CAAC;IACDC,IAAI,EAAEC,IAAI,CAACC,SAAS,CAACd,yBAAyB;EAChD,CAAC,CAAC,CACCe,IAAI,CAAC,IAAAC,eAAS,EAAC,GAAG,CAAC,CAAC,CACpBD,IAAI,CAAEE,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBH,IAAI,CAAEH,IAAI,IAAKO,yBAAkB,CAACC,SAAS,CAACR,IAAI,CAAC,CAAC;EAErD,IAAI,CAACP,aAAa,CAACgB,OAAO,EAAE;IAC1B,MAAM,IAAItB,wBAAgB,CAACM,aAAa,CAACiB,KAAK,CAACC,OAAO,CAAC;EACzD;EAEA,OAAOlB,aAAa,CAACmB,IAAI;AAC3B,CAAC;AAAChD,OAAA,CAAAC,gBAAA,GAAAA,gBAAA"}
@@ -11,33 +11,26 @@ var _sdJwt = require("../../sd-jwt");
11
11
 
12
12
  // handy alias
13
13
 
14
- const parseCredentialSdJwt = function (credentials_supported, _ref) {
15
- var _credentials_supporte;
14
+ const parseCredentialSdJwt = (credentials_supported, _ref) => {
16
15
  let {
17
16
  sdJwt,
18
17
  disclosures
19
18
  } = _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.format === "vc+sd-jwt" && 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
19
+ const credentialSubject = credentials_supported[sdJwt.payload.vct];
26
20
  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}', `);
21
+ throw new _errors.IoWalletError("Credential type not supported by the issuer");
22
+ }
23
+ if (credentialSubject.format !== sdJwt.header.typ) {
24
+ throw new _errors.IoWalletError(`Received credential is of an unknwown type. Expected one of [${credentialSubject.format}], received '${sdJwt.header.typ}', `);
29
25
  }
30
26
 
31
27
  // transfrom a record { key: value } in an iterable of pairs [key, value]
32
- const attrDefinitions = Object.entries(credentialSubject);
28
+ const attrDefinitions = Object.entries(credentialSubject.claims);
33
29
 
34
- // every mandatory attribute must be present in the credential's disclosures
35
30
  // the key of the attribute defintion must match the disclosure's name
36
31
  const attrsNotInDisclosures = attrDefinitions.filter(_ref2 => {
37
- let [attrKey, {
38
- mandatory
39
- }] = _ref2;
40
- return mandatory && !disclosures.some(_ref3 => {
32
+ let [attrKey] = _ref2;
33
+ return !disclosures.some(_ref3 => {
41
34
  let [, name] = _ref3;
42
35
  return name === attrKey;
43
36
  });
@@ -45,12 +38,7 @@ const parseCredentialSdJwt = function (credentials_supported, _ref) {
45
38
  if (attrsNotInDisclosures.length > 0) {
46
39
  const missing = attrsNotInDisclosures.map(_ => _[0 /* key */]).join(", ");
47
40
  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
- }
41
+ throw new _errors.IoWalletError(`Some attributes are missing in the credential. Missing: [${missing}], received: [${received}]`);
54
42
  }
55
43
 
56
44
  // attributes that are defined in the issuer configuration
@@ -93,7 +81,6 @@ const parseCredentialSdJwt = function (credentials_supported, _ref) {
93
81
  let [, key, value] = _ref7;
94
82
  return [key, {
95
83
  value,
96
- mandatory: false,
97
84
  name: key
98
85
  }];
99
86
  }));
@@ -135,41 +122,31 @@ async function verifyCredentialSdJwt(rawCredential, issuerKeys, holderBindingCon
135
122
 
136
123
  const verifyAndParseCredentialSdJwt = async (issuerConf, credential, _, _ref8) => {
137
124
  let {
138
- credentialCryptoContext,
139
- ignoreMissingAttributes
125
+ credentialCryptoContext
140
126
  } = _ref8;
141
127
  const decoded = await verifyCredentialSdJwt(credential, issuerConf.openid_credential_issuer.jwks.keys, credentialCryptoContext);
142
- const parsedCredential = parseCredentialSdJwt(issuerConf.openid_credential_issuer.credentials_supported, decoded, ignoreMissingAttributes);
128
+ const parsedCredential = parseCredentialSdJwt(issuerConf.openid_credential_issuer.credential_configurations_supported, decoded);
143
129
  return {
144
130
  parsedCredential
145
131
  };
146
132
  };
147
- const verifyAndParseCredentialMdoc = async (_issuerConf, _credential, _, _ctx) => {
148
- // TODO: [SIW-686] decode MDOC credentials
149
- throw new Error("verifyAndParseCredentialMdoc not implemented yet");
150
- };
151
133
 
152
134
  /**
153
- * Verify and parse an encoded credential
154
- *
155
- * @param issuerConf The Issuer configuration
156
- * @param credential The encoded credential
157
- * @param format The format of the credentual
158
- * @param context.credentialCryptoContext The context to access the key the Credential will be bound to
159
- * @param context.ignoreMissingAttributes (optional) Whether to fail if a defined attribute is note present in the credentual. Default: false
135
+ * Verify and parse an encoded credential.
136
+ * @param issuerConf The Issuer configuration returned by {@link evaluateIssuerTrust}
137
+ * @param credential The encoded credential returned by {@link obtainCredential}
138
+ * @param format The format of the credentual returned by {@link obtainCredential}
139
+ * @param context.credentialCryptoContext The crypto context used to obtain the credential in {@link obtainCredential}
160
140
  * @returns A parsed credential with attributes in plain value
161
- * @throws If the credential signature is not verified with the Issuer key set
162
- * @throws If the credential is not bound to the provided user key
163
- * @throws If the credential data fail to parse
141
+ * @throws {IoWalletError} If the credential signature is not verified with the Issuer key set
142
+ * @throws {IoWalletError} If the credential is not bound to the provided user key
143
+ * @throws {IoWalletError} If the credential data fail to parse
164
144
  */
165
145
  const verifyAndParseCredential = async (issuerConf, credential, format, context) => {
166
146
  if (format === "vc+sd-jwt") {
167
147
  return verifyAndParseCredentialSdJwt(issuerConf, credential, format, context);
168
- } else if (format === "vc+mdoc-cbor") {
169
- return verifyAndParseCredentialMdoc(issuerConf, credential, format, context);
170
148
  }
171
- const _ = format;
172
- throw new _errors.IoWalletError(`Unsupported credential format: ${_}`);
149
+ throw new _errors.IoWalletError(`Unsupported credential format: ${format}`);
173
150
  };
174
151
  exports.verifyAndParseCredential = verifyAndParseCredential;
175
152
  //# sourceMappingURL=07-verify-and-parse-credential.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_errors","require","_types","_sdJwt","parseCredentialSdJwt","credentials_supported","_ref","_credentials_supporte","sdJwt","disclosures","ignoreMissingAttributes","arguments","length","undefined","credentialSubject","find","c","format","credential_definition","type","includes","payload","expected","flatMap","_","join","IoWalletError","attrDefinitions","Object","entries","attrsNotInDisclosures","filter","_ref2","attrKey","mandatory","some","_ref3","name","missing","map","received","definedValues","fromEntries","_ref4","_disclosures$find","definition","value","_ref5","display","reduce","names","_ref6","locale","undefinedValues","keys","_ref7","key","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","verifyAndParseCredentialMdoc","_issuerConf","_credential","_ctx","Error","verifyAndParseCredential","context","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D,MAAM,EACNqE,OACF,CAAC;EACH;EAEA,MAAM9D,CAAQ,GAAGP,MAAM;EACvB,MAAM,IAAIS,qBAAa,CAAE,kCAAiCF,CAAE,EAAC,CAAC;AAChE,CAAC;AAAC+D,OAAA,CAAAF,wBAAA,GAAAA,wBAAA"}
1
+ {"version":3,"names":["_errors","require","_types","_sdJwt","parseCredentialSdJwt","credentials_supported","_ref","sdJwt","disclosures","credentialSubject","payload","vct","IoWalletError","format","header","typ","attrDefinitions","Object","entries","claims","attrsNotInDisclosures","filter","_ref2","attrKey","some","_ref3","name","length","missing","map","_","join","received","definedValues","fromEntries","_ref4","_disclosures$find","definition","value","find","_ref5","display","reduce","names","_ref6","locale","undefinedValues","keys","includes","_ref7","key","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","credential_configurations_supported","verifyAndParseCredential","context","exports"],"sourceRoot":"../../../../src","sources":["credential/issuance/07-verify-and-parse-credential.ts"],"mappings":";;;;;;AAEA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AACA,IAAAE,MAAA,GAAAF,OAAA;AAcA;;AAkBA;;AAKA,MAAMG,oBAAoB,GAAGA,CAE3BC,qBAAgI,EAAAC,IAAA,KAE3G;EAAA,IADrB;IAAEC,KAAK;IAAEC;EAAoC,CAAC,GAAAF,IAAA;EAE9C,MAAMG,iBAAiB,GAAGJ,qBAAqB,CAACE,KAAK,CAACG,OAAO,CAACC,GAAG,CAAC;EAElE,IAAI,CAACF,iBAAiB,EAAE;IACtB,MAAM,IAAIG,qBAAa,CAAC,6CAA6C,CAAC;EACxE;EAEA,IAAIH,iBAAiB,CAACI,MAAM,KAAKN,KAAK,CAACO,MAAM,CAACC,GAAG,EAAE;IACjD,MAA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AACgE,OAAA,CAAAF,wBAAA,GAAAA,wBAAA"}
@@ -9,6 +9,12 @@ Object.defineProperty(exports, "authorizeAccess", {
9
9
  return _authorizeAccess.authorizeAccess;
10
10
  }
11
11
  });
12
+ Object.defineProperty(exports, "completeUserAuthorizationWithQueryMode", {
13
+ enumerable: true,
14
+ get: function () {
15
+ return _completeUserAuthorization.completeUserAuthorizationWithQueryMode;
16
+ }
17
+ });
12
18
  Object.defineProperty(exports, "evaluateIssuerTrust", {
13
19
  enumerable: true,
14
20
  get: function () {
@@ -35,6 +41,7 @@ Object.defineProperty(exports, "verifyAndParseCredential", {
35
41
  });
36
42
  var _evaluateIssuerTrust = require("./02-evaluate-issuer-trust");
37
43
  var _startUserAuthorization = require("./03-start-user-authorization");
44
+ var _completeUserAuthorization = require("./04-complete-user-authorization");
38
45
  var _authorizeAccess = require("./05-authorize-access");
39
46
  var _obtainCredential = require("./06-obtain-credential");
40
47
  var _verifyAndParseCredential = require("./07-verify-and-parse-credential");
@@ -1 +1 @@
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"}
1
+ {"version":3,"names":["_evaluateIssuerTrust","require","_startUserAuthorization","_completeUserAuthorization","_authorizeAccess","_obtainCredential","_verifyAndParseCredential"],"sourceRoot":"../../../../src","sources":["credential/issuance/index.ts"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,oBAAA,GAAAC,OAAA;AAIA,IAAAC,uBAAA,GAAAD,OAAA;AAIA,IAAAE,0BAAA,GAAAF,OAAA;AAIA,IAAAG,gBAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AAIA,IAAAK,yBAAA,GAAAL,OAAA"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.TokenResponse = exports.CredentialResponse = void 0;
7
+ var _par = require("../../utils/par");
8
+ var z = _interopRequireWildcard(require("zod"));
9
+ var _const = require("./const");
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
+ 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
+ const TokenResponse = z.object({
13
+ access_token: z.string(),
14
+ authorization_details: z.array(_par.AuthorizationDetail),
15
+ c_nonce: z.string(),
16
+ c_nonce_expires_in: z.number(),
17
+ expires_in: z.number(),
18
+ token_type: z.string()
19
+ });
20
+ exports.TokenResponse = TokenResponse;
21
+ const CredentialResponse = z.object({
22
+ c_nonce: z.string(),
23
+ c_nonce_expires_in: z.number(),
24
+ credential: z.string(),
25
+ format: _const.SupportedCredentialFormat
26
+ });
27
+ exports.CredentialResponse = CredentialResponse;
28
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_par","require","z","_interopRequireWildcard","_const","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","default","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","TokenResponse","object","access_token","string","authorization_details","array","AuthorizationDetail","c_nonce","c_nonce_expires_in","number","expires_in","token_type","exports","CredentialResponse","credential","format","SupportedCredentialFormat"],"sourceRoot":"../../../../src","sources":["credential/issuance/types.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AACA,IAAAC,CAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,MAAA,GAAAH,OAAA;AAAoD,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,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;AAI7C,MAAMW,aAAa,GAAGzB,CAAC,CAAC0B,MAAM,CAAC;EACpCC,YAAY,EAAE3B,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACxBC,qBAAqB,EAAE7B,CAAC,CAAC8B,KAAK,CAACC,wBAAmB,CAAC;EACnDC,OAAO,EAAEhC,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACnBK,kBAAkB,EAAEjC,CAAC,CAACkC,MAAM,CAAC,CAAC;EAC9BC,UAAU,EAAEnC,CAAC,CAACkC,MAAM,CAAC,CAAC;EACtBE,UAAU,EAAEpC,CAAC,CAAC4B,MAAM,CAAC;AACvB,CAAC,CAAC;AAACS,OAAA,CAAAZ,aAAA,GAAAA,aAAA;AAII,MAAMa,kBAAkB,GAAGtC,CAAC,CAAC0B,MAAM,CAAC;EACzCM,OAAO,EAAEhC,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACnBK,kBAAkB,EAAEjC,CAAC,CAACkC,MAAM,CAAC,CAAC;EAC9BK,UAAU,EAAEvC,CAAC,CAAC4B,MAAM,CAAC,CAAC;EACtBY,MAAM,EAAEC;AACV,CAAC,CAAC;AAACJ,OAAA,CAAAC,kBAAA,GAAAA,kBAAA"}
@@ -1 +1 @@
1
- {"version":3,"names":["_jwk","require","Credential","_interopRequireWildcard","exports","PID","SdJwt","Errors","WalletInstanceAttestation","Trust","WalletInstance","_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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAGAA,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,uBAAA,CAAAF,OAAA;AAAkCG,OAAA,CAAAE,KAAA,GAAAA,KAAA;AAClC,IAAAC,MAAA,GAAAJ,uBAAA,CAAAF,OAAA;AAAyCG,OAAA,CAAAG,MAAA,GAAAA,MAAA;AACzC,IAAAC,yBAAA,GAAAL,uBAAA,CAAAF,OAAA;AAA2EG,OAAA,CAAAI,yBAAA,GAAAA,yBAAA;AAC3E,IAAAC,KAAA,GAAAN,uBAAA,CAAAF,OAAA;AAAiCG,OAAA,CAAAK,KAAA,GAAAA,KAAA;AACjC,IAAAC,cAAA,GAAAP,uBAAA,CAAAF,OAAA;AAAoDG,OAAA,CAAAM,cAAA,GAAAA,cAAA;AACpD,IAAAC,IAAA,GAAAV,OAAA;AACA,IAAAW,OAAA,GAAAX,OAAA;AAAwD,SAAAY,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,SAAAX,wBAAAe,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":["_jwk","require","Credential","_interopRequireWildcard","exports","PID","SdJwt","Errors","WalletInstanceAttestation","Trust","WalletInstance","_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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,IAAAA,IAAA,GAAAC,OAAA;AAGAA,OAAA;AAEA,IAAAC,UAAA,GAAAC,uBAAA,CAAAF,OAAA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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"}
@@ -7,22 +7,18 @@ exports.pidFromToken = pidFromToken;
7
7
  var _converters = require("../../sd-jwt/converters");
8
8
  var _types = require("./types");
9
9
  function pidFromToken(sdJwt, disclosures) {
10
+ const placeOfBirth = (0, _converters.getValueFromDisclosures)(disclosures, "place_of_birth");
10
11
  return _types.PID.parse({
11
12
  issuer: sdJwt.payload.iss,
12
- issuedAt: new Date(sdJwt.payload.iat * 1000),
13
+ issuedAt: new Date((0, _converters.getValueFromDisclosures)(disclosures, "iat") * 1000),
13
14
  expiration: new Date(sdJwt.payload.exp * 1000),
14
- verification: {
15
- trustFramework: sdJwt.payload.verified_claims.verification.trust_framework,
16
- assuranceLevel: sdJwt.payload.verified_claims.verification.assurance_level,
17
- evidence: (0, _converters.getValueFromDisclosures)(disclosures, "evidence")
18
- },
19
15
  claims: {
20
16
  uniqueId: (0, _converters.getValueFromDisclosures)(disclosures, "unique_id"),
21
17
  givenName: (0, _converters.getValueFromDisclosures)(disclosures, "given_name"),
22
18
  familyName: (0, _converters.getValueFromDisclosures)(disclosures, "family_name"),
23
- birthdate: (0, _converters.getValueFromDisclosures)(disclosures, "birthdate"),
24
- placeOfBirth: (0, _converters.getValueFromDisclosures)(disclosures, "place_of_birth"),
25
- taxIdCode: (0, _converters.getValueFromDisclosures)(disclosures, "tax_id_number")
19
+ birthDate: (0, _converters.getValueFromDisclosures)(disclosures, "birth_date"),
20
+ ...(placeOfBirth && placeOfBirth),
21
+ taxIdCode: (0, _converters.getValueFromDisclosures)(disclosures, "tax_id_code")
26
22
  }
27
23
  });
28
24
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_converters","require","_types","pidFromToken","sdJwt","disclosures","PID","parse","issuer","payload","iss","issuedAt","Date","iat","expiration","exp","verification","trustFramework","verified_claims","trust_framework","assuranceLevel","assurance_level","evidence","getValueFromDisclosures","claims","uniqueId","givenName","familyName","birthdate","placeOfBirth","taxIdCode"],"sourceRoot":"../../../../src","sources":["pid/sd-jwt/converters.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEO,SAASE,YAAYA,CAACC,KAAe,EAAEC,WAAyB,EAAO;EAC5E,OAAOC,UAAG,CAACC,KAAK,CAAC;IACfC,MAAM,EAAEJ,KAAK,CAACK,OAAO,CAACC,GAAG;IACzBC,QAAQ,EAAE,IAAIC,IAAI,CAACR,KAAK,CAACK,OAAO,CAACI,GAAG,GAAG,IAAI,CAAC;IAC5CC,UAAU,EAAE,IAAIF,IAAI,CAACR,KAAK,CAACK,OAAO,CAACM,GAAG,GAAG,IAAI,CAAC;IAC9CC,YAAY,EAAE;MACZC,cAAc,EACZb,KAAK,CAACK,OAAO,CAACS,eAAe,CAACF,YAAY,CAACG,eAAe;MAC5DC,cAAc,EACZhB,KAAK,CAACK,OAAO,CAACS,eAAe,CAACF,YAAY,CAACK,eAAe;MAC5DC,QAAQ,EAAE,IAAAC,mCAAuB,EAAClB,WAAW,EAAE,UAAU;IAC3D,CAAC;IACDmB,MAAM,EAAE;MACNC,QAAQ,EAAE,IAAAF,mCAAuB,EAAClB,WAAW,EAAE,WAAW,CAAC;MAC3DqB,SAAS,EAAE,IAAAH,mCAAuB,EAAClB,WAAW,EAAE,YAAY,CAAC;MAC7DsB,UAAU,EAAE,IAAAJ,mCAAuB,EAAClB,WAAW,EAAE,aAAa,CAAC;MAC/DuB,SAAS,EAAE,IAAAL,mCAAuB,EAAClB,WAAW,EAAE,WAAW,CAAC;MAC5DwB,YAAY,EAAE,IAAAN,mCAAuB,EAAClB,WAAW,EAAE,gBAAgB,CAAC;MACpEyB,SAAS,EAAE,IAAAP,mCAAuB,EAAClB,WAAW,EAAE,eAAe;IACjE;EACF,CAAC,CAAC;AACJ"}
1
+ {"version":3,"names":["_converters","require","_types","pidFromToken","sdJwt","disclosures","placeOfBirth","getValueFromDisclosures","PID","parse","issuer","payload","iss","issuedAt","Date","expiration","exp","claims","uniqueId","givenName","familyName","birthDate","taxIdCode"],"sourceRoot":"../../../../src","sources":["pid/sd-jwt/converters.ts"],"mappings":";;;;;;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAEA,IAAAC,MAAA,GAAAD,OAAA;AAEO,SAASE,YAAYA,CAACC,KAAe,EAAEC,WAAyB,EAAO;EAC5E,MAAMC,YAAY,GAAG,IAAAC,mCAAuB,EAACF,WAAW,EAAE,gBAAgB,CAAC;EAC3E,OAAOG,UAAG,CAACC,KAAK,CAAC;IACfC,MAAM,EAAEN,KAAK,CAACO,OAAO,CAACC,GAAG;IACzBC,QAAQ,EAAE,IAAIC,IAAI,CAAC,IAAAP,mCAAuB,EAACF,WAAW,EAAE,KAAK,CAAC,GAAG,IAAI,CAAC;IACtEU,UAAU,EAAE,IAAID,IAAI,CAACV,KAAK,CAACO,OAAO,CAACK,GAAG,GAAG,IAAI,CAAC;IAC9CC,MAAM,EAAE;MACNC,QAAQ,EAAE,IAAAX,mCAAuB,EAACF,WAAW,EAAE,WAAW,CAAC;MAC3Dc,SAAS,EAAE,IAAAZ,mCAAuB,EAACF,WAAW,EAAE,YAAY,CAAC;MAC7De,UAAU,EAAE,IAAAb,mCAAuB,EAACF,WAAW,EAAE,aAAa,CAAC;MAC/DgB,SAAS,EAAE,IAAAd,mCAAuB,EAACF,WAAW,EAAE,YAAY,CAAC;MAC7D,IAAIC,YAAY,IAAIA,YAAY,CAAC;MACjCgB,SAAS,EAAE,IAAAf,mCAAuB,EAACF,WAAW,EAAE,aAAa;IAC/D;EACF,CAAC,CAAC;AACJ"}
@@ -33,16 +33,16 @@ const PID = _zod.z.object({
33
33
  issuer: _zod.z.string(),
34
34
  issuedAt: _zod.z.date(),
35
35
  expiration: _zod.z.date(),
36
- verification: Verification,
36
+ verification: Verification.optional(),
37
37
  claims: _zod.z.object({
38
38
  uniqueId: _zod.z.string(),
39
39
  givenName: _zod.z.string(),
40
40
  familyName: _zod.z.string(),
41
- birthdate: _zod.z.string(),
41
+ birthDate: _zod.z.string(),
42
42
  placeOfBirth: _zod.z.object({
43
43
  country: _zod.z.string(),
44
44
  locality: _zod.z.string()
45
- }),
45
+ }).optional(),
46
46
  taxIdCode: _zod.z.string()
47
47
  })
48
48
  });
@@ -1 +1 @@
1
- {"version":3,"names":["_zod","require","VerificationEvidence","z","object","type","string","record","source","organization_name","organization_id","country_code","Verification","trustFramework","literal","assuranceLevel","evidence","array","PID","issuer","issuedAt","date","expiration","verification","claims","uniqueId","givenName","familyName","birthdate","placeOfBirth","country","locality","taxIdCode","exports"],"sourceRoot":"../../../../src","sources":["pid/sd-jwt/types.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAEA,MAAMC,oBAAoB,GAAGC,MAAC,CAACC,MAAM,CAAC;EACpCC,IAAI,EAAEF,MAAC,CAACG,MAAM,CAAC,CAAC;EAChBC,MAAM,EAAEJ,MAAC,CAACC,MAAM,CAAC;IACfC,IAAI,EAAEF,MAAC,CAACG,MAAM,CAAC,CAAC;IAChBE,MAAM,EAAEL,MAAC,CAACC,MAAM,CAAC;MACfK,iBAAiB,EAAEN,MAAC,CAACG,MAAM,CAAC,CAAC;MAC7BI,eAAe,EAAEP,MAAC,CAACG,MAAM,CAAC,CAAC;MAC3BK,YAAY,EAAER,MAAC,CAACG,MAAM,CAAC;IACzB,CAAC;EACH,CAAC;AACH,CAAC,CAAC;AAEF,MAAMM,YAAY,GAAGT,MAAC,CAACC,MAAM,CAAC;EAC5BS,cAAc,EAAEV,MAAC,CAACW,OAAO,CAAC,OAAO,CAAC;EAClCC,cAAc,EAAEZ,MAAC,CAACG,MAAM,CAAC,CAAC;EAC1BU,QAAQ,EAAEb,MAAC,CAACc,KAAK,CAACf,oBAAoB;AACxC,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMgB,GAAG,GAAGf,MAAC,CAACC,MAAM,CAAC;EAC1Be,MAAM,EAAEhB,MAAC,CAACG,MAAM,CAAC,CAAC;EAClBc,QAAQ,EAAEjB,MAAC,CAACkB,IAAI,CAAC,CAAC;EAClBC,UAAU,EAAEnB,MAAC,CAACkB,IAAI,CAAC,CAAC;EACpBE,YAAY,EAAEX,YAAY;EAC1BY,MAAM,EAAErB,MAAC,CAACC,MAAM,CAAC;IACfqB,QAAQ,EAAEtB,MAAC,CAACG,MAAM,CAAC,CAAC;IACpBoB,SAAS,EAAEvB,MAAC,CAACG,MAAM,CAAC,CAAC;IACrBqB,UAAU,EAAExB,MAAC,CAACG,MAAM,CAAC,CAAC;IACtBsB,SAAS,EAAEzB,MAAC,CAACG,MAAM,CAAC,CAAC;IACrBuB,YAAY,EAAE1B,MAAC,CAACC,MAAM,CAAC;MACrB0B,OAAO,EAAE3B,MAAC,CAACG,MAAM,CAAC,CAAC;MACnByB,QAAQ,EAAE5B,MAAC,CAACG,MAAM,CAAC;IACrB,CAAC,CAAC;IACF0B,SAAS,EAAE7B,MAAC,CAACG,MAAM,CAAC;EACtB,CAAC;AACH,CAAC,CAAC;AAAC2B,OAAA,CAAAf,GAAA,GAAAA,GAAA"}
1
+ {"version":3,"names":["_zod","require","VerificationEvidence","z","object","type","string","record","source","organization_name","organization_id","country_code","Verification","trustFramework","literal","assuranceLevel","evidence","array","PID","issuer","issuedAt","date","expiration","verification","optional","claims","uniqueId","givenName","familyName","birthDate","placeOfBirth","country","locality","taxIdCode","exports"],"sourceRoot":"../../../../src","sources":["pid/sd-jwt/types.ts"],"mappings":";;;;;;AAAA,IAAAA,IAAA,GAAAC,OAAA;AAEA,MAAMC,oBAAoB,GAAGC,MAAC,CAACC,MAAM,CAAC;EACpCC,IAAI,EAAEF,MAAC,CAACG,MAAM,CAAC,CAAC;EAChBC,MAAM,EAAEJ,MAAC,CAACC,MAAM,CAAC;IACfC,IAAI,EAAEF,MAAC,CAACG,MAAM,CAAC,CAAC;IAChBE,MAAM,EAAEL,MAAC,CAACC,MAAM,CAAC;MACfK,iBAAiB,EAAEN,MAAC,CAACG,MAAM,CAAC,CAAC;MAC7BI,eAAe,EAAEP,MAAC,CAACG,MAAM,CAAC,CAAC;MAC3BK,YAAY,EAAER,MAAC,CAACG,MAAM,CAAC;IACzB,CAAC;EACH,CAAC;AACH,CAAC,CAAC;AAEF,MAAMM,YAAY,GAAGT,MAAC,CAACC,MAAM,CAAC;EAC5BS,cAAc,EAAEV,MAAC,CAACW,OAAO,CAAC,OAAO,CAAC;EAClCC,cAAc,EAAEZ,MAAC,CAACG,MAAM,CAAC,CAAC;EAC1BU,QAAQ,EAAEb,MAAC,CAACc,KAAK,CAACf,oBAAoB;AACxC,CAAC,CAAC;;AAEF;AACA;AACA;AACA;AACA;AACA;;AAEO,MAAMgB,GAAG,GAAGf,MAAC,CAACC,MAAM,CAAC;EAC1Be,MAAM,EAAEhB,MAAC,CAACG,MAAM,CAAC,CAAC;EAClBc,QAAQ,EAAEjB,MAAC,CAACkB,IAAI,CAAC,CAAC;EAClBC,UAAU,EAAEnB,MAAC,CAACkB,IAAI,CAAC,CAAC;EACpBE,YAAY,EAAEX,YAAY,CAACY,QAAQ,CAAC,CAAC;EACrCC,MAAM,EAAEtB,MAAC,CAACC,MAAM,CAAC;IACfsB,QAAQ,EAAEvB,MAAC,CAACG,MAAM,CAAC,CAAC;IACpBqB,SAAS,EAAExB,MAAC,CAACG,MAAM,CAAC,CAAC;IACrBsB,UAAU,EAAEzB,MAAC,CAACG,MAAM,CAAC,CAAC;IACtBuB,SAAS,EAAE1B,MAAC,CAACG,MAAM,CAAC,CAAC;IACrBwB,YAAY,EAAE3B,MAAC,CACZC,MAAM,CAAC;MACN2B,OAAO,EAAE5B,MAAC,CAACG,MAAM,CAAC,CAAC;MACnB0B,QAAQ,EAAE7B,MAAC,CAACG,MAAM,CAAC;IACrB,CAAC,CAAC,CACDkB,QAAQ,CAAC,CAAC;IACbS,SAAS,EAAE9B,MAAC,CAACG,MAAM,CAAC;EACtB,CAAC;AACH,CAAC,CAAC;AAAC4B,OAAA,CAAAhB,GAAA,GAAAA,GAAA"}
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
 
3
3
  var _converters = require("../converters");
4
- const disclosures = [["6w1_soRXFgaHKfpYn3cvfQ", "given_name", "Mario"], ["fuNp97Hf3wV6y48y-QZhIg", "birthdate", "1980-10-01"], ["p-9LzyWHZBVDvhXDWkN2xA", "place_of_birth", {
4
+ const disclosures = [["6w1_soRXFgaHKfpYn3cvfQ", "given_name", "Mario"], ["fuNp97Hf3wV6y48y-QZhIg", "birth_date", "1980-10-01"], ["p-9LzyWHZBVDvhXDWkN2xA", "place_of_birth", {
5
5
  country: "IT",
6
6
  locality: "Rome"
7
7
  }]];
@@ -1 +1 @@
1
- {"version":3,"names":["_converters","require","disclosures","country","locality","describe","it","success","getValueFromDisclosures","expect","toBe","toEqual","toBeUndefined"],"sourceRoot":"../../../../src","sources":["sd-jwt/__test__/converters.test.ts"],"mappings":";;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAGA,MAAMC,WAAyB,GAAG,CAChC,CAAC,wBAAwB,EAAE,YAAY,EAAE,OAAO,CAAC,EACjD,CAAC,wBAAwB,EAAE,WAAW,EAAE,YAAY,CAAC,EACrD,CACE,wBAAwB,EACxB,gBAAgB,EAChB;EAAEC,OAAO,EAAE,IAAI;EAAEC,QAAQ,EAAE;AAAO,CAAC,CACpC,CACF;AAEDC,QAAQ,CAAC,yBAAyB,EAAE,MAAM;EACxCC,EAAE,CAAC,4CAA4C,EAAE,MAAM;IACrD,MAAMC,OAAO,GAAG,IAAAC,mCAAuB,EAACN,WAAW,EAAE,YAAY,CAAC;IAClEO,MAAM,CAACF,OAAO,CAAC,CAACG,IAAI,CAAC,OAAO,CAAC;EAC/B,CAAC,CAAC;EACFJ,EAAE,CAAC,gDAAgD,EAAE,MAAM;IACzD,MAAMC,OAAO,GAAG,IAAAC,mCAAuB,EAACN,WAAW,EAAE,gBAAgB,CAAC;IACtEO,MAAM,CAACF,OAAO,CAAC,CAACI,OAAO,CAAC;MAAER,OAAO,EAAE,IAAI;MAAEC,QAAQ,EAAE;IAAO,CAAC,CAAC;EAC9D,CAAC,CAAC;EACFE,EAAE,CAAC,aAAa,EAAE,MAAM;IACtB,MAAMC,OAAO,GAAG,IAAAC,mCAAuB,EAACN,WAAW,EAAE,eAAe,CAAC;IACrEO,MAAM,CAACF,OAAO,CAAC,CAACK,aAAa,CAAC,CAAC;EACjC,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_converters","require","disclosures","country","locality","describe","it","success","getValueFromDisclosures","expect","toBe","toEqual","toBeUndefined"],"sourceRoot":"../../../../src","sources":["sd-jwt/__test__/converters.test.ts"],"mappings":";;AAAA,IAAAA,WAAA,GAAAC,OAAA;AAGA,MAAMC,WAAyB,GAAG,CAChC,CAAC,wBAAwB,EAAE,YAAY,EAAE,OAAO,CAAC,EACjD,CAAC,wBAAwB,EAAE,YAAY,EAAE,YAAY,CAAC,EACtD,CACE,wBAAwB,EACxB,gBAAgB,EAChB;EAAEC,OAAO,EAAE,IAAI;EAAEC,QAAQ,EAAE;AAAO,CAAC,CACpC,CACF;AAEDC,QAAQ,CAAC,yBAAyB,EAAE,MAAM;EACxCC,EAAE,CAAC,4CAA4C,EAAE,MAAM;IACrD,MAAMC,OAAO,GAAG,IAAAC,mCAAuB,EAACN,WAAW,EAAE,YAAY,CAAC;IAClEO,MAAM,CAACF,OAAO,CAAC,CAACG,IAAI,CAAC,OAAO,CAAC;EAC/B,CAAC,CAAC;EACFJ,EAAE,CAAC,gDAAgD,EAAE,MAAM;IACzD,MAAMC,OAAO,GAAG,IAAAC,mCAAuB,EAACN,WAAW,EAAE,gBAAgB,CAAC;IACtEO,MAAM,CAACF,OAAO,CAAC,CAACI,OAAO,CAAC;MAAER,OAAO,EAAE,IAAI;MAAEC,QAAQ,EAAE;IAAO,CAAC,CAAC;EAC9D,CAAC,CAAC;EACFE,EAAE,CAAC,aAAa,EAAE,MAAM;IACtB,MAAMC,OAAO,GAAG,IAAAC,mCAAuB,EAACN,WAAW,EAAE,eAAe,CAAC;IACrEO,MAAM,CAACF,OAAO,CAAC,CAACK,aAAa,CAAC,CAAC;EACjC,CAAC,CAAC;AACJ,CAAC,CAAC"}