-
Notifications
You must be signed in to change notification settings - Fork 88
/
policies.go
161 lines (120 loc) · 4.47 KB
/
policies.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
package policy
/*
A Policy includes both an Action and a Resource.
An Action must be one of "read" or "write".
The Resource must use dot separators.
Permissions defined by Roles will define rules for both Action and Resource and may use glob
pattern matching.
*/
var (
ActionRead = "read"
ActionWrite = "write"
)
// Redactor
var (
RedactorRead = Must(NewPolicy(ActionRead, "redactor."))
RedactorWrite = Must(NewPolicy(ActionWrite, "redactor."))
)
// Registry
var (
RegistryRead = Must(NewPolicy(ActionRead, "registry."))
)
// Snapshots
var (
BackupRead = Must(NewPolicy(ActionRead, "backup."))
BackupWrite = Must(NewPolicy(ActionWrite, "backup."))
RestoreRead = Must(NewPolicy(ActionRead, "restore."))
RestoreWrite = Must(NewPolicy(ActionWrite, "restore."))
SnapshotsettingsRead = Must(NewPolicy(ActionRead, "snapshotsettings."))
SnapshotsettingsWrite = Must(NewPolicy(ActionWrite, "snapshotsettings."))
)
// Cluster
var (
ClusterRead = Must(NewPolicy(ActionRead, "cluster."))
ClusterWrite = Must(NewPolicy(ActionWrite, "cluster."))
)
// GitOps
var (
GitOpsRead = Must(NewPolicy(ActionRead, "gitops."))
GitOpsWrite = Must(NewPolicy(ActionWrite, "gitops."))
)
// Prometheus
var (
PrometheussettingsWrite = Must(NewPolicy(ActionWrite, "prometheussettings."))
)
// Password change
var (
PasswordChange = Must(NewPolicy(ActionWrite, "passwordupdate."))
)
// Kotsadm Identity Service
var (
IdentityServiceWrite = Must(NewPolicy(ActionWrite, "identityservice."))
IdentityServiceRead = Must(NewPolicy(ActionRead, "identityservice."))
)
// App Identity Service
var (
AppIdentityServiceWrite = Must(NewPolicy(ActionWrite, "app.{{.appSlug}}.identityservice."))
AppIdentityServiceRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.identityservice."))
)
// App
var (
AppList = Must(NewPolicy(ActionRead, "app."))
AppRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}"))
AppCreate = Must(NewPolicy(ActionWrite, "app."))
AppUpdate = Must(NewPolicy(ActionWrite, "app.{{.appSlug}}", appSlugFromAppIDGetter))
)
// App status
var (
AppStatusRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.status."))
)
// App supportbundle
var (
AppSupportbundleRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.supportbundle.", appSlugFromSupportbundleGetter))
AppSupportbundleWrite = Must(NewPolicy(ActionWrite, "app.{{.appSlug}}.supportbundle.", appSlugFromAppIDGetter))
)
// App snapshots
var (
AppBackupRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.backup."))
AppBackupWrite = Must(NewPolicy(ActionWrite, "app.{{.appSlug}}.backup."))
AppRestoreRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.restore."))
AppRestoreWrite = Must(NewPolicy(ActionWrite, "app.{{.appSlug}}.restore."))
AppSnapshotsettingsRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.snapshotsettings."))
AppSnapshotsettingsWrite = Must(NewPolicy(ActionWrite, "app.{{.appSlug}}.snapshotsettings."))
)
// App registry
var (
AppRegistryRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.registry."))
AppRegistryWrite = Must(NewPolicy(ActionWrite, "app.{{.appSlug}}.registry."))
)
// App license
var (
AppLicenseRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.license."))
AppLicenseWrite = Must(NewPolicy(ActionWrite, "app.{{.appSlug}}.license."))
)
// App gitops
var (
AppGitopsRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.gitops.", appSlugFromAppIDGetter))
AppGitopsWrite = Must(NewPolicy(ActionWrite, "app.{{.appSlug}}.gitops.", appSlugFromAppIDGetter))
)
// App downstream
var (
AppDownstreamRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.downstream."))
AppDownstreamWrite = Must(NewPolicy(ActionWrite, "app.{{.appSlug}}.downstream."))
AppDownstreamLogsRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.downstream.logs."))
AppDownstreamFiletreeRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.downstream.filetree."))
)
// App downstream preflight
var (
AppDownstreamPreflightRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.downstream.preflight."))
AppDownstreamPreflightWrite = Must(NewPolicy(ActionWrite, "app.{{.appSlug}}.downstream.preflight."))
)
// App downstream config
var (
AppDownstreamConfigRead = Must(NewPolicy(ActionRead, "app.{{.appSlug}}.downstream.config."))
AppDownstreamConfigWrite = Must(NewPolicy(ActionWrite, "app.{{.appSlug}}.downstream.config."))
)
// Helm
var (
IsHelmManaged = Must(NewPolicy(ActionRead, ""))
GetAppValuesFile = Must(NewPolicy(ActionRead, ""))
)