Skip to content

Admin action plan #8049

Open
Tracking Issue
@LawnGnome

Description

@LawnGnome

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:

  1. 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.
  2. 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
  3. 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).
  4. Finally, expand the list of admin actions in the UI to include:
    1. User locking and unlocking
    2. Mass crate yanking and unyanking
    3. Crate and crate version deletion2
    4. your idea here

Feedback encouraged, @rust-lang/crates-io!

Footnotes

  1. 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.

  2. 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.

Metadata

Metadata

Assignees

Labels

A-backend ⚙️A-frontend 🐹C-internal 🔧Category: Nonessential work that would make the codebase more consistent or clearC-tracking-issueCategory: A tracking issue for an RFC, an unstable feature, or an issue made of many parts

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions