Skip to content

feat(service-accounts): Gate service account attachment downloads on a scope - #130757

Open
gricha wants to merge 2 commits into
masterfrom
feat/sa-event-attachment-scope
Open

gricha wants to merge 2 commits into
masterfrom
feat/sa-event-attachment-scope

Conversation

@gricha

@gricha gricha commented Nov 11, 2026

Copy link
Copy Markdown
Member

Adds an event_attachment:read scope. A service account needs it to download event attachments; the org's attachments role no longer decides. Members are unchanged: they still need the attachments role.

Only managers and owners hold the scope, because you can only grant a service account scopes you hold. Both can already change the attachments role (org:write), so they gain nothing from it.

Before this, a service account could download attachments only when the attachments role was the default. Accounts that need attachments now have to be granted the scope.

Follow-up to Shaun's comment on #130533.

…a scope

Add event_attachment:read. A service account has no role, so it needs this
scope to download event attachments instead of depending on the org's
attachments role. Members are unchanged: they still need the attachments role.

Only managers and owners hold the scope, since a scope is grantable to a
service account only by someone who holds it. They can already change the
attachments role, so they gain nothing.
@gricha
gricha requested review from a team as code owners November 11, 2026 07:24
@gricha
gricha requested a review from skaasten November 11, 2026 07:24
@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Nov 11, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 46d7618. Configure here.

@gricha
gricha requested a review from arslnb November 13, 2026 07:16
…:read

The endpoint's ProjectPermission needs project:read before the attachment
scope is checked, so the service account tests were denied by the base
check. Grant project:read so they exercise the event_attachment:read gate,
and type the helper's response as HttpResponse so mypy sees .content.

Claude-Session: https://claude.ai/code/session_01XgqSAzy2Dt6DYCbvqLnKum

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Backend Automatically applied to PRs that change backend components

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants