Admin-credentials help text is wrong: forget does not use admin creds, and blank does not fall back for prune #34
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
The admin-credentials help text on the host repo page says admin creds are used for
prune / forget. Forget never uses them. Following this text while debugging a403 Forbiddenon forget leads to configuring admin creds, seeing no change, andlooking in the wrong place.
Found while diagnosing a real fleet-wide forget failure (rest-server running
--append-only, so everyDELETEreturned 403).Current text —
web/templates/pages/host_repo.html:85-88:Two inaccuracies
1. Forget does not use admin credentials
cmd/agent/main.go:case api.JobForgetruns onr, the everyday runner bound to thenormal repo credentials.
case api.JobPruneis the only kind that builds a separaterunner from
d.secrets.LoadAdmin(), gated onp.RequiresAdminCreds.The code already states this —
cmd/agent/main.go:517-524:Corroborating:
internal/store/host_credentials.go:17— "CredKindAdmin is the delete-capable credential used for prune."CredKindAdminisinternal/server/http/maintenance_dispatch.go:52, insidecase "prune". Every other reference is CRUD on the credential itself.Practical consequence: the append-only/delete-capable split the text describes cannot
work for forget. An operator who sets up exactly what it suggests — append-only everyday
creds, delete-capable admin creds — gets working prune and forget still failing with 403.
Forget requires the everyday credentials to have delete authority.
2. "leave this blank — the everyday repo credentials handle prune too"
There is no fallback. When admin creds are unset,
maintenance_dispatch.go:52-56logsmaintenance: prune skipped — no admin credsandcontinues, on any backend. Prune isskipped entirely rather than run with everyday creds.
This is also silent: no job row, no alert. In our deployment scheduled prune had never once
run across 5 hosts and nothing surfaced it — it only came to light from reading the source.
Suggested wording
Possibly worth a look beyond the docs
Forget needing delete authority on the everyday credentials undercuts the append-only-everyday-user
story the UI is describing. If that split is intended to be supported, forget would need to
mirror the
JobPrunepattern (main.go:622-645) — which is precisely what the comment atmain.go:523-524anticipates. Happy to leave that out of scope; flagging since the doc fixalone leaves the underlying limitation in place.
Separately, the silent skip on missing admin creds might warrant surfacing in the UI or as an
alert, given "prune has silently never run" is hard to notice.
Verified against
main@6c6b962.