-
Notifications
You must be signed in to change notification settings - Fork 14
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
Centralize demo mode DB clearing logic in ExperimentUserService #1845
Conversation
@danoswaltCL I've added the |
wait... this endpoint shouldn't be on the client controller, that makes no sense, especially now if using an authenticated endpoint middleware that uses a different auth than the client middleware uses. clients don't call this, it's an admin endpoint that should require a google login user credential. Maybe can we copy paste this endpoint over to some other spot like the @VivekFitkariwala @bcb37 @ppratikcr7 any thoughts? this came about from me asking Zack if we really needed this endpoint, it seems like we're flirting with danger |
It didn't feel like a huge change. It's technically a bit safer because the Authorization decorator is requiring the same authorization as the non-client endpoints. It's an odd endpoint so it's not obvious where it belongs. Maybe it should have its own controller? But if we're going to revisit the need for this eventually anyway, I was ok with leaving it in the client controller with Authorization required. It's necessary for the demo app to function without a lot of re-engineering, |
As @bcb37 said this is an odd endpoint and it is present because we don't have a multitenant system. So I don't have a strong opinion. We must be sure that the DEMO flag is false in production :) |
This PR centralizes the logic for clearing the database (
/clearDB
) in demo mode within the ExperimentUserService.Key changes:
ExperimentClientController
toExperimentUserService
clearDB
method inExperimentUserService
to include demo mode check/clearDB
endpoints in all versions ofExperimentClientController
Benefits:
Testing:
clearDB
functionality works as expected in demo modeclearDB
is properly restricted when not in demo mode