Skip to content

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

Repository files navigation

Digital Identity Credential Issuer

di-ipv-cri-fraud-front

Frontend for Fraud Credential Issuer

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

  • BASE_URL: Externally accessible base url of the webserver. Used to generate the callback url as part of credential issuer oauth flows
  • PORT - Default port to run webserver on. (Default to 5030)
  • GOOGLE_ANALYTICS_4_GTM_CONTAINER_ID - Container ID for GA4 tracking.
  • UNIVERSAL_ANALYTICS_GTM_CONTAINER_ID - Container ID for UA tracking.
  • GA4_DISABLED - BOOLEAN
  • UA_DISABLED - BOOLEAN
  • LANGUAGE_TOGGLE_DISABLED - Feature flag to disable Language Toggle, defaulted to true

Testing

Mock Data

Wiremock has been used to create a stateful mock of the API, through the use of scenarios. These configuration files are stored as JSON files in the ./test/mocks/mappings directory.

This can be run by using:

yarn run mock

The frontend can be configured to use this server through changing two environment variables:

  • NODE_ENV = development - this enables a middleware that passes the x-scenario-id header from web requests through to the API.
  • API_BASE_URL = http://localhost:8090 - this points the frontend to the wiremock instance.

A browser extension that can modify headers can be used to set the value of the header in a web browser. Example - Mod Header

Request properties

In order to support consistent use of headers for API requests. middleware is applied to add an instance of axios on each reqest onto req.axios. This is then reused in any code that uses the API.

Code Owners

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