Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(IT Wallet): [SIW-975,SIW-976] Wallet instance registration and attestation retrieval #5861

Merged
merged 283 commits into from
Jul 16, 2024

Conversation

mastro993
Copy link
Contributor

@mastro993 mastro993 commented Jun 14, 2024

Warning

This PR depends on #5922

Short description

This PR introduces the wallet instance and attestation retrieval state to the eID issuance machine.

List of changes proposed in this pull request

  • Added @pagopa/io-react-native-integrity dipendency
  • Updated @pagopa/io-react-native-wallet to ^0.13.0
  • Moved cards and credentials catalog screen to the IT Wallet navigation stack
  • Added issuance reducer
  • Updated itwEidIssuanceMachine logic
    • Added registerWalletInstance and getWalletAttestation actors
    • Added WalletInstanceRegistration and WalletAttestationRetrieval substates to WalletInitialization state
  • Updated ItwIdentificationModeSelectionScreen copy

How to test

In order to test this PR you need a physical device and the io-wallet local development server.
From the IT Wallet playground, go to the Discovery screen. You should be able to go through the wallet init phase and land in the identification screen

Co-authored by: @LazyAfternoons

hevelius and others added 30 commits January 25, 2024 10:05
Comment on lines 32 to 35
await WalletInstance.createWalletInstance({
integrityContext,
walletProviderBaseUrl: itwWalletProviderBaseUrl
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have to pass the appFetch of the app which includes our custom headers, otherwise this won't work in production. Also, we have to manage the LV 401 status code.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in 1c430ba

Since we are not in a saga we have to implement custom logic to handle the 401. I think we should address it in a dedicated task.

Copy link
Contributor

@LazyAfternoons LazyAfternoons Jul 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I craeated a task at the top of the backlog since this might be a blocking issue. Thanks.

await generate(ephemeralKey);
const wiaCryptoContext = createCryptoContextFor(ephemeralKey);

return WalletInstanceAttestation.getAttestation({
Copy link
Contributor

@LazyAfternoons LazyAfternoons Jul 15, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above (line 53).

Copy link
Contributor

@LazyAfternoons LazyAfternoons left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mastro993 mastro993 merged commit 5cfdb78 into master Jul 16, 2024
13 checks passed
@mastro993 mastro993 deleted the SIW-975-wallet-attestation-registration branch July 16, 2024 10:40
mastro993 added a commit that referenced this pull request Jul 17, 2024
> [!Warning]
> This PR depends on #5861 

## Short description
This PR adds a lifecycle reducer to IT Wallet. The goal of this reducer
is to persist the wallet instance state (installed, operational, valid,
deactivated), so it is available in the global store.

## List of changes proposed in this pull request
- Add persisted lifecycle ITW reducer
- Update the wallet instance state from the eID issuance machine
- Refactor persist logic

## How to test
Run the app and check that `features.itWallet.lifecycle` gets updated
after the eID issuance.

---------

Co-authored-by: Cristiano Tofani <[email protected]>
Co-authored-by: Fabio Bombardi <[email protected]>
Co-authored-by: LazyAfternoons <[email protected]>
Co-authored-by: Federico Mastrini <[email protected]>
Co-authored-by: Damiano Plebani <[email protected]>
Co-authored-by: Alice Di Rico <[email protected]>
Co-authored-by: Mario Perrotta <[email protected]>
Co-authored-by: LazyAfternoons <[email protected]>
Co-authored-by: Andrea Piai <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants