Skip to content

fix(workflows): Advertise missing scope for all-project updates - #123917

Open
gricha wants to merge 5 commits into
masterfrom
fix/workflow-insufficient-scope
Open

fix(workflows): Advertise missing scope for all-project updates#123917
gricha wants to merge 5 commits into
masterfrom
fix/workflow-insufficient-scope

Conversation

@gricha

@gricha gricha commented Sep 9, 2026

Copy link
Copy Markdown
Member

Agent-authenticated all-project workflow mutations that lack org:write now return an RFC 6750 insufficient_scope challenge only when that scope is grantable to the delegating member. This lets Seer request approval and retry without advertising a scope that would still fail the same role check.

The explicit scope enforcement runs only when a mutation actually targets a workflow connected to the all-project detector. Ordinary bulk mutations continue to work with alerts:write even when the organization also has an all-project workflow. Feature-flag, GET, session-auth, and ordinary permission-denial behavior remain unchanged.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Sep 9, 2026
@gricha
gricha force-pushed the fix/workflow-insufficient-scope branch 3 times, most recently from b14afbb to 377549b Compare September 9, 2026 16:41
Comment thread src/sentry/workflow_engine/endpoints/validators/utils.py
@gricha
gricha force-pushed the fix/workflow-insufficient-scope branch from 377549b to 16320db Compare September 9, 2026 17:19
Simulate the member/token scope intersection before returning an insufficient-scope challenge, so reminting with the advertised scope is guaranteed to satisfy the same check.
@gricha
gricha force-pushed the fix/workflow-insufficient-scope branch from 006f5cf to c194a8d Compare September 9, 2026 22:55
@gricha
gricha marked this pull request as ready for review September 9, 2026 23:01
@gricha
gricha requested review from a team as code owners September 9, 2026 23:01

@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.

Stale Bugbot comment from a previous run.

Comment thread src/sentry/workflow_engine/endpoints/organization_workflow_index.py Outdated

@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 63a0070. Configure here.

Comment thread src/sentry/workflow_engine/endpoints/organization_workflow_index.py
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.

1 participant