Skip to content

Commit 44fe486

Browse files
committed
linting
1 parent 3dde682 commit 44fe486

File tree

2 files changed

+157
-160
lines changed

2 files changed

+157
-160
lines changed

scripts/rbacgen/typescript.tstmpl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
// Code generated by rbacgen/main.go. DO NOT EDIT.
22

3-
import { RBACAction, RBACResource } from "./typesGenerated";
3+
import type { RBACAction, RBACResource } from "./typesGenerated";
44

55
// RBACResourceActions maps RBAC resources to their possible actions.
66
// Descriptions are included to document the purpose of each action.
77
// Source is in 'coderd/rbac/policy/policy.go'.
8-
export const RBACResourceActions: Record<
9-
RBACResource,
10-
Partial<Record<RBACAction, string>>
8+
export const RBACResourceActions: Partial<
9+
Record<RBACResource, Partial<Record<RBACAction, string>>>
1110
> = {
12-
{{- range $element := . }}
13-
"{{ $element.Type }}": {
14-
{{- range $actionValue, $actionDescription := $element.Actions }}
15-
"{{ $actionValue }}": "{{ $actionDescription }}",
16-
{{- end }}
17-
},
18-
{{- end }}
11+
{{- range $element := . }}
12+
{{- if eq $element.Type "*" }}{{ continue }}{{ end }}
13+
{{ $element.Type }}: {
14+
{{- range $actionValue, $actionDescription := $element.Actions }}
15+
{{ $actionValue }}: "{{ $actionDescription }}",
16+
{{- end }}
17+
},
18+
{{- end }}
1919
};

site/src/api/rbacresources_gen.ts

Lines changed: 146 additions & 149 deletions
Original file line numberDiff line numberDiff line change
@@ -1,157 +1,154 @@
11
// Code generated by rbacgen/main.go. DO NOT EDIT.
22

3-
import { RBACAction, RBACResource } from "./typesGenerated";
3+
import type { RBACAction, RBACResource } from "./typesGenerated";
44

55
// RBACResourceActions maps RBAC resources to their possible actions.
66
// Descriptions are included to document the purpose of each action.
77
// Source is in 'coderd/rbac/policy/policy.go'.
8-
export const RBACResourceActions: Record<
9-
RBACResource,
10-
Partial<Record<RBACAction, string>>
8+
export const RBACResourceActions: Partial<
9+
Record<RBACResource, Partial<Record<RBACAction, string>>>
1110
> = {
12-
"*": {
13-
},
14-
"api_key": {
15-
"create": "create an api key",
16-
"delete": "delete an api key",
17-
"read": "read api key details (secrets are not stored)",
18-
"update": "update an api key, eg expires",
19-
},
20-
"assign_org_role": {
21-
"assign": "ability to assign org scoped roles",
22-
"create": "ability to create/delete/edit custom roles within an organization",
23-
"delete": "ability to delete org scoped roles",
24-
"read": "view what roles are assignable",
25-
},
26-
"assign_role": {
27-
"assign": "ability to assign roles",
28-
"create": "ability to create/delete/edit custom roles",
29-
"delete": "ability to unassign roles",
30-
"read": "view what roles are assignable",
31-
},
32-
"audit_log": {
33-
"create": "create new audit log entries",
34-
"read": "read audit logs",
35-
},
36-
"debug_info": {
37-
"read": "access to debug routes",
38-
},
39-
"deployment_config": {
40-
"read": "read deployment config",
41-
"update": "updating health information",
42-
},
43-
"deployment_stats": {
44-
"read": "read deployment stats",
45-
},
46-
"file": {
47-
"create": "create a file",
48-
"read": "read files",
49-
},
50-
"group": {
51-
"create": "create a group",
52-
"delete": "delete a group",
53-
"read": "read groups",
54-
"update": "update a group",
55-
},
56-
"license": {
57-
"create": "create a license",
58-
"delete": "delete license",
59-
"read": "read licenses",
60-
},
61-
"oauth2_app": {
62-
"create": "make an OAuth2 app.",
63-
"delete": "delete an OAuth2 app",
64-
"read": "read OAuth2 apps",
65-
"update": "update the properties of the OAuth2 app.",
66-
},
67-
"oauth2_app_code_token": {
68-
"create": "",
69-
"delete": "",
70-
"read": "",
71-
},
72-
"oauth2_app_secret": {
73-
"create": "",
74-
"delete": "",
75-
"read": "",
76-
"update": "",
77-
},
78-
"organization": {
79-
"create": "create an organization",
80-
"delete": "delete an organization",
81-
"read": "read organizations",
82-
"update": "update an organization",
83-
},
84-
"organization_member": {
85-
"create": "create an organization member",
86-
"delete": "delete member",
87-
"read": "read member",
88-
"update": "update an organization member",
89-
},
90-
"provisioner_daemon": {
91-
"create": "create a provisioner daemon",
92-
"delete": "delete a provisioner daemon",
93-
"read": "read provisioner daemon",
94-
"update": "update a provisioner daemon",
95-
},
96-
"provisioner_keys": {
97-
"create": "create a provisioner key",
98-
"delete": "delete a provisioner key",
99-
"read": "read provisioner keys",
100-
},
101-
"replicas": {
102-
"read": "read replicas",
103-
},
104-
"system": {
105-
"create": "create system resources",
106-
"delete": "delete system resources",
107-
"read": "view system resources",
108-
"update": "update system resources",
109-
},
110-
"tailnet_coordinator": {
111-
"create": "",
112-
"delete": "",
113-
"read": "",
114-
"update": "",
115-
},
116-
"template": {
117-
"create": "create a template",
118-
"delete": "delete a template",
119-
"read": "read template",
120-
"update": "update a template",
121-
"view_insights": "view insights",
122-
},
123-
"user": {
124-
"create": "create a new user",
125-
"delete": "delete an existing user",
126-
"read": "read user data",
127-
"read_personal": "read personal user data like user settings and auth links",
128-
"update": "update an existing user",
129-
"update_personal": "update personal data",
130-
},
131-
"workspace": {
132-
"application_connect": "connect to workspace apps via browser",
133-
"create": "create a new workspace",
134-
"delete": "delete workspace",
135-
"read": "read workspace data to view on the UI",
136-
"ssh": "ssh into a given workspace",
137-
"start": "allows starting a workspace",
138-
"stop": "allows stopping a workspace",
139-
"update": "edit workspace settings (scheduling, permissions, parameters)",
140-
},
141-
"workspace_dormant": {
142-
"application_connect": "connect to workspace apps via browser",
143-
"create": "create a new workspace",
144-
"delete": "delete workspace",
145-
"read": "read workspace data to view on the UI",
146-
"ssh": "ssh into a given workspace",
147-
"start": "allows starting a workspace",
148-
"stop": "allows stopping a workspace",
149-
"update": "edit workspace settings (scheduling, permissions, parameters)",
150-
},
151-
"workspace_proxy": {
152-
"create": "create a workspace proxy",
153-
"delete": "delete a workspace proxy",
154-
"read": "read and use a workspace proxy",
155-
"update": "update a workspace proxy",
156-
},
11+
api_key: {
12+
create: "create an api key",
13+
delete: "delete an api key",
14+
read: "read api key details (secrets are not stored)",
15+
update: "update an api key, eg expires",
16+
},
17+
assign_org_role: {
18+
assign: "ability to assign org scoped roles",
19+
create: "ability to create/delete/edit custom roles within an organization",
20+
delete: "ability to delete org scoped roles",
21+
read: "view what roles are assignable",
22+
},
23+
assign_role: {
24+
assign: "ability to assign roles",
25+
create: "ability to create/delete/edit custom roles",
26+
delete: "ability to unassign roles",
27+
read: "view what roles are assignable",
28+
},
29+
audit_log: {
30+
create: "create new audit log entries",
31+
read: "read audit logs",
32+
},
33+
debug_info: {
34+
read: "access to debug routes",
35+
},
36+
deployment_config: {
37+
read: "read deployment config",
38+
update: "updating health information",
39+
},
40+
deployment_stats: {
41+
read: "read deployment stats",
42+
},
43+
file: {
44+
create: "create a file",
45+
read: "read files",
46+
},
47+
group: {
48+
create: "create a group",
49+
delete: "delete a group",
50+
read: "read groups",
51+
update: "update a group",
52+
},
53+
license: {
54+
create: "create a license",
55+
delete: "delete license",
56+
read: "read licenses",
57+
},
58+
oauth2_app: {
59+
create: "make an OAuth2 app.",
60+
delete: "delete an OAuth2 app",
61+
read: "read OAuth2 apps",
62+
update: "update the properties of the OAuth2 app.",
63+
},
64+
oauth2_app_code_token: {
65+
create: "",
66+
delete: "",
67+
read: "",
68+
},
69+
oauth2_app_secret: {
70+
create: "",
71+
delete: "",
72+
read: "",
73+
update: "",
74+
},
75+
organization: {
76+
create: "create an organization",
77+
delete: "delete an organization",
78+
read: "read organizations",
79+
update: "update an organization",
80+
},
81+
organization_member: {
82+
create: "create an organization member",
83+
delete: "delete member",
84+
read: "read member",
85+
update: "update an organization member",
86+
},
87+
provisioner_daemon: {
88+
create: "create a provisioner daemon",
89+
delete: "delete a provisioner daemon",
90+
read: "read provisioner daemon",
91+
update: "update a provisioner daemon",
92+
},
93+
provisioner_keys: {
94+
create: "create a provisioner key",
95+
delete: "delete a provisioner key",
96+
read: "read provisioner keys",
97+
},
98+
replicas: {
99+
read: "read replicas",
100+
},
101+
system: {
102+
create: "create system resources",
103+
delete: "delete system resources",
104+
read: "view system resources",
105+
update: "update system resources",
106+
},
107+
tailnet_coordinator: {
108+
create: "",
109+
delete: "",
110+
read: "",
111+
update: "",
112+
},
113+
template: {
114+
create: "create a template",
115+
delete: "delete a template",
116+
read: "read template",
117+
update: "update a template",
118+
view_insights: "view insights",
119+
},
120+
user: {
121+
create: "create a new user",
122+
delete: "delete an existing user",
123+
read: "read user data",
124+
read_personal: "read personal user data like user settings and auth links",
125+
update: "update an existing user",
126+
update_personal: "update personal data",
127+
},
128+
workspace: {
129+
application_connect: "connect to workspace apps via browser",
130+
create: "create a new workspace",
131+
delete: "delete workspace",
132+
read: "read workspace data to view on the UI",
133+
ssh: "ssh into a given workspace",
134+
start: "allows starting a workspace",
135+
stop: "allows stopping a workspace",
136+
update: "edit workspace settings (scheduling, permissions, parameters)",
137+
},
138+
workspace_dormant: {
139+
application_connect: "connect to workspace apps via browser",
140+
create: "create a new workspace",
141+
delete: "delete workspace",
142+
read: "read workspace data to view on the UI",
143+
ssh: "ssh into a given workspace",
144+
start: "allows starting a workspace",
145+
stop: "allows stopping a workspace",
146+
update: "edit workspace settings (scheduling, permissions, parameters)",
147+
},
148+
workspace_proxy: {
149+
create: "create a workspace proxy",
150+
delete: "delete a workspace proxy",
151+
read: "read and use a workspace proxy",
152+
update: "update a workspace proxy",
153+
},
157154
};

0 commit comments

Comments
 (0)