Skip to content

govuk-one-login/ipv-cri-bav-front

Repository files navigation

Digital Identity Bank Account Verification

di-ipv-cri-bav-front

Frontend for the identify proving and verification bank account verification CRI

This is the home for the front end user interface for a credential issuer as a part of the Identity Proofing and Verification (IPV) system within the GDS digital identity platform. Other repositories are used for core services or other credential issuers.

Installation

Clone this repository and then run

yarn install

Environment Variables

All the required Environment Variables are inside the .env.sample file. Copy the contents on this file to a .env file in the same location, using the API locations specific for the envrionment you wish to test against.

CUSTOM_FE_URL only needs to be populated if you would like to test against a custom deployed FE stack or if you wish to run browser-test against your local stack in which case set the value to be http:/localhost:5040

Run front-end locally against deployed back-end

  • Setup .env file as mentioned above
  • Run yarn build followed by yarn start
  • Make a POST call to the IPV_STUB_URL with the following body payload
{
"frontendURL": "http://localhost:5040"
}
  • Start the journey from the but navigating to the AuthorizeLocation in the Stub response

Browser tests

Browser based tests can be run against a deployed API stack using the CIC-IPV Stub. To run the tests make sure you have urls pointing to the relevant envrionment filled out in your .env file and run npm run test:browser

Adding CUSTOM_FE_URL=http:/localhost:5040 will run browser tets against your local changes

These tests are written using Cucumber as the test runner and Playwright as the automation tool. They also follow the Page Object Model for separation of concerns.

Code Owners

This repo has a CODEOWNERS file in the root and is configured to require PRs to reviewed by Code Owners.

Create and upload a custom image to ECR

Execute the following commands to create a custom image locally and push it up to ECR. You need to have AWS credentials in your shell via aws-vault or gds-cli or similar. YOUR_REPO needs to refer to an existing repo in ECR, you can create one in console if you don't have one already.

aws ecr get-login-password --region eu-west-2 | docker login --username AWS --password-stdin 060113405249.dkr.ecr.eu-west-2.amazonaws.com
docker build --platform linux/amd64 -t di-ipv-cri-cic-front .
docker tag di-ipv-cri-cic-front:latest 060113405249.dkr.ecr.eu-west-2.amazonaws.com/dev-images-ddunford
docker push 060113405249.dkr.ecr.eu-west-2.amazonaws.com/dev-images-ddunford

Then to use this new image update the Image: tag in the template.yaml and redeploy your template locally in to your own stack in DEV.

Pre-Commit Checking / Verification

Completely optional, there is a .pre-commit-config.yaml configuration setup in this repo, this uses pre-commit to verify your commit before actually commiting, it runs the following checks:

  • Check Json files for formatting issues
  • Fixes end of file issues (it will auto correct if it spots an issue - you will need to run the git commit again after it has fixed the issue)
  • It automatically removes trailing whitespaces (again will need to run commit again after it detects and fixes the issue)
  • Detects aws credentials or private keys accidentally added to the repo
  • runs cloud formation linter and detects issues
  • runs checkov and checks for any issues.

Dependency Installation

To use this locally you will first need to install the dependencies, this can be done in 2 ways:

Method 1 - Python pip

Run the following in a terminal:

sudo -H pip3 install checkov pre-commit cfn-lint

this should work across platforms

Method 2 - Brew

If you have brew installed please run the following:

brew install pre-commit ;\
brew install cfn-lint ;\
brew install checkov

Post Installation Configuration

once installed run:

pre-commit install

To update the various versions of the pre-commit plugins, this can be done by running:

pre-commit autoupdate && pre-commit install

This will install / configure the pre-commit git hooks, if it detects an issue while committing it will produce an output like the following:

 git commit -a
check json...........................................(no files to check)Skipped
fix end of files.........................................................Passed
trim trailing whitespace.................................................Passed
detect aws credentials...................................................Passed
detect private key.......................................................Passed
AWS CloudFormation Linter................................................Failed
- hook id: cfn-python-lint
- exit code: 4
W3011 Both UpdateReplacePolicy and DeletionPolicy are needed to protect Resources/PublicHostedZone from deletion
core/deploy/dns-zones/template.yaml:20:3
Checkov..............................................(no files to check)Skipped
- hook id: checkov

About

Frontend for the identify proving and verification bank account verification CRI

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published