Passport-verify-stub-relying-party is a Node.js application built to demonstrate how a government service connecting to GOV.UK Verify can build a Node.js service that uses the Verify Service Provider to communicate with the Verify Hub.
This application uses:
- Express framework
- Passport.js identification middleware
- passport-verify package
For more information about connecting to Verify, refer to:
To use Passport-verify-stub-relying-party, you must have:
- Node.js
- Docker
- Java11 JRE
You must also configure and deploy:
passport-verify-stub-relying-party uses yarn
to manage dependencies. See the yarn documentation for more information.
Install the dependencies with:
yarn install
Note: There is a preinstall script that prevents npm install
from being run. A consequnce of this is that yarn install cannot be chained with any other npm tasks, meaning yarn install
cannot be incorporated into an npm script such as npm build
or npm startup
.
npm run startup
This will invoke the following default values for configuration:
- ENTITY_ID:
null
- VERIFY_SERVICE_PROVIDER_HOST:
http://localhost:50400
- DATABASE_CONNECTION_STRING:
postgesql://localhost:5432/stub_rp_test
(intended for connecting to a local postgres docker container defined by db.Dockerfile
For the unit tests run:
npm run test
To run the full suite of tests, refer to the acceptance test documentation
To run the end-to-end tests using docker, first build a docker image:
docker build . -f ci/puppeteer.Dockerfile -t puppeteer
Then (while connected to the VPN) run something like:
docker run --network=host -v `pwd`:"/passport-verify-stub" -e "E2E_TEST_ENVIRONMENT=https://passport-verify-stub-relying-party-integration.cloudapps.digital" puppeteer /bin/sh -exc "cd passport-verify-stub; yarn install; yarn run e2e-tests:non-matching"
For valid combinations of environment URL and test suite (i.e. matching vs non-matching), see the VSP Concourse pipeline.
If you want to run the service using a locally linked copy of 'passport-verify', be aware that TypeScript has a bug that duplicates dependencies. To get around this, remove the following dependencies.
rm -r node_modules/@types/passport-strategy/
rm -r node_modules/@types/passport/