This repository has been archived by the owner on Sep 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #124 from felleslosninger/structure
Structure
- Loading branch information
Showing
25 changed files
with
128 additions
and
204 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,117 +1,105 @@ | ||
## Components | ||
Components | ||
---------- | ||
|
||
**App.js** | ||
**src\components\frames\Onboarding.jsx** | ||
|
||
### 1. App | ||
### 1. Onboarding | ||
|
||
--- | ||
|
||
**components\ConsentButton.jsx** | ||
|
||
### 1. ConsentButton | ||
|
||
Toggle button that changes between true/false depending on if you want/not want to share information | ||
@returns Toggle button and text describing the status of the button (boolean) | ||
----- | ||
**src\components\frames\ProfileMenu.jsx** | ||
|
||
--- | ||
### 1. ProfileMenuSlide | ||
|
||
**components\Proof.jsx** | ||
A profile site for administrativ changes on the profile | ||
@returns A new site, A logout button and a delete button | ||
|
||
### 1. Proof | ||
|
||
A proof object/card with info about the issuer, validity, shared with and deletion option. | ||
@param {string} props | ||
From the ProofOverviewFrame a proof object is sent with corresponding prop values. | ||
@returns A proof card/object | ||
|
||
--- | ||
|
||
**components\QRcode.jsx** | ||
----- | ||
**src\components\frames\ProofOverviewFrame.jsx** | ||
|
||
### 1. CreateQR | ||
### 1. ProofOverviewFrame | ||
|
||
A frame with an overview of every proof the wallet has | ||
@returns | ||
|
||
Making a QR code that takes in a jwt string that will be the information in the QR code | ||
@param {string} props | ||
@returns qr code containing string information (string: jwt) | ||
|
||
--- | ||
|
||
**components\Verifier.jsx** | ||
|
||
### 1. Verifier | ||
----- | ||
**src\components\frames\RequestFrame.jsx** | ||
|
||
A card for a verifier | ||
(VerifierLogFrame shows all Verifier cards that belong to a proof) | ||
@param {string} props props is from VerifierLogFrame with corresponding props | ||
@returns A card for a verifier | ||
### 1. RequestFrame | ||
|
||
--- | ||
Page to request new proof, retrieve and save new proof | ||
@returns Buttons and menus to select the issuer and type of proof | ||
|
||
**components\frames\VerifyFrame.jsx** | ||
|
||
### 1. VerifyFrame | ||
|
||
A frame with a botton to send proof to a verifier if you choose to share | ||
@returns A frame, sending the proof | ||
|
||
--- | ||
----- | ||
**src\components\frames\StartPage.jsx** | ||
|
||
**components\frames\Onboarding.jsx** | ||
### 1. StartPage | ||
|
||
### 1. Onboarding | ||
The intro page to the app, choose between log in or create a user | ||
@returns Two buttons/options: "access control" or "create user" | ||
|
||
Here we are going to add the onboarding | ||
@returns | ||
|
||
--- | ||
|
||
**components\frames\ProofOverviewFrame.jsx** | ||
|
||
### 1. ProofOverviewFrame | ||
----- | ||
**src\components\frames\VerifierLogFrame.jsx** | ||
|
||
A frame with an overview of every proof the wallet has | ||
@returns | ||
### 1. VerifierLogFrame | ||
|
||
Page with an overview of which verifiers who have access to a specific proof | ||
@param {proof} param0 a spesific proof | ||
@returns Page with a list of all verifiers a proof is shared with | ||
|
||
--- | ||
|
||
**components\frames\RequestFrame.jsx** | ||
|
||
### 1. RequestFrame | ||
|
||
Page to request new proof, retrieve and save new proof | ||
@returns Buttons and menus to select the issuer and type of proof | ||
----- | ||
**src\components\frames\VerifyFrame.jsx** | ||
|
||
--- | ||
### 1. VerifyFrame | ||
|
||
**components\frames\StartPage.jsx** | ||
A frame with a botton to send proof to a verifier if you choose to share | ||
@returns A frame, sending the proof | ||
|
||
### 1. StartPage | ||
|
||
The intro page to the app, choose between log in or create a user | ||
@returns Two buttons/options: "access control" or "create user" | ||
|
||
--- | ||
|
||
**components\frames\VerifierLogFrame.jsx** | ||
----- | ||
**src\components\other\QRCode.jsx** | ||
|
||
### 1. VerifierLogFrame | ||
### 1. CreateQR | ||
|
||
Page with an overview of which verifiers who have access to a specific proof | ||
@param {proof} param0 a spesific proof | ||
@returns Page with a list of all verifiers a proof is shared with | ||
Making a QR code that takes in a jwt string that will be the information in the QR code | ||
@param {string} props | ||
@returns qr code containing string information (string: jwt) | ||
|
||
--- | ||
|
||
**utils\storage\StorageExample.jsx** | ||
|
||
### 1. Storage | ||
|
||
--- | ||
----- | ||
**src\components\views\ProofView.jsx** | ||
|
||
### 1. Proof | ||
|
||
A proof object/card with info about the issuer, validity, shared with and deletion option. | ||
@param {string} props | ||
From the ProofOverviewFrame a proof object is sent with corresponding prop values. | ||
@returns A proof card/object | ||
|
||
|
||
**utils\storage\WriteToFile.jsx** | ||
|
||
### 1. RequestFrame | ||
|
||
--- | ||
----- | ||
|
||
<sub>This document was generated by the <a href="https://github.com/marborkowski/react-doc-generator" target="_blank">**React DOC Generator v1.2.5**</a>.</sub> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 0 additions & 6 deletions
6
wallet/wallet-app/AppWrapper.js → wallet/wallet-app/src/AppWrapper.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
3 changes: 1 addition & 2 deletions
3
...llet-app/components/frames/Onboarding.jsx → ...-app/src/components/frames/Onboarding.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
1 change: 1 addition & 0 deletions
1
...et-app/components/frames/RequestFrame.jsx → ...pp/src/components/frames/RequestFrame.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
1 change: 0 additions & 1 deletion
1
...pp/components/frames/VerifierLogFrame.jsx → ...rc/components/frames/VerifierLogFrame.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
11 changes: 0 additions & 11 deletions
11
wallet/wallet-app/redux/CredentialSlice.js → ...t/wallet-app/src/redux/CredentialSlice.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 1 addition & 3 deletions
4
wallet/wallet-app/utils/sign.js → wallet/wallet-app/src/utils/sign.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
/* eslint-disable no-alert */ | ||
import AsyncStorage from '@react-native-async-storage/async-storage'; | ||
|
||
export const saveProof = async (cred) => { | ||
if (cred.jti !== undefined) { | ||
try { | ||
await AsyncStorage.setItem(cred.jti, cred.token); | ||
return true; | ||
} catch (error) { | ||
alert(error); | ||
} | ||
} | ||
return false; | ||
}; | ||
|
||
/** | ||
* Adds the keys and the associated information into a list | ||
*/ | ||
export const getProofs = async (keys) => { | ||
const proofs = []; | ||
try { | ||
keys.forEach(async (key) => { | ||
const value = await AsyncStorage.getItem(key); | ||
if (value !== null) { | ||
if (!proofs.some((item) => item.id === key)) { | ||
// Makes sure that there are no duplicates | ||
proofs.push({ id: key, proof: value }); | ||
// dispatch(addCredential(JSON.parse(value))); | ||
} | ||
} | ||
}); | ||
} catch (error) { | ||
alert(error); | ||
} | ||
return proofs; | ||
}; | ||
|
||
/** | ||
* Gets all the proof keys in AsyncStorage | ||
* Adds the keys into a list | ||
*/ | ||
export const getProofKeys = async () => { | ||
const keys = []; | ||
try { | ||
const allKeys = await AsyncStorage.getAllKeys(); | ||
if (allKeys !== null) { | ||
allKeys.forEach((key) => { | ||
if ( | ||
!keys.includes(key) && | ||
key !== 'pin' && | ||
key !== 'baseId' && | ||
key !== 'privateKey' && | ||
key !== 'walletID' | ||
) { | ||
keys.push(key); | ||
} | ||
}); | ||
} | ||
} catch (error) { | ||
alert(error); | ||
} | ||
return keys; | ||
}; |
Oops, something went wrong.