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

The UserService.setUser method should detect M2M tokens #1052

Open
chrisala opened this issue Jan 9, 2025 · 0 comments
Open

The UserService.setUser method should detect M2M tokens #1052

chrisala opened this issue Jan 9, 2025 · 0 comments
Assignees

Comments

@chrisala
Copy link
Collaborator

chrisala commented Jan 9, 2025

When running the functional tests, an issue arose whereby the user was being set to the jwtId (which is the stubbed M2M token user for MERIT->ecodata comms in the test).

This is because the getUserFromJWT is making a call to get the user profile for the presented JWT which presumably returns 404 in the real environment but because of the stubbing was returning a profile in the tests.

However, we don't want to be making this call and having it return 404 for every request from MERIT (or BioCollect) to ecodata.

We should probably either preference the userId header or detect the M2M token via other means and not make this call.

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

No branches or pull requests

2 participants