sx-gitea Phase 2: access — acl-backed permissions, collaborators, teams, auth-gated routes (TDD, 194/194)
lib/gitea/access.sx: repo role groups (admin>write>read) as acl facts saturated by the datalog engine; user-owner => admin; collaborators (per-repo role, upsert); org teams (one role, 'all' or scoped repo list); org-admin?; visible-repos; create-allowed?; bearer tokens in kv. Facts derived from forge state, acl db cached in the forge handle and rebuilt only when facts change. lib/gitea/web.sx: every repo route now requires read (404 hides private repos); repo create needs owner/org-admin, delete + collaborator API need admin (401 no credentials / 403 not allowed); index + /api/repos list only visible repos; PUT/DELETE collab endpoints. tests/access.sx (103) + repo suite updated for gating (91). Fixed a web.sx corruption from the known sx_find_all/sx_replace_node path mismatch by rewriting via sx_write_file; suite timeout 300->600s. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
{
|
||||
"suites": {
|
||||
"repo": {"pass": 91, "fail": 0}
|
||||
"repo": {"pass": 91, "fail": 0},
|
||||
"access": {"pass": 103, "fail": 0}
|
||||
},
|
||||
"total_pass": 91,
|
||||
"total_pass": 194,
|
||||
"total_fail": 0,
|
||||
"total": 91
|
||||
"total": 194
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user