Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Stub Relying party that integrates with Verify using the passport-verify library

License

Notifications You must be signed in to change notification settings

alphagov/passport-verify-stub-relying-party

Repository files navigation

Passport-verify-stub-relying-party

GOV.UK Verify has closed

This repository is out of date and has been archived

==================================

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:

For more information about connecting to Verify, refer to:

Build status

Build Status

Pre-requisites

To use Passport-verify-stub-relying-party, you must have:

  • Node.js
  • Docker
  • Java11 JRE

You must also configure and deploy:

Installation

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.

Start the application with defaults:

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

Testing

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.

For development of passport-verify node module

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/