Open source api written in NestJS to decode and verify a NZ Covid Pass payload. This service can be deployed as a microservice and integrated into your existing ecosystem.
An NZCP is constructed using the pattern:
NZCP:/{version}/{base32-encoded-string}
This service also validates if the pass:
- is a Base32 encoded NZCP Version 1
- is encoded as a CBOR
- has the correct protected headers
- is issued by New Zealand Ministry of Health by matching the iss in the payload
- is signed and validated by using the signature of the payload over the CBOR structure using the MOH public key
- hasn't expired
- is active
If all the above checks are valid then the verified boolean is set to true, otherwise it will be classed as false.
The following error messages are returned with status 200 if the verification fails:
- unable to base32 decode
- unable to decode cbor
- unable to extract headers
- pass expired
- pass not yet active
- unable to decode payload
- unable to fetch authority DID
- not a new zealand ministry of health trusted issuer
- absolute key mismatch
- verification method failure
- elliptical signature verification failed
- An unknown error occurred. Please contact the administrator with ref: kwoein4y
For online demo of this application click here
This project uses the following libraries to decode and verify the pass:
- Base32 Decode: Base32 decoder with support for multiple variants.
- CBOR: Encode and parse data in the Concise Binary Object Representation (CBOR) data format
- COSE: JavaScript implementation of COSE, RFC8152
docker
(For serving the app for local development)docker-compose
(v1.22 minimum, for serving the app for local development)make
(For helper commands)
make start
make build
- Run a production build and output the generated files todist
make exec
- Start an interactive command prompt in the local development containermake lint
- Lint the project with ESLintmake logs
- View and follow logs for the local development containermake restart
- Restart the local development container (Useful if Webpack file watchers break)make start
- Start the local development containermake stop
- Stop and remove the local development container
This api can be packaged into a docker image and deployed on any cloud service. To build the image run make build-docker
Open an issue or a pull request to suggest changes or additions.
All commit messages should try to match the regex
/^NZVA-[\d]{1,4} - [A-Z].*[\w)]$/
. In short (see
here for details):
- Titles should try to not exceed 50 characters and should never exceed 72 characters
- Use the message body for further info on how/why you made your change
- Titles should be capitalised
- Titles should not end in a period
- Titles should be in the imperative mood (
Add feature A
notAdded feature A
) - Separate the body from the title with an empty line
- The body should wrap at 72 characters
Bad:
Updated readme to include guidelines on good commit message format.
[NZVA-123] updated readme to include guidelines on good commit message format
NZVA-123 - Added commit message guidelines to README
Good:
NZVA-123 - Add commit message guidelines to README
@cto.af/[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
@nestjs/[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
@nestjs/[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
@nestjs/[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
@nestjs/[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
@nestjs/[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
@nestjs/[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
@nuxtjs/[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
@vendia/[email protected] [license(s): Apache, Apache-2.0]
├── package.json: Apache-2.0
└── license files: Apache
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): Apache, Apache-2.0, BSD, MIT]
├── package.json: Apache-2.0
└── license files: Apache, BSD, MIT
[email protected] [license(s): Apache, Apache-2.0]
├── package.json: Apache-2.0
└── license files: Apache
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): Apache, Apache-2.0]
├── package.json: Apache-2.0
└── license files: Apache
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): Apache, Apache-2.0]
├── package.json: Apache-2.0
└── license files: Apache
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): BSD-2-Clause]
└── package.json: BSD-2-Clause
[email protected] [license(s): BSD-2-Clause]
└── package.json: BSD-2-Clause
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): BSD, BSD-2-Clause]
├── package.json: BSD-2-Clause
└── readme files: BSD
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): ISC, MIT]
├── package.json: ISC
└── license files: ISC, MIT
[email protected] [license(s): ISC]
├── package.json: ISC
└── license files: ISC
[email protected] [license(s): BSD-2-Clause]
└── package.json: BSD-2-Clause
[email protected] [license(s): ISC]
├── package.json: ISC
└── license files: ISC
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): BSD, BSD-3-Clause]
├── package.json: BSD-3-Clause
└── readme files: BSD
[email protected] [license(s): BSD, BSD-3-Clause]
├── package.json: BSD-3-Clause
└── readme files: BSD
[email protected] [license(s): ISC]
├── package.json: ISC
└── license files: ISC
[email protected] [license(s): ISC]
├── package.json: ISC
└── license files: ISC
[email protected] [license(s): ISC]
├── package.json: ISC
└── license files: ISC
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): ISC]
├── package.json: ISC
└── license files: ISC
[email protected] [license(s): Apache 2.0]
└── package.json: Apache 2.0
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): Apache, MIT]
├── package.json: MIT
├── license files: Apache, MIT
└── readme files: Apache
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): ISC]
└── package.json: ISC
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): ISC]
├── package.json: ISC
└── license files: ISC
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): Apache]
└── readme files: Apache
[email protected] [license(s): BSD, MIT]
├── package.json: MIT
└── readme files: BSD
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): BSD, GPL, ISC, MIT, Public Domain, UNLICENSED]
├── package.json: UNLICENSED
└── license files: BSD, GPL, ISC, MIT, Public Domain
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): ISC]
├── package.json: ISC
└── license files: ISC
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): BSD-3-Clause]
└── package.json: BSD-3-Clause
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): Apache, Apache-2.0]
├── package.json: Apache-2.0
└── license files: Apache
[email protected] [license(s): ISC]
├── package.json: ISC
└── license files: ISC
[email protected] [license(s): Apache, Apache-2.0]
├── package.json: Apache-2.0
└── license files: Apache
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): GPL, ISC, MIT]
├── package.json: ISC
└── license files: GPL, ISC, MIT
[email protected] [license(s): ISC, MIT]
├── package.json: ISC
└── license files: ISC, MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): ISC]
└── package.json: ISC
[email protected] [license(s): BSD, BSD-3-Clause]
├── package.json: BSD-3-Clause
└── readme files: BSD
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): Apache, Apache-2.0]
├── package.json: Apache-2.0
└── license files: Apache
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): 0BSD]
└── package.json: 0BSD
[email protected] [license(s): 0BSD]
└── package.json: 0BSD
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── readme files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): Unknown]
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): BSD, BSD-2-Clause]
├── package.json: BSD-2-Clause
└── license files: BSD
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): ISC]
├── package.json: ISC
└── license files: ISC
[email protected] [license(s): MIT]
└── package.json: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
└── license files: MIT
[email protected] [license(s): MIT]
├── package.json: MIT
├── license files: MIT
└── readme files: MIT
LICENSES: 0BSD, Apache, Apache 2.0, Apache-2.0, BSD, BSD-2-Clause, BSD-3-Clause, GPL, ISC, MIT, Public Domain, UNLICENSED, Unknown