Description
Previously, on crates.io gaining support for admin actions without needing to run crates-admin
...
Adding support for admin actions in UI has been identified as a priority for a while. Last year, I opened #6811 (among other PRs) to start fleshing that out as a separate admin console using server side rendering. I didn't particularly like the code, it was warty, and (as it turned out) other things came up that demanded a bit more of my attention like artifact signing and malware detection, so it hasn't progressed since then.
More recently, @Turbo87 merged #7852, which provides minimal support for the concept of crates.io admins, and uses it to allow them to yank and unyank crates.
This is a good first step, and I definitely prefer the idea of incorporating admin functionality more directly into crates.io rather than building a new frontend, but is incomplete — there are other actions that we also need to be able to perform, it's probably a little too easy for us to accidentally perform an action right now1, and the logging is arguably too ephemeral at present.
Here's what I'd like to do:
- Only allow admin actions when an admin explicitly opts in. Practically, this would involve something like GitHub's sudo mode (so you only get privileges for a limited period in one session), and we may want to consider requiring crates.io-specific 2FA as part of flipping that switch on.
- Migrate logging of admin actions into the database, rather than logging them into the normal logging machinery, so that we can retain them indefinitely, and
- Require an admin action to include an explanation for why it's being taken (in most cases, presumably just a link to a Zulip thread or Zendesk ticket).
- Finally, expand the list of admin actions in the UI to include:
- User locking and unlocking
- Mass crate yanking and unyanking
- Crate and crate version deletion2
- your idea here
Feedback encouraged, @rust-lang/crates-io!
Footnotes
-
Of course, yank and unyank actions are trivially reversible, so it's not really that bad in practice when that's all we support. A misclick can be fixed with another click. ↩
-
This will probably require further thought on implementation, since it's not trivially reversible. @walterhpearce suggested putting it on a timer of a few minutes to allow easy cancellation before the action is taken. ↩