@pagopa/io-react-native-wallet 3.1.2 → 3.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (174) hide show
  1. package/lib/commonjs/credential/issuance/README.md +44 -17
  2. package/lib/commonjs/credential/issuance/v1.0.0/03-complete-user-authorization.js +5 -2
  3. package/lib/commonjs/credential/issuance/v1.0.0/03-complete-user-authorization.js.map +1 -1
  4. package/lib/commonjs/credential/issuance/v1.0.0/05-obtain-credential.js +5 -1
  5. package/lib/commonjs/credential/issuance/v1.0.0/05-obtain-credential.js.map +1 -1
  6. package/lib/commonjs/credential/issuance/v1.0.0/index.js +1 -0
  7. package/lib/commonjs/credential/issuance/v1.0.0/index.js.map +1 -1
  8. package/lib/commonjs/credential/issuance/v1.3.3/03-complete-user-authorization.js +1 -1
  9. package/lib/commonjs/credential/issuance/v1.3.3/03-complete-user-authorization.js.map +1 -1
  10. package/lib/commonjs/credential/issuance/v1.3.3/05-obtain-credential.js +147 -52
  11. package/lib/commonjs/credential/issuance/v1.3.3/05-obtain-credential.js.map +1 -1
  12. package/lib/commonjs/credential/issuance/v1.3.3/index.js +1 -0
  13. package/lib/commonjs/credential/issuance/v1.3.3/index.js.map +1 -1
  14. package/lib/commonjs/credential/presentation/api/types.js.map +1 -1
  15. package/lib/commonjs/credential/presentation/v1.0.0/05-verify-request-object.js +18 -12
  16. package/lib/commonjs/credential/presentation/v1.0.0/05-verify-request-object.js.map +1 -1
  17. package/lib/commonjs/credential/presentation/v1.0.0/07-send-authorization-response.js +3 -0
  18. package/lib/commonjs/credential/presentation/v1.0.0/07-send-authorization-response.js.map +1 -1
  19. package/lib/commonjs/credential/presentation/v1.0.0/index.js +0 -2
  20. package/lib/commonjs/credential/presentation/v1.0.0/index.js.map +1 -1
  21. package/lib/commonjs/credential/presentation/v1.0.0/mappers.js +23 -13
  22. package/lib/commonjs/credential/presentation/v1.0.0/mappers.js.map +1 -1
  23. package/lib/commonjs/credential/presentation/v1.0.0/types.js +25 -17
  24. package/lib/commonjs/credential/presentation/v1.0.0/types.js.map +1 -1
  25. package/lib/commonjs/credential/presentation/v1.3.3/05-verify-request-object.js +29 -6
  26. package/lib/commonjs/credential/presentation/v1.3.3/05-verify-request-object.js.map +1 -1
  27. package/lib/commonjs/credential/presentation/v1.3.3/07-send-authorization-response.js +9 -6
  28. package/lib/commonjs/credential/presentation/v1.3.3/07-send-authorization-response.js.map +1 -1
  29. package/lib/commonjs/credential/presentation/v1.3.3/mappers.js +25 -13
  30. package/lib/commonjs/credential/presentation/v1.3.3/mappers.js.map +1 -1
  31. package/lib/commonjs/credential/presentation/v1.3.3/types.js +6 -3
  32. package/lib/commonjs/credential/presentation/v1.3.3/types.js.map +1 -1
  33. package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js +26 -1
  34. package/lib/commonjs/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
  35. package/lib/commonjs/credentials-catalogue/v1.3.3/fetch-and-parse-catalogue.js +4 -0
  36. package/lib/commonjs/credentials-catalogue/v1.3.3/fetch-and-parse-catalogue.js.map +1 -1
  37. package/lib/commonjs/credentials-catalogue/v1.3.3/fetch-translations.js +5 -3
  38. package/lib/commonjs/credentials-catalogue/v1.3.3/fetch-translations.js.map +1 -1
  39. package/lib/commonjs/credentials-catalogue/v1.3.3/mappers.js +9 -1
  40. package/lib/commonjs/credentials-catalogue/v1.3.3/mappers.js.map +1 -1
  41. package/lib/commonjs/credentials-catalogue/v1.3.3/types.js +49 -1
  42. package/lib/commonjs/credentials-catalogue/v1.3.3/types.js.map +1 -1
  43. package/lib/commonjs/utils/callbacks.js +25 -6
  44. package/lib/commonjs/utils/callbacks.js.map +1 -1
  45. package/lib/commonjs/utils/crypto.js +58 -5
  46. package/lib/commonjs/utils/crypto.js.map +1 -1
  47. package/lib/module/credential/issuance/README.md +44 -17
  48. package/lib/module/credential/issuance/v1.0.0/03-complete-user-authorization.js +6 -3
  49. package/lib/module/credential/issuance/v1.0.0/03-complete-user-authorization.js.map +1 -1
  50. package/lib/module/credential/issuance/v1.0.0/05-obtain-credential.js +4 -1
  51. package/lib/module/credential/issuance/v1.0.0/05-obtain-credential.js.map +1 -1
  52. package/lib/module/credential/issuance/v1.0.0/index.js +2 -1
  53. package/lib/module/credential/issuance/v1.0.0/index.js.map +1 -1
  54. package/lib/module/credential/issuance/v1.3.3/03-complete-user-authorization.js +1 -1
  55. package/lib/module/credential/issuance/v1.3.3/03-complete-user-authorization.js.map +1 -1
  56. package/lib/module/credential/issuance/v1.3.3/05-obtain-credential.js +143 -49
  57. package/lib/module/credential/issuance/v1.3.3/05-obtain-credential.js.map +1 -1
  58. package/lib/module/credential/issuance/v1.3.3/index.js +2 -1
  59. package/lib/module/credential/issuance/v1.3.3/index.js.map +1 -1
  60. package/lib/module/credential/presentation/api/types.js.map +1 -1
  61. package/lib/module/credential/presentation/v1.0.0/05-verify-request-object.js +13 -7
  62. package/lib/module/credential/presentation/v1.0.0/05-verify-request-object.js.map +1 -1
  63. package/lib/module/credential/presentation/v1.0.0/07-send-authorization-response.js +4 -1
  64. package/lib/module/credential/presentation/v1.0.0/07-send-authorization-response.js.map +1 -1
  65. package/lib/module/credential/presentation/v1.0.0/index.js +0 -2
  66. package/lib/module/credential/presentation/v1.0.0/index.js.map +1 -1
  67. package/lib/module/credential/presentation/v1.0.0/mappers.js +23 -13
  68. package/lib/module/credential/presentation/v1.0.0/mappers.js.map +1 -1
  69. package/lib/module/credential/presentation/v1.0.0/types.js +23 -15
  70. package/lib/module/credential/presentation/v1.0.0/types.js.map +1 -1
  71. package/lib/module/credential/presentation/v1.3.3/05-verify-request-object.js +28 -6
  72. package/lib/module/credential/presentation/v1.3.3/05-verify-request-object.js.map +1 -1
  73. package/lib/module/credential/presentation/v1.3.3/07-send-authorization-response.js +9 -6
  74. package/lib/module/credential/presentation/v1.3.3/07-send-authorization-response.js.map +1 -1
  75. package/lib/module/credential/presentation/v1.3.3/mappers.js +25 -13
  76. package/lib/module/credential/presentation/v1.3.3/mappers.js.map +1 -1
  77. package/lib/module/credential/presentation/v1.3.3/types.js +5 -2
  78. package/lib/module/credential/presentation/v1.3.3/types.js.map +1 -1
  79. package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js +24 -0
  80. package/lib/module/credentials-catalogue/api/DigitalCredentialsCatalogue.js.map +1 -1
  81. package/lib/module/credentials-catalogue/v1.3.3/fetch-and-parse-catalogue.js +5 -1
  82. package/lib/module/credentials-catalogue/v1.3.3/fetch-and-parse-catalogue.js.map +1 -1
  83. package/lib/module/credentials-catalogue/v1.3.3/fetch-translations.js +5 -3
  84. package/lib/module/credentials-catalogue/v1.3.3/fetch-translations.js.map +1 -1
  85. package/lib/module/credentials-catalogue/v1.3.3/mappers.js +9 -1
  86. package/lib/module/credentials-catalogue/v1.3.3/mappers.js.map +1 -1
  87. package/lib/module/credentials-catalogue/v1.3.3/types.js +47 -0
  88. package/lib/module/credentials-catalogue/v1.3.3/types.js.map +1 -1
  89. package/lib/module/utils/callbacks.js +26 -7
  90. package/lib/module/utils/callbacks.js.map +1 -1
  91. package/lib/module/utils/crypto.js +57 -6
  92. package/lib/module/utils/crypto.js.map +1 -1
  93. package/lib/typescript/credential/issuance/api/05-obtain-credential.d.ts +20 -0
  94. package/lib/typescript/credential/issuance/api/05-obtain-credential.d.ts.map +1 -1
  95. package/lib/typescript/credential/issuance/v1.0.0/03-complete-user-authorization.d.ts.map +1 -1
  96. package/lib/typescript/credential/issuance/v1.0.0/05-obtain-credential.d.ts +1 -0
  97. package/lib/typescript/credential/issuance/v1.0.0/05-obtain-credential.d.ts.map +1 -1
  98. package/lib/typescript/credential/issuance/v1.0.0/index.d.ts.map +1 -1
  99. package/lib/typescript/credential/issuance/v1.3.3/05-obtain-credential.d.ts +23 -2
  100. package/lib/typescript/credential/issuance/v1.3.3/05-obtain-credential.d.ts.map +1 -1
  101. package/lib/typescript/credential/issuance/v1.3.3/index.d.ts.map +1 -1
  102. package/lib/typescript/credential/presentation/api/04-verify-certificate-chain.d.ts +9 -2
  103. package/lib/typescript/credential/presentation/api/04-verify-certificate-chain.d.ts.map +1 -1
  104. package/lib/typescript/credential/presentation/api/05-verify-request-object.d.ts +2 -2
  105. package/lib/typescript/credential/presentation/api/05-verify-request-object.d.ts.map +1 -1
  106. package/lib/typescript/credential/presentation/api/07-send-authorization-response.d.ts +2 -2
  107. package/lib/typescript/credential/presentation/api/07-send-authorization-response.d.ts.map +1 -1
  108. package/lib/typescript/credential/presentation/api/types.d.ts +18 -0
  109. package/lib/typescript/credential/presentation/api/types.d.ts.map +1 -1
  110. package/lib/typescript/credential/presentation/v1.0.0/05-verify-request-object.d.ts.map +1 -1
  111. package/lib/typescript/credential/presentation/v1.0.0/07-send-authorization-response.d.ts.map +1 -1
  112. package/lib/typescript/credential/presentation/v1.0.0/index.d.ts.map +1 -1
  113. package/lib/typescript/credential/presentation/v1.0.0/mappers.d.ts +21 -13
  114. package/lib/typescript/credential/presentation/v1.0.0/mappers.d.ts.map +1 -1
  115. package/lib/typescript/credential/presentation/v1.0.0/types.d.ts +23 -15
  116. package/lib/typescript/credential/presentation/v1.0.0/types.d.ts.map +1 -1
  117. package/lib/typescript/credential/presentation/v1.3.3/05-verify-request-object.d.ts.map +1 -1
  118. package/lib/typescript/credential/presentation/v1.3.3/07-send-authorization-response.d.ts.map +1 -1
  119. package/lib/typescript/credential/presentation/v1.3.3/mappers.d.ts +89 -79
  120. package/lib/typescript/credential/presentation/v1.3.3/mappers.d.ts.map +1 -1
  121. package/lib/typescript/credential/presentation/v1.3.3/types.d.ts +87 -79
  122. package/lib/typescript/credential/presentation/v1.3.3/types.d.ts.map +1 -1
  123. package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts +73 -0
  124. package/lib/typescript/credentials-catalogue/api/DigitalCredentialsCatalogue.d.ts.map +1 -1
  125. package/lib/typescript/credentials-catalogue/api/index.d.ts +6 -5
  126. package/lib/typescript/credentials-catalogue/api/index.d.ts.map +1 -1
  127. package/lib/typescript/credentials-catalogue/v1.0.0/mappers.d.ts +25 -0
  128. package/lib/typescript/credentials-catalogue/v1.0.0/mappers.d.ts.map +1 -1
  129. package/lib/typescript/credentials-catalogue/v1.3.3/fetch-and-parse-catalogue.d.ts.map +1 -1
  130. package/lib/typescript/credentials-catalogue/v1.3.3/fetch-translations.d.ts.map +1 -1
  131. package/lib/typescript/credentials-catalogue/v1.3.3/mappers.d.ts +51 -0
  132. package/lib/typescript/credentials-catalogue/v1.3.3/mappers.d.ts.map +1 -1
  133. package/lib/typescript/credentials-catalogue/v1.3.3/types.d.ts +33 -0
  134. package/lib/typescript/credentials-catalogue/v1.3.3/types.d.ts.map +1 -1
  135. package/lib/typescript/utils/callbacks.d.ts.map +1 -1
  136. package/lib/typescript/utils/crypto.d.ts +32 -15
  137. package/lib/typescript/utils/crypto.d.ts.map +1 -1
  138. package/package.json +1 -1
  139. package/src/credential/issuance/README.md +44 -17
  140. package/src/credential/issuance/api/05-obtain-credential.ts +24 -0
  141. package/src/credential/issuance/v1.0.0/03-complete-user-authorization.ts +8 -3
  142. package/src/credential/issuance/v1.0.0/05-obtain-credential.ts +6 -0
  143. package/src/credential/issuance/v1.0.0/index.ts +5 -1
  144. package/src/credential/issuance/v1.3.3/03-complete-user-authorization.ts +1 -1
  145. package/src/credential/issuance/v1.3.3/05-obtain-credential.ts +175 -80
  146. package/src/credential/issuance/v1.3.3/index.ts +5 -1
  147. package/src/credential/presentation/api/04-verify-certificate-chain.ts +9 -2
  148. package/src/credential/presentation/api/05-verify-request-object.ts +2 -2
  149. package/src/credential/presentation/api/07-send-authorization-response.ts +2 -2
  150. package/src/credential/presentation/api/types.ts +16 -0
  151. package/src/credential/presentation/v1.0.0/05-verify-request-object.ts +21 -10
  152. package/src/credential/presentation/v1.0.0/07-send-authorization-response.ts +7 -0
  153. package/src/credential/presentation/v1.0.0/index.ts +0 -2
  154. package/src/credential/presentation/v1.0.0/mappers.ts +17 -17
  155. package/src/credential/presentation/v1.0.0/types.ts +23 -15
  156. package/src/credential/presentation/v1.3.3/05-verify-request-object.ts +63 -10
  157. package/src/credential/presentation/v1.3.3/07-send-authorization-response.ts +13 -4
  158. package/src/credential/presentation/v1.3.3/mappers.ts +19 -17
  159. package/src/credential/presentation/v1.3.3/types.ts +9 -3
  160. package/src/credentials-catalogue/api/DigitalCredentialsCatalogue.ts +32 -0
  161. package/src/credentials-catalogue/api/index.ts +6 -3
  162. package/src/credentials-catalogue/v1.3.3/fetch-and-parse-catalogue.ts +6 -0
  163. package/src/credentials-catalogue/v1.3.3/fetch-translations.ts +6 -3
  164. package/src/credentials-catalogue/v1.3.3/mappers.ts +17 -1
  165. package/src/credentials-catalogue/v1.3.3/types.ts +51 -0
  166. package/src/utils/callbacks.ts +29 -8
  167. package/src/utils/crypto.ts +86 -15
  168. package/lib/commonjs/credential/presentation/v1.0.0/04-verify-certificate-chain.js +0 -12
  169. package/lib/commonjs/credential/presentation/v1.0.0/04-verify-certificate-chain.js.map +0 -1
  170. package/lib/module/credential/presentation/v1.0.0/04-verify-certificate-chain.js +0 -5
  171. package/lib/module/credential/presentation/v1.0.0/04-verify-certificate-chain.js.map +0 -1
  172. package/lib/typescript/credential/presentation/v1.0.0/04-verify-certificate-chain.d.ts +0 -3
  173. package/lib/typescript/credential/presentation/v1.0.0/04-verify-certificate-chain.d.ts.map +0 -1
  174. package/src/credential/presentation/v1.0.0/04-verify-certificate-chain.ts +0 -10
@@ -169,6 +169,32 @@ export declare const mapToCredentialsCatalogue: (input: [{
169
169
  }[];
170
170
  last_modified?: string | undefined;
171
171
  last_updated?: string | undefined;
172
+ }, {
173
+ version: string;
174
+ last_modified: string;
175
+ id: string;
176
+ name_l10n_id: string;
177
+ description_l10n_id: string;
178
+ domains: {
179
+ id: string;
180
+ name_l10n_id: string;
181
+ description_l10n_id: string;
182
+ classes: {
183
+ id: string;
184
+ name_l10n_id: string;
185
+ supported_purposes: string[];
186
+ }[];
187
+ }[];
188
+ purposes: {
189
+ id: string;
190
+ name_l10n_id: string;
191
+ }[];
192
+ localization?: {
193
+ available_locales: string[];
194
+ base_uri: string;
195
+ default_locale: string;
196
+ version: string;
197
+ } | undefined;
172
198
  }]) => {
173
199
  taxonomy_uri: string;
174
200
  credentials: {
@@ -249,6 +275,31 @@ export declare const mapToCredentialsCatalogue: (input: [{
249
275
  }[];
250
276
  iat: number;
251
277
  exp: number;
278
+ taxonomy?: {
279
+ id: string;
280
+ name_l10n_id: string;
281
+ description_l10n_id: string;
282
+ domains: {
283
+ id: string;
284
+ name_l10n_id: string;
285
+ description_l10n_id: string;
286
+ classes: {
287
+ id: string;
288
+ name_l10n_id: string;
289
+ supported_purposes: string[];
290
+ }[];
291
+ }[];
292
+ purposes: {
293
+ id: string;
294
+ name_l10n_id: string;
295
+ }[];
296
+ localization?: {
297
+ available_locales: string[];
298
+ base_uri: string;
299
+ default_locale: string;
300
+ version: string;
301
+ } | undefined;
302
+ } | undefined;
252
303
  localization?: {
253
304
  available_locales: string[];
254
305
  base_uri: string;
@@ -1 +1 @@
1
- {"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../../../src/credentials-catalogue/v1.3.3/mappers.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmErC,CAAC"}
1
+ {"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../../../../src/credentials-catalogue/v1.3.3/mappers.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,yBAAyB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAkFrC,CAAC"}
@@ -310,4 +310,37 @@ export declare const RegistryDiscoveryJwt: z.ZodObject<{
310
310
  }, z.core.$strip>;
311
311
  }, z.core.$strip>;
312
312
  export type RegistryDiscoveryJwt = z.infer<typeof RegistryDiscoveryJwt>;
313
+ /**
314
+ * Taxonomy registry, available at a dedicated endpoint.
315
+ * Provides a hierarchical classification of domains, classes, and purposes.
316
+ * @see https://italia.github.io/eid-wallet-it-docs/releases/1.3.3/en/registry.html#taxonomy
317
+ */
318
+ export declare const TaxonomyRegistry: z.ZodObject<{
319
+ version: z.ZodString;
320
+ last_modified: z.ZodString;
321
+ id: z.ZodString;
322
+ localization: z.ZodOptional<z.ZodObject<{
323
+ available_locales: z.ZodArray<z.ZodString>;
324
+ base_uri: z.ZodString;
325
+ default_locale: z.ZodString;
326
+ version: z.ZodString;
327
+ }, z.core.$strip>>;
328
+ name_l10n_id: z.ZodString;
329
+ description_l10n_id: z.ZodString;
330
+ domains: z.ZodArray<z.ZodObject<{
331
+ id: z.ZodString;
332
+ name_l10n_id: z.ZodString;
333
+ description_l10n_id: z.ZodString;
334
+ classes: z.ZodArray<z.ZodObject<{
335
+ id: z.ZodString;
336
+ name_l10n_id: z.ZodString;
337
+ supported_purposes: z.ZodArray<z.ZodString>;
338
+ }, z.core.$strip>>;
339
+ }, z.core.$strip>>;
340
+ purposes: z.ZodArray<z.ZodObject<{
341
+ id: z.ZodString;
342
+ name_l10n_id: z.ZodString;
343
+ }, z.core.$strip>>;
344
+ }, z.core.$strip>;
345
+ export type TaxonomyRegistry = z.infer<typeof TaxonomyRegistry>;
313
346
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/credentials-catalogue/v1.3.3/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAmCzB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuB1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,MAAM;;;;;;;;;;;;;iBAUjB,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AA6B5C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuC5B,CAAC;AASH;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;iBAKzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAalC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBzC,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,8BAA8B,CACtC,CAAC;AAmBF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;iBAO/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/credentials-catalogue/v1.3.3/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAmCzB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuB1B,CAAC;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAE9D,eAAO,MAAM,MAAM;;;;;;;;;;;;;iBAUjB,CAAC;AACH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,MAAM,CAAC,CAAC;AA6B5C,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuC5B,CAAC;AASH;;;GAGG;AACH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;iBAKzB,CAAC;AACH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,cAAc,CAAC,CAAC;AAE5D;;;GAGG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAalC,CAAC;AACH,MAAM,MAAM,uBAAuB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAE9E;;;GAGG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAmBzC,CAAC;AACH,MAAM,MAAM,8BAA8B,GAAG,CAAC,CAAC,KAAK,CAClD,OAAO,8BAA8B,CACtC,CAAC;AAmBF,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;iBAO/B,CAAC;AACH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AA6BxE;;;;GAIG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;iBAgB3B,CAAC;AACH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"callbacks.d.ts","sourceRoot":"","sources":["../../../src/utils/callbacks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAKhE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAEjC,KAAK,sBAAsB,GAAG,IAAI,CAChC,eAAe,EACf,SAAS,GAAG,sBAAsB,CACnC,CAAC;AAQF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,sBAuC9B,CAAC;AAIF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,GAAG,EAAE,KACV,eAAe,CAAC,WAAW,CAU7B,CAAC"}
1
+ {"version":3,"file":"callbacks.d.ts","sourceRoot":"","sources":["../../../src/utils/callbacks.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,eAAe,EAAkB,MAAM,0BAA0B,CAAC;AAKhF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAGjC,KAAK,sBAAsB,GAAG,IAAI,CAChC,eAAe,EACf,SAAS,GAAG,sBAAsB,CACnC,CAAC;AA+BF;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,EAAE,sBAoC9B,CAAC;AAIF;;;;;;;;GAQG;AACH,eAAO,MAAM,uBAAuB,GAClC,MAAM,GAAG,EAAE,KACV,eAAe,CAAC,WAAW,CAU7B,CAAC"}
@@ -1,5 +1,23 @@
1
1
  import { type CryptoContext } from "@pagopa/io-react-native-jwt";
2
2
  import { JWK } from "./jwk";
3
+ /**
4
+ * Extension of the {@link CryptoContext} that adds key generation with optional key attestation.
5
+ *
6
+ * This context requires the consumer to provide an additional method for **key generation**;
7
+ * on Android this method should also generate a key attestation as a certificate chain
8
+ * to ensure the key pair is hardware-backed.
9
+ */
10
+ export type KeyAttestationCryptoContext = CryptoContext & {
11
+ /**
12
+ * Generate a key pair with an **optional key attestation** (Android).
13
+ * @param challenge The challenge for the key attestation.
14
+ * @returns An object with a success flag and a key attestation, if it was generated.
15
+ */
16
+ generateKeyWithAttestation(challenge: string): Promise<{
17
+ success: boolean;
18
+ attestation?: string;
19
+ }>;
20
+ };
3
21
  /**
4
22
  * Create a CryptoContext bound to a key pair.
5
23
  * Key pair is supposed to exist already in the device's keychain.
@@ -33,21 +51,20 @@ export declare const convertBase64DerToPem: (certificate: string) => string;
33
51
  */
34
52
  export declare const getSigninJwkFromCert: (pemCert: string) => JWK;
35
53
  /**
36
- * Extension of the {@link CryptoContext} that adds key generation with optional key attestation.
54
+ * Retrieves the signing JWK from a x509 certificate chain.
37
55
  *
38
- * This context requires the consumer to provide an additional method for **key generation**;
39
- * on Android this method should also generate a key attestation as a certificate chain
40
- * to ensure the key pair is hardware-backed.
56
+ * @param certChain - The x509 certificate chain.
57
+ * @returns The signing JWK.
58
+ * @throws Will throw an error if no suitable keys are found.
41
59
  */
42
- export type KeyAttestationCryptoContext = CryptoContext & {
43
- /**
44
- * Generate a key pair with an **optional key attestation** (Android).
45
- * @param challenge The challenge for the key attestation.
46
- * @returns An object with a success flag and a key attestation, if it was generated.
47
- */
48
- generateKeyWithAttestation(challenge: string): Promise<{
49
- success: boolean;
50
- attestation?: string;
51
- }>;
52
- };
60
+ export declare const getJwkFromCertificateChain: (certChain: string[]) => Promise<JWK>;
61
+ /**
62
+ * Retrieves the signing JWK from a trust chain of entity configuration JWTs, matching the provided signer KID.
63
+ *
64
+ * @param trustChain - The trust chain of entity configuration JWTs.
65
+ * @param signerKid - The KID of the signer to look for in the trust chain.
66
+ * @returns The signing JWK.
67
+ * @throws Will throw an error if no suitable keys are found.
68
+ */
69
+ export declare const getJwkFromTrustChain: (trustChain: string[], signerKid: string) => JWK;
53
70
  //# sourceMappingURL=crypto.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../src/utils/crypto.ts"],"names":[],"mappings":"AAOA,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAC7E,OAAO,EAAE,GAAG,EAAE,MAAM,OAAO,CAAC;AAI5B;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,KAAG,aAsBvD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAU,CAAC,EACtC,IAAI,CAAC,gBAAgB,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,KAClD,OAAO,CAAC,CAAC,CAMX,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,aAAa,MAAM,KAAG,MACc,CAAC;AAE3E;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,KAAG,GAetD,CAAC;AAEF;;;;;;GAMG;AACH,MAAM,MAAM,2BAA2B,GAAG,aAAa,GAAG;IACxD;;;;OAIG;IACH,0BAA0B,CACxB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxD,CAAC"}
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../src/utils/crypto.ts"],"names":[],"mappings":"AAOA,OAAO,EAGL,KAAK,aAAa,EACnB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EAAE,GAAG,EAAQ,MAAM,OAAO,CAAC;AAIlC;;;;;;GAMG;AACH,MAAM,MAAM,2BAA2B,GAAG,aAAa,GAAG;IACxD;;;;OAIG;IACH,0BAA0B,CACxB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC;QAAE,OAAO,EAAE,OAAO,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;CACxD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,GAAI,QAAQ,MAAM,KAAG,aAsBvD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GAAU,CAAC,EACtC,IAAI,CAAC,gBAAgB,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,KAClD,OAAO,CAAC,CAAC,CAMX,CAAC;AACF;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,GAAI,aAAa,MAAM,KAAG,MACc,CAAC;AAE3E;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,GAAI,SAAS,MAAM,KAAG,GAetD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,GACrC,WAAW,MAAM,EAAE,KAClB,OAAO,CAAC,GAAG,CASb,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,oBAAoB,GAC/B,YAAY,MAAM,EAAE,EACpB,WAAW,MAAM,KAChB,GAiCF,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagopa/io-react-native-wallet",
3
- "version": "3.1.2",
3
+ "version": "3.2.0",
4
4
  "description": "Provide data structures, helpers and API for IO Wallet",
5
5
  "main": "lib/commonjs/index",
6
6
  "module": "lib/module/index",
@@ -8,6 +8,8 @@ Credentials instead require a simpler authorization flow and they require other
8
8
 
9
9
  The supported credentials are defined in the entity configuration of the issuer which is evaluted and parsed in the `evaluateIssuerTrust` step. Available credentials are identified with a unique `credential_configuration_id`, that must be used when requesting authorization. The Authorization Server returns an array of **credential identifiers** that map to the `credential_configuration_id` provided: to obtain the credential, one of the credential identifiers (or all of them) must be requested to the credential endpoint.
10
10
 
11
+ In the newest versions of IT-Wallet specifications it is mandatory that the cryptographic keys bound to each credential are stored in a WSCD and attested in a **Wallet Unit Attestation**, that must be sent to the Issuer when requesting a credential.
12
+
11
13
  ## Sequence Diagram
12
14
 
13
15
  ```mermaid
@@ -20,8 +22,9 @@ graph TD;
20
22
  C4.1[completeUserAuthorizationWithFormPostJwtMode]
21
23
  E4[completeUserAuthorizationWithQueryMode]
22
24
  5[authorizeAccess]
23
- 6[obtainCredential]
24
- 7[verifyAndParseCredential]
25
+ 6[WalletUnitAttestation.getAttestation]
26
+ 7[obtainCredential]
27
+ 8[verifyAndParseCredential]
25
28
  credSel{Is credential an eID?}
26
29
  proofSel{Requires MRTD PoP?}
27
30
  M1[continueUserAuthorizationWithMRTDPoPChallenge]
@@ -44,6 +47,7 @@ graph TD;
44
47
  E4 --> 5
45
48
  5 --> 6
46
49
  6 --> 7
50
+ 7 --> 8
47
51
 
48
52
  M1 --> M2
49
53
  M2 --> M3
@@ -92,6 +96,10 @@ When the credential is different than an eID, the flow requires the user to pres
92
96
 
93
97
  The expected result from the authentication process is in `form_post.jwt` format as defined in [JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)](https://openid.net/specs/oauth-v2-jarm.html#name-response-mode-form_postjwt).
94
98
 
99
+ ## Batch issuance
100
+
101
+ To obtain a batch of credentials the Issuance module exposes a dedicated method—`obtainCredentialsBatch`—that returns a list of credentials of the same type with different cryptographic data. For this reason the caller must generate multiple keys and attest them in a single Wallet Unit Attestation.
102
+
95
103
  ## Examples
96
104
 
97
105
  <details>
@@ -119,12 +127,28 @@ const { WALLET_PROVIDER_BASE_URL, WALLET_EAA_PROVIDER_BASE_URL, REDIRECT_URI } =
119
127
  * WARNING: The integrity context must be the same used when creating the Wallet Instance with the same keytag.
120
128
  */
121
129
  const walletInstanceAttestation =
122
- await WalletInstanceAttestation.getAttestation({
123
- wiaCryptoContext,
124
- integrityContext,
125
- walletProviderBaseUrl: WALLET_PROVIDER_BASE_URL,
126
- appFetch,
127
- });
130
+ await wallet.WalletInstanceAttestation.getAttestation(
131
+ {
132
+ walletProviderBaseUrl: WALLET_PROVIDER_BASE_URL,
133
+ walletSolutionId: "exampleId",
134
+ walletSolutionVersion: "1.2.3",
135
+ },
136
+ {
137
+ wiaCryptoContext,
138
+ integrityContext,
139
+ appFetch,
140
+ }
141
+ );
142
+
143
+ const credentialKeyTag = uuidv4().toString();
144
+ let walletUnitAttestation: string | undefined;
145
+
146
+ // Obtains a Wallet Unit Attestation if supported
147
+ if (wallet.WalletUnitAttestation.isSupported) {
148
+ walletUnitAttestation = await wallet.WalletUnitAttestation.getAttestation(); // See the Wallet Unit Attestation README for more details
149
+ } else {
150
+ await generate(credentialKeyTag); // Let's assume this function generates a new hardware-backed key pair
151
+ }
128
152
 
129
153
  const pid = {
130
154
  credential: "example",
@@ -133,9 +157,6 @@ const pid = {
133
157
  credentialType: "PersonIdentificationData";
134
158
  };
135
159
 
136
- // Create credential crypto context
137
- const credentialKeyTag = uuidv4().toString();
138
- await generate(credentialKeyTag); // Let's assume this function generates a new hardware-backed key pair
139
160
  const credentialCryptoContext = createCryptoContextFor(credentialKeyTag);
140
161
 
141
162
  // Evaluate issuer trust
@@ -271,12 +292,18 @@ const { WALLET_PROVIDER_BASE_URL, WALLET_EID_PROVIDER_BASE_URL, REDIRECT_URI } =
271
292
  * WARNING: The integrity context must be the same used when creating the Wallet Instance with the same keytag.
272
293
  */
273
294
  const walletInstanceAttestation =
274
- await WalletInstanceAttestation.getAttestation({
275
- wiaCryptoContext,
276
- integrityContext,
277
- walletProviderBaseUrl: WALLET_PROVIDER_BASE_URL,
278
- appFetch,
279
- });
295
+ await wallet.WalletInstanceAttestation.getAttestation(
296
+ {
297
+ walletProviderBaseUrl: WALLET_PROVIDER_BASE_URL,
298
+ walletSolutionId: "exampleId",
299
+ walletSolutionVersion: "1.2.3",
300
+ },
301
+ {
302
+ wiaCryptoContext,
303
+ integrityContext,
304
+ appFetch,
305
+ }
306
+ );
280
307
 
281
308
  const idpHit = "https://example.com"; // Let's assume this is the IDP hint
282
309
 
@@ -41,4 +41,28 @@ export interface ObtainCredentialApi {
41
41
  credential: string;
42
42
  format: CredentialFormat;
43
43
  }>;
44
+
45
+ /**
46
+ * Obtains a batch of credentials from the issuer.
47
+ * The batch includes the same credential format and dataset with different cryptographic data.
48
+ * For this reason, the function accepts a list of {@link CryptoContext}; the rest of the parameters are the same as {@link obtainCredential}.
49
+ * @since 1.3.3
50
+ *
51
+ * @returns The list of credentials issued in the batch.
52
+ */
53
+ obtainCredentialsBatch(
54
+ issuerConf: IssuerConfig,
55
+ accessToken: Out<AuthorizeAccessApi["authorizeAccess"]>["accessToken"],
56
+ clientId: string,
57
+ credentialDefinition: {
58
+ credential_configuration_id: string;
59
+ credential_identifier: string;
60
+ },
61
+ context: {
62
+ dPopCryptoContext: CryptoContext;
63
+ credentialCryptoContexts: CryptoContext[];
64
+ walletUnitAttestation?: string;
65
+ appFetch?: GlobalFetch["fetch"];
66
+ }
67
+ ): Promise<{ credential: string; format: CredentialFormat }[]>;
44
68
  }
@@ -17,7 +17,7 @@ import { ResponseUriResultShape } from "./types";
17
17
  import { getJwtFromFormPost } from "../../../utils/decoder";
18
18
  import { AuthorizationError, AuthorizationIdpError } from "../common/errors";
19
19
  import { LogLevel, Logger } from "../../../utils/logging";
20
- import { RequestObjectPayload } from "../../presentation/v1.0.0/types";
20
+ import { RawRequestObject } from "../../presentation/v1.0.0/types";
21
21
  import { RemotePresentation as RemotePresentationFlow } from "../../presentation/v1.0.0";
22
22
  import type { IssuanceApi } from "../api";
23
23
  import type { RemotePresentation } from "../../presentation";
@@ -105,7 +105,12 @@ export const getRequestedCredentialToBePresented: IssuanceApi["getRequestedCrede
105
105
  .then(hasStatusOrThrow(200, IssuerResponseError))
106
106
  .then((res) => res.text())
107
107
  .then((jws) => decode(jws))
108
- .then((reqObj) => RequestObjectPayload.safeParse(reqObj.payload));
108
+ .then((reqObj) =>
109
+ RawRequestObject.safeParse({
110
+ header: reqObj.protectedHeader,
111
+ payload: reqObj.payload,
112
+ })
113
+ );
109
114
 
110
115
  if (!requestObject.success) {
111
116
  Logger.log(
@@ -117,7 +122,7 @@ export const getRequestedCredentialToBePresented: IssuanceApi["getRequestedCrede
117
122
  reason: requestObject.error.message,
118
123
  });
119
124
  }
120
- return requestObject.data;
125
+ return requestObject.data.payload;
121
126
  };
122
127
 
123
128
  export const completeUserAuthorizationWithFormPostJwtMode: IssuanceApi["completeUserAuthorizationWithFormPostJwtMode"] =
@@ -10,6 +10,7 @@ import {
10
10
  IssuerResponseErrorCodes,
11
11
  ResponseErrorBuilder,
12
12
  UnexpectedStatusCodeError,
13
+ UnimplementedFeatureError,
13
14
  ValidationFailed,
14
15
  } from "../../../utils/errors";
15
16
  import { createDPopToken } from "../../../utils/dpop";
@@ -210,3 +211,8 @@ const handleObtainCredentialError = (e: unknown) => {
210
211
  })
211
212
  .buildFrom(e);
212
213
  };
214
+
215
+ export const obtainCredentialsBatch: IssuanceApi["obtainCredentialsBatch"] =
216
+ () => {
217
+ throw new UnimplementedFeatureError("obtainCredentialsBatch", "1.0.0");
218
+ };
@@ -9,7 +9,10 @@ import {
9
9
  getRequestedCredentialToBePresented,
10
10
  } from "./03-complete-user-authorization";
11
11
  import { authorizeAccess } from "./04-authorize-access";
12
- import { obtainCredential } from "./05-obtain-credential";
12
+ import {
13
+ obtainCredential,
14
+ obtainCredentialsBatch,
15
+ } from "./05-obtain-credential";
13
16
  import { verifyAndParseCredential } from "./06-verify-and-parse-credential";
14
17
  import { MRTDPoP } from "../mrtd-pop";
15
18
 
@@ -23,6 +26,7 @@ export const Issuance: IssuanceApi = {
23
26
  completeUserAuthorizationWithFormPostJwtMode,
24
27
  authorizeAccess,
25
28
  obtainCredential,
29
+ obtainCredentialsBatch,
26
30
  verifyAndParseCredential,
27
31
  MRTDPoP,
28
32
  };
@@ -16,11 +16,11 @@ import { AuthorizationError, AuthorizationIdpError } from "../common/errors";
16
16
  import { LogLevel, Logger } from "../../../utils/logging";
17
17
  import { RemotePresentation as RemotePresentationFlow } from "../../presentation/v1.3.3";
18
18
  import { partialCallbacks } from "../../../utils/callbacks";
19
+ import { sdkConfigV1_3 } from "../../../utils/config";
19
20
  import {
20
21
  IoWalletError,
21
22
  sdkUnexpectedStatusCodeToIssuerError,
22
23
  } from "../../../utils/errors";
23
- import { sdkConfigV1_3 } from "../../../utils/config";
24
24
  import type { IssuanceApi } from "../api";
25
25
  import { mapToRequestObject } from "./mappers";
26
26
  import type { RemotePresentation } from "../../presentation";