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

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 +55 -82
  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 +55 -32
  14. package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -1
  15. package/lib/commonjs/credential/issuance/06-obtain-credential.js +50 -77
  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 +55 -79
  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 +53 -32
  67. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -1
  68. package/lib/module/credential/issuance/06-obtain-credential.js +49 -74
  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 +22 -17
  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 +21 -15
  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 +87 -92
  167. package/src/credential/issuance/04-complete-user-authorization.ts +114 -13
  168. package/src/credential/issuance/05-authorize-access.ts +73 -48
  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
@@ -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,uBA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,aAAa,EAAE;IACpEiB,MAAM,EAAE,MAAM;IACdC,OAAO,EAAE;MACP,cAAc,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,Q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wBAAgB,CACxB,qEACF,CAAC;EACH;;EAEA;EACA,MAAMC,yBAAyB,GAAG;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","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,CACjDC,CAAC,IACAA,CAAC,CAACC,MAAM,KAAK,WAAW,IACxBD,CAAC,CAACE,qBAAqB,CAACC,IAAI,CAACC,QAAQ,CAACZ,KAAK,CAACa,OAAO,CAACF,IAAI,CAC5D,CAAC,cAAAZ,qBAAA,uBAJyBA,qBAAA,CAIvBW,qBAAqB,CAACJ,iBAAiB;;EAE1C;EACA,IAAI,CAACA,iBAAiB,EAAE;IACtB,MAAMQ,QAAQ,GAAGjB,qBAAqB,CACnCkB,OAAO,CAAEC,CAAC,IAAKA,CAAC,CAACN,qBAAqB,CAACC,IAAI,CAAC,CAC5CM,IAAI,CAAC,IAAI,CAAC;IACb,MAAM,IAAIC,qBAAa,CACpB,gEAA+DJ,QAAS,gBAAed,KAAK,CAACa,OAAO,CAACF,IAAK,KAC7G,CAAC;EACH;;EAEA;EACA,MAAMQ,eAAe,GAAGC,MAAM,CAACC,OAAO,CAACf,iBAAiB,CAAC;;EAEzD;EACA;EACA,MAAMgB,qBAAqB,GAAGH,eAAe,CAACI,MAAM,CAClDC,KAAA;IAAA,IA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cAAc,EAAE;IACpC,OAAO+D,4BAA4B,CACjCR,UAAU,EACVC,UAAU,EACVxD,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,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M,IAAIhE,qBAAa,CAAE,kCAAiCC,MAAO,EAAC,CAAC;AACrE,CAAC;AAACgE,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,S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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,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AA,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"}
@@ -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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ationEvidence","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"}
@@ -12,56 +12,43 @@ var _types = require("../types");
12
12
  // - payload is taken from the italian specification, but _sd are compiled with:
13
13
  // - "address" is used as verification._sd
14
14
  // - all others disclosures are in claims._sd
15
- const token = "eyJ0eXAiOiJ2YytzZC1qd3QiLCJhbGciOiJFUzI1NiIsImtpZCI6ImIxODZlYTBjMTkyNTc5MzA5N2JmMDFiOGEyODlhNDVmIiwidHJ1c3RfY2hhaW4iOlsiTkVoUmRFUnBZbmxIWTNNNVdsZFdUV1oyYVVobSAuLi4iLCJleUpoYkdjaU9pSlNVekkxTmlJc0ltdHBaQ0k2IC4uLiIsIklrSllkbVp5Ykc1b1FVMTFTRkl3TjJGcVZXMUIgLi4uIl19.eyJpc3MiOiJodHRwczovL2V4YW1wbGUuY29tL2lzc3VlciIsInN1YiI6Ik56YkxzWGg4dURDY2Q3bm9XWEZaQWZIa3hac1JHQzlYcy4uLiIsImp0aSI6InVybjp1dWlkOjZjNWMwYTQ5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LCJNOWxvOVl4RE5JWHJBcTJxV2VpQ0E0MHpwSl96WWZGZFJfNEFFQUxjUnRVIiwiY3pnalVrMG5xUkNzd1NoQ2hDamRTNkExLXY0N2RfcVRDU0ZJdklIaE1vSSIsIm5HblFyN2NsbTN0ZlRwOHlqTF91SHJEU090elIyUFZiOFM3R2VMZEFxQlEiLCJ4TklWd2xwU3NhWjhDSlNmMGd6NXhfNzVWUldXYzZWMW1scGVqZENycVVzIl0sInN1YiI6IjIxNmY4OTQ2LTllY2ItNDgxOS05MzA5LWMwNzZmMzRhN2UxMSIsIl9zZF9hbGciOiJzaGEtMjU2IiwidmN0IjoiUGVyc29uSWRlbnRpZmljYXRpb25EYXRhIiwiaXNzIjoiaHR0cHM6Ly9wcmUuZWlkLndhbGxldC5pcHpzLml0IiwiY25mIjp7Imp3ayI6eyJrdHkiOiJFQyIsImNydiI6IlAtMjU2Iiwia2lkIjoiUnYzVy1FaUtwdkJUeWs1eVp4dnJldi03TURCNlNselVDQm9fQ1FqamRkVSIsIngiOiIwV294N1F0eVBxQnlnMzVNSF9YeUNjbmQ1TGUtSm0wQVhIbFVnREJBMDNZIiwieSI6ImVFaFZ2ZzFKUHFOZDNEVFNhNG1HREdCbHdZNk5QLUVaYkxiTkZYU1h3SWcifX0sImV4cCI6MTc1MTU0NjU3Niwic3RhdHVzIjp7InN0YXR1c19hdHRlc3RhdGlvbiI6eyJjcmVkZW50aWFsX2hhc2hfYWxnIjoic2hhLTI1NiJ9fX0";
17
+ const signature = "qXHA2oqr8trX4fGxpxpUft2GX380TM3pzfo1MYAsDjUC8HsODA-4rdRWAvDe2zYP57x4tJU7eiABkd1Kmln9yQ";
18
18
  const signed = `${unsigned}.${signature}`;
19
- const tokenizedDisclosures = ["WyIyR0xDNDJzS1F2ZUNmR2ZyeU5STjl3IiwgImdpdmVuX25hbWUiLCAiSm9obiJd", "WyJlbHVWNU9nM2dTTklJOEVZbnN4QV9BIiwgImZhbWlseV9uYW1lIiwgIkRvZSJd", "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1XQ"];
20
20
  const sdJwt = {
21
21
  header: {
22
+ kid: "-F_6Uga8n3VegjY2U7YUHK1zLoaD-NPTc63RMISnLaw",
22
23
  typ: "vc+sd-jwt",
23
- alg: "ES256",
24
- kid: "b186ea0c1925793097bf01b8a289a45f",
25
- trust_chain: ["NEhRdERpYnlHY3M5WldWTWZ2aUhm ...", "eyJhbGciOiJSUzI1NiIsImtpZCI6 ...", "IkJYdmZybG5oQU11SFIwN2FqVW1B ..."]
24
+ alg: "ES256"
26
25
  },
27
26
  payload: {
28
- iss: "https://example.com/issuer",
29
- sub: "NzbLsXh8uDCcd7noWXFZAfHkxZsRGC9Xs...",
30
- jti: "urn:uuid:6c5c0a49-b589-431d-bae7-219122a9ec2c",
31
- iat: 1541493724,
32
- exp: 1541493724,
33
- status: "https://example.com/status",
27
+ _sd: ["0q1D5Jmav6pQaEh_J_Fcv_uNNMQIgCyhQOxqlY4l3qU", "KCJ-AVNv88d-xj6sUIAOJxFnbUh3rHXDKkIH1lFqbRs", "M9lo9YxDNIXrAq2qWeiCA40zpJ_zYfFdR_4AEALcRtU", "czgjUk0nqRCswShChCjdS6A1-v47d_qTCSFIvIHhMoI", "nGnQr7clm3tfTp8yjL_uHrDSOtzR2PVb8S7GeLdAqBQ", "xNIVwlpSsaZ8CJSf0gz5x_75VRWWc6V1mlpejdCrqUs"],
28
+ sub: "216f8946-9ecb-4819-9309-c076f34a7e11",
29
+ _sd_alg: "sha-256",
30
+ vct: "PersonIdentificationData",
31
+ iss: "https://pre.eid.wallet.ipzs.it",
34
32
  cnf: {
35
33
  jwk: {
36
- kty: "RSA",
37
- use: "sig",
38
- n: "1Ta-sE",
39
- e: "AQAB",
40
- kid: "YhNFS3YnC9tjiCaivhWLVUJ3AxwGGz_98uRFaqMEEs"
34
+ kty: "EC",
35
+ crv: "P-256",
36
+ kid: "Rv3W-EiKpvBTyk5yZxvrev-7MDB6SlzUCBo_CQjjddU",
37
+ x: "0Wox7QtyPqByg35MH_XyCcnd5Le-Jm0AXHlUgDBA03Y",
38
+ y: "eEhVvg1JPqNd3DTSa4mGDGBlwY6NP-EZbLbNFXSXwIg"
41
39
  }
42
40
  },
43
- type: "PersonIdentificationData",
44
- verified_claims: {
45
- verification: {
46
- _sd: ["JzYjH4svliH0R3PyEMfeZu6Jt69u5qehZo7F7EPYlSE"],
47
- trust_framework: "eidas",
48
- assurance_level: "high"
49
- },
50
- claims: {
51
- _sd: ["09vKrJMOlyTWM0sjpu_pdOBVBQ2M1y3KhpH515nXkpY", "2rsjGbaC0ky8mT0pJrPioWTq0_daw1sX76poUlgCwbI", "EkO8dhW0dHEJbvUHlE_VCeuC9uRELOieLZhh7XbUTtA", "IlDzIKeiZdDwpqpK6ZfbyphFvz5FgnWa-sN6wqQXCiw", "PorFbpKuVu6xymJagvkFsFXAbRoc2JGlAUA2BA4o7cI", "TGf4oLbgwd5JQaHyKVQZU9UdGE0w5rtDsrZzfUaomLo", "jdrTE8YcbY4EifugihiAe_BPekxJQZICeiUQwY9QqxI", "jsu9yVulwQQlhFlM_3JlzMaSFzglhQG0DpfayQwLUK4"]
41
+ exp: 1751546576,
42
+ status: {
43
+ status_attestation: {
44
+ credential_hash_alg: "sha-256"
52
45
  }
53
- },
54
- _sd_alg: "sha-256"
46
+ }
55
47
  }
56
48
  };
57
49
 
58
50
  // In the very same order than tokenizedDisclosures
59
- const disclosures = [["2GLC42sKQveCfGfryNRN9w", "given_name", "John"], ["eluV5Og3gSNII8EYnsxA_A", "family_name", "Doe"], ["6Ij7tM-a5iVPGboS5tmvVA", "email", "johndoe@example.com"], ["eI8ZWm9QnKPpNPeNenHdhQ", "phone_number", "+1-202-555-0101"], ["AJx-095VPrpTtN4QMOqROA", "birthdate", "1940-01-01"], ["Pc33JM2LchcU_lHggv_ufQ", "is_over_18", true], ["G02NSrQfjFXQ7Io09syajA", "is_over_21", true], ["lklxF5jMYlGTPUovMNIvCA", "is_over_65", true], ["Qg_O64zqAxe412a108iroA", "address", {
60
- street_address: "123 Main St",
61
- locality: "Anytown",
62
- region: "Anystate",
63
- country: "US"
64
- }]];
51
+ const disclosures = [["kJDEP8EaNTEMBDOZzZzT4w", "unique_id", "TINIT-LVLDAA85T50G702B"], ["zIAyUFvPfIpE1zBqxI5haQ", "birth_date", "1985-12-10"], ["Gr3R3s290OkQUm-NFTu96A", "tax_id_code", "TINIT-LVLDAA85T50G702B"], ["GxORalMAelfZ0edFJjjYUw", "given_name", "Ada"], ["_vV5RIkl0IOEXKots9kt1w", "family_name", "Lovelace"], ["Cj5tccR72Jwrze2TW4a-wg", "iat", 1720010575]];
65
52
  it("Ensures example data correctness", () => {
66
53
  expect(JSON.parse((0, _ioReactNativeJwt.decodeBase64)((0, _ioReactNativeJwt.encodeBase64)(JSON.stringify(sdJwt.header))))).toEqual(sdJwt.header);
67
54
  expect([signed, ...tokenizedDisclosures].join("~")).toBe(token);
@@ -113,10 +100,10 @@ describe("disclose", () => {
113
100
  it("should encode a valid sdjwt (one claim)", async () => {
114
101
  const result = await (0, _index.disclose)(token, ["given_name"]);
115
102
  const expected = {
116
- token: `${signed}~WyIyR0xDNDJzS1F2ZUNmR2ZyeU5STjl3IiwgImdpdmVuX25hbWUiLCAiSm9obiJd`,
103
+ token: `${signed}~WyJHeE9SYWxNQWVsZlowZWRGSmpqWVV3IiwiZ2l2ZW5fbmFtZSIsIkFkYSJd`,
117
104
  paths: [{
118
105
  claim: "given_name",
119
- path: "verified_claims.claims._sd[7]"
106
+ path: "verified_claims.claims._sd[3]"
120
107
  }]
121
108
  };
122
109
  expect(result).toEqual(expected);
@@ -130,15 +117,15 @@ describe("disclose", () => {
130
117
  expect(result).toEqual(expected);
131
118
  });
132
119
  it("should encode a valid sdjwt (multiple claims)", async () => {
133
- const result = await (0, _index.disclose)(token, ["given_name", "email"]);
120
+ const result = await (0, _index.disclose)(token, ["iat", "family_name"]);
134
121
  const expected = {
135
- token: `${signed}~WyIyR0xDNDJzS1F2ZUNmR2ZyeU5STjl3IiwgImdpdmVuX25hbWUiLCAiSm9obiJd~WyI2SWo3dE0tYTVpVlBHYm9TNXRtdlZBIiwgImVtYWlsIiwgImpvaG5kb2VAZXhhbXBsZS5jb20iXQ`,
122
+ token: `${signed}~WyJfdlY1UklrbDBJT0VYS290czlrdDF3IiwiZmFtaWx5X25hbWUiLCJMb3ZlbGFjZSJd~WyJDajV0Y2NSNzJKd3J6ZTJUVzRhLXdnIiwiaWF0IiwxNzIwMDEwNTc1XQ`,
136
123
  paths: [{
137
- claim: "given_name",
138
- path: "verified_claims.claims._sd[7]"
124
+ claim: "iat",
125
+ path: "verified_claims.claims._sd[4]"
139
126
  }, {
140
- claim: "email",
141
- path: "verified_claims.verification._sd[0]"
127
+ claim: "family_name",
128
+ path: "verified_claims.claims._sd[0]"
142
129
  }]
143
130
  };
144
131
  expect(result).toEqual(expected);
@@ -1 +1 @@
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,G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AK,CAAC,CAAC;EACvD,CAAC,CAAC;AACJ,CAAC,CAAC"}
1
+ {"version":3,"names":["_zod","require","_index","_ioReactNativeJwt","_types","token","unsigned","signature","signed","tokenizedDisclosures","sdJwt","header","kid","typ","alg","payload","_sd","sub","_sd_alg","vct","iss","cnf","jwk","kty","crv","x","y","exp","status","status_attestation","credential_hash_alg","disclosures","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,giDAAgiD;AAEliD,MAAMC,QAAQ,GACZ,whCAAwhC;AAE1hC,MAAMC,SAAS,GACb,wFAAwF;AAE1F,MAAMC,MAAM,GAAI,GAAEF,QAAS,IAAGC,SAAU,EAAC;AAEzC,MAAME,oBAAoB,GAAG,CAC3B,sFAAsF,EACtF,wEAAwE,EACxE,yFAAyF,EACzF,8DAA8D,EAC9D,sEAAsE,EACtE,4DAA4D,CAC7D;AAED,MAAMC,KAAK,GAAG;EACZC,MAAM,EAAE;IACNC,GAAG,EAAE,6CAA6C;IAClDC,GAAG,EAAE,WAAW;IAChBC,GAAG,EAAE;EACP,CAAC;EACDC,OAAO,EAAE;IACPC,GAAG,EAAE,CACH,6CAA6C,EAC7C,6CAA6C,EAC7C,6CAA6C,EAC7C,6CAA6C,EAC7C,6CAA6C,EAC7C,6CAA6C,CAC9C;IACDC,GAAG,EAAE,sCAAsC;IAC3CC,OAAO,EAAE,SAAS;IAClBC,GAAG,EAAE,0BAA0B;IAC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KAAY,IAAAL,eAAQ,EAACrD,KAAK,EAAE,CAAC,SAAS,CAAC,CAAC;IAEnD,MAAM4B,MAAM,CAAC8B,EAAE,CAAC,CAAC,CAAC,CAACC,OAAO,CAACzB,OAAO,CAACN,MAAM,CAACgC,GAAG,CAACC,KAAK,CAAC,CAAC;EACvD,CAAC,CAAC;AACJ,CAAC,CAAC"}
@@ -8,37 +8,29 @@ describe("SdJwt4VC", () => {
8
8
  header: {
9
9
  typ: "vc+sd-jwt",
10
10
  alg: "RS512",
11
- kid: "dB67gL7ck3TFiIAf7N6_7SHvqk0MDYMEQcoGGlkUAAw",
12
- trust_chain: ["NEhRdERpYnlHY3M5WldWTWZ2aUhm ...", "eyJhbGciOiJSUzI1NiIsImtpZCI6 ...", "IkJYdmZybG5oQU11SFIwN2FqVW1B ..."]
11
+ kid: "dB67gL7ck3TFiIAf7N6_7SHvqk0MDYMEQcoGGlkUAAw"
13
12
  },
14
13
  payload: {
15
- iss: "https://pidprovider.example.org",
16
- sub: "NzbLsXh8uDCcd7noWXFZAfHkxZsRGC9Xs...",
17
- jti: "urn:uuid:6c5c0a49-b589-431d-bae7-219122a9ec2c",
18
- iat: 1541493724,
19
- exp: 1541493724,
20
- status: "https://pidprovider.example.org/status",
14
+ _sd: ["0q1D5Jmav6pQaEh_J_Fcv_uNNMQIgCyhQOxqlY4l3qU", "KCJ-AVNv88d-xj6sUIAOJxFnbUh3rHXDKkIH1lFqbRs", "M9lo9YxDNIXrAq2qWeiCA40zpJ_zYfFdR_4AEALcRtU", "czgjUk0nqRCswShChCjdS6A1-v47d_qTCSFIvIHhMoI", "nGnQr7clm3tfTp8yjL_uHrDSOtzR2PVb8S7GeLdAqBQ", "xNIVwlpSsaZ8CJSf0gz5x_75VRWWc6V1mlpejdCrqUs"],
15
+ sub: "216f8946-9ecb-4819-9309-c076f34a7e11",
16
+ _sd_alg: "sha-256",
17
+ vct: "PersonIdentificationData",
18
+ iss: "https://pidprovider.example.com",
21
19
  cnf: {
22
20
  jwk: {
23
- kty: "RSA",
24
- use: "sig",
25
- n: "1Ta-sE …",
26
- e: "AQAB",
27
- kid: "YhNFS3YnC9tjiCaivhWLVUJ3AxwGGz_98uRFaqMEEs"
21
+ kty: "EC",
22
+ crv: "P-256",
23
+ kid: "zEv_qGSL5r0_F67j2dwEgUJmBgbMNSEJ5K_iH1PYc7A",
24
+ x: "0Pj7v_afNp9ETJx11JbYgkI7yQpd0rtiYuo5feuAN2o",
25
+ y: "XB62Um02vHqedkOzSfJ5hdtjPz-zmV9jmWh4sKgdD9o"
28
26
  }
29
27
  },
30
- type: "PersonIdentificationData",
31
- verified_claims: {
32
- verification: {
33
- _sd: ["OGm7ryXgt5Xzlevp-Hu-UTk0a-TxAaPAobqv1pIWMfw"],
34
- trust_framework: "eidas",
35
- assurance_level: "high"
36
- },
37
- claims: {
38
- _sd: ["8JjozBfovMNvQ3HflmPWy4O19Gpxs61FWHjZebU589E", "BoMGktW1rbikntw8Fzx_BeL4YbAndr6AHsdgpatFCig", "CFLGzentGNRFngnLVVQVcoAFi05r6RJUX-rdbLdEfew", "JU_sTaHCngS32X-0ajHrd1-HCLCkpT5YqgcfQme168w", "VQI-S1mT1Kxfq2o8J9io7xMMX2MIxaG9M9PeJVqrMcA", "zVdghcmClMVWlUgGsGpSkCPkEHZ4u9oWj1SlIBlCc1o"]
28
+ exp: 1751107255,
29
+ status: {
30
+ status_attestation: {
31
+ credential_hash_alg: "sha-256"
39
32
  }
40
- },
41
- _sd_alg: "sha-256"
33
+ }
42
34
  }
43
35
  };
44
36
  const {