UKHomeOffice / lev

Life Event Verification service prototype monorepo
https://lev-docs.netlify.app/
0 stars 1 forks source link

Readiness check for lev-ui #13

Open daniel-ac-martin opened 3 years ago

daniel-ac-martin commented 3 years ago

We should have a /readiness endpoint for the UI application.

This should probably check the following:

Ideally this would probably be supported by NotGovUK. i.e. A specific config to the readiness handler?

That said, we should be able to support it right now with the API support.

RobinKnipe commented 3 years ago

I think only the API connectivity should be checked. I think the job of checking for auth app support should be handled by something else. e.g. if the UI forms part of a k8s deployment, there should be another container in the pod which has the responsibility to ensure requests are properly auth'd before passing them on to the UI container.

daniel-ac-martin commented 3 years ago

The new system uses passport.js to handle the OIDC flow, so that it doesn't need another container (like louketo-proxy) sat in front of it.

daniel-ac-martin commented 3 years ago

Although, now I think of it, there is an option to run it behind something like louketo-proxy.

You can pick up user information from headers like we do in lev-api and lev-web: https://github.com/daniel-ac-martin/NotGovUK/blob/master/apps/govuk-template/src/server/config.ts#L11

That config parameter can be set to AuthMethod.Headers.