fix(forgejo): correct which endpoint the repository lock actually closes #672
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/document-the-reachable-creation-path"
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?
Correcting the reason, not the fix
PR #670 is deployed and works. But it named the wrong endpoint, and a security control documented with the wrong mechanism is a trap for the next reader.
What #670 said: the contributor token holds
write:repository, and that authorizesPOST /user/repos.What the live server says:
The routine token never had that route. The reachable one is
POST /repos/migrate—routers/api/v1/api.go:777marks it// (repo scope), and its group closes withtokenRequiresScopes(auth_model.AccessTokenScopeCategoryRepository)at line 1083.That also fits how
sean/ex_mcpappeared: a full upstream import carrying 29 tags and upstream branches (cursor/…,claude/…). That is what a migrate produces, not what a bare create produces.The fix was right, and is now proven live
That message is
ErrReachLimitOfRepo, raised atservices/repository/create.go:201— the exact line the guard header cites.migrate.go:180callsCreateRepositoryDirectly(ctx, ctx.Doer(), repoOwner, …), and for a contributordoeris non-admin, so the limit applies.What the limit does not stop
Now stated plainly in the guard header, because it was implied before and should not be:
make forgejo-cred-admincan still create an undeclared repository. That is the break-glass path, and it is exactly whytests/forgejo-repo-reconcile/run-all.shexists. The limit closes the routine path; the reconciler catches anything that arrives by any path.POST /orgsis refused for want ofwrite:organizationbeforeDISABLE_REGULAR_ORG_CREATIONis ever consulted. It stays as defence in depth for any wider token, and is now labelled as such rather than claimed as verified.Documentation only — no behaviour change.
tests/forgejo-repo-creation-locked.shstill passes, and still fails when either setting is removed.https://claude.ai/code/session_01XdBRc9CHgFhAxCyHbdVtt6