@pagopa/io-react-native-wallet 0.7.4 → 0.9.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 (211) hide show
  1. package/README.md +49 -31
  2. package/lib/commonjs/credential/index.js +13 -0
  3. package/lib/commonjs/credential/index.js.map +1 -0
  4. package/lib/commonjs/credential/issuance/01-start-flow.js +2 -0
  5. package/lib/commonjs/credential/issuance/01-start-flow.js.map +1 -0
  6. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js +26 -0
  7. package/lib/commonjs/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
  8. package/lib/commonjs/credential/issuance/03-start-user-authorization.js +119 -0
  9. package/lib/commonjs/credential/issuance/03-start-user-authorization.js.map +1 -0
  10. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js +6 -0
  11. package/lib/commonjs/credential/issuance/04-complete-user-authorization.js.map +1 -0
  12. package/lib/commonjs/credential/issuance/05-authorize-access.js +63 -0
  13. package/lib/commonjs/credential/issuance/05-authorize-access.js.map +1 -0
  14. package/lib/commonjs/credential/issuance/06-obtain-credential.js +128 -0
  15. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -0
  16. package/lib/commonjs/credential/issuance/07-confirm-credential.js +6 -0
  17. package/lib/commonjs/credential/issuance/07-confirm-credential.js.map +1 -0
  18. package/lib/commonjs/credential/issuance/const.js +9 -0
  19. package/lib/commonjs/credential/issuance/const.js.map +1 -0
  20. package/lib/commonjs/credential/issuance/index.js +34 -0
  21. package/lib/commonjs/credential/issuance/index.js.map +1 -0
  22. package/lib/commonjs/credential/presentation/01-start-flow.js +55 -0
  23. package/lib/commonjs/credential/presentation/01-start-flow.js.map +1 -0
  24. package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js +32 -0
  25. package/lib/commonjs/credential/presentation/02-evaluate-rp-trust.js.map +1 -0
  26. package/lib/commonjs/credential/presentation/03-get-request-object.js +68 -0
  27. package/lib/commonjs/credential/presentation/03-get-request-object.js.map +1 -0
  28. package/lib/commonjs/credential/presentation/04-send-authorization-response.js +139 -0
  29. package/lib/commonjs/credential/presentation/04-send-authorization-response.js.map +1 -0
  30. package/lib/commonjs/credential/presentation/index.js +34 -0
  31. package/lib/commonjs/credential/presentation/index.js.map +1 -0
  32. package/lib/commonjs/{rp → credential/presentation}/types.js +17 -34
  33. package/lib/commonjs/credential/presentation/types.js.map +1 -0
  34. package/lib/commonjs/index.js +10 -61
  35. package/lib/commonjs/index.js.map +1 -1
  36. package/lib/commonjs/pid/index.js +1 -3
  37. package/lib/commonjs/pid/index.js.map +1 -1
  38. package/lib/commonjs/sd-jwt/index.js +1 -1
  39. package/lib/commonjs/sd-jwt/index.js.map +1 -1
  40. package/lib/commonjs/sd-jwt/types.js +1 -1
  41. package/lib/commonjs/sd-jwt/types.js.map +1 -1
  42. package/lib/commonjs/trust/chain.js +32 -4
  43. package/lib/commonjs/trust/chain.js.map +1 -1
  44. package/lib/commonjs/trust/index.js +105 -20
  45. package/lib/commonjs/trust/index.js.map +1 -1
  46. package/lib/commonjs/trust/types.js +54 -35
  47. package/lib/commonjs/trust/types.js.map +1 -1
  48. package/lib/commonjs/utils/crypto.js +5 -18
  49. package/lib/commonjs/utils/crypto.js.map +1 -1
  50. package/lib/commonjs/utils/misc.js +23 -0
  51. package/lib/commonjs/utils/misc.js.map +1 -0
  52. package/lib/commonjs/utils/par.js +86 -0
  53. package/lib/commonjs/utils/par.js.map +1 -0
  54. package/lib/module/credential/index.js +4 -0
  55. package/lib/module/credential/index.js.map +1 -0
  56. package/lib/module/credential/issuance/01-start-flow.js +2 -0
  57. package/lib/module/credential/issuance/01-start-flow.js.map +1 -0
  58. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js +19 -0
  59. package/lib/module/credential/issuance/02-evaluate-issuer-trust.js.map +1 -0
  60. package/lib/module/credential/issuance/03-start-user-authorization.js +109 -0
  61. package/lib/module/credential/issuance/03-start-user-authorization.js.map +1 -0
  62. package/lib/module/credential/issuance/04-complete-user-authorization.js +2 -0
  63. package/lib/module/credential/issuance/04-complete-user-authorization.js.map +1 -0
  64. package/lib/module/credential/issuance/05-authorize-access.js +55 -0
  65. package/lib/module/credential/issuance/05-authorize-access.js.map +1 -0
  66. package/lib/module/credential/issuance/06-obtain-credential.js +117 -0
  67. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -0
  68. package/lib/module/credential/issuance/07-confirm-credential.js +2 -0
  69. package/lib/module/credential/issuance/07-confirm-credential.js.map +1 -0
  70. package/lib/module/credential/issuance/const.js +2 -0
  71. package/lib/module/credential/issuance/const.js.map +1 -0
  72. package/lib/module/credential/issuance/index.js +6 -0
  73. package/lib/module/credential/issuance/index.js.map +1 -0
  74. package/lib/module/credential/presentation/01-start-flow.js +46 -0
  75. package/lib/module/credential/presentation/01-start-flow.js.map +1 -0
  76. package/lib/module/credential/presentation/02-evaluate-rp-trust.js +25 -0
  77. package/lib/module/credential/presentation/02-evaluate-rp-trust.js.map +1 -0
  78. package/lib/module/credential/presentation/03-get-request-object.js +60 -0
  79. package/lib/module/credential/presentation/03-get-request-object.js.map +1 -0
  80. package/lib/module/credential/presentation/04-send-authorization-response.js +128 -0
  81. package/lib/module/credential/presentation/04-send-authorization-response.js.map +1 -0
  82. package/lib/module/credential/presentation/index.js +6 -0
  83. package/lib/module/credential/presentation/index.js.map +1 -0
  84. package/lib/module/credential/presentation/types.js +21 -0
  85. package/lib/module/credential/presentation/types.js.map +1 -0
  86. package/lib/module/index.js +4 -5
  87. package/lib/module/index.js.map +1 -1
  88. package/lib/module/pid/index.js +1 -2
  89. package/lib/module/pid/index.js.map +1 -1
  90. package/lib/module/sd-jwt/index.js +1 -1
  91. package/lib/module/sd-jwt/index.js.map +1 -1
  92. package/lib/module/sd-jwt/types.js +1 -1
  93. package/lib/module/sd-jwt/types.js.map +1 -1
  94. package/lib/module/trust/chain.js +30 -3
  95. package/lib/module/trust/chain.js.map +1 -1
  96. package/lib/module/trust/index.js +99 -16
  97. package/lib/module/trust/index.js.map +1 -1
  98. package/lib/module/trust/types.js +50 -31
  99. package/lib/module/trust/types.js.map +1 -1
  100. package/lib/module/utils/crypto.js +2 -15
  101. package/lib/module/utils/crypto.js.map +1 -1
  102. package/lib/module/utils/misc.js +17 -0
  103. package/lib/module/utils/misc.js.map +1 -0
  104. package/lib/module/utils/par.js +74 -0
  105. package/lib/module/utils/par.js.map +1 -0
  106. package/lib/typescript/credential/index.d.ts +4 -0
  107. package/lib/typescript/credential/index.d.ts.map +1 -0
  108. package/lib/typescript/credential/issuance/01-start-flow.d.ts +11 -0
  109. package/lib/typescript/credential/issuance/01-start-flow.d.ts.map +1 -0
  110. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts +18 -0
  111. package/lib/typescript/credential/issuance/02-evaluate-issuer-trust.d.ts.map +1 -0
  112. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts +31 -0
  113. package/lib/typescript/credential/issuance/03-start-user-authorization.d.ts.map +1 -0
  114. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts +16 -0
  115. package/lib/typescript/credential/issuance/04-complete-user-authorization.d.ts.map +1 -0
  116. package/lib/typescript/credential/issuance/05-authorize-access.d.ts +26 -0
  117. package/lib/typescript/credential/issuance/05-authorize-access.d.ts.map +1 -0
  118. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts +32 -0
  119. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -0
  120. package/lib/typescript/credential/issuance/07-confirm-credential.d.ts +11 -0
  121. package/lib/typescript/credential/issuance/07-confirm-credential.d.ts.map +1 -0
  122. package/lib/typescript/credential/issuance/const.d.ts +2 -0
  123. package/lib/typescript/credential/issuance/const.d.ts.map +1 -0
  124. package/lib/typescript/credential/issuance/index.d.ts +10 -0
  125. package/lib/typescript/credential/issuance/index.d.ts.map +1 -0
  126. package/lib/typescript/credential/presentation/01-start-flow.d.ts +20 -0
  127. package/lib/typescript/credential/presentation/01-start-flow.d.ts.map +1 -0
  128. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts +18 -0
  129. package/lib/typescript/credential/presentation/02-evaluate-rp-trust.d.ts.map +1 -0
  130. package/lib/typescript/credential/presentation/03-get-request-object.d.ts +25 -0
  131. package/lib/typescript/credential/presentation/03-get-request-object.d.ts.map +1 -0
  132. package/lib/typescript/credential/presentation/04-send-authorization-response.d.ts +34 -0
  133. package/lib/typescript/credential/presentation/04-send-authorization-response.d.ts.map +1 -0
  134. package/lib/typescript/credential/presentation/index.d.ts +7 -0
  135. package/lib/typescript/credential/presentation/index.d.ts.map +1 -0
  136. package/lib/typescript/credential/presentation/types.d.ts +49 -0
  137. package/lib/typescript/credential/presentation/types.d.ts.map +1 -0
  138. package/lib/typescript/index.d.ts +4 -5
  139. package/lib/typescript/index.d.ts.map +1 -1
  140. package/lib/typescript/pid/index.d.ts +1 -2
  141. package/lib/typescript/pid/index.d.ts.map +1 -1
  142. package/lib/typescript/sd-jwt/index.d.ts +2 -2
  143. package/lib/typescript/sd-jwt/index.d.ts.map +1 -1
  144. package/lib/typescript/sd-jwt/types.d.ts +5 -5
  145. package/lib/typescript/trust/chain.d.ts +12 -3
  146. package/lib/typescript/trust/chain.d.ts.map +1 -1
  147. package/lib/typescript/trust/index.d.ts +198 -24
  148. package/lib/typescript/trust/index.d.ts.map +1 -1
  149. package/lib/typescript/trust/types.d.ts +1299 -623
  150. package/lib/typescript/trust/types.d.ts.map +1 -1
  151. package/lib/typescript/utils/crypto.d.ts +1 -1
  152. package/lib/typescript/utils/crypto.d.ts.map +1 -1
  153. package/lib/typescript/utils/dpop.d.ts +2 -2
  154. package/lib/typescript/utils/misc.d.ts +8 -0
  155. package/lib/typescript/utils/misc.d.ts.map +1 -0
  156. package/lib/typescript/utils/par.d.ts +68 -0
  157. package/lib/typescript/utils/par.d.ts.map +1 -0
  158. package/package.json +2 -2
  159. package/src/credential/index.ts +4 -0
  160. package/src/credential/issuance/01-start-flow.ts +10 -0
  161. package/src/credential/issuance/02-evaluate-issuer-trust.ts +31 -0
  162. package/src/credential/issuance/03-start-user-authorization.ts +138 -0
  163. package/src/credential/issuance/04-complete-user-authorization.ts +17 -0
  164. package/src/credential/issuance/05-authorize-access.ts +92 -0
  165. package/src/credential/issuance/06-obtain-credential.ts +179 -0
  166. package/src/credential/issuance/07-confirm-credential.ts +14 -0
  167. package/src/credential/issuance/const.ts +2 -0
  168. package/src/credential/issuance/index.ts +32 -0
  169. package/src/credential/presentation/01-start-flow.ts +51 -0
  170. package/src/credential/presentation/02-evaluate-rp-trust.ts +33 -0
  171. package/src/credential/presentation/03-get-request-object.ts +85 -0
  172. package/src/credential/presentation/04-send-authorization-response.ts +168 -0
  173. package/src/credential/presentation/index.ts +26 -0
  174. package/src/credential/presentation/types.ts +27 -0
  175. package/src/index.ts +7 -28
  176. package/src/pid/index.ts +1 -2
  177. package/src/sd-jwt/index.ts +2 -2
  178. package/src/sd-jwt/types.ts +1 -1
  179. package/src/trust/chain.ts +45 -3
  180. package/src/trust/index.ts +136 -19
  181. package/src/trust/types.ts +57 -35
  182. package/src/utils/crypto.ts +2 -20
  183. package/src/utils/misc.ts +23 -0
  184. package/src/utils/par.ts +103 -0
  185. package/lib/commonjs/pid/issuing.js +0 -276
  186. package/lib/commonjs/pid/issuing.js.map +0 -1
  187. package/lib/commonjs/rp/__test__/index.test.js +0 -172
  188. package/lib/commonjs/rp/__test__/index.test.js.map +0 -1
  189. package/lib/commonjs/rp/index.js +0 -239
  190. package/lib/commonjs/rp/index.js.map +0 -1
  191. package/lib/commonjs/rp/types.js.map +0 -1
  192. package/lib/module/pid/issuing.js +0 -266
  193. package/lib/module/pid/issuing.js.map +0 -1
  194. package/lib/module/rp/__test__/index.test.js +0 -168
  195. package/lib/module/rp/__test__/index.test.js.map +0 -1
  196. package/lib/module/rp/index.js +0 -228
  197. package/lib/module/rp/index.js.map +0 -1
  198. package/lib/module/rp/types.js +0 -36
  199. package/lib/module/rp/types.js.map +0 -1
  200. package/lib/typescript/pid/issuing.d.ts +0 -57
  201. package/lib/typescript/pid/issuing.d.ts.map +0 -1
  202. package/lib/typescript/rp/__test__/index.test.d.ts +0 -2
  203. package/lib/typescript/rp/__test__/index.test.d.ts.map +0 -1
  204. package/lib/typescript/rp/index.d.ts +0 -43
  205. package/lib/typescript/rp/index.d.ts.map +0 -1
  206. package/lib/typescript/rp/types.d.ts +0 -122
  207. package/lib/typescript/rp/types.d.ts.map +0 -1
  208. package/src/pid/issuing.ts +0 -405
  209. package/src/rp/__test__/index.test.ts +0 -250
  210. package/src/rp/index.ts +0 -287
  211. package/src/rp/types.ts +0 -42
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/trust/types.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAEzB,eAAO,MAAM,SAAS;;;;;;;;;EAAuD,CAAC;AAC9E,MAAM,MAAM,SAAS,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,SAAS,CAAC,CAAC;AAyBlD,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,eAAe,CAAC,CAAC;AAC9D,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAc1B,CAAC;AAEH,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAC7C,OAAO,yBAAyB,CACjC,CAAC;AACF,eAAO,MAAM,yBAAyB;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;KA4D7E,CAAC"}
@@ -15,5 +15,5 @@ export declare const createCryptoContextFor: (keytag: string) => CryptoContext;
15
15
  * @param fn The procedure to be executed
16
16
  * @returns The returned value of the input procedure.
17
17
  */
18
- export declare const useEphemeralKey: <R>(fn: (ephemeralContext: CryptoContext) => Promise<R>) => Promise<R>;
18
+ export declare const withEphemeralKey: <R>(fn: (ephemeralContext: CryptoContext) => Promise<R>) => Promise<R>;
19
19
  //# 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;AAG7E;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,WAAY,MAAM,KAAG,aA6BvD,CAAC;AAoBF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,6BACH,aAAa,8BAOrC,CAAC"}
1
+ {"version":3,"file":"crypto.d.ts","sourceRoot":"","sources":["../../../src/utils/crypto.ts"],"names":[],"mappings":"AAOA,OAAO,EAAc,KAAK,aAAa,EAAE,MAAM,6BAA6B,CAAC;AAG7E;;;;;;GAMG;AACH,eAAO,MAAM,sBAAsB,WAAY,MAAM,KAAG,aA6BvD,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,6BACJ,aAAa,8BAOrC,CAAC"}
@@ -17,12 +17,12 @@ export declare const DPoPPayload: z.ZodObject<{
17
17
  ath: z.ZodOptional<z.ZodString>;
18
18
  }, "strip", z.ZodTypeAny, {
19
19
  jti: string;
20
- htm: "POST" | "GET";
20
+ htm: "GET" | "POST";
21
21
  htu: string;
22
22
  ath?: string | undefined;
23
23
  }, {
24
24
  jti: string;
25
- htm: "POST" | "GET";
25
+ htm: "GET" | "POST";
26
26
  htu: string;
27
27
  ath?: string | undefined;
28
28
  }>;
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Check if a response is in the expected status, other
3
+ * @param status The expected status
4
+ * @returns The given response object
5
+ */
6
+ export declare const hasStatus: (status: number) => (res: Response) => Response;
7
+ export type Out<FN> = FN extends (...args: any[]) => Promise<any> ? Awaited<ReturnType<FN>> : never;
8
+ //# sourceMappingURL=misc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/utils/misc.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,SAAS,WACX,MAAM,WACT,QAAQ,KAAG,QAOhB,CAAC;AAIJ,MAAM,MAAM,GAAG,CAAC,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,OAAO,CAAC,GAAG,CAAC,GAC7D,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC,GACvB,KAAK,CAAC"}
@@ -0,0 +1,68 @@
1
+ /// <reference types="react-native" />
2
+ import { type CryptoContext } from "@pagopa/io-react-native-jwt";
3
+ import * as z from "zod";
4
+ export type AuthorizationDetail = z.infer<typeof AuthorizationDetail>;
5
+ export declare const AuthorizationDetail: z.ZodObject<{
6
+ credential_definition: z.ZodObject<{
7
+ type: z.ZodString;
8
+ }, "strip", z.ZodTypeAny, {
9
+ type: string;
10
+ }, {
11
+ type: string;
12
+ }>;
13
+ format: z.ZodLiteral<"vc+sd-jwt">;
14
+ type: z.ZodLiteral<"openid_credential">;
15
+ }, "strip", z.ZodTypeAny, {
16
+ type: "openid_credential";
17
+ format: "vc+sd-jwt";
18
+ credential_definition: {
19
+ type: string;
20
+ };
21
+ }, {
22
+ type: "openid_credential";
23
+ format: "vc+sd-jwt";
24
+ credential_definition: {
25
+ type: string;
26
+ };
27
+ }>;
28
+ export type AuthorizationDetails = z.infer<typeof AuthorizationDetails>;
29
+ export declare const AuthorizationDetails: z.ZodArray<z.ZodObject<{
30
+ credential_definition: z.ZodObject<{
31
+ type: z.ZodString;
32
+ }, "strip", z.ZodTypeAny, {
33
+ type: string;
34
+ }, {
35
+ type: string;
36
+ }>;
37
+ format: z.ZodLiteral<"vc+sd-jwt">;
38
+ type: z.ZodLiteral<"openid_credential">;
39
+ }, "strip", z.ZodTypeAny, {
40
+ type: "openid_credential";
41
+ format: "vc+sd-jwt";
42
+ credential_definition: {
43
+ type: string;
44
+ };
45
+ }, {
46
+ type: "openid_credential";
47
+ format: "vc+sd-jwt";
48
+ credential_definition: {
49
+ type: string;
50
+ };
51
+ }>, "many">;
52
+ /**
53
+ * Make a PAR request to the issuer and return the response url
54
+ */
55
+ export declare const makeParRequest: ({ wiaCryptoContext, appFetch, }: {
56
+ wiaCryptoContext: CryptoContext;
57
+ appFetch?: {
58
+ (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
59
+ (input: RequestInfo, init?: RequestInit | undefined): Promise<Response>;
60
+ } | undefined;
61
+ }) => (clientId: string, codeVerifier: string, walletProviderBaseUrl: string, parEndpoint: string, walletInstanceAttestation: string, authorizationDetails: {
62
+ type: "openid_credential";
63
+ format: "vc+sd-jwt";
64
+ credential_definition: {
65
+ type: string;
66
+ };
67
+ }[], assertionType: string) => Promise<string>;
68
+ //# sourceMappingURL=par.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"par.d.ts","sourceRoot":"","sources":["../../../src/utils/par.ts"],"names":[],"mappings":";AAAA,OAAO,EAEL,KAAK,aAAa,EAEnB,MAAM,6BAA6B,CAAC;AAErC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC;AAIzB,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AACtE,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;EAM9B,CAAC;AAEH,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AACxE,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;WAA+B,CAAC;AAEjE;;GAEG;AACH,eAAO,MAAM,cAAc;sBAKL,aAAa;;;;;iBAIrB,MAAM,gBACF,MAAM,yBACG,MAAM,eAChB,MAAM,6BACQ,MAAM;;;;;;oBAElB,MAAM,KACpB,QAAQ,MAAM,CA6DhB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pagopa/io-react-native-wallet",
3
- "version": "0.7.4",
3
+ "version": "0.9.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",
@@ -29,7 +29,7 @@
29
29
  "scripts": {
30
30
  "test": "jest",
31
31
  "typecheck": "tsc --noEmit",
32
- "lint": "eslint \"src/**\"",
32
+ "lint": "eslint \"src/**\" \"example/src/**\" \"__mocks__/**\"",
33
33
  "prepack": "bob build",
34
34
  "release": "release-it",
35
35
  "example": "yarn --cwd example",
@@ -0,0 +1,4 @@
1
+ import * as Issuance from "./issuance";
2
+ import * as Presentation from "./presentation";
3
+
4
+ export { Issuance, Presentation };
@@ -0,0 +1,10 @@
1
+ /**
2
+ * The beginning of the issuing flow.
3
+ * To be implemented accordind to the user touchpoint
4
+ *
5
+ * @returns The type of the Credential to be issued and the url of the Issuer
6
+ */
7
+ export type StartFlow = () => Promise<{
8
+ issuerUrl: string;
9
+ credentialType: string;
10
+ }>;
@@ -0,0 +1,31 @@
1
+ import { getCredentialIssuerEntityConfiguration } from "../../trust";
2
+ import { CredentialIssuerEntityConfiguration } from "../../trust/types";
3
+ import type { StartFlow } from "./01-start-flow";
4
+ import type { Out } from "../../utils/misc";
5
+
6
+ export type EvaluateIssuerTrust = (
7
+ issuerUrl: Out<StartFlow>["issuerUrl"],
8
+ context?: {
9
+ appFetch?: GlobalFetch["fetch"];
10
+ }
11
+ ) => Promise<{
12
+ issuerConf: CredentialIssuerEntityConfiguration["payload"]["metadata"];
13
+ }>;
14
+
15
+ /**
16
+ * The Issuer trust evaluation phase.
17
+ * Fetch the Issuer's configuration and verify trust.
18
+ *
19
+ * @param issuerUrl The base url of the Issuer
20
+ * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
21
+ * @returns The Issuer's configuration
22
+ */
23
+ export const evaluateIssuerTrust: EvaluateIssuerTrust = async (
24
+ issuerUrl,
25
+ context = {}
26
+ ) => {
27
+ const issuerConf = await getCredentialIssuerEntityConfiguration(issuerUrl, {
28
+ appFetch: context.appFetch,
29
+ }).then((_) => _.payload.metadata);
30
+ return { issuerConf };
31
+ };
@@ -0,0 +1,138 @@
1
+ import * as z from "zod";
2
+ import uuid from "react-native-uuid";
3
+ import { AuthorizationDetail, makeParRequest } from "../../utils/par";
4
+ import type { CryptoContext } from "@pagopa/io-react-native-jwt";
5
+ import { getJwtFromFormPost } from "../../utils/decoder";
6
+ import { hasStatus, type Out } from "../../utils/misc";
7
+ import type { StartFlow } from "./01-start-flow";
8
+ import type { EvaluateIssuerTrust } from "./02-evaluate-issuer-trust";
9
+ import { ASSERTION_TYPE } from "./const";
10
+
11
+ const selectCredentialDefinition = (
12
+ issuerConf: Out<EvaluateIssuerTrust>["issuerConf"],
13
+ credentialType: Out<StartFlow>["credentialType"]
14
+ ): AuthorizationDetail => {
15
+ const { credentials_supported } = issuerConf.openid_credential_issuer;
16
+
17
+ const [result] = credentials_supported
18
+ .filter((e) => e.credential_definition.type.includes(credentialType))
19
+ .map((e) => ({
20
+ credential_definition: { type: credentialType },
21
+ format: e.format,
22
+ type: "openid_credential" as const,
23
+ }));
24
+
25
+ if (!result) {
26
+ throw new Error(`No credential support the type '${credentialType}'`);
27
+ }
28
+ return result;
29
+ };
30
+
31
+ const decodeAuthorizationResponse = async (
32
+ raw: string
33
+ ): Promise<{ request_uri: string }> => {
34
+ const {
35
+ decodedJwt: { payload },
36
+ } = await getJwtFromFormPost(raw);
37
+
38
+ /**
39
+ * FIXME: [SIW-628] This step must not make any difference on the credential
40
+ * we are authorizing for, being a PID or any other (Q)EAA.
41
+ *
42
+ * Currently, PID issuer is implemented to skip the CompleteUserAuthorization step
43
+ * thus returning a stubbed (code, state) pair.
44
+ *
45
+ * This is a workaround to proceeed the flow anyway.
46
+ * If the response does not map what expected (CorrectShape),
47
+ * we try parse into (code, state) to check if we are in the PID scenario.
48
+ * In that case, a stub value is returned (will not be evaluated anyway).
49
+ *
50
+ * This workaround will be obsolete once the PID issuer fixes its implementation
51
+ */
52
+ const CorrectShape = z.object({ request_uri: z.string() });
53
+ const WrongShapeForPID = z.object({ code: z.string(), state: z.string() });
54
+
55
+ const [correct, wrong] = [
56
+ CorrectShape.safeParse(payload),
57
+ WrongShapeForPID.safeParse(payload),
58
+ ];
59
+
60
+ if (correct.success) {
61
+ return correct.data;
62
+ } else if (wrong.success) {
63
+ return { request_uri: "https://fake-request-uri" };
64
+ }
65
+ throw correct.error;
66
+ };
67
+
68
+ export type StartUserAuthorization = (
69
+ issuerConf: Out<EvaluateIssuerTrust>["issuerConf"],
70
+ credentialType: Out<StartFlow>["credentialType"],
71
+ context: {
72
+ wiaCryptoContext: CryptoContext;
73
+ walletInstanceAttestation: string;
74
+ walletProviderBaseUrl: string;
75
+ additionalParams?: Record<string, string>;
76
+ appFetch?: GlobalFetch["fetch"];
77
+ }
78
+ ) => Promise<{ requestUri: string; clientId: string }>;
79
+
80
+ /**
81
+ * Start the User authorization phase.
82
+ * Perform the Pushed Authorization Request as defined in OAuth 2.0 protocol.
83
+ *
84
+ * @param issuerConf The Issuer configuration
85
+ * @param credentialType The type of the credential to be requested
86
+ * @param context.wiaCryptoContext The context to access the key associated with the Wallet Instance Attestation
87
+ * @param context.walletInstanceAttestation The Wallet Instance Attestation token
88
+ * @param context.walletProviderBaseUrl The base url of the Wallet Provider
89
+ * @param context.additionalParams Hash set of parameters to be passed to the authorization endpoint
90
+ * (used as a temporary fix until we have a proper User identity in the PID token provider)
91
+ * TODO: [SIW-630]
92
+ * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
93
+ * @returns The request uri to continue the authorization to
94
+ */
95
+ export const startUserAuthorization: StartUserAuthorization = async (
96
+ issuerConf,
97
+ credentialType,
98
+ ctx
99
+ ) => {
100
+ const {
101
+ wiaCryptoContext,
102
+ walletInstanceAttestation,
103
+ walletProviderBaseUrl,
104
+ additionalParams = {},
105
+ appFetch = fetch,
106
+ } = ctx;
107
+ const clientId = await wiaCryptoContext.getPublicKey().then((_) => _.kid);
108
+ const codeVerifier = `${uuid.v4()}`;
109
+ // Make a PAR request to the credential issuer and return the response url
110
+ const parUrl =
111
+ issuerConf.openid_credential_issuer.pushed_authorization_request_endpoint;
112
+ const getPar = makeParRequest({ wiaCryptoContext, appFetch });
113
+ const issuerRequestUri = await getPar(
114
+ clientId,
115
+ codeVerifier,
116
+ walletProviderBaseUrl,
117
+ parUrl,
118
+ walletInstanceAttestation,
119
+ [selectCredentialDefinition(issuerConf, credentialType)],
120
+ ASSERTION_TYPE
121
+ );
122
+
123
+ // Initialize authorization by requesting the authz request uri
124
+ const authzRequestEndpoint =
125
+ issuerConf.openid_credential_issuer.authorization_endpoint;
126
+ const params = new URLSearchParams({
127
+ client_id: clientId,
128
+ request_uri: issuerRequestUri,
129
+ ...additionalParams,
130
+ });
131
+
132
+ const { request_uri } = await appFetch(`${authzRequestEndpoint}?${params}`)
133
+ .then(hasStatus(200))
134
+ .then((res) => res.text())
135
+ .then(decodeAuthorizationResponse);
136
+
137
+ return { requestUri: request_uri, clientId };
138
+ };
@@ -0,0 +1,17 @@
1
+ import type { Out } from "../../utils/misc";
2
+ import type { StartUserAuthorization } from "./03-start-user-authorization";
3
+
4
+ /**
5
+ * The interface of the phase to complete User authorization.
6
+ * It may be implemented as a Credential presentation
7
+ * or with a strong User identification
8
+ *
9
+ * @param requestUri The url to reach to complete the user authorization.
10
+ * @param cliendId Identifies the current client across all the requests of the issuing flow
11
+ *
12
+ * @returns the access code to use to request the credental
13
+ */
14
+ export type CompleteUserAuthorization = (
15
+ requestUri: Out<StartUserAuthorization>["requestUri"],
16
+ clientId: Out<StartUserAuthorization>["clientId"]
17
+ ) => Promise<{ code: string }>;
@@ -0,0 +1,92 @@
1
+ import uuid from "react-native-uuid";
2
+ import { withEphemeralKey } from "../../utils/crypto";
3
+ import { createDPopToken } from "../../utils/dpop";
4
+ import type { StartUserAuthorization } from "./03-start-user-authorization";
5
+ import { hasStatus, type Out } from "../../utils/misc";
6
+ import type { EvaluateIssuerTrust } from "./02-evaluate-issuer-trust";
7
+ import { ASSERTION_TYPE } from "./const";
8
+ import type { CompleteUserAuthorization } from "./04-complete-user-authorization";
9
+
10
+ export type AuthorizeAccess = (
11
+ issuerConf: Out<EvaluateIssuerTrust>["issuerConf"],
12
+ code: Out<CompleteUserAuthorization>["code"],
13
+ clientId: Out<StartUserAuthorization>["clientId"],
14
+ context: {
15
+ walletInstanceAttestation: string;
16
+ walletProviderBaseUrl: string;
17
+ appFetch?: GlobalFetch["fetch"];
18
+ }
19
+ ) => Promise<{
20
+ // The access token to grant access to the credential
21
+ accessToken: string;
22
+ // The nonce, to prevent reply attacks
23
+ nonce: string;
24
+ // Same as input
25
+ clientId: string;
26
+ }>;
27
+
28
+ /**
29
+ * Obtain the access token to finally request the credential
30
+ *
31
+ * @param issuerConf The Issuer configuration
32
+ * @param code The access code from the User authorization phase
33
+ * @param clientId Identifies the current client across all the requests of the issuing flow
34
+ * @param context.walletInstanceAttestation The Wallet Instance Attestation token
35
+ * @param context.walletProviderBaseUrl The base url of the Wallet Provider
36
+ * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
37
+ * @returns
38
+ */
39
+ export const authorizeAccess: AuthorizeAccess = async (
40
+ issuerConf,
41
+ code,
42
+ clientId,
43
+ context
44
+ ): Promise<{ accessToken: string; nonce: string; clientId: string }> => {
45
+ const {
46
+ appFetch = fetch,
47
+ walletInstanceAttestation,
48
+ walletProviderBaseUrl,
49
+ } = context;
50
+
51
+ const tokenUrl = issuerConf.openid_credential_issuer.token_endpoint;
52
+
53
+ // Use an ephemeral key to be destroyed after use
54
+ const signedDPop = await withEphemeralKey((ephemeralContext) =>
55
+ createDPopToken(
56
+ {
57
+ htm: "POST",
58
+ htu: tokenUrl,
59
+ jti: `${uuid.v4()}`,
60
+ },
61
+ ephemeralContext
62
+ )
63
+ );
64
+
65
+ const codeVerifier = `${uuid.v4()}`;
66
+ const requestBody = {
67
+ grant_type: "authorization code",
68
+ client_id: clientId,
69
+ code,
70
+ code_verifier: codeVerifier,
71
+ client_assertion_type: ASSERTION_TYPE,
72
+ client_assertion: walletInstanceAttestation,
73
+ redirect_uri: walletProviderBaseUrl,
74
+ };
75
+ var formBody = new URLSearchParams(requestBody);
76
+
77
+ return appFetch(tokenUrl, {
78
+ method: "POST",
79
+ headers: {
80
+ "Content-Type": "application/x-www-form-urlencoded",
81
+ DPoP: signedDPop,
82
+ },
83
+ body: formBody.toString(),
84
+ })
85
+ .then(hasStatus(200))
86
+ .then((res) => res.json())
87
+ .then((body) => ({
88
+ accessToken: body.access_token,
89
+ nonce: body.c_nonce,
90
+ clientId,
91
+ }));
92
+ };
@@ -0,0 +1,179 @@
1
+ import * as z from "zod";
2
+ import uuid from "react-native-uuid";
3
+ import { SignJWT, type CryptoContext } from "@pagopa/io-react-native-jwt";
4
+ import { verify as verifySdJwt } from "../../sd-jwt";
5
+ import { createDPopToken } from "../../utils/dpop";
6
+
7
+ import type { StartFlow } from "./01-start-flow";
8
+ import { hasStatus, type Out } from "../../utils/misc";
9
+ import type { EvaluateIssuerTrust } from "./02-evaluate-issuer-trust";
10
+ import type { AuthorizeAccess } from "./05-authorize-access";
11
+ import { SdJwt4VC } from "../../sd-jwt/types";
12
+ import { IoWalletError } from "../../utils/errors";
13
+ import type { JWK } from "../../utils/jwk";
14
+
15
+ /**
16
+ * Return the signed jwt for nonce proof of possession
17
+ */
18
+ export const createNonceProof = async (
19
+ nonce: string,
20
+ issuer: string,
21
+ audience: string,
22
+ ctx: CryptoContext
23
+ ): Promise<string> => {
24
+ return new SignJWT(ctx)
25
+ .setPayload({
26
+ nonce,
27
+ jwk: await ctx.getPublicKey(),
28
+ })
29
+ .setProtectedHeader({
30
+ type: "openid4vci-proof+jwt",
31
+ })
32
+ .setAudience(audience)
33
+ .setIssuer(issuer)
34
+ .setIssuedAt()
35
+ .setExpirationTime("1h")
36
+ .sign();
37
+ };
38
+
39
+ /**
40
+ * Given a credential, verify it's in the supported format
41
+ * and the credential is correctly signed
42
+ * and it's bound to the given key
43
+ *
44
+ * @param rawCredential The received credential
45
+ * @param issuerKeys The set of public keys of the issuer,
46
+ * which will be used to verify the signature
47
+ * @param holderBindingContext The access to the holder's key
48
+ *
49
+ * @throws If the signature verification fails
50
+ * @throws If the credential is not in the SdJwt4VC format
51
+ * @throws If the holder binding is not properly configured
52
+ *
53
+ */
54
+ async function verifyCredential(
55
+ rawCredential: string,
56
+ issuerKeys: JWK[],
57
+ holderBindingContext: CryptoContext
58
+ ): Promise<void> {
59
+ const [{ sdJwt }, holderBindingKey] =
60
+ // parallel for optimization
61
+ await Promise.all([
62
+ verifySdJwt(rawCredential, issuerKeys, SdJwt4VC),
63
+ holderBindingContext.getPublicKey(),
64
+ ]);
65
+
66
+ if (
67
+ !sdJwt.payload.cnf.jwk.kid ||
68
+ sdJwt.payload.cnf.jwk.kid !== holderBindingKey.kid
69
+ ) {
70
+ throw new IoWalletError(
71
+ `Failed to verify holder binding, expected kid: ${holderBindingKey.kid}, got: ${sdJwt.payload.cnf.jwk.kid}`
72
+ );
73
+ }
74
+ }
75
+
76
+ const CredentialEndpointResponse = z.object({
77
+ credential: z.string(),
78
+ format: z.literal("vc+sd-jwt"),
79
+ });
80
+
81
+ export type ObtainCredential = (
82
+ issuerConf: Out<EvaluateIssuerTrust>["issuerConf"],
83
+ accessToken: Out<AuthorizeAccess>["accessToken"],
84
+ nonce: Out<AuthorizeAccess>["nonce"],
85
+ clientId: Out<AuthorizeAccess>["clientId"],
86
+ credentialType: Out<StartFlow>["credentialType"],
87
+ context: {
88
+ credentialCryptoContext: CryptoContext;
89
+ walletProviderBaseUrl: string;
90
+ appFetch?: GlobalFetch["fetch"];
91
+ }
92
+ ) => Promise<{ credential: string; format: string }>;
93
+
94
+ /**
95
+ * Fetch a credential from the issuer
96
+ *
97
+ * @param issuerConf The Issuer configuration
98
+ * @param accessToken The access token to grant access to the credential, obtained with the access authorization step
99
+ * @param nonce The nonce value to prevent reply attacks, obtained with the access authorization step
100
+ * @param clientId Identifies the current client across all the requests of the issuing flow
101
+ * @param credentialType The type of the credential to be requested
102
+ * @param context.credentialCryptoContext The context to access the key the Credential will be bound to
103
+ * @param context.walletProviderBaseUrl The base url of the Wallet Provider
104
+ * @param context.appFetch (optional) fetch api implementation. Default: built-in fetch
105
+ * @returns The signed credential token
106
+ */
107
+ export const obtainCredential: ObtainCredential = async (
108
+ issuerConf,
109
+ accessToken,
110
+ nonce,
111
+ clientId,
112
+ credentialType,
113
+ context
114
+ ) => {
115
+ const {
116
+ credentialCryptoContext,
117
+ walletProviderBaseUrl,
118
+ appFetch = fetch,
119
+ } = context;
120
+
121
+ const credentialUrl = issuerConf.openid_credential_issuer.credential_endpoint;
122
+
123
+ /** DPoP token for demonstating the possession
124
+ of the key that will bind the holder User with the Credential
125
+ @see https://datatracker.ietf.org/doc/html/rfc9449 */
126
+ const signedDPopForPid = await createDPopToken(
127
+ {
128
+ htm: "POST",
129
+ htu: credentialUrl,
130
+ jti: `${uuid.v4()}`,
131
+ },
132
+ credentialCryptoContext
133
+ );
134
+
135
+ /** JWT proof token to bind the request nonce
136
+ to the key that will bind the holder User with the Credential
137
+ @see https://openid.net/specs/openid-4-verifiable-credential-issuance-1_0.html#name-proof-types */
138
+ const signedNonceProof = await createNonceProof(
139
+ nonce,
140
+ clientId,
141
+ walletProviderBaseUrl,
142
+ credentialCryptoContext
143
+ );
144
+
145
+ /** The credential request body */
146
+ const formBody = new URLSearchParams({
147
+ credential_definition: JSON.stringify({
148
+ type: [credentialType],
149
+ }),
150
+ format: "vc+sd-jwt",
151
+ proof: JSON.stringify({
152
+ jwt: signedNonceProof,
153
+ proof_type: "jwt",
154
+ }),
155
+ });
156
+
157
+ const { credential, format } = await appFetch(credentialUrl, {
158
+ method: "POST",
159
+ headers: {
160
+ "Content-Type": "application/x-www-form-urlencoded",
161
+ DPoP: signedDPopForPid,
162
+ Authorization: accessToken,
163
+ },
164
+ body: formBody.toString(),
165
+ })
166
+ .then(hasStatus(200))
167
+ .then((res) => res.json())
168
+ .then(CredentialEndpointResponse.parse);
169
+
170
+ /** validate the received credential signature
171
+ is correct and refers to the public keys of the issuer */
172
+ await verifyCredential(
173
+ credential,
174
+ issuerConf.openid_credential_issuer.jwks.keys,
175
+ credentialCryptoContext
176
+ );
177
+
178
+ return { credential, format };
179
+ };