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

feat: generate RBAC scope name constants#19896

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

Merged

Conversation

ThomasK33
Copy link
Member

Generate RBAC scope name constants

This PR adds a new generated filecoderd/rbac/scopes_constants_gen.go that contains typed constants for all RBAC scope names in the formatScope<Resource><Action>. For example,ScopeWorkspaceRead for the scope "workspace:read".

These constants make it easier to reference specific scopes in code without using string literals, improving type safety and making refactoring easier.

The PR:

  • Adds a new template filescripts/typegen/scopenames.gotmpl
  • Updates the typegen script to support generating scope name constants
  • Updates the Makefile to include the new generated file in build targets

@ThomasK33Graphite App
Copy link
MemberAuthor

ThomasK33 commentedSep 19, 2025
edited
Loading

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

@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch fromefb80b5 to0dadef5CompareSeptember 19, 2025 18:48
@ThomasK33ThomasK33force-pushed thethomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes branch from1d5d9f1 toce47b02CompareSeptember 19, 2025 18:50
@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch 2 times, most recently from0149b55 to6de9975CompareSeptember 22, 2025 13:47
@ThomasK33ThomasK33force-pushed thethomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes branch fromce47b02 to37f92feCompareSeptember 22, 2025 13:47
@ThomasK33ThomasK33 marked this pull request as ready for reviewSeptember 22, 2025 13:50
@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch from6de9975 to99afbd9CompareSeptember 22, 2025 15:28
@ThomasK33ThomasK33force-pushed thethomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes branch 2 times, most recently from9c60b1f to2666417CompareSeptember 22, 2025 16:33
@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch 2 times, most recently from6a22bcc to2dc79e0CompareSeptember 22, 2025 17:03
@ThomasK33ThomasK33force-pushed thethomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes branch 3 times, most recently from3a1adbe to9d2bcc2CompareSeptember 22, 2025 17:27
@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch from2dc79e0 to92537e5CompareSeptember 22, 2025 17:27
@ThomasK33ThomasK33force-pushed thethomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes branch from9d2bcc2 toec7f46aCompareSeptember 22, 2025 17:42
@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch 2 times, most recently from4810c5e to6d04e1cCompareSeptember 23, 2025 08:53
@ThomasK33ThomasK33force-pushed thethomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes branch fromec7f46a to0fb96ebCompareSeptember 23, 2025 08:53
@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch from6d04e1c to49feb2dCompareSeptember 23, 2025 20:53
@ThomasK33ThomasK33force-pushed thethomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes branch from0fb96eb to0d6db42CompareSeptember 23, 2025 20:54
@ThomasK33ThomasK33force-pushed thethomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes branch from0d6db42 toe0432ebCompareSeptember 24, 2025 08:36
@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch from49feb2d toa9ec515CompareSeptember 24, 2025 08:36
@ThomasK33ThomasK33force-pushed thethomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes branch frome0432eb tob4b6ef1CompareSeptember 24, 2025 08:58
@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch froma9ec515 to316bcd9CompareSeptember 24, 2025 08:58
@ThomasK33ThomasK33force-pushed thethomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes branch fromb4b6ef1 tocfd4f7fCompareSeptember 24, 2025 12:51
@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch from316bcd9 to2dd3612CompareSeptember 24, 2025 12:51
@ThomasK33ThomasK33 changed the base branch fromthomask33/19846-build-time-check-db-enum-contains-all-rbac-scopes tographite-base/19896September 24, 2025 16:06
@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch from2dd3612 toeddb2a7CompareSeptember 24, 2025 16:06
@graphite-appgraphite-appbot changed the base branch fromgraphite-base/19896 tomainSeptember 24, 2025 16:07
@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch 2 times, most recently fromab8574e tocffaa05CompareSeptember 24, 2025 16:09
Add build-time generation of typed Go constants for all RBAC scopenames to improve type safety and prevent typos when referencingscopes in code.- Add scopenames.gotmpl template for generating ScopeName constants- Extend scripts/typegen/main.go to support "scopenames" template- Generate coderd/rbac/scopes_constants_gen.go with all typed constants- Update Makefile to include generated file in build targets- Constants follow pattern Scope<Resource><Action> = "resource:action"
@ThomasK33ThomasK33force-pushed thethomask33/09-19-feat_add_scope_constants_generation branch fromcffaa05 to84de60eCompareSeptember 24, 2025 16:27
@ThomasK33ThomasK33 merged commitadb7521 intomainSep 24, 2025
32 checks passed
@ThomasK33ThomasK33 deleted the thomask33/09-19-feat_add_scope_constants_generation branchSeptember 24, 2025 16:40
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsSep 24, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@EmyrkEmyrkEmyrk approved these changes

Assignees

@ThomasK33ThomasK33

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@ThomasK33@Emyrk

[8]ページ先頭

©2009-2025 Movatter.jp