@pagopa/io-react-native-wallet 0.16.3 → 0.17.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. package/README.md +146 -197
  2. package/lib/commonjs/cie/README.md +6 -0
  3. package/lib/commonjs/cie/component.js +3 -1
  4. package/lib/commonjs/cie/component.js.map +1 -1
  5. package/lib/commonjs/credential/issuance/06-obtain-credential.js +6 -0
  6. package/lib/commonjs/credential/issuance/06-obtain-credential.js.map +1 -1
  7. package/lib/commonjs/credential/issuance/README.md +323 -0
  8. package/lib/commonjs/credential/presentation/README.md +3 -0
  9. package/lib/commonjs/credential/status/README.md +64 -0
  10. package/lib/commonjs/utils/errors.js +20 -1
  11. package/lib/commonjs/utils/errors.js.map +1 -1
  12. package/lib/commonjs/wallet-instance/README.md +29 -0
  13. package/lib/commonjs/wallet-instance-attestation/README.md +35 -0
  14. package/lib/module/cie/README.md +6 -0
  15. package/lib/module/cie/component.js +2 -1
  16. package/lib/module/cie/component.js.map +1 -1
  17. package/lib/module/credential/issuance/06-obtain-credential.js +7 -1
  18. package/lib/module/credential/issuance/06-obtain-credential.js.map +1 -1
  19. package/lib/module/credential/issuance/README.md +323 -0
  20. package/lib/module/credential/presentation/README.md +3 -0
  21. package/lib/module/credential/status/README.md +64 -0
  22. package/lib/module/utils/errors.js +18 -0
  23. package/lib/module/utils/errors.js.map +1 -1
  24. package/lib/module/wallet-instance/README.md +29 -0
  25. package/lib/module/wallet-instance-attestation/README.md +35 -0
  26. package/lib/typescript/cie/component.d.ts.map +1 -1
  27. package/lib/typescript/credential/issuance/06-obtain-credential.d.ts.map +1 -1
  28. package/lib/typescript/utils/errors.d.ts +9 -0
  29. package/lib/typescript/utils/errors.d.ts.map +1 -1
  30. package/package.json +1 -1
  31. package/src/cie/README.md +6 -0
  32. package/src/cie/component.tsx +3 -1
  33. package/src/credential/issuance/06-obtain-credential.ts +10 -0
  34. package/src/credential/issuance/README.md +323 -0
  35. package/src/credential/presentation/README.md +3 -0
  36. package/src/credential/status/README.md +64 -0
  37. package/src/utils/errors.ts +18 -0
  38. package/src/wallet-instance/README.md +29 -0
  39. package/src/wallet-instance-attestation/README.md +35 -0
@@ -0,0 +1,323 @@
1
+ # Credential Issuance
2
+
3
+ This flow is used to obtain a credential from a credential issuer. Each step in the flow is imported from the related file which is named with a sequential number.
4
+
5
+ There's a fork in the flow which is based on the type of the credential that is being requested. If the credential is an eID, the flow takes a different path than if it is not an eID.
6
+ This is due to the fact that eID credentials require a different authorization flow than other credentials, which is accomplished by a strong authentication method like SPID or CIE.
7
+ Credentials instead require a simpler authorization flow and they require other credentials to be presented in order to be issued.
8
+
9
+ The supported credentials are defined in the entity configuration of the issuer which is evaluted and parsed in the `evaluateIssuerTrust` step.
10
+
11
+ ## Sequence Diagram
12
+
13
+ ```mermaid
14
+ graph TD;
15
+ 0[WalletInstanceAttestation.getAttestation]
16
+ 1[startFlow]
17
+ 2[evaluateIssuerTrust]
18
+ 3[startUserAuthorization]
19
+ C4[getRequestedCredentialToBePresented]
20
+ C4.1[completeUserAuthorizationWithFormPostJwtMode]
21
+ E4[completeUserAuthorizationWithQueryMode]
22
+ 5[authorizeAccess]
23
+ 6[obtainCredential]
24
+ 7[verifyAndParseCredential]
25
+ credSel{Is credential an eID?}
26
+
27
+ 0 --> 1
28
+ 1 --> 2
29
+ 2 --> 3
30
+ 3 --> credSel
31
+ credSel -->|Yes| E4
32
+ credSel -->|No| C4
33
+ C4 --> C4.1
34
+ C4.1 --> 5
35
+ E4 --> 5
36
+ 5 --> 6
37
+ 6 --> 7
38
+ ```
39
+
40
+ ## Mapped results
41
+
42
+ ### 404 Not Found (CredentialNotEntitledError)
43
+
44
+ A `404 Not Found` response is returned by the credential issuer when the authenticated user is not entitled to receive the requested credential.
45
+
46
+ ## Strong authentication for eID issuance (Query Mode)
47
+
48
+ The eID issuance requires a strong authentication method. Currently SPID (L2), CieID (L2) and CIE+PIN (L3) are supported. The strong authentication method is determined by the IDP hint which is passed to the `completeUserAuthorizationWithQueryMode` function.
49
+
50
+ For SPID in production the IDP hint can be found [here](https://registry.spid.gov.it/identity-providers), under the `entityId` field. For pre-production environment the IDP hint is `https://demo.spid.gov.it'`.
51
+
52
+ For CieID(L2) the IDP hint is `https://idserver.servizicie.interno.gov.it/idp/profile/SAML2/POST/SSO"` for production and `https://collaudo.idserver.servizicie.interno.gov.it/idp/profile/SAML2/POST/SSO` for pre-production.
53
+
54
+ CIE+PIN(L3) requires a different flow due to the physical card presence. Helper functions are exposed to handle it and the documentation can be found [here](../../cie/README.md).
55
+
56
+ The expected result from the authentication process is in provided in the query string as defined in the [JWT Secured Authorization Response Mode for OAuth 2.0 (JARM)](https://openid.net/specs/oauth-v2-jarm.html#name-response-mode-queryjwt).
57
+
58
+ ## Authentication through credentials (Form Post JWT Mode)
59
+
60
+ When the credential is different than an eID, the flow requires the user to present other credentials in order to obtain the requested one. This is done through the `getRequestedCredentialToBePresented` followed by the `completeUserAuthorizationWithFormPostJwtMode`.
61
+
62
+ 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).
63
+
64
+ ## Examples
65
+
66
+ <details>
67
+ <summary>Credential issuance flow</summary>
68
+
69
+ ```ts
70
+ // Retrieve the integrity key tag from the store and create its context
71
+ const integrityKeyTag = "example"; // Let's assume this is the key tag used to create the wallet instance
72
+ const integrityContext = getIntegrityContext(integrityKeyTag);
73
+
74
+ // generate Key for Wallet Instance Attestation
75
+ // ensure the key esists befor starting the issuing process
76
+ await regenerateCryptoKey(WIA_KEYTAG); // Let's assume this function regenerates this ephemeral key
77
+ const wiaCryptoContext = createCryptoContextFor(WIA_KEYTAG);
78
+
79
+ const { WALLET_PROVIDER_BASE_URL, WALLET_EAA_PROVIDER_BASE_URL, REDIRECT_URI } =
80
+ env; // Let's assume these are the environment variables
81
+
82
+ /**
83
+ * Obtains a new Wallet Instance Attestation.
84
+ * WARNING: The integrity context must be the same used when creating the Wallet Instance with the same keytag.
85
+ */
86
+ const walletInstanceAttestation =
87
+ await WalletInstanceAttestation.getAttestation({
88
+ wiaCryptoContext,
89
+ integrityContext,
90
+ walletProviderBaseUrl: WALLET_PROVIDER_BASE_URL,
91
+ appFetch,
92
+ });
93
+
94
+ const credentialType = "someCredential"; // Let's assume this is the credential type
95
+
96
+ const eid = {
97
+ credential: "example",
98
+ parsedCredential: "example"
99
+ keyTag: "example";
100
+ credentialType: "eid";
101
+ };
102
+
103
+ const eidCryptoContext = createCryptoContextFor(eid.keyTag);
104
+
105
+ // Create credential crypto context
106
+ const credentialKeyTag = uuid.v4().toString();
107
+ await generate(credentialKeyTag); // Let's assume this function generates a new hardware-backed key pair
108
+ const credentialCryptoContext = createCryptoContextFor(credentialKeyTag);
109
+
110
+ // Start the issuance flow
111
+ const startFlow: Credential.Issuance.StartFlow = () => ({
112
+ issuerUrl: WALLET_EAA_PROVIDER_BASE_URL,
113
+ credentialType,
114
+ });
115
+
116
+ const { issuerUrl } = startFlow();
117
+
118
+ // Evaluate issuer trust
119
+ const { issuerConf } = await Credential.Issuance.evaluateIssuerTrust(issuerUrl);
120
+
121
+ // Start user authorization
122
+ const { issuerRequestUri, clientId, codeVerifier, credentialDefinition } =
123
+ await Credential.Issuance.startUserAuthorization(issuerConf, credentialType, {
124
+ walletInstanceAttestation,
125
+ redirectUri,
126
+ wiaCryptoContext,
127
+ appFetch,
128
+ });
129
+
130
+ const requestObject =
131
+ await Credential.Issuance.getRequestedCredentialToBePresented(
132
+ issuerRequestUri,
133
+ clientId,
134
+ issuerConf,
135
+ appFetch
136
+ );
137
+
138
+ // The app here should ask the user to confirm the required data contained in the requestObject
139
+
140
+ // Complete the user authorization via form_post.jwt mode
141
+ const { code } =
142
+ await Credential.Issuance.completeUserAuthorizationWithFormPostJwtMode(
143
+ requestObject,
144
+ { wiaCryptoContext, pidCryptoContext, pid, walletInstanceAttestation }
145
+ );
146
+
147
+ // Generate the DPoP context which will be used for the whole issuance flow
148
+ await regenerateCryptoKey(DPOP_KEYTAG); // Let's assume this function regenerates this ephemeral key for the DPoP
149
+ const dPopCryptoContext = createCryptoContextFor(DPOP_KEYTAG);
150
+
151
+ const { accessToken } = await Credential.Issuance.authorizeAccess(
152
+ issuerConf,
153
+ code,
154
+ clientId,
155
+ redirectUri,
156
+ codeVerifier,
157
+ {
158
+ walletInstanceAttestation,
159
+ wiaCryptoContext,
160
+ dPopCryptoContext,
161
+ appFetch,
162
+ }
163
+ );
164
+
165
+ // Obtain the credential
166
+ const { credential, format } = await Credential.Issuance.obtainCredential(
167
+ issuerConf,
168
+ accessToken,
169
+ clientId,
170
+ credentialDefinition,
171
+ {
172
+ credentialCryptoContext,
173
+ dPopCryptoContext,
174
+ appFetch,
175
+ }
176
+ );
177
+
178
+ // Parse and verify the credential. The ignoreMissingAttributes flag must be set to false or omitted in production.
179
+ const { parsedCredential } = await Credential.Issuance.verifyAndParseCredential(
180
+ issuerConf,
181
+ credential,
182
+ format,
183
+ { credentialCryptoContext, ignoreMissingAttributes: true }
184
+ );
185
+
186
+ return {
187
+ parsedCredential,
188
+ credential,
189
+ keyTag: credentialKeyTag,
190
+ credentialType,
191
+ };
192
+ ```
193
+
194
+ </details>
195
+
196
+ <details>
197
+ <summary>eID issuance flow</summary>
198
+
199
+ ```ts
200
+ // Retrieve the integrity key tag from the store and create its context
201
+ const integrityKeyTag = "example"; // Let's assume this is the key tag used to create the wallet instance
202
+ const integrityContext = getIntegrityContext(integrityKeyTag);
203
+
204
+ // generate Key for Wallet Instance Attestation
205
+ // ensure the key esists befor starting the issuing process
206
+ await regenerateCryptoKey(WIA_KEYTAG); // Let's assume this function regenerates this ephemeral key
207
+ const wiaCryptoContext = createCryptoContextFor(WIA_KEYTAG);
208
+
209
+ const { WALLET_PROVIDER_BASE_URL, WALLET_EID_PROVIDER_BASE_URL, REDIRECT_URI } =
210
+ env; // Let's assume these are the environment variables
211
+
212
+ /**
213
+ * Obtains a new Wallet Instance Attestation.
214
+ * WARNING: The integrity context must be the same used when creating the Wallet Instance with the same keytag.
215
+ */
216
+ const walletInstanceAttestation =
217
+ await WalletInstanceAttestation.getAttestation({
218
+ wiaCryptoContext,
219
+ integrityContext,
220
+ walletProviderBaseUrl: WALLET_PROVIDER_BASE_URL,
221
+ appFetch,
222
+ });
223
+
224
+ const idpHit = "https://example.com"; // Let's assume this is the IDP hint
225
+
226
+ const authorizationContext = idpHint.includes("servizicie")
227
+ ? undefined
228
+ : {
229
+ authorize: openAuthenticationSession, // Let's assume this function opens the browser for the user to authenticate
230
+ };
231
+ /*
232
+ * Create credential crypto context for the PID
233
+ * WARNING: The eID keytag must be persisted and later used when requesting a credential which requires a eID presentation
234
+ */
235
+ const credentialKeyTag = uuid.v4().toString();
236
+ await generate(credentialKeyTag);
237
+ const credentialCryptoContext = createCryptoContextFor(credentialKeyTag);
238
+
239
+ // Start the issuance flow
240
+ const startFlow: Credential.Issuance.StartFlow = () => ({
241
+ issuerUrl: WALLET_EID_PROVIDER_BASE_URL,
242
+ credentialType: "PersonIdentificationData",
243
+ appFetch,
244
+ });
245
+
246
+ const { issuerUrl } = startFlow();
247
+
248
+ // Evaluate issuer trust
249
+ const { issuerConf } = await Credential.Issuance.evaluateIssuerTrust(
250
+ issuerUrl,
251
+ { appFetch }
252
+ );
253
+
254
+ // Start user authorization
255
+ const { issuerRequestUri, clientId, codeVerifier, credentialDefinition } =
256
+ await Credential.Issuance.startUserAuthorization(issuerConf, credentialType, {
257
+ walletInstanceAttestation,
258
+ redirectUri,
259
+ wiaCryptoContext,
260
+ appFetch,
261
+ });
262
+
263
+ // Complete the authroization process with query mode with the authorizationContext which opens the browser
264
+ const { code } =
265
+ await Credential.Issuance.completeUserAuthorizationWithQueryMode(
266
+ issuerRequestUri,
267
+ clientId,
268
+ issuerConf,
269
+ idpHint,
270
+ redirectUri,
271
+ authorizationContext
272
+ );
273
+
274
+ // Create DPoP context which will be used for the whole issuance flow
275
+ await regenerateCryptoKey(DPOP_KEYTAG);
276
+ const dPopCryptoContext = createCryptoContextFor(DPOP_KEYTAG);
277
+
278
+ const { accessToken } = await Credential.Issuance.authorizeAccess(
279
+ issuerConf,
280
+ code,
281
+ clientId,
282
+ redirectUri,
283
+ codeVerifier,
284
+ {
285
+ walletInstanceAttestation,
286
+ wiaCryptoContext,
287
+ dPopCryptoContext,
288
+ appFetch,
289
+ }
290
+ );
291
+
292
+ // Obtain che eID credential
293
+ const { credential, format } = await Credential.Issuance.obtainCredential(
294
+ issuerConf,
295
+ accessToken,
296
+ clientId,
297
+ credentialDefinition,
298
+ {
299
+ credentialCryptoContext,
300
+ dPopCryptoContext,
301
+ appFetch,
302
+ }
303
+ );
304
+
305
+ // Parse and verify the eID credential
306
+ const { parsedCredential } = await Credential.Issuance.verifyAndParseCredential(
307
+ issuerConf,
308
+ credential,
309
+ format,
310
+ { credentialCryptoContext }
311
+ );
312
+
313
+ return {
314
+ parsedCredential,
315
+ credential,
316
+ keyTag: credentialKeyTag,
317
+ credentialType,
318
+ };
319
+ ```
320
+
321
+ The result of this flow is a row credential and a parsed credential which must be stored securely in the wallet along with its crypto key.
322
+
323
+ </details>
@@ -0,0 +1,3 @@
1
+ # Credential presentation
2
+
3
+ Currently this flow is outdated.
@@ -0,0 +1,64 @@
1
+ # Credential Status Attestation
2
+
3
+ This flow is used to obtain a credential status attestation from its credential issuer. Each step in the flow is imported from the related file which is named with a sequential number.
4
+ The credential status attestation is a JWT which contains the credential status which indicates if the credential is valid or not.
5
+ The status attestation is supposed to be stored securely along with the credential. It has a limited lifetime and should be refreshed periodically according to the `exp` field in the JWT payload.
6
+
7
+ ## Sequence Diagram
8
+
9
+ ```mermaid
10
+ graph TD;
11
+ 0[startFlow]
12
+ 1[statusAttestation]
13
+ 2[verifyAndParseStatusAttestation]
14
+
15
+ 0 --> 1
16
+ 1 --> 2
17
+ ```
18
+
19
+ ## Mapped results
20
+
21
+ ### 404 Not Found (StatusAttestationInvalid)
22
+
23
+ A `404 Not Found` response is returned by the credential issuer when the status attestation is invalid.
24
+
25
+ ## Example
26
+
27
+ <details>
28
+ <summary>Credential status attestation flow</summary>
29
+
30
+ ```ts
31
+ // Start the issuance flow
32
+ const credentialIssuerUrl = "https://issuer.example.com";
33
+ const startFlow: Credential.Status.StartFlow = () => ({
34
+ issuerUrl: credentialIssuerUrl, // Let's assum
35
+ });
36
+
37
+ const { issuerUrl } = startFlow();
38
+
39
+ // Evaluate issuer trust
40
+ const { issuerConf } = await Credential.Status.evaluateIssuerTrust(issuerUrl);
41
+
42
+ // Get the credential attestation
43
+ const res = await Credential.Status.statusAttestation(
44
+ issuerConf,
45
+ credential,
46
+ credentialCryptoContext
47
+ );
48
+
49
+ // Verify and parse the status attestation
50
+ const { parsedStatusAttestation } =
51
+ await Credential.Status.verifyAndParseStatusAttestation(
52
+ issuerConf,
53
+ res.statusAttestation,
54
+ { credentialCryptoContext }
55
+ );
56
+
57
+ return {
58
+ statusAttestation: res.statusAttestation,
59
+ parsedStatusAttestation,
60
+ credentialType,
61
+ };
62
+ ```
63
+
64
+ </details>
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.serializeAttrs = exports.WalletProviderResponseError = exports.WalletInstanceRevokedError = exports.WalletInstanceNotFoundError = exports.WalletInstanceAttestationIssuingError = exports.ValidationFailed = exports.UnexpectedStatusCodeError = exports.StatusAttestationInvalid = exports.StatusAttestationError = exports.PidMetadataError = exports.PidIssuingError = exports.OperationAbortedError = exports.NoSuitableKeysFoundInEntityConfiguration = exports.IoWalletError = exports.CredentialRequestError = exports.CredentialNotEntitledError = exports.ClaimsNotFoundInToken = exports.ClaimsNotFoundBetweenDislosures = exports.AuthorizationIdpError = exports.AuthorizationError = exports.AuthRequestDecodeError = void 0;
6
+ exports.serializeAttrs = exports.WalletProviderResponseError = exports.WalletInstanceRevokedError = exports.WalletInstanceNotFoundError = exports.WalletInstanceAttestationIssuingError = exports.ValidationFailed = exports.UnexpectedStatusCodeError = exports.StatusAttestationInvalid = exports.StatusAttestationError = exports.PidMetadataError = exports.PidIssuingError = exports.OperationAbortedError = exports.NoSuitableKeysFoundInEntityConfiguration = exports.IoWalletError = exports.CredentialRequestError = exports.CredentialNotEntitledError = exports.CredentialIssuingNotSynchronousError = exports.ClaimsNotFoundInToken = exports.ClaimsNotFoundBetweenDislosures = exports.AuthorizationIdpError = exports.AuthorizationError = exports.AuthRequestDecodeError = void 0;
7
7
  /**
8
8
  * utility to format a set of attributes into an error message string
9
9
  *
@@ -453,5 +453,24 @@ class CredentialRequestError extends IoWalletError {
453
453
  this.reason = reason;
454
454
  }
455
455
  }
456
+
457
+ /**
458
+ * Error subclass thrown when a credential cannot be issued immediately because it follows the async flow.
459
+ */
456
460
  exports.CredentialRequestError = CredentialRequestError;
461
+ class CredentialIssuingNotSynchronousError extends IoWalletError {
462
+ static get code() {
463
+ return "CREDENTIAL_ISSUING_NOT_SYNCHRONOUS_ERROR";
464
+ }
465
+ code = "CREDENTIAL_ISSUING_NOT_SYNCHRONOUS_ERROR";
466
+ constructor(message) {
467
+ let reason = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "unspecified";
468
+ super(serializeAttrs({
469
+ message,
470
+ reason
471
+ }));
472
+ this.reason = reason;
473
+ }
474
+ }
475
+ exports.CredentialIssuingNotSynchronousError = CredentialIssuingNotSynchronousError;
457
476
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","exports","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","UnexpectedStatusCodeError","statusCode","toString","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError","WalletInstanceRevokedError","WalletInstanceNotFoundError","AuthorizationError","AuthorizationIdpError","error","errorDescription","OperationAbortedError","operation","StatusAttestationInvalid","StatusAttestationError","CredentialNotEntitledError","CredentialRequestError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GACzBC,KAAsC,IAEtCC,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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAVAE,OAAA,CAAAZ,cAAA,GAAAA,cAAA;AAWO,MAAMa,aAAa,SAASC,KAAK,CAAC;EACvC;EACA,WAAWC,IAAIA,CAAA,EAAW;IACxB,OAAO,uBAAuB;EAChC;;EAEA;EACAA,IAAI,GAAW,uBAAuB;EAEtCC,WAAWA,CAACC,OAAgB,EAAE;IAAA,IAAAC,qBAAA;IAC5B,KAAK,CAACD,OAAO,CAAC;IACd,IAAI,CAACE,IAAI,GAAG,IAAI,CAACH,WAAW,CAACG,IAAI;IACjC;IACA,CAAAD,qBAAA,GAAAJ,KAAK,CAACM,iBAAiB,cAAAF,qBAAA,uBAAvBA,qBAAA,CAAAG,IAAA,CAAAP,KAAK,EAAqB,IAAI,EAAE,IAAI,CAACE,WAAW,CAAC;EACnD;AACF;;AAEA;AACA;AACA;AAFAJ,OAAA,CAAAC,aAAA,GAAAA,aAAA;AAGO,MAAMS,yBAAyB,SAAST,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0BAAA;AAGO,MAAMC,sBAAsB,SAASxC,aAAa,CAAC;EACxD,WAAWE,IAAIA,CAAA,EAA+B;IAC5C,OAAO,0BAA0B;EACnC;EAEAA,IAAI,GAAG,0BAA0B;EAIjCC,WAAWA,CAACC,OAAe,EAAkC;IAAA,IAAhCa,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC3B,cAAc,CAAC;MAAEiB,OAAO;MAAEa;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;AAAClB,OAAA,CAAAyC,sBAAA,GAAAA,sBAAA"}
1
+ {"version":3,"names":["serializeAttrs","attrs","Object","entries","map","_ref","k","v","Array","isArray","join","_","exports","IoWalletError","Error","code","constructor","message","_Error$captureStackTr","name","captureStackTrace","call","UnexpectedStatusCodeError","statusCode","toString","ValidationFailed","claim","arguments","length","undefined","reason","WalletInstanceAttestationIssuingError","AuthRequestDecodeError","PidIssuingError","ClaimsNotFoundBetweenDislosures","claims","c","ClaimsNotFoundInToken","NoSuitableKeysFoundInEntityConfiguration","scenario","PidMetadataError","WalletProviderResponseError","WalletInstanceRevokedError","WalletInstanceNotFoundError","AuthorizationError","AuthorizationIdpError","error","errorDescription","OperationAbortedError","operation","StatusAttestationInvalid","StatusAttestationError","CredentialNotEntitledError","CredentialRequestError","CredentialIssuingNotSynchronousError"],"sourceRoot":"../../../src","sources":["utils/errors.ts"],"mappings":";;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,MAAMA,cAAc,GACzBC,KAAsC,IAEtCC,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,CAA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A;AACA;AAFAlB,OAAA,CAAAyC,sBAAA,GAAAA,sBAAA;AAGO,MAAMC,oCAAoC,SAASzC,aAAa,CAAC;EACtE,WAAWE,IAAIA,CAAA,EAA+C;IAC5D,OAAO,0CAA0C;EACnD;EAEAA,IAAI,GAAG,0CAA0C;EAIjDC,WAAWA,CAACC,OAAe,EAAkC;IAAA,IAAhCa,MAAc,GAAAH,SAAA,CAAAC,MAAA,QAAAD,SAAA,QAAAE,SAAA,GAAAF,SAAA,MAAG,aAAa;IACzD,KAAK,CAAC3B,cAAc,CAAC;MAAEiB,OAAO;MAAEa;IAAO,CAAC,CAAC,CAAC;IAC1C,IAAI,CAACA,MAAM,GAAGA,MAAM;EACtB;AACF;AAAClB,OAAA,CAAA0C,oCAAA,GAAAA,oCAAA"}
@@ -0,0 +1,29 @@
1
+ # Wallet Instance
2
+
3
+ This flow which consists of a single step, is used to create a wallet instance. The wallet provider must implement its endpoints based on the OpenAPI specification provided in the [wallet-instance.yaml](../../openapi/wallet-provider.yaml) file.
4
+ A service that is responsible for ensuring the integrity of the device where the app is running is required and it's supposed to use [Google Play Integrity API](https://developer.android.com/google/play/integrity/overview) and [Key Attestation](https://developer.android.com/privacy-and-security/security-key-attestation) on Android, [DCAppAttestService](https://developer.apple.com/documentation/devicecheck/establishing-your-app-s-integrity) on iOS.
5
+ The suggested way to implement this service is to use [io-react-native-integrity](https://github.com/pagopa/io-react-native-integrity) by providing an [IntegrityContext](../utils/integrity.ts) object.
6
+ An example is provided as follows:
7
+
8
+ ```ts
9
+ // Get env
10
+ const { GOOGLE_CLOUD_PROJECT_NUMBER, WALLET_PROVIDER_BASE_URL } = env; // Let's assume env is an object containing the environment variables
11
+
12
+ const googleCloudProjectNumber = isAndroid
13
+ ? GOOGLE_CLOUD_PROJECT_NUMBER
14
+ : undefined;
15
+
16
+ await ensureIntegrityServiceIsReady(googleCloudProjectNumber); // Required by io-react-native-integrity to ensure the service is ready
17
+ const integrityKeyTag = await generateIntegrityHardwareKeyTag();
18
+ const integrityContext = getIntegrityContext(integrityKeyTag); // This function is supposed to return an object as required by IntegrityContext.
19
+
20
+ await WalletInstance.createWalletInstance({
21
+ integrityContext,
22
+ walletProviderBaseUrl: WALLET_PROVIDER_BASE_URL,
23
+ appFetch,
24
+ });
25
+
26
+ return integrityKeyTag;
27
+ ```
28
+
29
+ The returned `integrityKeyTag` is supposed to be stored and used to verify the integrity of the device in the future when using an `IntegrityContext` object. It must be regenerated if another wallet instance is created.
@@ -0,0 +1,35 @@
1
+ # Wallet Instance Attestation
2
+
3
+ This flow consists of a single step and is used to obtain a Wallet Instance Attestation. The wallet provider must implement its endpoints based on the OpenAPI specification provided in the [wallet-instance.yaml](../../openapi/wallet-provider.yaml) file.
4
+ In order to require a status attestation the consumer application must provide:
5
+
6
+ - `wiaCryptoContext` object that is used to sign the attestation request. The key must be generated before creating the crypto context;
7
+ - `integrityContext` object that is used to verify the integrity of the device where the app is running. The key tag must be the same used when creating the Wallet Instance;
8
+
9
+ ```ts
10
+ // Retrieve the integrity key tag from the store and create its context
11
+ const integrityKeyTag = "example"; // Let's assume this is the same key used when creating the Wallet Instance
12
+ const integrityContext = getIntegrityContext(integrityKeyTag);
13
+
14
+ // generate Key for Wallet Instance Attestation
15
+ // ensure the key esists befor starting the issuing process
16
+ await regenerateCryptoKey(WIA_KEYTAG); // Let's assume WI_KEYTAG is a constant string and regenerateCryptoKey is a function that regenerates the key each time it is called
17
+ const wiaCryptoContext = createCryptoContextFor(WIA_KEYTAG);
18
+
19
+ // Get env URLs
20
+ const { WALLET_PROVIDER_BASE_URL } = env; // Let's assume env is an object containing the environment variables
21
+
22
+ /**
23
+ * Obtains a new Wallet Instance Attestation.
24
+ * WARNING: The integrity context must be the same used when creating the Wallet Instance with the same keytag.
25
+ */
26
+ const issuedAttestation = await WalletInstanceAttestation.getAttestation({
27
+ wiaCryptoContext,
28
+ integrityContext,
29
+ walletProviderBaseUrl: WALLET_PROVIDER_BASE_URL,
30
+ appFetch,
31
+ });
32
+ return issuedAttestation;
33
+ ```
34
+
35
+ The returned `issuedAttestation` is supposed to be stored and used for any future operation that requires a Wallet Instance Attestation. The wallet attestation has a limited validity and must be regenerated when it expires.
@@ -0,0 +1,6 @@
1
+ # CIE
2
+
3
+ This library provides a components and a set of utilities to interact with the physical [CIE (Carta d'Identità Elettronica)](https://www.cartaidentita.interno.gov.it/) card. It can be used to [obtain an eID](../credential/issuance/README.md) via strong authentication.
4
+ Under the hood it uses [@pagopa/react-native-cie](https://github.com/pagopa/io-cie-sdk) to interact with the card and [react-native-webview](https://github.com/react-native-webview/react-native-webview) to complete the authorization flow.
5
+
6
+ An example of usage can be found in the [example](./example) folder of this repository.
@@ -3,6 +3,7 @@ import { Platform } from "react-native";
3
3
  import { WebView } from "react-native-webview";
4
4
  import { startCieAndroid, startCieiOS } from "./manager";
5
5
  import { CieError, CieErrorType } from "./error";
6
+ const AUTH_LINK_PATTERN = "lettura carta";
6
7
 
7
8
  /* To obtain the authentication URL on CIE L3 it is necessary to take the
8
9
  * link contained in the "Entra con lettura carta CIE" button.
@@ -13,7 +14,7 @@ const injectedJavaScript = `
13
14
  (function() {
14
15
  function sendDocumentContent() {
15
16
  const idpAuthUrl = [...document.querySelectorAll("a")]
16
- .filter(a => a.textContent.includes("lettura carta CIE"))
17
+ .filter(a => a.textContent.toLowerCase().includes("${AUTH_LINK_PATTERN}"))
17
18
  .map(a=>a.href)[0];
18
19
 
19
20
  if(idpAuthUrl) {
@@ -1 +1 @@
1
- {"version":3,"names":["React","createRef","Platform","WebView","startCieAndroid","startCieiOS","CieError","CieErrorType","injectedJavaScript","CieEvent","iOSUserAgent","defaultUserAgent","select","ios","default","undefined","webView","WebViewComponent","params","webViewUrl","setWebViewUrl","useState","authUrl","isCardReadingFinished","setCardReadingFinished","continueWithUrl","callbackUrl","handleMessage","event","cieAuthorizationUri","nativeEvent","data","startCie","useUat","pin","onError","onEvent","handleShouldStartLoading","onSuccess","redirectUrl","url","includes","handleOnLoadEnd","onCieEvent","e","eventTitle","title","toLowerCase","handleOnError","Error","completed","error","webViewError","webViewHttpError","statusCode","description","message","type","WEB_VIEW_ERROR","code","createElement","ref","userAgent","javaScriptEnabled","source","uri","onLoadEnd","onHttpError","onShouldStartLoadWithRequest","onMessage"],"sourceRoot":"../../../src","sources":["cie/component.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,OAAO,QAAQ,sBAAsB;AAS9C,SAASC,eAAe,EAAEC,WAAW,QAA8B,WAAW;AAC9E,SAASC,QAAQ,EAAEC,YAAY,QAAQ,SAAS;;AAEhD;AACA;AACA;AACA;AACA;AACA,MAAMC,kBAAkB,GAAI;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AAIH,WAAYC,QAAQ,0BAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAARA,QAAQ;EAAA,OAARA,QAAQ;AAAA;AAgBpB;AACA;AACA;AACA;AACA,MAAMC,YAAY,GAChB,2IAA2I;AAC7I,MAAMC,gBAAgB,GAAGT,QAAQ,CAACU,MAAM,CAAC;EACvCC,GAAG,EAAEH,YAAY;EACjBI,OAAO,EAAEC;AACX,CAAC,CAAC;AAEF,MAAMC,OAAO,gBAAGf,SAAS,CAAU,CAAC;;AAEpC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMgB,gBAAgB,GAAIC,MAAiB,IAAK;EACrD,MAAM,CAACC,UAAU,EAAEC,aAAa,CAAC,GAAGpB,KAAK,CAACqB,QAAQ,CAACH,MAAM,CAACI,OAAO,CAAC;EAClE,MAAM,CAACC,qBAAqB,EAAEC,sBAAsB,CAAC,GAAGxB,KAAK,CAACqB,QAAQ,CAAC,KA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BAAiB,EAAE,IAAK;IACxBC,MAAM,EAAE;MAAEC,GAAG,EAAE9C;IAAW,CAAE;IAC5B+C,SAAS,EAAExB,eAAe,CAACxB,MAAM,CAACiB,OAAO,EAAEjB,MAAM,CAACkB,OAAO,CAAE;IAC3DD,OAAO,EAAEa,aAAa,CAAC9B,MAAM,CAACiB,OAAO,CAAE;IACvCgC,WAAW,EAAEnB,aAAa,CAAC9B,MAAM,CAACiB,OAAO,CAAE;IAC3C3B,kBAAkB,EAAEA,kBAAmB;IACvC4D,4BAA4B,EAAE/B,wBAAwB,CACpDnB,MAAM,CAACoB,SAAS,EAChBpB,MAAM,CAACqB,WACT,CAAE;IACF8B,SAAS,EAAE1C;EAAc,CAC1B,CAAC;AAEN,CAAC"}
1
+ {"version":3,"names":["React","createRef","Platform","WebView","startCieAndroid","startCieiOS","CieError","CieErrorType","AUTH_LINK_PATTERN","injectedJavaScript","CieEvent","iOSUserAgent","defaultUserAgent","select","ios","default","undefined","webView","WebViewComponent","params","webViewUrl","setWebViewUrl","useState","authUrl","isCardReadingFinished","setCardReadingFinished","continueWithUrl","callbackUrl","handleMessage","event","cieAuthorizationUri","nativeEvent","data","startCie","useUat","pin","onError","onEvent","handleShouldStartLoading","onSuccess","redirectUrl","url","includes","handleOnLoadEnd","onCieEvent","e","eventTitle","title","toLowerCase","handleOnError","Error","completed","error","webViewError","webViewHttpError","statusCode","description","message","type","WEB_VIEW_ERROR","code","createElement","ref","userAgent","javaScriptEnabled","source","uri","onLoadEnd","onHttpError","onShouldStartLoadWithRequest","onMessage"],"sourceRoot":"../../../src","sources":["cie/component.tsx"],"mappings":"AAAA,OAAOA,KAAK,IAAIC,SAAS,QAAQ,OAAO;AACxC,SAASC,QAAQ,QAAQ,cAAc;AACvC,SAASC,OAAO,QAAQ,sBAAsB;AAS9C,SAASC,eAAe,EAAEC,WAAW,QAA8B,WAAW;AAC9E,SAASC,QAAQ,EAAEC,YAAY,QAAQ,SAAS;AAEhD,MAAMC,iBAAiB,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AACoB,SAAS,EAChBpB,MAAM,CAACqB,WACT,CAAE;IACF8B,SAAS,EAAE1C;EAAc,CAC1B,CAAC;AAEN,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { sha256ToBase64, SignJWT } from "@pagopa/io-react-native-jwt";
2
2
  import { hasStatus } from "../../utils/misc";
3
- import { CredentialNotEntitledError, CredentialRequestError, UnexpectedStatusCodeError, ValidationFailed } from "../../utils/errors";
3
+ import { CredentialIssuingNotSynchronousError, CredentialNotEntitledError, CredentialRequestError, UnexpectedStatusCodeError, ValidationFailed } from "../../utils/errors";
4
4
  import { CredentialResponse } from "./types";
5
5
  import { createDPopToken } from "../../utils/dpop";
6
6
  import uuid from "react-native-uuid";
@@ -94,6 +94,12 @@ const handleObtainCredentialError = e => {
94
94
  if (!(e instanceof UnexpectedStatusCodeError)) {
95
95
  throw e;
96
96
  }
97
+
98
+ // Although it is technically not an error, we handle it as such to avoid
99
+ // changing the return type of `obtainCredential` and introduce a breaking change.
100
+ if (e.statusCode === 201) {
101
+ throw new CredentialIssuingNotSynchronousError("This credential cannot be issued synchronously. It will be available at a later time.", e.message);
102
+ }
97
103
  if (e.statusCode === 404) {
98
104
  throw new CredentialNotEntitledError("Invalid status found for the given credential", e.message);
99
105
  }
@@ -1 +1 @@
1
- {"version":3,"names":["sha256ToBase64","SignJWT","hasStatus","CredentialNotEntitledError","CredentialRequestError","UnexpectedStatusCodeError","ValidationFailed","CredentialResponse","createDPopToken","uuid","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credentialUrl","openid_credential_issuer","credential_endpoint","signedNonceProof","c_nonce","constainsCredentialDefinition","authorization_details","some","c","credential_configuration_id","format","type","credentialRequestFormBody","credential_definition","proof","jwt","proof_type","tokenRequestSignedDPop","htm","htu","jti","v4","ath","access_token","credentialRes","method","headers","DPoP","Authorization","token_type","body","JSON","stringify","then","res","json","safeParse","catch","handleObtainCredentialError","success","error","message","data","e","statusCode"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":"AAAA,SACEA,cAAc,EACdC,OAAO,QAEF,6BAA6B;AAGpC,SAASC,SAAS,QAAkB,kBAAkB;AAEtD,SACEC,0BAA0B,EAC1BC,sBAAsB,EACtBC,yBAAyB,EACzBC,gBAAgB,QACX,oBAAoB;AAC3B,SAASC,kBAAkB,QAAQ,SAAS;AAE5C,SAASC,eAAe,QAAQ,kBAAkB;AAClD,OAAOC,IAAI,MAAM,mBAAmB;AAcpC,OAAO,MAAMC,gBAAgB,GAAG,MAAAA,CAC9BC,KAAa,EACbC,MAAc,EACdC,QAAgB,EAChBC,GAAkB,KACE;EACpB,MAAMC,GAAG,GAAG,MAAMD,GAAG,CAACE,YAAY,CAAC,CAAC;EACpC,OAAO,IAAIf,OAAO,CAACa,GAAG,CAAC,CACpBG,UAAU,CAAC;IACVN;EACF,CAAC,CAAC,CACDO,kBAAkB,CAAC;IAClBC,GAAG,EAAE,sBAAsB;IAC3BJ;EACF,CAAC,CAAC,CACDK,WAAW,CAACP,QAAQ,CAAC,CACrBQ,SAAS,CAACT,MAAM,CAAC,CACjBU,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,MAAM,CAAC,CACzBC,IAAI,CAAC,CAAC;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAkC,GAAG,MAAAA,CAChDC,UAAU,EACVC,WAAW,EACXC,QAAQ,EACRC,oBAAoB,EACpBC,OAAO,KACJ;EACH,MAAM;IACJC,uBAAuB;IACvBC,QAAQ,GAAGC,KAAK;IAChBC;EACF,CAAC,GAAGJ,OAAO;EAEX,MAAMK,aAAa,GAAGT,UAAU,CAACU,wBAAwB,CAACC,mB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IACvE,CAAC;IACDO,IAAI,EAAEC,IAAI,CAACC,SAAS,CAACpB,yBAAyB;EAChD,CAAC,CAAC,CACCqB,IAAI,CAAClE,SAAS,CAAC,GAAG,CAAC,CAAC,CACpBkE,IAAI,CAAEC,GAAG,IAAKA,GAAG,CAACC,IAAI,CAAC,CAAC,CAAC,CACzBF,IAAI,CAAEH,IAAI,IAAK1D,kBAAkB,CAACgE,SAAS,CAACN,IAAI,CAAC,CAAC,CAClDO,KAAK,CAACC,2BAA2B,CAAC;EAErC,IAAI,CAACd,aAAa,CAACe,OAAO,EAAE;IAC1B,MAAM,IAAIpE,gBAAgB,CAACqD,aAAa,CAACgB,KAAK,CAACC,OAAO,CAAC;EACzD;EAEA,OAAOjB,aAAa,CAACkB,IAAI;AAC3B,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMJ,2BAA2B,GAAIK,CAAU,IAAK;EAClD,IAAI,EAAEA,CAAC,YAAYzE,yBAAyB,CAAC,EAAE;IAC7C,MAAMyE,CAAC;EACT;EAEA,IAAIA,CAAC,CAACC,UAAU,KAAK,GAAG,EAAE;IACxB,MAAM,IAAI5E,0BAA0B,CAClC,+CAA+C,EAC/C2E,CAAC,CAACF,OACJ,CAAC;EACH;EAEA,MAAM,IAAIxE,sBAAsB,CAC7B,oEAAmE0E,CAAC,CAACC,UAAW,GAAE,EACnFD,CAAC,CAACF,OACJ,CAAC;AACH,CAAC"}
1
+ {"version":3,"names":["sha256ToBase64","SignJWT","hasStatus","CredentialIssuingNotSynchronousError","CredentialNotEntitledError","CredentialRequestError","UnexpectedStatusCodeError","ValidationFailed","CredentialResponse","createDPopToken","uuid","createNonceProof","nonce","issuer","audience","ctx","jwk","getPublicKey","setPayload","setProtectedHeader","typ","setAudience","setIssuer","setIssuedAt","setExpirationTime","sign","obtainCredential","issuerConf","accessToken","clientId","credentialDefinition","context","credentialCryptoContext","appFetch","fetch","dPopCryptoContext","credentialUrl","openid_credential_issuer","credential_endpoint","signedNonceProof","c_nonce","constainsCredentialDefinition","authorization_details","some","c","credential_configuration_id","format","type","credentialRequestFormBody","credential_definition","proof","jwt","proof_type","tokenRequestSignedDPop","htm","htu","jti","v4","ath","access_token","credentialRes","method","headers","DPoP","Authorization","token_type","body","JSON","stringify","then","res","json","safeParse","catch","handleObtainCredentialError","success","error","message","data","e","statusCode"],"sourceRoot":"../../../../src","sources":["credential/issuance/06-obtain-credential.ts"],"mappings":"AAAA,SACEA,cAAc,EACdC,OAAO,QAEF,6BAA6B;AAGpC,SAASC,SAAS,QAAkB,kBAAkB;AAEtD,SACEC,oCAAoC,EACpCC,0BAA0B,EAC1BC,sBAAsB,EACtBC,yBAAyB,EACzBC,gBAAgB,QACX,oBAAoB;AAC3B,SAASC,kBAAkB,QAAQ,SAAS;AAE5C,SAASC,eAAe,QAAQ,kBAAkB;AAClD,OAAOC,IAAI,MAAM,mBAAmB;AAcpC,OAAO,MAAMC,gBAAgB,GAAG,MAAAA,CAC9BC,KAAa,EACbC,MAAc,EACdC,QAAgB,EAChBC,GAAkB,KACE;EACpB,MAAMC,GAAG,GAAG,MAAMD,GAAG,CAACE,YAAY,CAAC,CAAC;EACpC,OAAO,IAAIhB,OAAO,CAACc,GAAG,CAAC,CACpBG,UAAU,CAAC;IACVN;EACF,CAAC,CAAC,CACDO,kBAAkB,CAAC;IAClBC,GAAG,EAAE,sBAAsB;IAC3BJ;EACF,CAAC,CAAC,CACDK,WAAW,CAACP,QAAQ,CAAC,CACrBQ,SAAS,CAACT,MAAM,CAAC,CACjBU,WAAW,CAAC,CAAC,CACbC,iBAAiB,CAAC,MAAM,CAAC,CACzBC,IAAI,CAAC,CAAC;AACX,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,gBAAkC,GAAG,MAAAA,CAChDC,UAAU,EACVC,WAAW,EACXC,QAAQ,EACRC,oBAAoB,EACpBC,OAAO,KACJ;EACH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