Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: improve RBAC scope allow list handling for create actions#20008

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
ThomasK33 wants to merge1 commit intothomask33/09-26-add_token_scope_support_in_cli
base:thomask33/09-26-add_token_scope_support_in_cli
Choose a base branch
Loading
fromthomask33/09-29-feat_typed_rbac_allow_list

Conversation

ThomasK33
Copy link
Member

Fix API key scope authorization for workspace creation

This PR fixes an issue with API key scopes and workspace creation. Previously, the RBAC policy allowed creation of resources with an empty ID in the allow list, but this approach was inconsistent with how other permissions work.

The changes:

  1. Update the Rego policy to properly handle "create" actions by checking if the resource type is in the allow list
  2. Add tests to verify that workspace creation requires a matching type entry in the allow list
  3. Add tests for scope filtering to ensure proper behavior
  4. Add a test to verify that authorization requires a scope
  5. Add a test to ensure workspace agent scope allow lists contain the correct elements

These changes ensure that API key scopes are properly enforced for creation operations while maintaining backward compatibility.

This was referencedSep 29, 2025
@ThomasK33Graphite App
Copy link
MemberAuthor

ThomasK33 commentedSep 29, 2025
edited
Loading

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stackon Graphite.
Learn more

This stack of pull requests is managed byGraphite. Learn more aboutstacking.

@ThomasK33ThomasK33 linked an issueSep 29, 2025 that may beclosed by this pull request
@ThomasK33ThomasK33force-pushed thethomask33/09-28-add_api_key_audit_metadata branch from5ac8d9c tobd1ff54CompareSeptember 29, 2025 13:25
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch fromf53f9aa to7a79289CompareSeptember 29, 2025 13:25
@ThomasK33ThomasK33 marked this pull request as ready for reviewSeptember 29, 2025 16:12
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch from7a79289 tof38d137CompareSeptember 29, 2025 16:15
@ThomasK33ThomasK33force-pushed thethomask33/09-28-add_api_key_audit_metadata branch frombd1ff54 toeedeed8CompareSeptember 29, 2025 16:15
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch 2 times, most recently from09d60e6 to4bb9040CompareOctober 6, 2025 09:42
@ThomasK33ThomasK33force-pushed thethomask33/09-28-add_api_key_audit_metadata branch 2 times, most recently from4280771 to384a406CompareOctober 6, 2025 10:11
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch 2 times, most recently fromcc44d1c to4c9762eCompareOctober 6, 2025 10:48
@ThomasK33ThomasK33force-pushed thethomask33/09-28-add_api_key_audit_metadata branch 2 times, most recently from154d4a1 tocafac8dCompareOctober 6, 2025 11:24
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch 2 times, most recently fromc9ad043 to610e5e7CompareOctober 6, 2025 11:57
@ThomasK33ThomasK33force-pushed thethomask33/09-28-add_api_key_audit_metadata branch fromcafac8d to393492aCompareOctober 6, 2025 11:57
@EmyrkEmyrk self-assigned thisOct 6, 2025
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch from610e5e7 to14537dbCompareOctober 6, 2025 21:16
@ThomasK33ThomasK33force-pushed thethomask33/09-28-add_api_key_audit_metadata branch from393492a to2c9a4c1CompareOctober 6, 2025 21:16
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch from14537db tofd7df7cCompareOctober 6, 2025 21:40
@ThomasK33ThomasK33force-pushed thethomask33/09-28-add_api_key_audit_metadata branch 2 times, most recently from7915a16 toe153689CompareOctober 7, 2025 16:38
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch fromfd7df7c to80f543aCompareOctober 7, 2025 16:38
@ThomasK33ThomasK33force-pushed thethomask33/09-28-add_api_key_audit_metadata branch frome153689 to48d0e45CompareOctober 9, 2025 12:56
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch from80f543a toc18adc2CompareOctober 9, 2025 12:56
@ThomasK33ThomasK33force-pushed thethomask33/09-28-add_api_key_audit_metadata branch from48d0e45 to0f2c153CompareOctober 9, 2025 13:06
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch fromc18adc2 todda7c9aCompareOctober 9, 2025 13:06
The allow_list for RBAC scopes has been updated to use typed elementsof the form `{type: string, id: string}` instead of raw string IDs.This change enables more granular authorization policies. Specifically, itmodifies the behavior for "create" actions. A create operation is nowpermitted if the scope's allow_list contains an entry matching theresource type, even without a specific ID. This is useful for scenarioslike workspace agent tokens which need to create resources but cannotknow the ID ahead of time.For all other actions (e.g., read, update, delete), the allow_listmust still contain an entry that matches both the type and the specificID of the resource.The Rego policy, relevant Go code, and tests have been updated toimplement and verify this new typed allow_list behavior.
@ThomasK33ThomasK33 changed the base branch fromthomask33/09-28-add_api_key_audit_metadata tographite-base/20008October 9, 2025 15:31
@ThomasK33ThomasK33 changed the base branch fromgraphite-base/20008 tothomask33/09-26-add_token_scope_support_in_cliOctober 9, 2025 15:32
@ThomasK33ThomasK33force-pushed thethomask33/09-29-feat_typed_rbac_allow_list branch fromdda7c9a to31abb13CompareOctober 9, 2025 15:38
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@EmyrkEmyrkEmyrk requested changes

@johnstcnjohnstcnAwaiting requested review from johnstcn

@aslilacaslilacAwaiting requested review from aslilac

@ParkreinerParkreinerAwaiting requested review from Parkreiner

Assignees

@ThomasK33ThomasK33

@EmyrkEmyrk

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

OPA/Policy: ensure scope and allow-list checks

2 participants

@ThomasK33@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp