Coder Social home page Coder Social logo

decodeproject / decode-app Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 11.0 8.95 MB

DECODE Project mobile app

Home Page: https://app.decodeproject.eu

License: Apache License 2.0

JavaScript 90.90% Java 2.75% Objective-C 1.52% Ruby 3.27% C 0.94% Starlark 0.62%

decode-app's People

Contributors

andrea-dintino avatar jordibuj avatar puria avatar uladribia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

decode-app's Issues

Reorganize api folder (enhancement)

Reorganize API folder with:

  • Core: Containing credential, petitions, zenroom, atlas
  • Aplications: Speciffic client applications (dddc, login, iot stack).

Reorganize also calls from code (imports)

Tests fail

Testing on dyne fork, calling yarn test returns 269 errors:

Screenshot from 2020-05-08 11-18-20

Bug: Log-in should pass the credentialID

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.

Failed to set up development environment

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.

System configuration

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

Steps to reproduce

  1. Clone the repo locally and change into the project directory
  2. Install node dependencies by running yarn install
  3. Copy the .env.sample file in the project root to a file named .env
  4. Insert the following text into the .env file:
    STORAGE_KEY=48656c6c6f20576f726c6421
    SENTRY_DSN=http://sentry.io
    
  5. Run the tests by executing 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.

Potential bug on data hashing with DDDC

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.