- Notifications
You must be signed in to change notification settings - Fork1k
Commita9ec515
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 parente0432eb commita9ec515
File tree
4 files changed
+520
-0
lines changed- coderd/rbac
- scripts/typegen
4 files changed
+520
-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 | + | |
845 | 852 |
| |
846 | 853 |
| |
847 | 854 |
| |
|
0 commit comments
Comments
(0)