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

[INJIMOB-2109] - create component and sequence diagram for Inji Wallet #1641

Draft
wants to merge 2 commits into
base: release-0.14.x
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -372,5 +372,9 @@ fileignoreconfig:
- filename: components/FaceScanner/LivenessDetection.tsx
checksum: d4140a42ee9ca0f7c90e490f762d181a723fd9dd20db891cbbe53bfbd8f81632
- filename: machines/VerifiableCredential/VCItemMachine/VCItemActions.ts
checksum: 9b68ccc45681459d164197f73a1875e6f8bdf473acede18c811f4a784fca00e0
checksum: 9b68ccc45681459d164197f73a1875e6f8bdf473acede18c811f4a784fca00e0
- filename: docs/InjiWalletComponents.drawio
checksum: d295ba37678f892d6939fa51b7e936d942fb9fa9b29ca4b64f0acef28ffeffa1
- filename: docs/InjiWalletComponents.md
checksum: 2e1d6b147803bfcf93c1f83fcd01242c0d5d873817cc135491a24fecaae2b53e
Copy link
Member

Choose a reason for hiding this comment

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

what is this file ? Is this used in all the repos ?

Copy link
Contributor Author

@swatigoel swatigoel Oct 17, 2024

Choose a reason for hiding this comment

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

We have talisman setup which acts as hook to protect committing secrets and sensitive information.
If we want to exclude some files to be removed from scan, need to be part of this file with the checksum defined. For all subsequent run if checksum is same, this file will be skipped. If anyone makes changes in the same file, talisman will rescan and gives error which tells developer to look at that file and review it. https://thoughtworks.github.io/talisman/docs/configuring-talisman/ignoring/

Copy link
Member

Choose a reason for hiding this comment

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

Possible to remove this while merging to MOSIP repo, since we don't use tailsman as part of mosip checks ?

version: ""
73 changes: 73 additions & 0 deletions docs/InjiWalletComponents.drawio

Large diffs are not rendered by default.

53 changes: 53 additions & 0 deletions docs/InjiWalletComponents.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# **Inji Wallet Components**

<!-- TOC -->

- [**Inji Wallet Components**](#inji-wallet-components)
_ [**Inji Wallet**](#inji-wallet)
_ [**Mimoto**](#mimoto)
_ [**Inji Verify**](#inji-verify)
_ [**Inji Certify**](#inji-certify)
_ [**Data Share**](#data-share)
_ [**ESignet**](#esignet) \* [\*\*Native Libraries](#native-libraries)
<!-- TOC -->

### **Inji Wallet**

- The Inji Wallet is a mobile application for Android and iOS developed in react native.
- It offers a secure, trustworthy, and dependable mobile Verifiable Credentials wallet designed to fulfil the following functions
- Download and store Verifiable Credentials
- Conduct offline face verification
- Share Verifiable Credentials
- Enable users to log in to relying parties with their credential
- Generate a QR code for the credential to be shared offline or with other application.

### **Mimoto**

- Mimoto is a BFF(Backend for Frontend) for Inji Wallet. It's being used to get default configuration, list of trusted issuers and few other services as mentioned below:
- Gives default properties needed by Inji Wallet
- Gives the List of Issuers Supported by the Inji Wallet through mimoto-issuers-config.json
- Gives access token based on authorization code to download credential
- Allows to wallet binding so that user can log in to relying party

### **Inji Verify**

- **Inji Verify** stands out as a robust verification tool specifically designed to validate the verifiable credentials encoded in QR codes through an intuitive web portal interface.
- Inji Verify can verify the Credential either via Scan or Upload Functionality
- Inji Verify supports the QR code generated in VC to verify

### **Inji Certify**

- Inji Certify lets organizations issue and manage verifiable credentials, empowering users with greater control over their data and access to services.
- Inji Certify Integrate with specific plugins to retrieve the data from the registry and convert the raw Data into verifiable Credential and Issues them to wallet to manage it.

### **eSignet**

- **eSignet** strives to provide a user-friendly and effective method for individuals to authenticate themselves and utilize online services while also having the option to share their profile information. Moreover, eSignet supports multiple modes of identity verification to ensure inclusivity and broaden access, thereby reducing potential digital barriers.
- eSignet Allows us to perform the authorization of the resident on the portal before downloading the credential

### **Native Libraries**
Copy link
Member

Choose a reason for hiding this comment

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

these are actual components and we should have more detailing here on the components used.

Copy link
Member

Choose a reason for hiding this comment

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

Inji Stack components drawio (6)

On the diagram, you can refer the Inji wallet and mimoto boxes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated the component diagram and md file

Copy link
Member

Choose a reason for hiding this comment

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

Updated diagram looks good, but I not sure in using icons like openID connect, can we check on this once with Keshav ?


- **Secure-Keystore** is a module to create and store keys in android hardware keystore and helps to do encryption, decryption, and hmac calculation
- **Tuvali** is a module for the OpenID for Verifiable Presentations over BLE implementation to support sending vc/vp using Bluetooth Low Energy local channel
- **Pixelpass** is a module to generate QR code from VC data and decode from QR to get VC data
- **VCI client** is a module to support OpenId4VCI specification for downloading the credential
Binary file added docs/InjiWalletComponents.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
50 changes: 50 additions & 0 deletions docs/InjiWalletSequence.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# **Understanding the workflow**

### **Inji Wallet**

- The use installs the application on Android or iOS device.
- Application link is available in our sandbox env https://collab.mosip.net/
- After installation, user will be asked to select unlock mehtod as passcode or biometric to add security to the applicaiton
- After selecting unlock method, user will be navigated to Home screen.
- There is plus icon on home screen, after tapping on that icon, it will display list of issuers supported by Inji wallet to downlaod credentials.
- List of Issuers supported and sourced from [mimoto-issuers-configuration](https://github.com/mosip/inji-config/blob/collab/mimoto-issuers-config.json)

### **Selection of Issuer and credential type:**

- The users can select an Issuer from the list of trusted issuers
- On Clicking the issuer, user will be redirected to credential Types, where user will be displayed with list of credentials supported by the selected issuer.
- Credential Types of the issuers are sourced from the issuers wellknown **"/.well-known/openid-credential-issuer"**
- The users can select a credential type from the available options provided by the issuers.

**Sequence Diagram for the Inji Wallet is mentioned here**

![inji-wallet-sequence.png](InjiWalletSequence.png)

### **Authorization**

- When the user selects any credential type, user is redirected to the authorization page for that specific issuer.
Copy link
Member

Choose a reason for hiding this comment

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

We need more technical details like the webview part

Copy link
Member

Choose a reason for hiding this comment

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

Is this taken care ?

- Once authorization is successful, authorization server return the **"authorizationCode"**
- Inji Wallet sends the authorization code to authorization server through Mimoto to perform the client assertions.
Copy link
Member

Choose a reason for hiding this comment

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

This part I believe need to be improve by a implementer to include assurance of the request indeed came from inji-wallet and not from post man. Do we have a store on this ? May in the sequence we should say that is required and need to implemented specific to inji wallet ?

- Once authorized, authorization server issues token response, which include **access_token**.
- The "access_token" will be used to download the credential through VCI.

### **VC Issuance**

- Inji wallet generates a keypair using secure-keystore module and signs the credential request.
- It invokes the issuer's VCI endpoint and send this credential request along with access token issued during authorization.
- Inji Wallet receives the credential back, displays it and stores in internal storage to support offline transfer.

### \*\*Display and Store Credential

- Inji Wallet uses the credential response and applies the issuers wellknown display properties to modify the template text and background colour.
- It also uses order field in wellknown to render the fields in the same order.

### **Supported QR Codes**

- Inji Wallet uses Pixelpass libary to generate the QR to emded complete VC within the QR.
- This library supports the VC without biometric/face

### **Offline BLE Sharing**

- Inji Wallet use Tuvali libary to support offline BLE sharing with relying parties or verifiers.
- The user can tap on kebab popup icon (three dots) and initiate the flow with share or share with selfie option.
Copy link
Member

Choose a reason for hiding this comment

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

In the sequence diagram, can we bring in the webview part also ? so it is little more clear that construction of authentication request is not part of the Inji wallet ?

Copy link
Member

Choose a reason for hiding this comment

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

I think "opens webview" has to still explicitly come or it can be even a separate verticle line

Copy link
Member

Choose a reason for hiding this comment

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

In sequence diagram, the generation QR code happens immediately after the VC is downloaded ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No,QR code generation happens once VC details page is opened and then it's cached.

Copy link
Member

Choose a reason for hiding this comment

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

then the sequence diagram should be changed to give out the same understanding

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ok, updated in sequence diagram

Binary file added docs/InjiWalletSequence.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions docs/InjiWalletSequenceMermaid.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
sequenceDiagram
actor User
User->>+Inji Wallet: Launches Inji Wallet in mobile
Inji Wallet->>+Mimoto: Fetch trusted issuers
Mimoto->>+Inji Wallet: List of Issuers
User->>Inji Wallet: User chooses an issuer
Inji Wallet->>Inji Certify: Fetches issuers' well-known details
Inji Certify->>+Inji Wallet: Provide List of Credential types
User->>Inji Wallet: User chooses a credential type
Inji Wallet->>+eSignet: Authentication request
User->>eSignet: User provides details for authentication
eSignet->>+Inji Wallet: Authentication response with auth code
Inji Wallet->>+Mimoto: Initiate Token request
Mimoto->>+eSignet: Access Token request with client details
eSignet->>+Mimoto: Token response with access token
Mimoto->>+Inji Wallet: Access token
Inji Wallet->>+Inji Certify: Credential request with token
Inji Certify->>+Inji Wallet: VC sent in response
Inji Wallet->>Inji Wallet: Store the VC and generate the QR code
Loading