Summary
Follow-up to #2468. Currently, PAC's Bitbucket Data Center integration requires the service account to be a licensed Bitbucket user (LICENSED_USER global permission) because the vendored go-scm library calls /rest/api/1.0/admin/groups/more-members to resolve group membership. This endpoint requires the LICENSED_USER global permission, which means organizations must consume a Bitbucket license seat for what is essentially a technical/bot account.
Motivation
Cost: A licensed Bitbucket DC user seat costs money. Technical service accounts shouldn't need one.
Current Behavior
IsMember() in go-scm (scm/driver/stash/org.go)
GET /projects/{key}/permissions/users — finds directly assigned users
GET /projects/{key}/permissions/groups — lists groups with project permissions
- For each group:
GET /admin/groups/more-members?context={group} — requires LICENSED_USER
Step 3 fails if the service account is unlicensed. The error surfaces as "No message available" and aborts the entire auth check. The repo-level and OWNERS file fallbacks never execute.
Desired
Bitbucket Data Center 8.5 added the permissions/search endpoint:
- Project level:
GET /projects/{projectKey}/permissions/search?filterText={user}
- Requires:
PROJECT_ADMIN
- Returns: direct and implied permissions (including group-inherited and global)
- Repo level:
GET /projects/{projectKey}/repos/{repoSlug}/permissions/search?filterText={user}
- Requires:
REPO_ADMIN
- Returns: direct and implied permissions (including group-inherited, project-inherited, and global)
These endpoints:
- Do NOT require
LICENSED_USER — they are gated by project/repo-level permissions that the service account already has
- Return effective permissions including group inheritance in a single API call
- Eliminate the need for the
/admin/ endpoint entirely
Minimum Bitbucket DC version
Requires Bitbucket Data Center 8.5+ (released mid-2022). Bitbucket 7.x reached end of support in February 2024.
Related
Summary
Follow-up to #2468. Currently, PAC's Bitbucket Data Center integration requires the service account to be a licensed Bitbucket user (
LICENSED_USERglobal permission) because the vendoredgo-scmlibrary calls/rest/api/1.0/admin/groups/more-membersto resolve group membership. This endpoint requires theLICENSED_USERglobal permission, which means organizations must consume a Bitbucket license seat for what is essentially a technical/bot account.Motivation
Cost: A licensed Bitbucket DC user seat costs money. Technical service accounts shouldn't need one.
Current Behavior
IsMember()ingo-scm(scm/driver/stash/org.go)GET /projects/{key}/permissions/users— finds directly assigned usersGET /projects/{key}/permissions/groups— lists groups with project permissionsGET /admin/groups/more-members?context={group}— requiresLICENSED_USERStep 3 fails if the service account is unlicensed. The error surfaces as
"No message available"and aborts the entire auth check. The repo-level and OWNERS file fallbacks never execute.Desired
Bitbucket Data Center 8.5 added the
permissions/searchendpoint:GET /projects/{projectKey}/permissions/search?filterText={user}PROJECT_ADMINGET /projects/{projectKey}/repos/{repoSlug}/permissions/search?filterText={user}REPO_ADMINThese endpoints:
LICENSED_USER— they are gated by project/repo-level permissions that the service account already has/admin/endpoint entirelyMinimum Bitbucket DC version
Requires Bitbucket Data Center 8.5+ (released mid-2022). Bitbucket 7.x reached end of support in February 2024.
Related