CCM-12649 Get Status healthcheck endpoint#206
Conversation
346deab to
0be7bd3
Compare
0be7bd3 to
77c3202
Compare
There was a problem hiding this comment.
A couple points:
Response payload
I raised this this ticket originally thinking we'd only need to return 200 OK if pass and 400/500 if not, but looks like we need to do this like described in https://nhsd-confluence.digital.nhs.uk/spaces/APM/pages/158433407/_status+endpoint (payload links to the healthcheck RFC)?
I'm not aware if we can simplify it though... Any thoughts @masl2 ?
If we do need to return a payload like described in there it might prove tricky with the current error mapping logic involving mapToErrorResponse.
Proxygen
I wonder if we need to do something additional with proxygen too? Is it already supporting this? @nhsd-david-wass
OAS / Sandbox
Currently the _status endpoint inly has a 200 OK. We might want to build up on that depending on the answers above?
infrastructure/terraform/components/api/module_lambda_get_status.tf
Outdated
Show resolved
Hide resolved
infrastructure/terraform/components/api/resources/spec.tmpl.json
Outdated
Show resolved
Hide resolved
Am I right in thinking |
masl2
left a comment
There was a problem hiding this comment.
So by the information in https://nhsd-confluence.digital.nhs.uk/spaces/APM/pages/158433407/_status+endpoint
The status response should always return 200 if the check is triggered and contain a response with a status content (looks like we're currently returning empty)
Also - the setup for running the health checks will use a manually created product to routinely poll the healthcheck (using apikey auth) in order to report the proxy status; so we can't attach the standard auth pattern for suppliers to the healthcheck
infrastructure/terraform/components/api/resources/spec.tmpl.json
Outdated
Show resolved
Hide resolved
infrastructure/terraform/components/api/resources/spec.tmpl.json
Outdated
Show resolved
Hide resolved
lambdas/api-handler/src/handlers/__tests__/get-letter-data.test.ts
Outdated
Show resolved
Hide resolved
According to @nhsd-david-wass, the status JSON described there will be created for us for free by a default proxy policy - all we have to do is return 200 |
Ah OK, I wasn't sure on that point. I can remove that. Can we get away with no authorisation at all in that case? |
5801f43 to
9bc9ad3
Compare
infrastructure/terraform/components/api/resources/spec.tmpl.json
Outdated
Show resolved
Hide resolved
004ec01 to
db23668
Compare
ca695d2 to
7257ae0
Compare
* CCM-12649 Get status healthcheck endpoint * Address review comments * Fix following merge with main * Avoid leaking system details in 500 error message * Tidy up @internal paths * Update .gitleaksignore added gitleaks ignore * Fix logging in error mapper * Address review comments * Terraform fix * Allow for no headers * Change response shape --------- Co-authored-by: Tim Ireland <tim.ireland@hscic.gov.uk> Co-authored-by: Mark Slowey <113013138+masl2@users.noreply.github.com> Co-authored-by: Francisco Videira <francisco.videira@nhs.net> Signed-off-by: Mark Slowey <mark.slowey1@nhs.net>
Description
Context
Healthcheck endpoint
Type of changes
Checklist
Sensitive Information Declaration
To ensure the utmost confidentiality and protect your and others privacy, we kindly ask you to NOT including PII (Personal Identifiable Information) / PID (Personal Identifiable Data) or any other sensitive data in this PR (Pull Request) and the codebase changes. We will remove any PR that do contain any sensitive information. We really appreciate your cooperation in this matter.