update response and readme

This commit is contained in:
Gianmarco Pettinato 2021-09-26 18:46:21 +02:00
parent 12f733ee86
commit d813e08e6e
2 changed files with 12 additions and 3 deletions

View File

@ -1,7 +1,7 @@
# DGCServerVerifier # DGCServerVerifier
## what is it? ## what is it?
This web server takes a post request on /api/green with a json object as body. This web server takes a post request on ``/api/green`` with a json object as body.
Verifies if the data are correct: Verifies if the data are correct:
* Downloads the last rules released on https://get.dgc.gov.it/v1/dgc/settings * Downloads the last rules released on https://get.dgc.gov.it/v1/dgc/settings
@ -19,7 +19,7 @@ build a JSON object with this structure:
The string is the raw value read from a QR code reader app. The string is the raw value read from a QR code reader app.
## what does it returns? ## what does it return?
When the request is complete, the server returns a JSON object with this structure: When the request is complete, the server returns a JSON object with this structure:
{ {
@ -29,6 +29,15 @@ When the request is complete, the server returns a JSON object with this structu
"valid": { "valid": {
"valid": true, "valid": true,
"message": "Certificate is valid" "message": "Certificate is valid"
},
"info": {
"identity": {
"fnt": "ROSSI",
"fn": "ROSSI",
"gnt": "MARIO",
"gn": "MARIO"
},
"dob": "1973-06-22"
} }
} }

View File

@ -27,7 +27,7 @@ export default class Verifier {
let result:unknown = {}; let result:unknown = {};
result = await (await this.checkKey(dcc)).valid; result = await (await this.checkKey(dcc)).valid;
const vaccineVerifier = new VaccineVerifier(await this.ruleDownloader.getRules()); const vaccineVerifier = new VaccineVerifier(await this.ruleDownloader.getRules());
result = {signature: result, valid: vaccineVerifier.checkCertifcate(dcc.payload)}; result = {signature: result, valid: vaccineVerifier.checkCertifcate(dcc.payload), info:{identity:dcc.payload.nam,dob:dcc.payload.dob}};
return result; return result;
} }