- Notifications
You must be signed in to change notification settings - Fork1k
Commitadb7521
authored
feat: generate RBAC scope name constants (#19896)
# Generate RBAC scope name constantsThis PR adds a new generated file `coderd/rbac/scopes_constants_gen.go` that contains typed constants for all RBAC scope names in the format `Scope<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 file `scripts/typegen/scopenames.gotmpl`- Updates the typegen script to support generating scope name constants- Updates the Makefile to include the new generated file in build targets1 parent5ff503b commitadb7521
File tree
5 files changed
+545
-0
lines changed- coderd/rbac
- scripts/typegen
5 files changed
+545
-0
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
646 | 646 |
| |
647 | 647 |
| |
648 | 648 |
| |
| 649 | + | |
649 | 650 |
| |
650 | 651 |
| |
651 | 652 |
| |
| |||
695 | 696 |
| |
696 | 697 |
| |
697 | 698 |
| |
| 699 | + | |
698 | 700 |
| |
699 | 701 |
| |
700 | 702 |
| |
| |||
842 | 844 |
| |
843 | 845 |
| |
844 | 846 |
| |
| 847 | + | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
845 | 856 |
| |
846 | 857 |
| |
847 | 858 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2 | 2 |
| |
3 | 3 |
| |
4 | 4 |
| |
| 5 | + | |
5 | 6 |
| |
6 | 7 |
| |
7 | 8 |
| |
| |||
107 | 108 |
| |
108 | 109 |
| |
109 | 110 |
| |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
110 | 123 |
| |
111 | 124 |
| |
112 | 125 |
| |
|
0 commit comments
Comments
(0)