-
-
Notifications
You must be signed in to change notification settings - Fork 305
Expand file tree
/
Copy pathflipt.schema.cue
More file actions
412 lines (378 loc) · 9.03 KB
/
Copy pathflipt.schema.cue
File metadata and controls
412 lines (378 loc) · 9.03 KB
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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
package flipt
import "strings"
import "list"
JsonPath: string
#FliptSpec: {
// flipt-schema-v2
//
// Flipt config file is a YAML file defining how to configure the
// Flipt application.
@jsonschema(schema="http://json-schema.org/draft/2019-09/schema#")
version: "2.0" | *"2.0"
experimental?: #experimental
analytics?: #analytics
authentication?: #authentication
authorization?: #authorization
cors?: #cors
diagnostics?: #diagnostics
evaluation?: #evaluation
environments?: #environments
storage?: #storage
templates?: #templates
credentials?: #credentials
log?: #log
meta?: #meta
server?: #server
metrics?: #metrics
tracing?: #tracing
ui?: #ui
license?: #license
secrets?: #secrets
#authentication: {
required?: bool | *false
exclude?: {
management: bool | *false
metadata: bool | *false
evaluation: bool | *false
ofrep: bool | *false
}
session?: {
domain?: string
secure?: bool
token_lifetime: =~#duration | *"24h"
state_lifetime: =~#duration | *"10m"
csrf?: {
key: string
secure: bool
trusted_origins?: [...] | string | *[]
}
storage?: {
type: *"memory" | "redis"
cleanup?: {
grace_period?: =~#duration | int | *"30m"
}
redis?: {
host?: string | *"localhost"
port?: int | *6379
require_tls?: bool | *false
db?: int | *0
username?: string
password?: string
pool_size?: int | *0
min_idle_conn?: int | *0
conn_max_idle_time?: =~#duration | int | *0
net_timeout?: =~#duration | int | *0
ca_cert_path?: string
ca_cert_bytes?: string
insecure_skip_tls?: bool | *false
mode?: *"single" | "cluster"
prefix?: string | *"flipt"
}
}
}
methods?: {
token?: {
enabled?: bool | *false
storage?: {
type: string | *"static"
tokens: [string]: {
credential: string
metadata: [string]: string
}
}
}
oidc?: {
enabled?: bool | *false
providers?: {
{[=~"^.*$" & !~"^()$"]: #authentication.#authentication_oidc_provider}
}
email_matches?: [...] | string
cache_ttl?: =~#duration | *"15m"
}
kubernetes?: {
enabled?: bool | *false
discovery_url: string
ca_path: string
service_account_token_path: string
}
github?: {
enabled?: bool | *false
server_url?: string
api_url?: string
client_secret?: string
client_id?: string
redirect_address?: string
scopes?: [...string]
allowed_organizations?: [...] | string
allowed_teams?: [string]: [...string]
use_pkce?: bool
}
jwt?: {
enabled?: bool | *false
validate_claims?: {
issuer?: string
subject?: string
audiences?: [...string]
}
claims_mapping?: {
email?: JsonPath
name?: JsonPath
sub?: JsonPath
picture?: JsonPath
role?: JsonPath
}
jwks_url?: string
public_key_file?: string
}
}
#authentication_oidc_provider: {
@jsonschema(id="authentication_oidc_provider")
issuer_url?: string
discovery_url?: string
client_id?: string
client_secret?: string
redirect_address?: string
nonce?: string
scopes?: [...string]
use_pkce?: bool
use_end_session_endpoint?: bool
algorithms?: [...("RS256" | "RS384" | "RS512" | "ES256" | "ES384" | "ES512" | "PS256" | "PS384" | "PS512")] | *["RS256"]
fetch_extra_user_info?: bool
allow_front_channel_logout?: bool
authorize_parameters?: [string]: string
claims_mapping?: [string]: string
}
}
#authorization: {
required?: bool | *false
backend: "local" | "bundle" | *""
local?: {
policy?: {
poll_interval: =~#duration | *"5m"
path: string
}
data?: {
poll_interval: =~#duration | *"5m"
path: string
}
}
bundle?: {
configuration: string
}
}
#cors: {
enabled?: bool | *false
allowed_origins?: [...] | string | *["*"]
allowed_headers?: [...string] | string | *[
"Accept",
"Authorization",
"Content-Type",
"X-CSRF-Token",
"X-Flipt-Accept-Server-Version",
"X-Flipt-Environment",
"X-Flipt-Namespace",
"If-None-Match",
]
}
#diagnostics: {
profiling?: {
enabled?: bool | *false
}
}
#scm: {
type: *"github" | "gitea" | "gitlab" | "azure" | "bitbucket"
credentials: string
api_url?: string
}
#evaluation: {
include_flag_metadata?: bool | *false
}
#environments: [string]: {
name: string
default: bool | *false
storage: string
directory: string | *""
scm?: #scm
}
#storage: [string]: {
remote?: string
fetch_policy?: *"strict" | "lenient"
backend?: {
type: *"memory" | "local"
path?: string
}
branch?: string | *"main"
poll_interval?: =~#duration | *"30s"
ca_cert_path?: string
ca_cert_bytes?: string
insecure_skip_tls?: bool | *false
credentials?: string
signature?: {
name?: string
email?: string
enabled?: bool | *false
type?: string | *"gpg"
key_ref?: {
provider: string
path: string
key: string
}
key_id?: string
}
}
// Server-wide custom templates for commit messages and pull requests.
// These override built-in defaults but can be overridden by repository-level templates.
#templates: {
commit_message?: string
proposal_title?: string
proposal_body?: string
}
#credentials: [string]: {
type: "basic"
basic: {
username: string
password: string
}
} | {
type: "ssh"
ssh: {
user?: string
password: string
private_key_bytes: string
insecure_ignore_host_key?: bool
} | {
user?: string
password: string
private_key_path: string
insecure_ignore_host_key?: bool
}
} | {
type: "access_token"
access_token: string
} | {
type: "github_app"
github_app: {
client_id: string
installation_id: int | string
private_key_path: string
api_url?: string
} | {
client_id: string
installation_id: int | string
private_key_bytes: string
api_url?: string
}
}
_#lower: ["debug", "error", "fatal", "info", "panic", "warn"]
_#all: list.Concat([_#lower, [for x in _#lower {strings.ToUpper(x)}]])
#log: {
file?: string
encoding?: *"console" | "json"
level?: #log.#log_level
grpc_level?: #log.#log_level
keys?: {
time?: string | *"T"
level?: string | *"L"
message?: string | *"M"
}
#log_level: or(_#all)
}
#meta: {
check_for_updates?: bool | *true
telemetry_enabled?: bool | *true
state_directory?: string | *"$HOME/.config/flipt"
}
#server: {
protocol?: *"http" | "https"
host?: string | *"0.0.0.0"
https_port?: int | *443
http_port?: int | *8080
grpc_port?: int | *9000
cert_file?: string
cert_key?: string
grpc_conn_max_idle_time?: =~#duration
grpc_conn_max_age?: =~#duration
grpc_conn_max_age_grace?: =~#duration
}
#metrics: {
enabled?: bool | *true
exporter?: *"prometheus" | "otlp"
}
#tracing: {
enabled?: bool | *false
}
#ui: {
enabled?: bool | *true
default_theme?: "light" | "dark" | *"system"
topbar?: {
color?: string
label?: string
}
}
#license: {
key?: string
file?: string
machine_id?: string
}
#secrets: {
providers?: {
file?: {
enabled?: bool | *false
base_path?: string | *"/etc/flipt/secrets"
} | null
vault?: {
enabled?: bool | *false
address?: string
auth_method?: string | *"token"
role?: string
mount?: string | *"secret"
token?: string
namespace?: string
} | null
gcp?: {
enabled?: bool | *false
project?: string
location?: string
credentials?: string
} | null
aws?: {
enabled?: bool | *false
endpoint_url?: string
} | null
azure?: {
enabled?: bool | *false
vault_url?: string
} | null
}
}
#analytics: {
storage?: {
clickhouse?: {
enabled?: bool | *false
url?: string | *""
}
prometheus?: {
enabled?: bool | *false
url?: string | *""
headers?: [string]: string
sigv4?: {
enabled?: bool | *false
region?: string
access_key?: string
secret_key?: string
profile?: string
role_arn?: string
external_id?: string
use_fips_sts_endpoint?: bool | *false
service_name?: string
}
}
}
buffer?: {
capacity?: int
flush_period?: string | *"2m"
}
}
#experimental: {}
#duration: "^([0-9]+(ns|us|µs|ms|s|m|h))+$"
}