Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/certificate-support' int…
Browse files Browse the repository at this point in the history
…o validate-in-app
  • Loading branch information
DennisHouterman committed Apr 26, 2019
2 parents ea69965 + 72cf172 commit 01de7e7
Show file tree
Hide file tree
Showing 25 changed files with 3,117 additions and 3,049 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,8 @@
language: node_js
node_js:
- "lts/*"
before_script:
- if [ ! -z "$NLX_KEY" ]; then echo "$NLX_KEY" > ./waardepapieren-service/system-test/certs/org.key; fi
- if [ ! -z "$NLX_CERT" ]; then echo "$NLX_CERT" > ./waardepapieren-service/system-test/certs/org.crt; fi
script:
- ./.travis.sh
48 changes: 15 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,26 @@
# waardepapieren
# Waardepapieren

project for consortium of municipalities digitizing PoE services
This project provides a full implementation example of how Discipl components can be used to issue and
verify claims. In particular, how municipalities can issue

the project aims at a W3C verifiable credential compatible (or alike) solution based on discipl core for proving all kinds of facts atested for by an issuer (with a focus on municipalities as issuer).
## Running

# Running
The easiest way to run is using docker-compose:

Running the applications is easiest done using docker-compose. Simply run `docker-compose up`.
This will start 3 applications:

- clerk-frontend
- waardepapieren-service, with embedded ephemeral-server
- nlx-mock, which mocks an NLX API, such that development can be done independently

components:

- client-frontend : frontend webapplication (js) embedded in the my-environment provided by the municipality, which connects to a discipl node to retrieve a needed proof.
- clerk-frontend : frontend webapplication (js) which connects to a discipl node to retrieve a needed proof of a selected person (by referring to a BSN).
- authorization-backend : simple serverside authorization script that enables access to the abundance service that delivers certain proofs to a given ssid (authenticated for the my-environment, or being a clerk)
- validator-frontend : frontend webapplication (js) that can validate a proof
- dashboard
- revoke-service
- waardepapieren-service

these components might involve the following components from the discipl software stack:

- discipl-abundance-service
- discipl-4sacan
- discipl-expo
- discipl-rshiny
- discipl-core
- discipl-core-restapi
- discipl-core-node
- discipl-core-paper
- discipl-core-nlx
- discipl-core-iota
- discipl-core-ipfs
- discipl-core-irma

architectural primer : https://docs.google.com/presentation/d/1sw7xi2UbmxRN3NBwQTn9kWw6-RNhygdRL5kccnZWUyE
- nlx-mock, which is an nlx-outway that provides access to a mock BRP service

Note that the nlx-mock and waardepapieren-service need a valid certificate for the demo NLX environment.

1. Generate certificates as described [here](https://docs.nlx.io/get-started/create-certificates/)
2. Run `docker-compose up`

Alternatively, you can use an offline mock, which replicates the NLX environment.

1. Run `docker-compose -f docker-compose-travis.yml up`

# Running validator
The validator app is made with [Expo](https://expo.io/), which is a free and open-source react-native framework for mobile development. to run this on a mobile device, connect to the same network without firewall restrictions (if all else fails, starting an hotspot on your mobile device and connecting to it usually works). In the folder "validator-frontend", issue the command:
Expand Down
1 change: 1 addition & 0 deletions clerk-frontend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,4 @@ yarn-error.log*
public/images

cypress/videos
cypress/screenshots
3 changes: 1 addition & 2 deletions clerk-frontend/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ RUN npm install --unsafe-perm
ADD src /app/src
RUN npm run build


FROM nginx:1.15.8
ADD nginx/nginx.conf /etc/nginx/nginx.conf
COPY --from=0 /app/build /usr/share/nginx/html
COPY --from=0 /app/build /usr/share/nginx/html
4 changes: 2 additions & 2 deletions clerk-frontend/cypress/integration/scenario_spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ describe('clerk-frontend', () => {

cy.contains('Volgende').click()

cy.contains('Utrecht')
cy.contains('td', 'Utrecht', { 'timeout': 30000 })

cy.contains('Dit klopt!').click()

cy.get('canvas').should((canvasArray) => {
let canvas = canvasArray[0]
let context = canvas.getContext('2d')
// This a pixel just from the top left of the QR code based on the offset
let pixel = context.getImageData(320, 420, 1, 1)
let pixel = context.getImageData(549, 699, 1, 1)
expect(pixel.data).to.deep.equal(new Uint8ClampedArray([255, 255, 255, 255]))
})

Expand Down
Loading

0 comments on commit 01de7e7

Please sign in to comment.