fix(api): enforce repository creation token authorization (#39007)

Reject public-only tokens for repository migrations and require
repository scope for canonical organization repository creation. This
aligns both routes with the existing token authorization boundaries.

_Assisted-by: Codex:GPT-5_
This commit is contained in:
bircni
2026-08-21 07:28:23 +00:00
committed by GitHub
parent 920b5f1e68
commit db24633e6d
3 changed files with 58 additions and 3 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ func testOrgCounts(t *testing.T) {
orgOwner := "user2"
orgName := "testOrg"
orgCollaborator := "user4"
ctx := NewAPITestContext(t, orgOwner, "repo1", auth_model.AccessTokenScopeWriteOrganization)
ctx := NewAPITestContext(t, orgOwner, "repo1", auth_model.AccessTokenScopeWriteOrganization, auth_model.AccessTokenScopeWriteRepository)
var ownerCountRepos map[string]int
var collabCountRepos map[string]int