From 26f607a52028c4a0c4cf422d48842ab156f0392f Mon Sep 17 00:00:00 2001 From: ushkarev Date: Mon, 6 Nov 2023 17:22:29 +0000 Subject: [PATCH 1/2] Add newly-included Manage Users api to health checks --- integration_tests/e2e/health.cy.ts | 1 + integration_tests/mockApis/manageUsersApi.ts | 12 ++++++++++++ server/services/healthCheck.ts | 1 + 3 files changed, 14 insertions(+) diff --git a/integration_tests/e2e/health.cy.ts b/integration_tests/e2e/health.cy.ts index 932305bd..9c1e0ac9 100644 --- a/integration_tests/e2e/health.cy.ts +++ b/integration_tests/e2e/health.cy.ts @@ -3,6 +3,7 @@ context('Healthcheck', () => { beforeEach(() => { cy.task('reset') cy.task('stubAuthPing') + cy.task('stubManageUsersPing') cy.task('stubTokenVerificationPing') }) diff --git a/integration_tests/mockApis/manageUsersApi.ts b/integration_tests/mockApis/manageUsersApi.ts index f715d281..5120a004 100644 --- a/integration_tests/mockApis/manageUsersApi.ts +++ b/integration_tests/mockApis/manageUsersApi.ts @@ -37,7 +37,19 @@ const stubUserRoles = () => }, }) +const ping = () => + stubFor({ + request: { + method: 'GET', + urlPattern: '/manage-users-api/health/ping', + }, + response: { + status: 200, + }, + }) + export default { stubManageUser: (name = 'john smith'): Promise<[Response, Response]> => Promise.all([stubUser(name), stubUserRoles()]), + stubManageUsersPing: ping, } diff --git a/server/services/healthCheck.ts b/server/services/healthCheck.ts index e937d8a5..3be78365 100644 --- a/server/services/healthCheck.ts +++ b/server/services/healthCheck.ts @@ -51,6 +51,7 @@ function gatherCheckInfo(aggregateStatus: Record, currentStatus const apiChecks = [ service('hmppsAuth', `${config.apis.hmppsAuth.url}/health/ping`, config.apis.hmppsAuth.agent), + service('manageUsersApi', `${config.apis.manageUsersApi.url}/health/ping`, config.apis.manageUsersApi.agent), ...(config.apis.tokenVerification.enabled ? [ service( From 84144a538190de71a2ac1de62d34cced4f1b8f22 Mon Sep 17 00:00:00 2001 From: Igor Date: Mon, 6 Nov 2023 17:45:47 +0000 Subject: [PATCH 2/2] Update change log --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cef050d..715de9b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ --- +**November 6th 2023** – Add HMPPS Manage Users API to health checks + +PR: [#255](https://github.com/ministryofjustice/hmpps-template-typescript/pull/255) + +--- + **October 27th 2023** – Update to 4.0.0 of `jwt-decode` module This had breaking changes and required an update to the import statement