Open corneliusroemer opened 5 months ago
The reason why we have it is that I think that we should have multiple layers of protection against a configuration error, especially given the speed in which we make changes, merge PRs and change configs. If we remove the authentication requirement, I think that we should introduce something else to prevent the endpoint being accessible by mistake. For example something additional that prevents us from running the app in debug mode?
For me, it's hard to imagine misuse:
Do you have a concrete scenario where real damage would be done?
Maybe we call it "debug-mode" but "self-destruct-mode"? I guess you're worried about people enabling it without understanding the implications? We could make the argument more explicit, something like enable-everyone-can-delete-everything=True
? If you set that in production it's your own fault :D
We could also make the required arg yes-i-know-what-i-am-doing
instead of true
, so one really needs to know what one is doing:
backendExtraArgs:
- "--loculus.debug-mode.enable-everyone-can-delete-everything=true-yes-i-know-what-i-am-doing"
There's still a red banner (unless there's a bug), and also, one still needs to actually hit the endpoint. Plus one should have backups.
For comparison: PostgreSQL has a setting fsync=off
Never turn off unless your data is entirely disposable. Setting fsync=off is the equivalent of saying “I don't care about my data, I can recreate the database from scratch if I have to.” If synch activity is a performance concern, see synchronous_commit. https://postgresqlco.nf/doc/en/param/fsync/
Hmm, okay, this sounds convincing. As long as we emphasize the danger of the debug mode clearly (in future docs and maybe in variable naming), I am fine with removing the authentication.
The need for authentication makes the
/debug/delete-all-sequence-data
endpoint a pain to use.If you're debugging, it's not necessary to ensure authentication, as it's just you testing. If you want to avoid others deleting your stuff, just don't run in debug mode.
I haven't used the endpoint purely because there's not a simple button/endpoint I can call without requiring jumping through hoops to get the JWT etc.
I suggest we remove authn/authz requirements for debug endpoints.