Commit a981cac
feat(IT-Wallet): [SIW-3045] Add L2+ PID issuance flow with MRTD PoP (#7647)
## Short description
This PR introduces the L2+ flow for IT-Wallet. L2+ adds an extra step
after the primary SPID or CieID identification, requiring the user to
complete an MRTD (ID card) proof-of-possession check.
The verification is performed through an NFC scan of the ID card.
This PR also includes a major refactoring of the CIE scan logic, making
it reusable and shareable across both the CIE+PIN and MRTD flows.
## List of changes proposed in this pull request
### Credential Issuance Flow & Proof Handling
* Added support for selecting proof type (`mrtd-pop` or `none`) during
credential issuance, controlled by the new `withMRTDPoP` parameter in
`startAuthFlow`, and updated related function signatures and logic in
`itwIssuanceUtils.ts`.
[[1]](diffhunk://#diff-2cd6d88d7a0a5ffab205730094379c0e1c542e964874a0edf5a5d60416e295c3R28)
[[2]](diffhunk://#diff-2cd6d88d7a0a5ffab205730094379c0e1c542e964874a0edf5a5d60416e295c3R39-L50)
[[3]](diffhunk://#diff-2cd6d88d7a0a5ffab205730094379c0e1c542e964874a0edf5a5d60416e295c3R67-R69)
* Improved validation in `getCredentialIdentifierFromAccessToken` to
throw an error for unsupported authorization detail types, increasing
robustness.
### MRTD PoP Challenge Utilities
* Introduced the `mrtd.ts` utility with functions for initializing and
validating MRTD PoP challenges, encapsulating cryptographic context
management and challenge handling.
### NFC Feature Detection & L3 Flow
* Simplified L3 feature detection by checking for `level === "l3"`
directly instead of using a helper, and updated related tests and
screens to reflect this logic.
[[1]](diffhunk://#diff-aac82824191e7fddf4b8b79ddee9b8b13896340cea331ff4f4f2e6ea90335170L31-R30)
[[2]](diffhunk://#diff-ad0b45dc86f8c2a0249744d4413aef7b7d8667579124c2c7d156067e8c474304L21-R35)
* Updated the discovery component to use wallet lifecycle validity for
determining whether to start in "upgrade" or "issuance" mode, improving
flow control.
### Localization & Dependency Updates
* Updated Italian localization strings for credential issuance modes to
clarify durations and hints.
* Upgraded the `@pagopa/io-react-native-wallet` dependency to version
2.4.0 for access to new features and bug fixes.
### Error Handling & Analytics
* Refactored the CIE card read failure content to improve error
tracking, analytics integration, and retry handling, making the
component more robust and customizable.
[[1]](diffhunk://#diff-9c4c2ef6526484c9cf6023ef5875cd7d05a72c0a0bc331bb30305c47f1fafee8L2-R65)
[[2]](diffhunk://#diff-4f759b936530a9db89be53e8df2c20c5e69713067abb07ce762fce6d0dcc64ddL227-R229)
## How to test
- With the IT-Wallet whitelist flag **disabled**:
- Verify that all identification methods (CIE+PIN, SPID, CieID) behave
as before and no regressions are introduced.
- With the IT-Wallet whitelist flag **enabled**:
- Verify that the CIE+PIN identification flow still works correctly and
without regressions.
- Verify that it is possible to obtain an L3 PID using SPID or CieID
through the MRTD PoP flow.
## Demo
| SPID + CIE | CieID + CIE |
| --- | --- |
| <video
src="https://github.com/user-attachments/assets/83e7bf7b-7c60-4b21-9d7c-01175c00c395"
/> | <video
src="https://github.com/user-attachments/assets/f72e8343-0905-4f0b-bff4-99cdb880bc37"
/> |
---------
Co-authored-by: Alessandro Mazzon <[email protected]>1 parent 052410d commit a981cac
File tree
51 files changed
+1827
-1534
lines changed- locales/it
- ts
- features
- common
- components/cie
- utils/cie/__tests__
- itwallet
- common/utils
- discovery
- components
- screens
- __tests__
- identification
- cie
- components
- hooks
- machine
- __tests__
- screens
- utils
- common/screens
- __tests__
- spid/screens
- machine/eid
- __tests__
- playgrounds/components
- types
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
51 files changed
+1827
-1534
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4749 | 4749 | | |
4750 | 4750 | | |
4751 | 4751 | | |
4752 | | - | |
4753 | | - | |
4754 | | - | |
4755 | | - | |
| 4752 | + | |
4756 | 4753 | | |
4757 | 4754 | | |
4758 | 4755 | | |
4759 | 4756 | | |
4760 | 4757 | | |
4761 | 4758 | | |
4762 | | - | |
| 4759 | + | |
4763 | 4760 | | |
4764 | 4761 | | |
4765 | 4762 | | |
4766 | 4763 | | |
4767 | 4764 | | |
4768 | | - | |
| 4765 | + | |
4769 | 4766 | | |
4770 | 4767 | | |
4771 | 4768 | | |
4772 | | - | |
| 4769 | + | |
4773 | 4770 | | |
4774 | 4771 | | |
4775 | 4772 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
| 72 | + | |
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
232 | 232 | | |
233 | 233 | | |
234 | 234 | | |
235 | | - | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
236 | 238 | | |
237 | 239 | | |
238 | 240 | | |
| |||
This file was deleted.
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
| 62 | + | |
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
151 | 154 | | |
152 | 155 | | |
153 | 156 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
| |||
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| 39 | + | |
38 | 40 | | |
39 | 41 | | |
40 | 42 | | |
41 | 43 | | |
42 | 44 | | |
43 | | - | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
49 | 52 | | |
50 | | - | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| |||
218 | 223 | | |
219 | 224 | | |
220 | 225 | | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
221 | 232 | | |
222 | 233 | | |
223 | 234 | | |
| |||
275 | 286 | | |
276 | 287 | | |
277 | 288 | | |
278 | | - | |
279 | | - | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | 289 | | |
284 | 290 | | |
285 | 291 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
Lines changed: 4 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
63 | 64 | | |
64 | 65 | | |
65 | 66 | | |
| 67 | + | |
66 | 68 | | |
67 | 69 | | |
68 | 70 | | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
72 | | - | |
| 74 | + | |
73 | 75 | | |
74 | 76 | | |
75 | | - | |
| 77 | + | |
76 | 78 | | |
77 | 79 | | |
78 | 80 | | |
| |||
Lines changed: 1 addition & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | | - | |
| 30 | + | |
32 | 31 | | |
33 | 32 | | |
34 | 33 | | |
| |||
0 commit comments