From d813e08e6eabb51ec8af37eeb2e29b1df5d59b7f Mon Sep 17 00:00:00 2001 From: Gianmarco Pettinato Date: Sun, 26 Sep 2021 18:46:21 +0200 Subject: [PATCH] update response and readme --- README.md | 13 +++++++++++-- src/Services/dgcVerifier/Verifier.ts | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index b561cc5..6608ee7 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # DGCServerVerifier ## 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: * 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. -## what does it returns? +## what does it return? 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": true, "message": "Certificate is valid" + }, + "info": { + "identity": { + "fnt": "ROSSI", + "fn": "ROSSI", + "gnt": "MARIO", + "gn": "MARIO" + }, + "dob": "1973-06-22" } } diff --git a/src/Services/dgcVerifier/Verifier.ts b/src/Services/dgcVerifier/Verifier.ts index 6af287a..811e8c1 100644 --- a/src/Services/dgcVerifier/Verifier.ts +++ b/src/Services/dgcVerifier/Verifier.ts @@ -27,7 +27,7 @@ export default class Verifier { let result:unknown = {}; result = await (await this.checkKey(dcc)).valid; 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; }