mirror of
https://github.com/covidpass-org/covidpass.git
synced 2025-02-23 15:07:44 +01:00
Merge branch 'shc-refactoring' into shc-refactoring
This commit is contained in:
commit
1b9d592d25
13
public/shield-black.svg
Normal file
13
public/shield-black.svg
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<svg width="111.811" height="122.88" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
|
||||||
|
<g>
|
||||||
|
<title>background</title>
|
||||||
|
<rect fill="none" id="canvas_background" height="514" width="514" y="-1" x="-1"/>
|
||||||
|
</g>
|
||||||
|
<g>
|
||||||
|
<title>Layer 1</title>
|
||||||
|
<g id="svg_1">
|
||||||
|
<path fill="#000000" id="svg_2" d="m55.713,0c20.848,13.215 39.682,19.467 55.846,17.989c2.823,57.098 -18.263,90.818 -55.63,104.891c-36.085,-13.172 -57.429,-45.441 -55.846,-105.757c18.975,0.993 37.591,-3.109 55.63,-17.123l0,0zm-21.929,66.775c-1.18,-1.01 -1.318,-2.786 -0.309,-3.967c1.011,-1.181 2.787,-1.318 3.967,-0.309l11.494,9.875l25.18,-27.684c1.047,-1.15 2.828,-1.234 3.979,-0.188c1.149,1.046 1.233,2.827 0.187,3.978l-27.02,29.708l-0.002,-0.002c-1.02,1.121 -2.751,1.236 -3.91,0.244l-13.566,-11.655l0,0zm21.951,-59.72c18.454,11.697 35.126,17.232 49.434,15.923c2.498,50.541 -16.166,80.39 -49.241,92.846c-31.942,-11.659 -50.837,-40.221 -49.435,-93.613c16.797,0.88 33.275,-2.751 49.242,-15.156l0,0z" clip-rule="evenodd" fill-rule="evenodd"/>
|
||||||
|
</g>
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 1007 B |
@ -1,6 +1,7 @@
|
|||||||
export const issuers = [
|
export const issuers = [
|
||||||
{
|
{
|
||||||
id: "ca.qc",
|
id: "ca.qc",
|
||||||
|
display: "Québec",
|
||||||
iss: "https://covid19.quebec.ca/PreuveVaccinaleApi/issuer",
|
iss: "https://covid19.quebec.ca/PreuveVaccinaleApi/issuer",
|
||||||
keys: [
|
keys: [
|
||||||
{ kid: "qFdl0tDZK9JAWP6g9_cAv57c3KWxMKwvxCrRVSzcxvM",
|
{ kid: "qFdl0tDZK9JAWP6g9_cAv57c3KWxMKwvxCrRVSzcxvM",
|
||||||
@ -11,6 +12,7 @@ export const issuers = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "us.ca",
|
id: "us.ca",
|
||||||
|
display: "California, USA",
|
||||||
iss: "https://myvaccinerecord.cdph.ca.gov/creds",
|
iss: "https://myvaccinerecord.cdph.ca.gov/creds",
|
||||||
keys: [
|
keys: [
|
||||||
{ kid: "7JvktUpf1_9NPwdM-70FJT3YdyTiSe2IvmVxxgDSRb0",
|
{ kid: "7JvktUpf1_9NPwdM-70FJT3YdyTiSe2IvmVxxgDSRb0",
|
||||||
@ -21,6 +23,7 @@ export const issuers = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "us.ny",
|
id: "us.ny",
|
||||||
|
display: "New York, USA",
|
||||||
iss: "https://ekeys.ny.gov/epass/doh/dvc/2021",
|
iss: "https://ekeys.ny.gov/epass/doh/dvc/2021",
|
||||||
keys: [
|
keys: [
|
||||||
{ kid: "9ENs36Gsu-GmkWIyIH9XCozU9BFhLeaXvwrT3B97Wok",
|
{ kid: "9ENs36Gsu-GmkWIyIH9XCozU9BFhLeaXvwrT3B97Wok",
|
||||||
@ -31,6 +34,7 @@ export const issuers = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "us.la",
|
id: "us.la",
|
||||||
|
display: "Louisiana, USA",
|
||||||
iss: "https://healthcardcert.lawallet.com",
|
iss: "https://healthcardcert.lawallet.com",
|
||||||
keys: [
|
keys: [
|
||||||
{ kid: "UOvXbgzZj4zL-lt1uJVS_98NHQrQz48FTdqQyNEdaNE",
|
{ kid: "UOvXbgzZj4zL-lt1uJVS_98NHQrQz48FTdqQyNEdaNE",
|
||||||
@ -41,6 +45,7 @@ export const issuers = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "ca.yt",
|
id: "ca.yt",
|
||||||
|
display: "Yukon",
|
||||||
iss: "https://pvc.service.yukon.ca/issuer",
|
iss: "https://pvc.service.yukon.ca/issuer",
|
||||||
keys: [
|
keys: [
|
||||||
{ kid: "UnHGY-iyCIr__dzyqcxUiApMwU9lfeXnzT2i5Eo7TvE",
|
{ kid: "UnHGY-iyCIr__dzyqcxUiApMwU9lfeXnzT2i5Eo7TvE",
|
||||||
@ -51,6 +56,7 @@ export const issuers = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "ca.bc",
|
id: "ca.bc",
|
||||||
|
display: "British Columbia",
|
||||||
iss: "https://smarthealthcard.phsa.ca/v1/issuer",
|
iss: "https://smarthealthcard.phsa.ca/v1/issuer",
|
||||||
keys: [
|
keys: [
|
||||||
{ kid: "XCqxdhhS7SWlPqihaUXovM_FjU65WeoBFGc_ppent0Q",
|
{ kid: "XCqxdhhS7SWlPqihaUXovM_FjU65WeoBFGc_ppent0Q",
|
||||||
@ -61,6 +67,7 @@ export const issuers = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "ca.sk",
|
id: "ca.sk",
|
||||||
|
display: "Saskatchewan",
|
||||||
iss: "https://skphr.prd.telushealthspace.com",
|
iss: "https://skphr.prd.telushealthspace.com",
|
||||||
keys: [
|
keys: [
|
||||||
{ kid: "xOqUO82bEz8APn_5wohZZvSK4Ui6pqWdSAv5BEhkes0",
|
{ kid: "xOqUO82bEz8APn_5wohZZvSK4Ui6pqWdSAv5BEhkes0",
|
||||||
@ -71,6 +78,7 @@ export const issuers = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "ca.ab",
|
id: "ca.ab",
|
||||||
|
display: "Alberta",
|
||||||
iss: "https://covidrecords.alberta.ca/smarthealth/issuer",
|
iss: "https://covidrecords.alberta.ca/smarthealth/issuer",
|
||||||
keys: [
|
keys: [
|
||||||
{ kid: "JoO-sJHpheZboXdsUK4NtfulfvpiN1GlTdNnXN3XAnM",
|
{ kid: "JoO-sJHpheZboXdsUK4NtfulfvpiN1GlTdNnXN3XAnM",
|
||||||
@ -81,6 +89,7 @@ export const issuers = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "ca.ns",
|
id: "ca.ns",
|
||||||
|
display: "Nova Scotia",
|
||||||
iss: "https://pvc.novascotia.ca/issuer",
|
iss: "https://pvc.novascotia.ca/issuer",
|
||||||
keys: [
|
keys: [
|
||||||
{ kid: "UJrT9jU8vOCUl4xsI1RZjOPP8hFUv7n9mhVtolqH9qw",
|
{ kid: "UJrT9jU8vOCUl4xsI1RZjOPP8hFUv7n9mhVtolqH9qw",
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
import {toBuffer as createZip} from 'do-not-zip';
|
import {toBuffer as createZip} from 'do-not-zip';
|
||||||
import {v4 as uuid4} from 'uuid';
|
|
||||||
|
|
||||||
import {Constants} from "./constants";
|
import {Constants} from "./constants";
|
||||||
import {Payload, PayloadBody, PassDictionary} from "./payload";
|
import {Payload, PayloadBody, PassDictionary} from "./payload";
|
||||||
import * as Sentry from '@sentry/react';
|
import {QrCode,PassPhotoCommon} from './passphoto-common';
|
||||||
import { QRCodeMatrixUtil } from '@zxing/library';
|
|
||||||
import {QrCode,Encoding,PackageResult,QrFormat,PassPhotoCommon} from './passphoto-common';
|
|
||||||
|
|
||||||
const crypto = require('crypto')
|
const crypto = require('crypto')
|
||||||
|
|
||||||
@ -139,7 +136,6 @@ export class PassData {
|
|||||||
this.barcodes = [qrCode];
|
this.barcodes = [qrCode];
|
||||||
this.barcode = qrCode;
|
this.barcode = qrCode;
|
||||||
this.generic = payload.generic;
|
this.generic = payload.generic;
|
||||||
this.sharingProhibited = true;
|
|
||||||
this.expirationDate = payload.expirationDate;
|
this.expirationDate = payload.expirationDate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,6 @@
|
|||||||
import {toBuffer as createZip} from 'do-not-zip';
|
|
||||||
import {v4 as uuid4} from 'uuid';
|
import {v4 as uuid4} from 'uuid';
|
||||||
|
|
||||||
import {Constants} from "./constants";
|
import {Payload, PayloadBody} from "./payload";
|
||||||
import {Payload, PayloadBody, PassDictionary} from "./payload";
|
|
||||||
import * as Sentry from '@sentry/react';
|
|
||||||
import { QRCodeMatrixUtil } from '@zxing/library';
|
|
||||||
|
|
||||||
export enum QrFormat {
|
export enum QrFormat {
|
||||||
PKBarcodeFormatQR = 'PKBarcodeFormatQR',
|
PKBarcodeFormatQR = 'PKBarcodeFormatQR',
|
||||||
@ -39,7 +35,7 @@ export class PassPhotoCommon {
|
|||||||
const payload: Payload = new Payload(payloadBody, numDose);
|
const payload: Payload = new Payload(payloadBody, numDose);
|
||||||
|
|
||||||
payload.serialNumber = uuid4();
|
payload.serialNumber = uuid4();
|
||||||
let qrCodeMessage;
|
let qrCodeMessage = '';
|
||||||
|
|
||||||
if (payloadBody.rawData.startsWith('shc:/')) {
|
if (payloadBody.rawData.startsWith('shc:/')) {
|
||||||
|
|
||||||
@ -89,8 +85,7 @@ export class PassPhotoCommon {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const encodedUri = `serialNumber=${encodeURIComponent(payload.serialNumber)}&vaccineName=${encodeURIComponent(payloadBody.receipts[numDose].vaccineName)}&vaccinationDate=${encodeURIComponent(payloadBody.receipts[numDose].vaccinationDate)}&organization=${encodeURIComponent(payloadBody.receipts[numDose].organization)}&dose=${encodeURIComponent(payloadBody.receipts[numDose].numDoses)}`;
|
const encodedUri = `serialNumber=${encodeURIComponent(payload.serialNumber)}&vaccineName=${encodeURIComponent(payloadBody.receipts[numDose].vaccineName)}&vaccinationDate=${encodeURIComponent(payloadBody.receipts[numDose].vaccinationDate)}&organization=${encodeURIComponent(payloadBody.receipts[numDose].organization)}&dose=${encodeURIComponent(payloadBody.receipts[numDose].numDoses)}`;
|
||||||
const qrCodeUrl = `${verifierHost}/verify?${encodedUri}`;
|
qrCodeMessage = `${verifierHost}/verify?${encodedUri}`;
|
||||||
qrCodeMessage = qrCodeUrl;
|
|
||||||
// console.log(qrCodeUrl);
|
// console.log(qrCodeUrl);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
import {Constants} from "./constants";
|
import {Constants} from "./constants";
|
||||||
import {COLORS} from "./colors";
|
import {COLORS} from "./colors";
|
||||||
import { TEXT_ALIGN } from "html2canvas/dist/types/css/property-descriptors/text-align";
|
|
||||||
|
|
||||||
export class Receipt {
|
export class Receipt {
|
||||||
constructor(public name: string, public vaccinationDate: string, public vaccineName: string, public dateOfBirth: string, public numDoses: number, public organization: string) {};
|
constructor(public name: string, public vaccinationDate: string, public vaccineName: string, public dateOfBirth: string, public numDoses: number, public organization: string) {};
|
||||||
@ -30,7 +29,6 @@ export interface PassDictionary {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface PayloadBody {
|
export interface PayloadBody {
|
||||||
// color: COLORS;
|
|
||||||
rawData: string;
|
rawData: string;
|
||||||
receipts: HashTable<Receipt>;
|
receipts: HashTable<Receipt>;
|
||||||
}
|
}
|
||||||
@ -58,10 +56,10 @@ export class Payload {
|
|||||||
backFields: []
|
backFields: []
|
||||||
}
|
}
|
||||||
this.backgroundColor = COLORS.YELLOW;
|
this.backgroundColor = COLORS.YELLOW;
|
||||||
this.labelColor = COLORS.WHITE
|
this.labelColor = COLORS.WHITE;
|
||||||
this.foregroundColor = COLORS.WHITE
|
this.foregroundColor = COLORS.WHITE;
|
||||||
this.img1x = Constants.img1xWhite
|
this.img1x = Constants.img1xWhite;
|
||||||
this.img2x = Constants.img2xWhite
|
this.img2x = Constants.img2xWhite;
|
||||||
|
|
||||||
let fullyVaccinated = false;
|
let fullyVaccinated = false;
|
||||||
var keys = Object.keys(body.receipts).reverse();
|
var keys = Object.keys(body.receipts).reverse();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user