org base permission is none, not read#178
Conversation
Connector PR Review: org base permission is none, not readBlocking Issues: 0 | Suggestions: 0 | Threads Resolved: 0 Review SummaryScanned the full PR diff for security and correctness. This change fixes a false-positive grant bug: when the org GET endpoint omits default_repository_permission (common without org-owner / admin:org visibility), getOrgBasePermission now returns "none" instead of defaulting to "read", so orgBasePermissionToRepoPermissions returns nil and no org-member to repo pull expansion is emitted. Fail-closed behavior is correct, the Warn log is appropriate for a customer-visibility condition (per L1), imports for zap and ctxzap are already present, and the new table-driven test covers none, empty, read, write, and admin. Org-admin to repo expansion is unchanged. No new issues found. Security IssuesNone found. Correctness IssuesNone found. SuggestionsNone. |
Fixes CXH-2100
This will drop 10s of millions of grants from some syncs.
Summary
direct-collaborators-only: whenGET /orgs/{org}omitsdefault_repository_permission(common without org-owner /admin:org/ Organization Administration visibility), stop inventing"read"and treat it as"none"instead.GrantExpandable, even when GitHub effective permission is"none".Context
Reported on DoorDash (
github_v2): C1 showed repo pull inherited from org membership for ~all members (~7.6k), whileGET /repos/.../collaborators/{user}/permissionreturned"none". Root cause is the empty→"read"default ingetOrgBasePermission.