@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
@@ -233,16 +233,87 @@ export class WalletProviderResponseError extends IoWalletError {
233
233
 
234
234
  /** Reason code for the validation failure. */
235
235
 
236
+ /** HTTP status code */
237
+
236
238
  constructor(message) {
237
239
  let claim = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
240
+ let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
241
+ let statusCode = arguments.length > 3 ? arguments[3] : undefined;
242
+ super(serializeAttrs({
243
+ message,
244
+ claim,
245
+ reason,
246
+ statusCode: statusCode.toString()
247
+ }));
248
+ this.claim = claim;
249
+ this.reason = reason;
250
+ this.statusCode = statusCode;
251
+ }
252
+ }
253
+ export class WalletInstanceRevokedError extends IoWalletError {
254
+ static get code() {
255
+ return "ERR_IO_WALLET_INSTANCE_REVOKED";
256
+ }
257
+ code = "ERR_IO_WALLET_INSTANCE_REVOKED";
258
+ constructor(message, claim) {
238
259
  let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
239
260
  super(serializeAttrs({
240
261
  message,
241
262
  claim,
242
263
  reason
243
264
  }));
265
+ this.reason = reason;
244
266
  this.claim = claim;
267
+ }
268
+ }
269
+ export class WalletInstanceNotFoundError extends IoWalletError {
270
+ static get code() {
271
+ return "ERR_IO_WALLET_INSTANCE_NOT_FOUND";
272
+ }
273
+ code = "ERR_IO_WALLET_INSTANCE_NOT_FOUND";
274
+ constructor(message, claim) {
275
+ let reason = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : "unspecified";
276
+ super(serializeAttrs({
277
+ message,
278
+ claim,
279
+ reason
280
+ }));
245
281
  this.reason = reason;
282
+ this.claim = claim;
283
+ }
284
+ }
285
+
286
+ /**
287
+ * An error subclass thrown when an error occurs during the authorization process.
288
+ */
289
+ export class AuthorizationError extends IoWalletError {
290
+ static get code() {
291
+ return "ERR_IO_WALLET_AUTHORIZATION_ERROR";
292
+ }
293
+ code = "ERR_IO_WALLET_AUTHORIZATION_ERROR";
294
+ constructor(message) {
295
+ super(message);
296
+ }
297
+ }
298
+
299
+ /**
300
+ * An error subclass thrown when an error occurs during the authorization process with the IDP.
301
+ * It contains the error and error description returned by the IDP.
302
+ */
303
+ export class AuthorizationIdpError extends IoWalletError {
304
+ static get code() {
305
+ return "ERR_IO_WALLET_IDENTIFICATION_RESPONSE_ERROR";
306
+ }
307
+ code = "ERR_IO_WALLET_IDENTIFICATION_RESPONSE_PARSING_FAILED";
308
+ constructor(error, errorDescription) {
309
+ super(serializeAttrs(errorDescription ? {
310
+ error,
311
+ errorDescription
312
+ } : {
313
+ error
314
+ }));
315
+ this.error = error;
316
+ this.errorDescription = errorDescription;
246
317
  }
247
318
  }
248
319
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AAA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C,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IAAA,IAC7BG,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IAE9B,KAAK,CAACvB,cAAc,CAAC;MAAEgB,OAAO;MAAEM,KAAK;MAAEI;IAAO,CAAC,CAAC,CAAC;IACjD,IAAI,CAACJ,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACI,MAAM,GAAGA,MAAM;EACtB;AACF"}
1
+ {"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError","statusCode","toString","WalletInstanceRevokedError","WalletInstanceNotFoundError","AuthorizationError","AuthorizationIdpError","error","errorDescription"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAIC,KAAsC,IAC5DC,MAAM,CAACC,OAAO,CAACF,KAAK,CAAC,CAClBG,GAAG,CAACC,IAAA;EAAA,IAAC,CAACC,CAAC,EAAEC,CAAC,CAAC,GAAAF,IAAA;EAAA,OAAK,CAACC,CAAC,EAAEE,KAAK,CAACC,OAAO,CAACF,CAAC,CAAC,GAAI,IAAGA,CAAC,CAACG,IAAI,CAAC,IAAI,CAAE,GAAE,GAAGH,CAAC,CAAC;AAAA,EAAC,CAChEH,GAAG,CAAEO,CAAC,IAAKA,CAAC,CAACD,IAAI,CAAC,GAAG,CAAC,CAAC,CACvBA,IAAI,CAAC,GAAG,CAAC;;AAEd;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2B,qBAAqB,SAAS/B,aAAa,CAAC;EACvD,WAAWE,IAAIA,CAAA,EAAkD;IAC/D,OAAO,6CAA6C;EACtD;EAEAA,IAAI,GAAG,sDAAsD;EAK7DC,WAAWA,CAAC6B,KAAa,EAAEC,gBAAyB,EAAE;IACpD,KAAK,CACH7C,cAAc,CAAC6C,gBAAgB,GAAG;MAAED,KAAK;MAAEC;IAAiB,CAAC,GAAG;MAAED;IAAM,CAAC,CAC3E,CAAC;IACD,IAAI,CAACA,KAAK,GAAGA,KAAK;IAClB,IAAI,CAACC,gBAAgB,GAAGA,gBAAgB;EAC1C;AACF"}
@@ -14,4 +14,35 @@ export const hasStatus = status => async res => {
14
14
 
15
15
  // extract a type from an async function output
16
16
  // helpful to bind the input of a function to the output of another
17
+ /**
18
+ * TODO [SIW-1310]: replace this function with a cryptographically secure one.
19
+ * @param size - The size of the string to generate
20
+ * @returns A random alphanumeric string of the given size
21
+ */
22
+ export const generateRandomAlphaNumericString = size => Array.from(Array(size), () => Math.floor(Math.random() * 36).toString(36)).join("");
23
+
24
+ /**
25
+ * Repeatedly checks a condition function until it returns true,
26
+ * then resolves the returned promise. If the condition function does not return true
27
+ * within the specified timeout, the promise is rejected.
28
+ *
29
+ * @param conditionFunction - A function that returns a boolean value.
30
+ * The promise resolves when this function returns true.
31
+ * @param timeout - An optional timeout in seconds. The promise is rejected if the
32
+ * condition function does not return true within this time.
33
+ * @returns A promise that resolves once the conditionFunction returns true or rejects if timed out.
34
+ */
35
+ export const until = (conditionFunction, timeoutSeconds) => new Promise((resolve, reject) => {
36
+ const start = Date.now();
37
+ const poll = () => {
38
+ if (conditionFunction()) {
39
+ resolve();
40
+ } else if (timeoutSeconds !== undefined && Date.now() - start >= timeoutSeconds * 1000) {
41
+ reject(new Error("Timeout exceeded"));
42
+ } else {
43
+ setTimeout(poll, 400);
44
+ }
45
+ };
46
+ poll();
47
+ });
17
48
  //# sourceMappingURL=misc.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["IoWalletError","hasStatus","status","res","url","text"],"sourceRoot":"../../../src","sources":["utils/misc.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,UAAU;;AAExC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GACnBC,MAAc,IACf,MAAOC,GAAa,IAAwB;EAC1C,IAAIA,GAAG,CAACD,MAAM,KAAKA,MAAM,EAAE;IACzB,MAAM,IAAIF,aAAa,CACpB,iCAAgCE,MAAO,SAAQC,GAAG,CAACD,MAAO,UACzDC,GAAG,CAACC,GACL,mBAAkB,MAAMD,GAAG,CAACE,IAAI,CAAC,CAAE,EACtC,CAAC;EACH;EACA,OAAOF,GAAG;AACZ,CAAC;;AAEH;AACA"}
1
+ {"version":3,"names":["IoWalletError","hasStatus","status","res","url","text","generateRandomAlphaNumericString","size","Array","from","Math","floor","random","toString","join","until","conditionFunction","timeoutSeconds","Promise","resolve","reject","start","Date","now","poll","undefined","Error","setTimeout"],"sourceRoot":"../../../src","sources":["utils/misc.ts"],"mappings":"AAAA,SAASA,aAAa,QAAQ,UAAU;;AAExC;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,SAAS,GACnBC,MAAc,IACf,MAAOC,GAAa,IAAwB;EAC1C,IAAIA,GAAG,CAACD,MAAM,KAAKA,MAAM,EAAE;IACzB,MAAM,IAAIF,aAAa,CACpB,iCAAgCE,MAAO,SAAQC,GAAG,CAACD,MAAO,UACzDC,GAAG,CAACC,GACL,mBAAkB,MAAMD,GAAG,CAACE,IAAI,CAAC,CAAE,EACtC,CAAC;EACH;EACA,OAAOF,GAAG;AACZ,CAAC;;AAEH;AACA;AAOA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMG,gCAAgC,GAAIC,IAAY,IAC3DC,KAAK,CAACC,IAAI,CAACD,KAAK,CAACD,IAAI,CAAC,EAAE,MACtBG,IAAI,CAACC,KAAK,CAACD,IAAI,CAACE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,CAACC,QAAQ,CAAC,EAAE,CAC5C,CAAC,CAACC,IAAI,CAAC,EAAE,CAAC;;AAEZ;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,KAAK,GAAGA,CACnBC,iBAAgC,EAChCC,cAAuB,KAEvB,IAAIC,OAAO,CAAO,CAACC,OAAO,EAAEC,MAAM,KAAK;EACrC,MAAMC,KAAK,GAAGC,IAAI,CAACC,GAAG,CAAC,CAAC;EACxB,MAAMC,IAAI,GAAGA,CAAA,KAAM;IACjB,IAAIR,iBAAiB,CAAC,CAAC,EAAE;MACvBG,OAAO,CAAC,CAAC;IACX,CAAC,MAAM,IACLF,cAAc,KAAKQ,SAAS,IAC5BH,IAAI,CAACC,GAAG,CAAC,CAAC,GAAGF,KAAK,IAAIJ,cAAc,GAAG,IAAI,EAC3C;MACAG,MAAM,CAAC,IAAIM,KAAK,CAAC,kBAAkB,CAAC,CAAC;IACvC,CAAC,MAAM;MACLC,UAAU,CAACH,IAAI,EAAE,GAAG,CAAC;IACvB;EACF,CAAC;EAEDA,IAAI,CAAC,CAAC;AACR,CAAC,CAAC"}
@@ -2,11 +2,10 @@ import { sha256ToBase64, SignJWT } from "@pagopa/io-react-native-jwt";
2
2
  import uuid from "react-native-uuid";
3
3
  import * as z from "zod";
4
4
  import * as WalletInstanceAttestation from "../wallet-instance-attestation";
5
- import { hasStatus } from "./misc";
5
+ import { generateRandomAlphaNumericString, hasStatus } from "./misc";
6
+ import { createPopToken } from "./pop";
6
7
  export const AuthorizationDetail = z.object({
7
- credential_definition: z.object({
8
- type: z.string()
9
- }),
8
+ credential_configuration_id: z.string(),
10
9
  format: z.union([z.literal("vc+sd-jwt"), z.literal("vc+mdoc-cbor")]),
11
10
  type: z.literal("openid_credential")
12
11
  });
@@ -20,16 +19,21 @@ export const makeParRequest = _ref => {
20
19
  wiaCryptoContext,
21
20
  appFetch = fetch
22
21
  } = _ref;
23
- return async (clientId, codeVerifier, walletProviderBaseUrl, parEndpoint, walletInstanceAttestation, authorizationDetails, assertionType) => {
22
+ return async (clientId, codeVerifier, redirectUri, responseMode, parEndpoint, walletInstanceAttestation, authorizationDetails, assertionType) => {
24
23
  const wiaPublicKey = await wiaCryptoContext.getPublicKey();
25
24
  const parUrl = new URL(parEndpoint);
26
25
  const aud = `${parUrl.protocol}//${parUrl.hostname}`;
27
26
  const iss = WalletInstanceAttestation.decode(walletInstanceAttestation).payload.cnf.jwk.kid;
27
+ const signedWiaPoP = await createPopToken({
28
+ jti: `${uuid.v4()}`,
29
+ aud,
30
+ iss
31
+ }, wiaCryptoContext);
28
32
 
29
33
  /** A code challenge is provided so that the PAR is bound
30
34
  to the subsequent authorization code request
31
35
  @see https://datatracker.ietf.org/doc/html/rfc9126#name-request */
32
- const codeChallengeMethod = "s256";
36
+ const codeChallengeMethod = "S256";
33
37
  const codeChallenge = await sha256ToBase64(codeVerifier);
34
38
 
35
39
  /** The PAR request token is signed used the Wallet Instance Attestation key.
@@ -37,20 +41,24 @@ export const makeParRequest = _ref => {
37
41
  with the it will ship the Wallet Instance Attestation.
38
42
  The key is matched by its kid */
39
43
  const signedJwtForPar = await new SignJWT(wiaCryptoContext).setProtectedHeader({
44
+ typ: "jwk",
40
45
  kid: wiaPublicKey.kid
41
46
  }).setPayload({
42
- iss,
43
- aud,
44
47
  jti: `${uuid.v4()}`,
45
- client_assertion_type: assertionType,
46
- authorization_details: authorizationDetails,
48
+ aud,
47
49
  response_type: "code",
48
- redirect_uri: walletProviderBaseUrl,
49
- state: `${uuid.v4()}`,
50
+ response_mode: responseMode,
50
51
  client_id: clientId,
52
+ iss,
53
+ state: generateRandomAlphaNumericString(32),
54
+ code_challenge: codeChallenge,
51
55
  code_challenge_method: codeChallengeMethod,
52
- code_challenge: codeChallenge
53
- }).setIssuedAt().setExpirationTime("1h").sign();
56
+ authorization_details: authorizationDetails,
57
+ redirect_uri: redirectUri,
58
+ client_assertion_type: assertionType,
59
+ client_assertion: walletInstanceAttestation + "~" + signedWiaPoP
60
+ }).setIssuedAt() //iat is set to now
61
+ .setExpirationTime("5min").sign();
54
62
 
55
63
  /** The request body for the Pushed Authorization Request */
56
64
  var formBody = new URLSearchParams({
@@ -58,9 +66,9 @@ export const makeParRequest = _ref => {
58
66
  client_id: clientId,
59
67
  code_challenge: codeChallenge,
60
68
  code_challenge_method: "S256",
69
+ request: signedJwtForPar,
61
70
  client_assertion_type: assertionType,
62
- client_assertion: walletInstanceAttestation,
63
- request: signedJwtForPar
71
+ client_assertion: walletInstanceAttestation + "~" + signedWiaPoP
64
72
  });
65
73
  return await appFetch(parEndpoint, {
66
74
  method: "POST",
@@ -1 +1 @@
1
- {"version":3,"names":["sha256ToBase64","SignJWT","uuid","z","WalletInstanceAttestation","hasStatus","AuthorizationDetail","object","credential_definition","type","string","format","union","literal","AuthorizationDetails","array","makeParRequest","_ref","wiaCryptoContext","appFetch","fetch","clientId","codeVerifier","walletProviderBaseUrl","parEndpoint","walletInstanceAttestation","authorizationDetails","assertionType","wiaPublicKey","getPublicKey","parUrl","URL","aud","protocol","hostname","iss","decode","payload","cnf","jwk","kid","codeChallengeMethod","codeChallenge","signedJwtForPar","setProtectedHeader","setPayload","jti","v4","client_assertion_type","authorization_details","response_type","redirect_uri","state","client_id","code_challenge_method","code_challenge","setIssuedAt","setExpirationTime","sign","formBody","URLSearchParams","client_assertion","request","method","headers","body","toString","then","res","json","result","request_uri"],"sourceRoot":"../../../src","sources":["utils/par.ts"],"mappings":"AAAA,SACEA,cAAc,EAEdC,OAAO,QACF,6BAA6B;AACpC,OAAOC,IAAI,MAAM,mBAAmB;AACpC,OAAO,KAAKC,CAAC,MAAM,KAAK;AACxB,OAAO,KAAKC,yBAAyB,MAAM,gCAAgC;AAC3E,SAASC,SAAS,QAAQ,QAAQ;AAGlC,OAAO,MAAMC,mBAAmB,GAAGH,CAAC,CAACI,MAAM,CAAC;EAC1CC,qBAAqB,EAAEL,CAAC,CAACI,MAAM,CAAC;IAC9BE,IAAI,EAAEN,CAAC,CAACO,MAAM,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AAI,CAAC6C,EAAE,CAAC,CAAE,EAAC;MACnBC,qBAAqB,EAAErB,aAAa;MACpCsB,qBAAqB,EAAEvB,oBAAoB;MAC3CwB,aAAa,EAAE,MAAM;MACrBC,YAAY,EAAE5B,qBAAqB;MACnC6B,KAAK,EAAG,GAAElD,IAAI,CAAC6C,EAAE,CAAC,CAAE,EAAC;MACrBM,SAAS,EAAEhC,QAAQ;MACnBiC,qBAAqB,EAAEb,mBAAmB;MAC1Cc,cAAc,EAAEb;IAClB,CAAC,CAAC,CACDc,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,IAAI,CAAC,CACvBC,IAAI,CAAC,CAAC;;IAET;IACA,IAAIC,QAAQ,GAAG,IAAIC,eAAe,CAAC;MACjCV,aAAa,EAAE,MAAM;MACrBG,SAAS,EAAEhC,QAAQ;MACnBkC,cAAc,EAAEb,aAAa;MAC7BY,qBAAqB,EAAE,MAAM;MAC7BN,qBAAqB,EAAErB,aAAa;MACpCkC,gBAAgB,EAAEpC,yBAAyB;MAC3CqC,OAAO,EAAEnB;IACX,CAAC,CAAC;IAEF,OAAO,MAAMxB,QAAQ,CAACK,WAAW,EAAE;MACjCuC,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACDC,IAAI,EAAEN,QAAQ,CAACO,QAAQ,CAAC;IAC1B,CAAC,CAAC,CACCC,IAAI,CAAC9D,SAAS,CAAC,GAAG,CAAC,CAAC,CACpB8D,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBF,IAAI,CAAEG,MAAM,IAAKA,MAAM,CAACC,WAAW,CAAC;EACzC,CAAC;AAAA"}
1
+ {"version":3,"names":["sha256ToBase64","SignJWT","uuid","z","WalletInstanceAttestation","generateRandomAlphaNumericString","hasStatus","createPopToken","AuthorizationDetail","object","credential_configuration_id","string","format","union","literal","type","AuthorizationDetails","array","makeParRequest","_ref","wiaCryptoContext","appFetch","fetch","clientId","codeVerifier","redirectUri","responseMode","parEndpoint","walletInstanceAttestation","authorizationDetails","assertionType","wiaPublicKey","getPublicKey","parUrl","URL","aud","protocol","hostname","iss","decode","payload","cnf","jwk","kid","signedWiaPoP","jti","v4","codeChallengeMethod","codeChallenge","signedJwtForPar","setProtectedHeader","typ","setPayload","response_type","response_mode","client_id","state","code_challenge","code_challenge_method","authorization_details","redirect_uri","client_assertion_type","client_assertion","setIssuedAt","setExpirationTime","sign","formBody","URLSearchParams","request","method","headers","body","toString","then","res","json","result","request_uri"],"sourceRoot":"../../../src","sources":["utils/par.ts"],"mappings":"AAAA,SACEA,cAAc,EAEdC,OAAO,QACF,6BAA6B;AACpC,OAAOC,IAAI,MAAM,mBAAmB;AACpC,OAAO,KAAKC,CAAC,MAAM,KAAK;AACxB,OAAO,KAAKC,yBAAyB,MAAM,gCAAgC;AAC3E,SAASC,gCAAgC,EAAEC,SAAS,QAAQ,QAAQ;AACpE,SAASC,cAAc,QAAQ,OAAO;AAGtC,OAAO,MAAMC,mBAAmB,GAAGL,CAAC,CAACM,MAAM,CAAC;EAC1CC,2BAA2B,EAAEP,CAAC,CAACQ,MAAM,CAAC,CAAC;EACvCC,MAAM,EAAET,CAAC,CAACU,KAAK,CAAC,CAACV,CAAC,CAACW,OAAO,CAAC,WAAW,CAAC,EAAEX,CAAC,CAACW,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC;EACpEC,IAAI,EAAEZ,CAAC,CAACW,OAAO,CAAC,mBAAmB;AACrC,CAAC,CAAC;AAGF,OAAO,MAAME,oBAAoB,GAAGb,CAAC,CAACc,KAAK,CAACT,mBAAmB,CAAC;;AAEhE;AACA;AACA;AACA,OAAO,MAAMU,cAAc,GACzBC,IAAA;EAAA,IAAC;IACCC,gBAAgB;IAChBC,QAAQ,GAAGC;EAIb,CAAC,GAAAH,IAAA;EAAA,OACD,OACEI,QAAgB,EAChBC,YAAoB,EACpBC,WAAmB,EACnBC,YAAoB,EACpBC,WAAmB,EACnB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ACpCgC,gBAAgB,EAAElC,yBAAyB,GAAG,GAAG,GAAGgB;IACtD,CAAC,CAAC,CACDmB,WAAW,CAAC,CAAC,CAAC;IAAA,CACdC,iBAAiB,CAAC,MAAM,CAAC,CACzBC,IAAI,CAAC,CAAC;;IAET;IACA,IAAIC,QAAQ,GAAG,IAAIC,eAAe,CAAC;MACjCd,aAAa,EAAE,MAAM;MACrBE,SAAS,EAAEhC,QAAQ;MACnBkC,cAAc,EAAET,aAAa;MAC7BU,qBAAqB,EAAE,MAAM;MAC7BU,OAAO,EAAEnB,eAAe;MACxBY,qBAAqB,EAAE/B,aAAa;MACpCgC,gBAAgB,EAAElC,yBAAyB,GAAG,GAAG,GAAGgB;IACtD,CAAC,CAAC;IAEF,OAAO,MAAMvB,QAAQ,CAACM,WAAW,EAAE;MACjC0C,MAAM,EAAE,MAAM;MACdC,OAAO,EAAE;QACP,cAAc,EAAE;MAClB,CAAC;MACDC,IAAI,EAAEL,QAAQ,CAACM,QAAQ,CAAC;IAC1B,CAAC,CAAC,CACCC,IAAI,CAACnE,SAAS,CAAC,GAAG,CAAC,CAAC,CACpBmE,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBF,IAAI,CAAEG,MAAM,IAAKA,MAAM,CAACC,WAAW,CAAC;EACzC,CAAC;AAAA"}
@@ -0,0 +1,24 @@
1
+ import * as z from "zod";
2
+ import { SignJWT } from "@pagopa/io-react-native-jwt";
3
+
4
+ /**
5
+ * Create a signed PoP token
6
+ *
7
+ * @param payload The payload to be included in the token.
8
+ * @param crypto The crypto context that handles the key bound to the DPoP.
9
+ *
10
+ * @returns The signed crypto token.
11
+ */
12
+ export const createPopToken = async (payload, crypto) => {
13
+ const kid = await crypto.getPublicKey().then(_ => _.kid);
14
+ return new SignJWT(crypto).setPayload(payload).setProtectedHeader({
15
+ typ: "jwt-client-attestation-pop",
16
+ kid
17
+ }).setIssuedAt().setExpirationTime("5min").sign();
18
+ };
19
+ export const PoPPayload = z.object({
20
+ jti: z.string(),
21
+ aud: z.string(),
22
+ iss: z.string()
23
+ });
24
+ //# sourceMappingURL=pop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["z","SignJWT","createPopToken","payload","crypto","kid","getPublicKey","then","_","setPayload","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","PoPPayload","object","jti","string","aud","iss"],"sourceRoot":"../../../src","sources":["utils/pop.ts"],"mappings":"AAAA,OAAO,KAAKA,CAAC,MAAM,KAAK;AAExB,SAASC,OAAO,QAA4B,6BAA6B;;AAEzE;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,cAAc,GAAG,MAAAA,CAC5BC,OAAmB,EACnBC,MAAqB,KACD;EACpB,MAAMC,GAAG,GAAG,MAAMD,MAAM,CAACE,YAAY,CAAC,CAAC,CAACC,IAAI,CAAEC,CAAC,IAAKA,CAAC,CAACH,GAAG,CAAC;EAC1D,OAAO,IAAIJ,OAAO,CAACG,MAAM,CAAC,CACvBK,UAAU,CAACN,OAAO,CAAC,CACnBO,kBAAkB,CAAC;IAClBC,GAAG,EAAE,4BAA4B;IACjCN;EACF,CAAC,CAAC,CACDO,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,MAAM,CAAC,CACzBC,IAAI,CAAC,CAAC;AACX,CAAC;AAGD,OAAO,MAAMC,UAAU,GAAGf,CAAC,CAACgB,MAAM,CAAC;EACjCC,GAAG,EAAEjB,CAAC,CAACkB,MAAM,CAAC,CAAC;EACfC,GAAG,EAAEnB,CAAC,CAACkB,MAAM,CAAC,CAAC;EACfE,GAAG,EAAEpB,CAAC,CAACkB,MAAM,CAAC;AAChB,CAAC,CAAC"}
@@ -1,7 +1,8 @@
1
1
  import { SignJWT, thumbprint } from "@pagopa/io-react-native-jwt";
2
+ import { z } from "zod";
2
3
  import { JWK, fixBase64EncodingOnKey } from "../utils/jwk";
3
4
  import { getWalletProviderClient } from "../client";
4
- import { z } from "zod";
5
+ import { WalletProviderResponseError, WalletInstanceRevokedError, WalletInstanceNotFoundError, WalletInstanceAttestationIssuingError } from "../utils/errors";
5
6
 
6
7
  /**
7
8
  * Getter for an attestation request. The attestation request is a JWT that will be sent to the Wallet Provider to request a Wallet Instance Attestation.
@@ -52,6 +53,8 @@ export async function getAttestationRequest(challenge, wiaCryptoContext, integri
52
53
  * @param params.appFetch (optional) Http client
53
54
  * @param walletProviderBaseUrl Base url for the Wallet Provider
54
55
  * @returns The retrieved Wallet Instance Attestation token
56
+ * @throws {WalletInstanceRevokedError} The Wallet Instance was revoked
57
+ * @throws {WalletInstanceNotFoundError} The Wallet Instance does not exist
55
58
  */
56
59
  export const getAttestation = async _ref => {
57
60
  let {
@@ -77,7 +80,19 @@ export const getAttestation = async _ref => {
77
80
  grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer",
78
81
  assertion: signedAttestationRequest
79
82
  }
80
- }).then(result => z.string().parse(result));
83
+ }).then(result => z.string().parse(result)).catch(handleAttestationCreationError);
81
84
  return wia;
82
85
  };
86
+ const handleAttestationCreationError = e => {
87
+ if (!(e instanceof WalletProviderResponseError)) {
88
+ throw e;
89
+ }
90
+ if (e.statusCode === 403) {
91
+ throw new WalletInstanceRevokedError("Unable to get an attestation for a revoked Wallet Instance", e.claim, e.reason);
92
+ }
93
+ if (e.statusCode === 404) {
94
+ throw new WalletInstanceNotFoundError("Unable to get an attestation for a Wallet Instance that does not exist", e.claim, e.reason);
95
+ }
96
+ throw new WalletInstanceAttestationIssuingError(`Unable to obtain wallet instance attestation [response status code: ${e.statusCode}]`, e.claim, e.reason);
97
+ };
83
98
  //# sourceMappingURL=issuing.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["SignJWT","thumbprint","JWK","fixBase64EncodingOnKey","getWalletProviderClient","z","getAttestationRequest","challenge","wiaCryptoContext","integrityContext","walletProviderBaseUrl","jwk","getPublicKey","parsedJwk","parse","keyThumbprint","publicKey","kid","clientData","jwk_thumbprint","hardwareKeyTag","getHardwareKeyTag","signature","authenticatorData","getHardwareSignatureWithAuthData","JSON","stringify","setPayload","iss","sub","hardware_signature","integrity_assertion","hardware_key_tag","cnf","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","getAttestation","_ref","appFetch","fetch","api","get","then","response","nonce","signedAttestationRequest","wia","post","body","grant_type","assertion","result","string"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/issuing.ts"],"mappings":"AACA,SAASA,OAAO,EAAEC,UAAU,QAAQ,6BAA6B;AACjE,SAASC,GAAG,EAAEC,sBAAsB,QAAQ,cAAc;AAC1D,SAASC,uBAAuB,QAAQ,WAAW;AAEnD,SAASC,CAAC,QAAQ,KAAK;;AAEvB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,qBAAqBA,CACzCC,SAAiB,EACjBC,gBAA+B,EAC/BC,gBAAkC,EAClCC,qBAA6B,EACZ;EACjB,MAAMC,GAAG,GAAG,MAAMH,gBAAgB,CAACI,YAAY,CAAC,CAAC;EACjD,MAAMC,SAAS,GAAGX,GAAG,CAACY,KAAK,CAACH,GAAG,CAAC;EAChC,MAAMI,aAAa,GAAG,MAAMd,UAAU,CAACY,SAAS,CAAC;EACjD,MAAMG,SAAS,GAAG;IAAE,GAAGH,SAAS;IAAEI,GAAG,EAAEF;EAAc,CAAC;EAEtD,MAAMG,UAAU,GAAG;IACjBX,SAAS;IACTY,cAAc,EAAEJ;EAClB,CAAC;EAED,MAAMK,cAAc,GAAGX,gBAAgB,CAACY,iBAAiB,CAAC,CAAC;EAC3D,MAAM;IAAEC,SAAS;IAAEC;EAAkB,CAAC,GACpC,MAAMd,gBAAgB,CAACe,gCAAgC,CACrDC,IAAI,CAACC,SAAS,CAACR,UAAU,CAC3B,CAAC;EAEH,OAAO,IAAIlB,OAAO,CAACQ,gBAAgB,CAAC,CACjCmB,UAAU,CAAC;IACVC,GAAG,EAAEb,aAAa;IAClBc,GAAG,EAAEnB,qBAAqB;IAC1BH,SAAS;IAC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odingOnKey","getWalletProviderClient","WalletProviderResponseError","WalletInstanceRevokedError","WalletInstanceNotFoundError","WalletInstanceAttestationIssuingError","getAttestationRequest","challenge","wiaCryptoContext","integrityContext","walletProviderBaseUrl","jwk","getPublicKey","parsedJwk","parse","keyThumbprint","publicKey","kid","clientData","jwk_thumbprint","hardwareKeyTag","getHardwareKeyTag","signature","authenticatorData","getHardwareSignatureWithAuthData","JSON","stringify","setPayload","iss","sub","hardware_signature","integrity_assertion","hardware_key_tag","cnf","setProtectedHeader","typ","setIssuedAt","setExpirationTime","sign","getAttestation","_ref","appFetch","fetch","api","get","then","response","nonce","signedAttestationRequest","wia","post","body","grant_type","assertion","result","string","catch","handleAttestationCreationError","e","statusCode","claim","reason"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/issuing.ts"],"mappings":"AACA,SAASA,OAAO,EAAEC,UAAU,QAAQ,6BAA6B;AACjE,SAASC,CAAC,QAAQ,KAAK;AACvB,SAASC,GAAG,EAAEC,sBAAsB,QAAQ,cAAc;AAC1D,SAASC,uBAAuB,QAAQ,WAAW;AAEnD,SACEC,2BAA2B,EAC3BC,0BAA0B,EAC1BC,2BAA2B,EAC3BC,qCAAqC,QAChC,iBAAiB;;AAExB;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,eAAeC,qBAAqBA,CACzCC,SAAiB,EACjBC,gBAA+B,EAC/BC,gBAAkC,EAClCC,qBAA6B,EACZ;EACjB,MAAMC,GAAG,GAAG,MAAMH,gBAAgB,CAACI,YAAY,CAAC,CAAC;EACjD,MAAMC,SAAS,GAAGd,GAAG,CAACe,KAAK,CAACH,GAAG,CAAC;EAChC,MAAMI,aAAa,GAAG,MAAMlB,UAAU,CAACgB,SAAS,CAAC;EACjD,MAAMG,SAAS,GAAG;IAAE,GAAGH,SAAS;IAAEI,GAAG,EAAEF;EAAc,CAAC;EAEtD,MAAMG,UAAU,GAAG;IACjBX,SAAS;IACTY,cAAc,EAAEJ;EAClB,CAAC;EA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EACA,MAAMuC,GAAG,GAAG,MAAMN,GAAG,CAClBO,IAAI,CAAC,QAAQ,EAAE;IACdC,IAAI,EAAE;MACJC,UAAU,EAAE,6CAA6C;MACzDC,SAAS,EAAEL;IACb;EACF,CAAC,CAAC,CACDH,IAAI,CAAES,MAAM,IAAKxD,CAAC,CAACyD,MAAM,CAAC,CAAC,CAACzC,KAAK,CAACwC,MAAM,CAAC,CAAC,CAC1CE,KAAK,CAACC,8BAA8B,CAAC;EAExC,OAAOR,GAAG;AACZ,CAAC;AAED,MAAMQ,8BAA8B,GAAIC,CAAU,IAAK;EACrD,IAAI,EAAEA,CAAC,YAAYxD,2BAA2B,CAAC,EAAE;IAC/C,MAAMwD,CAAC;EACT;EAEA,IAAIA,CAAC,CAACC,UAAU,KAAK,GAAG,EAAE;IACxB,MAAM,IAAIxD,0BAA0B,CAClC,4DAA4D,EAC5DuD,CAAC,CAACE,KAAK,EACPF,CAAC,CAACG,MACJ,CAAC;EACH;EAEA,IAAIH,CAAC,CAACC,UAAU,KAAK,GAAG,EAAE;IACxB,MAAM,IAAIvD,2BAA2B,CACnC,wEAAwE,EACxEsD,CAAC,CAACE,KAAK,EACPF,CAAC,CAACG,MACJ,CAAC;EACH;EAEA,MAAM,IAAIxD,qCAAqC,CAC5C,uEAAsEqD,CAAC,CAACC,UAAW,GAAE,EACtFD,CAAC,CAACE,KAAK,EACPF,CAAC,CAACG,MACJ,CAAC;AACH,CAAC"}
@@ -38,16 +38,16 @@ export const WalletInstanceAttestationJwt = z.object({
38
38
  })),
39
39
  payload: z.intersection(Jwt.shape.payload, z.object({
40
40
  sub: z.string(),
41
- attested_security_context: z.string(),
41
+ aal: z.string(),
42
42
  authorization_endpoint: z.string(),
43
43
  response_types_supported: z.array(z.string()),
44
44
  vp_formats_supported: z.object({
45
- jwt_vp_json: z.object({
46
- alg_values_supported: z.array(z.string())
47
- }),
48
- jwt_vc_json: z.object({
49
- alg_values_supported: z.array(z.string())
50
- })
45
+ "vc+sd-jwt": z.object({
46
+ "sd-jwt_alg_values": z.array(z.string())
47
+ }).optional(),
48
+ "vp+sd-jwt": z.object({
49
+ "sd-jwt_alg_values": z.array(z.string())
50
+ }).optional()
51
51
  }),
52
52
  request_object_signing_alg_values_supported: z.array(z.string()),
53
53
  presentation_definition_uri_supported: z.boolean()
@@ -1 +1 @@
1
- {"version":3,"names":["JWK","z","UnixTime","number","min","max","Jwt","object","header","alg","string","kid","typ","x5c","array","optional","trust_chain","payload","iss","iat","exp","cnf","jwk","intersection","WalletInstanceAttestationRequestJwt","shape","literal","aud","jti","nonce","WalletInstanceAttestationJwt","sub","attested_security_context","authorization_endpoint","response_types_supported","vp_formats_supported","jwt_vp_json","alg_values_supported","jwt_vc_json","request_object_signing_alg_values_supported","presentation_definition_uri_supported","boolean"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/types.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,MAAMC,QAAQ,GAAGD,CAAC,CAACE,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC,CAAC,CAACC,GAAG,CAAC,aAAa,CAAC;AAGrD,MAAMC,GAAG,GAAGL,CAAC,CAACM,MAAM,CAAC;EACnBC,MAAM,EAAEP,CAAC,CAACM,MAAM,CAAC;IACfE,GAAG,EAAER,CAAC,CAACS,MAAM,CAAC,CAAC;IACfC,GAAG,EAAEV,CAAC,CAACS,MAAM,CAAC,CAAC;IACfE,GAAG,EAAEX,CAAC,CAACS,MAAM,CAAC,CAAC;IACfG,GAAG,EAAEZ,CAAC,CAACa,KAAK,CAACb,CAAC,CAACS,MAAM,CAAC,CAAC,CAAC,CAACK,QAAQ,CAAC,CAAC;IACnCC,WAAW,EAAEf,CAAC,CAACa,KAAK,CAACb,CAAC,CAACS,MAAM,CAAC,CAAC,CAAC,CAACK,QAAQ,CAAC;EAC5C,CAAC,CAAC;EACFE,OAAO,EAAEhB,CAAC,CAACM,MAAM,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C,CAACM,MAAM,CAAC;IACPwB,GAAG,EAAE9B,CAAC,CAACS,MAAM,CAAC,CAAC;IACfsB,yBAAyB,EAAE/B,CAAC,CAACS,MAAM,CAAC,CAAC;IACrCuB,sBAAsB,EAAEhC,CAAC,CAACS,MAAM,CAAC,CAAC;IAClCwB,wBAAwB,EAAEjC,CAAC,CAACa,KAAK,CAACb,CAAC,CAACS,MAAM,CAAC,CAAC,CAAC;IAC7CyB,oBAAoB,EAAElC,CAAC,CAACM,MAAM,CAAC;MAC7B6B,WAAW,EAAEnC,CAAC,CAACM,MAAM,CAAC;QACpB8B,oBAAoB,EAAEpC,CAAC,CAACa,KAAK,CAACb,CAAC,CAACS,MAAM,CAAC,CAAC;MAC1C,CAAC,CAAC;MACF4B,WAAW,EAAErC,CAAC,CAACM,MAAM,CAAC;QACpB8B,oBAAoB,EAAEpC,CAAC,CAACa,KAAK,CAACb,CAAC,CAACS,MAAM,CAAC,CAAC;MAC1C,CAAC;IACH,CAAC,CAAC;IACF6B,2CAA2C,EAAEtC,CAAC,CAACa,KAAK,CAACb,CAAC,CAACS,MAAM,CAAC,CAAC,CAAC;IAChE8B,qCAAqC,EAAEvC,CAAC,CAACwC,OAAO,CAAC;EACnD,CAAC,CACH;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["JWK","z","UnixTime","number","min","max","Jwt","object","header","alg","string","kid","typ","x5c","array","optional","trust_chain","payload","iss","iat","exp","cnf","jwk","intersection","WalletInstanceAttestationRequestJwt","shape","literal","aud","jti","nonce","WalletInstanceAttestationJwt","sub","aal","authorization_endpoint","response_types_supported","vp_formats_supported","request_object_signing_alg_values_supported","presentation_definition_uri_supported","boolean"],"sourceRoot":"../../../src","sources":["wallet-instance-attestation/types.ts"],"mappings":"AAAA,SAASA,GAAG,QAAQ,cAAc;AAClC,OAAO,KAAKC,CAAC,MAAM,KAAK;AAExB,MAAMC,QAAQ,GAAGD,CAAC,CAACE,MAAM,CAAC,CAAC,CAACC,GAAG,CAAC,CAAC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CAACb,CAAC,CAACS,MAAM,CAAC,CAAC,CAAC;IAChE2B,qCAAqC,EAAEpC,CAAC,CAACqC,OAAO,CAAC;EACnD,CAAC,CACH;AACF,CAAC,CAAC"}
@@ -1,4 +1,39 @@
1
1
  import z from "zod";
2
+ export type NonceDetailView = z.infer<typeof NonceDetailView>;
3
+ export declare const NonceDetailView: z.ZodObject<{
4
+ nonce: z.ZodString;
5
+ }, "strip", z.ZodTypeAny, {
6
+ nonce: string;
7
+ }, {
8
+ nonce: string;
9
+ }>;
10
+ export type WalletAttestationView = z.infer<typeof WalletAttestationView>;
11
+ export declare const WalletAttestationView: z.ZodString;
12
+ export type CreateWalletInstanceBody = z.infer<typeof CreateWalletInstanceBody>;
13
+ export declare const CreateWalletInstanceBody: z.ZodObject<{
14
+ challenge: z.ZodString;
15
+ key_attestation: z.ZodString;
16
+ hardware_key_tag: z.ZodString;
17
+ }, "strip", z.ZodTypeAny, {
18
+ challenge: string;
19
+ key_attestation: string;
20
+ hardware_key_tag: string;
21
+ }, {
22
+ challenge: string;
23
+ key_attestation: string;
24
+ hardware_key_tag: string;
25
+ }>;
26
+ export type CreateWalletAttestationBody = z.infer<typeof CreateWalletAttestationBody>;
27
+ export declare const CreateWalletAttestationBody: z.ZodObject<{
28
+ grant_type: z.ZodLiteral<"urn:ietf:params:oauth:grant-type:jwt-bearer">;
29
+ assertion: z.ZodString;
30
+ }, "strip", z.ZodTypeAny, {
31
+ grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer";
32
+ assertion: string;
33
+ }, {
34
+ grant_type: "urn:ietf:params:oauth:grant-type:jwt-bearer";
35
+ assertion: string;
36
+ }>;
2
37
  export type ProblemDetail = z.infer<typeof ProblemDetail>;
3
38
  export declare const ProblemDetail: z.ZodObject<{
4
39
  type: z.ZodOptional<z.ZodString>;
@@ -23,13 +58,6 @@ export type FiscalCode = z.infer<typeof FiscalCode>;
23
58
  export declare const FiscalCode: z.ZodString;
24
59
  export type Id = z.infer<typeof Id>;
25
60
  export declare const Id: z.ZodString;
26
- export type get_GetEntityConfiguration = typeof get_GetEntityConfiguration;
27
- export declare const get_GetEntityConfiguration: {
28
- method: z.ZodLiteral<"GET">;
29
- path: z.ZodLiteral<"/.well-known/openid-federation">;
30
- parameters: z.ZodNever;
31
- response: z.ZodUnknown;
32
- };
33
61
  export type get_GetNonce = typeof get_GetNonce;
34
62
  export declare const get_GetNonce: {
35
63
  method: z.ZodLiteral<"GET">;
@@ -106,12 +134,6 @@ export declare const post_CreateWalletAttestation: {
106
134
  };
107
135
  export declare const EndpointByMethod: {
108
136
  get: {
109
- "/.well-known/openid-federation": {
110
- method: z.ZodLiteral<"GET">;
111
- path: z.ZodLiteral<"/.well-known/openid-federation">;
112
- parameters: z.ZodNever;
113
- response: z.ZodUnknown;
114
- };
115
137
  "/nonce": {
116
138
  method: z.ZodLiteral<"GET">;
117
139
  path: z.ZodLiteral<"/nonce">;
@@ -1 +1 @@
1
- {"version":3,"file":"wallet-provider.d.ts","sourceRoot":"","sources":["../../../../src/client/generated/wallet-provider.ts"],"names":[],"mappings":"AAAA,OAAO,CAAC,MAAM,KAAK,CAAC;AAEpB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,aAAa,CAAC,CAAC;AAC1D,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;EAMxB,CAAC;AAEH,MAAM,MAAM,UAAU,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,UAAU,CAAC,CAAC;AACpD,eAAO,MAAM,UAAU,aAAa,CAAC;AAErC,MAAM,MAAM,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;AACpC,eAAO,MAAM,EAAE,aAAa,CAAC;AAE7B,MAAM,MAAM,0BAA0B,GAAG,OAAO,0BAA0B,CAAC;AAC3E,eAAO,MAAM,0BAA0B;;;;;CAKtC,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC;AAC/C,eAAO,M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;IAGD,OAAO,EAAE,OAAO;IAFnC,OAAO,EAAE,MAAM,CAAM;gBAEF,OAAO,EAAE,OAAO;IAEnC,UAAU,CAAC,OAAO,EAAE,MAAM;IAM1B,GAAG,CAAC,IAAI,SAAS,MAAM,YAAY,EAAE,SAAS,SAAS,YAAY,CAAC,IAAI,CAAC,EACvE,IAAI,EAAE,IAAI,EACV,GAAG,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,GAC5D,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;IAM1C,IAAI,CAAC,IAAI,SAAS,MAAM,aAAa,EAAE,SAAS,SAAS,aAAa,CAAC,IAAI,CAAC,EAC1E,IAAI,EAAE,IAAI,EACV,GAAG,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,YAAY,CAAC,CAAC,CAAC,GAC5D,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC;CAI3C;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,MAAM,aAEjE;;AAED;;;;;;;;EAQE"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,IAAI,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEnF,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AA4B3D,eAAO,MAAM,uBAAuB,YAAa;IAC/C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,4BAmBA,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,SAAS,IAAI,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AAEnF,MAAM,MAAM,oBAAoB,GAAG,uBAAuB,CAAC;AAuB3D,eAAO,MAAM,uBAAuB,YAAa;IAC/C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,4BAmBA,CAAC"}
@@ -1,4 +1,5 @@
1
1
  /**
2
+ * WARNING: This is the first function to be called in the issuing flow. The next function to be called is {@link evaluateIssuerTrust}.
2
3
  * The beginning of the issuing flow.
3
4
  * To be implemented accordind to the user touchpoint
4
5
  *
@@ -1 +1 @@
1
- {"version":3,"file":"01-start-flow.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/01-start-flow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC"}
1
+ {"version":3,"file":"01-start-flow.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/01-start-flow.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc,EAAE,MAAM,CAAC;CACxB,CAAC"}
@@ -7,10 +7,11 @@ export type EvaluateIssuerTrust = (issuerUrl: Out<StartFlow>["issuerUrl"], conte
7
7
  issuerConf: CredentialIssuerEntityConfiguration["payload"]["metadata"];
8
8
  }>;
9
9
  /**
10
+ * WARNING: This function must be called after {@link startFlow}. The next function to be called is {@link startUserAuthorization}.
10
11
  * The Issuer trust evaluation phase.
11
12
  * Fetch the Issuer's configuration and verify trust.
12
13
  *
13
- * @param issuerUrl The base url of the Issuer
14
+ * @param issuerUrl The base url of the Issuer returned by {@link startFlow}
14
15
  * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
15
16
  * @returns The Issuer's configuration
16
17
  */
@@ -1 +1 @@
1
- {"version":3,"file":"02-evaluate-issuer-trust.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/02-evaluate-issuer-trust.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,MAAM,mBAAmB,GAAG,CAChC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,EACtC,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC;IACX,UAAU,EAAE,mCAAmC,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;CACxE,CAAC,CAAC;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,mBAAmB,EAAE,mBAQjC,CAAC"}
1
+ {"version":3,"file":"02-evaluate-issuer-trust.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/02-evaluate-issuer-trust.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mCAAmC,EAAE,MAAM,mBAAmB,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,kBAAkB,CAAC;AAE5C,MAAM,MAAM,mBAAmB,GAAG,CAChC,SAAS,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,WAAW,CAAC,EACtC,OAAO,CAAC,EAAE;IACR,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC;IACX,UAAU,EAAE,mCAAmC,CAAC,SAAS,CAAC,CAAC,UAAU,CAAC,CAAC;CACxE,CAAC,CAAC;AAEH;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,EAAE,mBAQjC,CAAC"}
@@ -0,0 +1,41 @@
1
+ import { type CryptoContext } from "@pagopa/io-react-native-jwt";
2
+ import { type Out } from "../../utils/misc";
3
+ import type { StartFlow } from "./01-start-flow";
4
+ import type { EvaluateIssuerTrust } from "./02-evaluate-issuer-trust";
5
+ import { type AuthorizationContext, type AuthorizationResult } from "../../utils/auth";
6
+ import { CredentialResponse } from "./types";
7
+ export type StartCredentialIssuance = (issuerConf: Out<EvaluateIssuerTrust>["issuerConf"], credentialType: Out<StartFlow>["credentialType"], context: {
8
+ wiaCryptoContext: CryptoContext;
9
+ credentialCryptoContext: CryptoContext;
10
+ authorizationContext?: AuthorizationContext;
11
+ walletInstanceAttestation: string;
12
+ redirectUri: string;
13
+ idphint: string;
14
+ appFetch?: GlobalFetch["fetch"];
15
+ }) => Promise<CredentialResponse>;
16
+ /**
17
+ * Starts the credential issuance flow to obtain a credential from the issuer.
18
+ * @param issuerConf The Issuer configuration
19
+ * @param credentialType The type of the credential to be requested
20
+ * @param context.wiaCryptoContext The context to access the key associated with the Wallet Instance Attestation
21
+ * @param context.credentialCryptoContext The context to access the key to associat with credential
22
+ * @param context.walletInstanceAttestation The Wallet Instance Attestation token
23
+ * @param context.authorizationContext The context to identify the user which will be used to start the authorization. It's needed only when requesting a PersonalIdentificationData credential. The implementantion should open an in-app browser capable of catching the redirectSchema. If not specified, the default browser is used.
24
+ * @param context.redirectUri The internal URL to which to redirect has passed the in-app browser login phase. If you don't use authorizationContext remember to register this URL as customUrl or deepLink. See https://reactnative.dev/docs/linking
25
+ * @param context.idphint Unique identifier of the SPID IDP
26
+ * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
27
+ * @throws {AuthorizationError} When the response from the authorization response is not parsable
28
+ * @returns The credential obtained
29
+ */
30
+ export declare const startCredentialIssuance: StartCredentialIssuance;
31
+ /**
32
+ * Authorizes the user using the query mode and the authorization context.
33
+ * @param authzRequestEndpoint The authorization endpoint of the authorization server
34
+ * @param params The query parameters to be used in the request
35
+ * @param redirectUri The URL to which the redirect is made is usually a custom URL or deeplink
36
+ * @param authorizationContext The AuthorizationContext to manage the internal webview. If not specified, the default browser is used
37
+ * @returns The authrozation result containing the authorization code, state and issuer
38
+ */
39
+ export declare const authorizeUserWithQueryMode: (authzRequestEndpoint: string, params: URLSearchParams, redirectUri: string, authorizationContext?: AuthorizationContext) => Promise<AuthorizationResult>;
40
+ export declare const createNonceProof: (nonce: string, issuer: string, audience: string, ctx: CryptoContext) => Promise<string>;
41
+ //# sourceMappingURL=03-start-credential-issuance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"03-start-credential-issuance.d.ts","sourceRoot":"","sources":["../../../../src/credential/issuance/03-start-credential-issuance.ts"],"names":[],"mappings":"AAEA,OAAO,EAAW,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC1E,OAAO,EAIL,KAAK,GAAG,EACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAQtE,OAAO,EAGL,KAAK,oBAAoB,EACzB,KAAK,mBAAmB,EACzB,MAAM,kBAAkB,CAAC;AAI1B,OAAO,EAAE,kBAAkB,EAAoC,MAAM,SAAS,CAAC;AAuD/E,MAAM,MAAM,uBAAuB,GAAG,CACpC,UAAU,EAAE,GAAG,CAAC,mBAAmB,CAAC,CAAC,YAAY,CAAC,EAClD,cAAc,EAAE,GAAG,CAAC,SAAS,CAAC,CAAC,gBAAgB,CAAC,EAChD,OAAO,EAAE;IACP,gBAAgB,EAAE,aAAa,CAAC;IAChC,uBAAuB,EAAE,aAAa,CAAC;IACvC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IAC5C,yBAAyB,EAAE,MAAM,CAAC;IAClC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,WAAW,CAAC,OAAO,CAAC,CAAC;CACjC,KACE,OAAO,CAAC,kBAAkB,CAAC,CAAC;AAEjC;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,uBAAuB,EAAE,uBAgNrC,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,0BAA0B,yBACf,MAAM,UACpB,eAAe,eACV,MAAM,yBACI,oBAAoB,KAC1C,QAAQ,mBAAmB,CAkD7B,CAAC;AAEF,eAAO,MAAM,gBAAgB,UACpB,MAAM,UACL,MAAM,YACJ,MAAM,OACX,aAAa,KACjB,QAAQ,MAAM,CAehB,CAAC"}