Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SW-183: move auth to backend and use jwt for protected routes #12

Merged
merged 22 commits into from
Sep 11, 2024

Conversation

wheelsandcogs
Copy link
Collaborator

@wheelsandcogs wheelsandcogs commented Aug 30, 2024

This adds new routes and config to the backend that provide authentication via Google, OneLogin, and JWT tokens.

The Google and OneLogin providers are currently disabled for NODE_ENV=test. We can revisit this later if/when we have some kind of browser testing (playwright?).

I've done a bit of refactoring (sorry about that) to add a bit more (hopefully) logical structure.

src/route/auth.ts Fixed Show fixed Hide fixed
test/healthcheck.test.ts Dismissed Show dismissed Hide dismissed
src/db/database-manager.ts Fixed Show fixed Hide fixed
@wheelsandcogs wheelsandcogs changed the title WIP - SW-183: move auth to backend and use jwt for protected routes SW-183: move auth to backend and use jwt for protected routes Sep 10, 2024
src/dtos/revision.ts Outdated Show resolved Hide resolved

const dataLakeService = new DataLakeService();
export const healthcheck = Router();
const healthcheck = Router();

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do need a complete / healthcheck to pass to Docker and the Container service to tell us when things aren't working. Really this should include checking we have the following:

  • Database connection
  • Datalake connection
  • BlobStorage connection

As these are required for the service to work and if they stop working for any reason its good to be able to look at the health check to see thats the case.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, we should have a healthcheck/ for any connected services that we can use for monitoring.

I had to disable the datalake one temporarily because it is failing in CI when attempting to connect to your-storage-account-name.x.y.z endpoint to fetch creds.

Copy link
Collaborator

@j-maynard j-maynard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me 🚀

@wheelsandcogs wheelsandcogs merged commit f8f0afe into main Sep 11, 2024
3 checks passed
@wheelsandcogs wheelsandcogs deleted the SW-183 branch September 11, 2024 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants