Skip to content

feat: improve RBAC resource ID matching and structured allowlist targets#20035

Closed
ThomasK33 wants to merge 1 commit into
thomask33/09-29-feat_typed_rbac_allow_listfrom
thomask33/09-30-api_allowlist_structured_json
Closed

feat: improve RBAC resource ID matching and structured allowlist targets#20035
ThomasK33 wants to merge 1 commit into
thomask33/09-29-feat_typed_rbac_allow_listfrom
thomask33/09-30-api_allowlist_structured_json

Conversation

@ThomasK33
Copy link
Copy Markdown
Member

Structured JSON Representation for Allow List Targets

This PR changes the JSON representation of APIAllowListTarget from a string format ("type:id") to a structured object format ({"type": "...", "id": "..."}). The change maintains backward compatibility by preserving the string format for text marshaling/unmarshaling, which is used by CLI flag parsing and database helpers.

Key changes:

  • Updated APIAllowListTarget to use JSON struct tags
  • Implemented separate JSON and Text marshaling/unmarshaling logic
  • Added JSON marshaling/unmarshaling to the wildcard.Value type
  • Fixed SQL variable matchers for workspace and template IDs
  • Added test cases for both string and object formats

This change improves the API's consistency and makes it easier to work with allow list targets in the frontend.

Copy link
Copy Markdown
Member Author

ThomasK33 commented Sep 30, 2025

@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_legacy_apikey_backcompat branch from 90528a2 to a3e10c2 Compare September 30, 2025 14:02
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch 4 times, most recently from fcd6e93 to e2effa4 Compare October 2, 2025 07:35
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_legacy_apikey_backcompat branch from 5058a5a to a482459 Compare October 2, 2025 07:35
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from e2effa4 to 1db9559 Compare October 2, 2025 17:37
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_legacy_apikey_backcompat branch 2 times, most recently from 5e55406 to ecdebc1 Compare October 3, 2025 17:59
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from 1db9559 to 1fe2126 Compare October 3, 2025 17:59
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_legacy_apikey_backcompat branch from ecdebc1 to b07d6f5 Compare October 6, 2025 09:42
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from 1fe2126 to 79f06c2 Compare October 6, 2025 09:42
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_legacy_apikey_backcompat branch from b07d6f5 to 31570ef Compare October 6, 2025 10:12
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from 79f06c2 to 421cee2 Compare October 6, 2025 10:13
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_legacy_apikey_backcompat branch from 31570ef to ab61e4e Compare October 6, 2025 10:48
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch 2 times, most recently from 9b8d5d8 to d0f3a09 Compare October 6, 2025 11:24
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_legacy_apikey_backcompat branch from ab61e4e to 009ef1c Compare October 6, 2025 11:24
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from d0f3a09 to a6ad02f Compare October 6, 2025 11:57
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch 2 times, most recently from 008fc1a to f516f26 Compare October 7, 2025 16:38
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_legacy_apikey_backcompat branch 2 times, most recently from 2d313ef to d34dbe8 Compare October 9, 2025 12:57
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from f516f26 to 05af7c4 Compare October 9, 2025 12:57
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_legacy_apikey_backcompat branch from d34dbe8 to 47cccd7 Compare October 9, 2025 13:06
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from 05af7c4 to 1833742 Compare October 9, 2025 13:06
@ThomasK33 ThomasK33 changed the base branch from thomask33/09-29-feat_legacy_apikey_backcompat to graphite-base/20035 October 9, 2025 15:32
@ThomasK33 ThomasK33 changed the base branch from graphite-base/20035 to thomask33/09-29-feat_typed_rbac_allow_list October 9, 2025 15:32
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from 1833742 to 90212e3 Compare October 9, 2025 15:38
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_typed_rbac_allow_list branch from 31abb13 to c19eb90 Compare October 14, 2025 13:36
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch 2 times, most recently from ac2e772 to fd23c4d Compare October 14, 2025 13:57
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_typed_rbac_allow_list branch from c19eb90 to 2155bbf Compare October 14, 2025 13:57
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from fd23c4d to a48aa91 Compare October 14, 2025 14:11
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_typed_rbac_allow_list branch from 2155bbf to 33e1eaa Compare October 14, 2025 14:11
@github-actions github-actions Bot added the stale This issue is like stale bread. label Oct 22, 2025
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_typed_rbac_allow_list branch from 33e1eaa to 4bdf346 Compare October 22, 2025 11:17
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from a48aa91 to 6ed027c Compare October 22, 2025 11:17
@github-actions github-actions Bot removed the stale This issue is like stale bread. label Oct 23, 2025
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_typed_rbac_allow_list branch from 4bdf346 to d94abdc Compare October 24, 2025 14:20
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from 6ed027c to 0126ab0 Compare October 24, 2025 14:20
@ThomasK33 ThomasK33 force-pushed the thomask33/09-29-feat_typed_rbac_allow_list branch from d94abdc to bb1e7e8 Compare October 24, 2025 16:45
@ThomasK33 ThomasK33 force-pushed the thomask33/09-30-api_allowlist_structured_json branch from 0126ab0 to 2d12da3 Compare October 24, 2025 16:45
@ThomasK33 ThomasK33 closed this Oct 24, 2025
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 24, 2025
@ThomasK33 ThomasK33 deleted the thomask33/09-30-api_allowlist_structured_json branch October 24, 2025 16:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants