- Notifications
You must be signed in to change notification settings - Fork1k
Commit84de60e
committed
feat: generate typed ScopeName constants from RBAC permissions
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"1 parent5ff503b commit84de60e
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)