decodeproject / decode-app Goto Github PK
View Code? Open in Web Editor NEWDECODE Project mobile app
Home Page: https://app.decodeproject.eu
License: Apache License 2.0
DECODE Project mobile app
Home Page: https://app.decodeproject.eu
License: Apache License 2.0
To comply with FOSS standards, it would be interesting to publish the app at FDROID platform.
Reorganize API folder with:
Reorganize also calls from code (imports)
At the moment, upon log-in, the app chooses the first available credential to try and id itself.
The QR of the log-in flow should compulsory contain the credentialID so the app internally can choose which to send to the callback function.
Add a header to the repo so it is more amenable on landing page.
Hi I encountered a problem in setting up my local development environment which @jordibuj was helping me with on Telegram, but documenting it here to capture my problem in a better place.
The problem I have is that when I clone the repo and try to set up a development environment (which I'm defining as being able to run the test suite successfully) - the test suite fails with a cryptic error when trying to run applications.spec.js
.
Variable | Value |
---|---|
OS | Ubuntu 18.04.3 LTS |
Node version | v8.16.1 |
Yarn version | 1.17.3 |
Android studio installed | false |
Xcode installed | false |
yarn install
.env.sample
file in the project root to a file named .env
.env
file:
STORAGE_KEY=48656c6c6f20576f726c6421
SENTRY_DSN=http://sentry.io
yarn test
When I follow the above steps I see the following error output:
yarn run v1.17.3
$ eslint . && jest
PASS __tests__/migrations.spec.js
FAIL __tests__/attributes.spec.js
● Attribute tests › Add attribute
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at _default (src/redux/modules/attributes.js:158:15)
at Object.<anonymous> (__tests__/attributes.spec.js:45:21)
● Attribute tests › Encrypt
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:51:20)
● Attribute tests › Change attribute
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:62:19)
● Attribute tests › Change attribute and getAllAttributes
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:72:17)
● Attribute tests › Add another attribute
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:81:17)
● Attribute tests › Attribute selector
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:97:17)
● Attribute tests › All attributes selector
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:105:17)
● Attribute tests › All attribute names
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:128:17)
● Attribute tests › Filter atlas attributes
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:137:17)
● Attribute tests › Filter atlas attributes - all
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:146:17)
● Attribute tests › Delete attribute
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:163:17)
● Attribute tests › Delete attribute - empty
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:178:22)
● Attribute tests › Get application shared attributes - age
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:198:17)
● Attribute tests › Get application shared attributes - age range
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/attributes.spec.js:237:17)
PASS __tests__/root.spec.js
FAIL __tests__/applications.spec.js
● Application tests › Get shared attributes - sort
Array contains invalid value: 15,NaN
47 | const buffer = [];
48 | const iv = uuid(null, buffer);
> 49 | const aesCbc = new aesjs.ModeOfOperation.cbc(key, iv);
| ^
50 | const encryptedBytes = aesCbc.encrypt(paddedBytes);
51 | const encryptedHex = aesjs.utils.hex.fromBytes([...iv, ...encryptedBytes]);
52 | return encryptedHex;
at coerceArray (node_modules/aes-js/index.js:40:23)
at new coerceArray (node_modules/aes-js/index.js:195:20)
at new ModeOfOperationCBC (node_modules/aes-js/index.js:444:21)
at encrypt (src/lib/utils.js:49:18)
at Object.<anonymous> (__tests__/applications.spec.js:350:22)
PASS __tests__/walkthrough.spec.js
Test Suites: 2 failed, 3 passed, 5 total
Tests: 15 failed, 24 passed, 39 total
Snapshots: 0 total
Time: 2.58s
Ran all test suites.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
We need to check a bit more the hashing of data donation to the credential issuer. While it works, we'd need to make sure there aren't issues of communication between DDDC - CI - App - BCNNow.
Atlas should need its own README file with specs. It is self-evident from the JSON but could be enhanced.
As disscussed, try to refactor code in __test__
so addition of new applications is easier and all tests are passed.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.