- Notifications
You must be signed in to change notification settings - Fork1k
Commit99afbd9
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 parent9c60b1f commit99afbd9
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 | |
---|---|---|---|
| |||
645 | 645 |
| |
646 | 646 |
| |
647 | 647 |
| |
| 648 | + | |
648 | 649 |
| |
649 | 650 |
| |
650 | 651 |
| |
| |||
693 | 694 |
| |
694 | 695 |
| |
695 | 696 |
| |
| 697 | + | |
696 | 698 |
| |
697 | 699 |
| |
698 | 700 |
| |
| |||
832 | 834 |
| |
833 | 835 |
| |
834 | 836 |
| |
| 837 | + | |
| 838 | + | |
| 839 | + | |
| 840 | + | |
| 841 | + | |
835 | 842 |
| |
836 | 843 |
| |
837 | 844 |
| |
|
0 commit comments
Comments
(0)