Repository navigation
Index and delete actions, and remove the admin API #32
Copy link
Copy link
Closed
Labels
ready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agent
Description
Parent
What to build
An admin can index, reindex and delete one crate's indexes (covering the crates under it), and index, reindex or delete all of them, from the crate tree. The admin pages become the only way into admin: the bearer-token admin API is removed.
- Each action is a POST form that redirects back with a one-time flash message (post/redirect/get), so reloading doesn't repeat it.
- Delete actions ask for confirmation with
confirm()inadmin.js; without script they still work. - Today's rules stay: indexing an indexed crate needs reindex (force), and indexing during a delete is refused with the reason shown. Also refused, with the reason: indexing while a covered crate is queued or indexing, deleting while a covered crate is queued or indexing, and an unknown crate.
- Each action, accepted or refused, is logged with the admin's
sub. - Remove
/api/admin,TOKEN_ADMINand@fastify/bearer-auth(feat!). The admin route tests are rewritten to go through the admin pages, signed in as an admin.
Acceptance criteria
- Indexing one crate, reindexing an indexed crate, indexing all, deleting one crate and deleting all each work, checked by their effect on the indexes
- Each action redirects back with a flash message saying what was asked and whether it was accepted
- A refused action shows the reason
- Reloading after an action doesn't repeat it
- Delete actions ask for confirmation
- A POST with a missing or foreign
Originchanges nothing -
/api/adminis gone, andTOKEN_ADMINis no longer accepted or required -
TOKEN_ADMINremoved from the README and.env.example - Reindexing all works
- Deleting a crate also deletes the crates under it
- Each action is logged with the admin's
sub
Blocked by
Set as a native dependency.
Original request
Parent
What to build
An admin can index, reindex and delete one crate's indexes, and index or delete all of them, from the crate tree. The admin pages become the only way into admin: the bearer-token admin API is removed.
- Each action is a POST form that redirects back with a one-time flash message (post/redirect/get), so reloading doesn't repeat it.
- Delete actions ask for confirmation with
confirm()inadmin.js; without script they still work. - Today's rules stay: indexing an indexed crate needs reindex (force), and indexing during a delete is refused with the reason shown.
- Remove
/api/admin,TOKEN_ADMINand@fastify/bearer-auth(feat!). The admin route tests are rewritten to go through the admin pages, signed in as an admin.
Acceptance criteria
- Indexing one crate, reindexing an indexed crate, indexing all, deleting one crate and deleting all each work, checked by their effect on the indexes
- Each action redirects back with a flash message saying what was asked and whether it was accepted
- A refused action shows the reason
- Reloading after an action doesn't repeat it
- Delete actions ask for confirmation
- A POST with a missing or foreign
Originchanges nothing -
/api/adminis gone, andTOKEN_ADMINis no longer accepted or required -
TOKEN_ADMINremoved from the README and.env.example
Blocked by
Set as a native dependency.
Metadata
Metadata
Assignees
Labels
ready-for-agentFully specified, ready for an AFK agentFully specified, ready for an AFK agent
Activity
johnf commentedon Oct 28, 2026
Updated to match PR #33; the previous text is kept under Original request. Changes from review: Reindex all is added. Delete on a crate now covers the crates under it, the same as Index. Indexing is refused while another run covers the same crates, and deleting is refused while indexing is in progress. An unknown crate is refused. Every action is logged with the admin's
sub. Follow-up: #35.johnf commentedon Oct 28, 2026
Shipped in PR #33 (merge e2db8c2). All acceptance criteria met.