Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
6891 lines (6887 loc) · 235 KB
/
Copy pathopenapi.yaml
File metadata and controls
6891 lines (6887 loc) · 235 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
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Generated reference - see docs/api/README.md for how this is produced,
# validated (go test ./internal/server) and served (GET /api/openapi.yaml).
# Do not hand-edit paths/schemas without also updating internal/api/api.go's
# routes or internal/model's structs to match.
openapi: 3.1.0
info:
title: go-proxy-manager admin API
version: 0.1.0
summary: 'REST API for the go-proxy-manager admin panel: config CRUD, settings, backup/restore, DNS
sync, Ingress discovery, and admin auth.'
description: 'Covers the admin API surface only (port 8081 by default), not the public proxy
listeners that serve proxied traffic. Every non-2xx response uses the uniform `{"error": "..."}` shape
(see #/components/schemas/Error), except the plain-text/HTML auth endpoints noted individually below.
Authentication: an admin session cookie (`sessionCookie`) or a scoped API bearer token (`bearerAuth`)
- either satisfies every operation below unless noted. A session''s access is governed by its role
(`user` is read-only: every GET under /api/ plus GET /api/me, and 403 on every write and on
anything under /api/api-tokens - GET /api/config omits `apiTokens` for it; `admin` is unconstrained);
a token''s access is additionally
governed by its granted scopes, shown per-operation as `x-scope` (`admin` satisfies every scope check;
a concrete `<plural>:write` implies `<plural>:read`; `*:read`/`*:write` must be granted literally
- a resource-scoped grant does not satisfy a wildcard requirement). Mutating session requests additionally
require the `X-CSRF-Token` header (double-submit against the value GET /api/me returns); bearer requests
never need it.
HA: on an instance running GPM_HA_ROLE=follower, every write (any POST/PUT/DELETE under /api/) answers
503 rather than being applied; reads are unaffected. See docs/ha.md.'
license:
name: See repository LICENSE
servers:
- url: http://localhost:8081
description: Admin panel (default). Bind to loopback or front with your own ingress - do not
expose to the internet.
tags:
- name: Auth
description: Login/logout and the current principal.
- name: Meta
description: Health, version, capabilities, whole-config reads, logs, this spec.
- name: Settings
description: The singleton application settings object.
- name: Backup & restore
description: Whole-config export/import as a portable archive.
- name: DNS sync
description: Pi-hole / Cloudflare CNAME reconciliation for opted-in hosts.
- name: Ingress discovery
description: Kubernetes Ingress -> managed proxy host reconciliation.
- name: Docker discovery
description: Labelled Docker container -> managed proxy host reconciliation.
- name: API tokens
description: Scoped bearer credentials for automation.
- name: Profiling (opt-in)
description: net/http/pprof, only mounted with GPM_PPROF=1.
- name: Metrics (opt-in)
description: Prometheus text exposition, only mounted with GPM_METRICS=1.
- name: Proxy hosts
- name: Redirect hosts
- name: Stream hosts
- name: Parked hosts
- name: Certificates
- name: Client CAs
- name: DNS providers
- name: Identity providers
- name: Upstream groups
- name: Access lists
- name: Middlewares
- name: Webhooks
description: Outbound lifecycle notification targets (settings.webhooks) - delivery state and test sends.
- name: Notifications
description: Outbound alert targets (settings.notifications, ntfy/Discord/generic) - delivery state
and test sends.
security:
- sessionCookie: []
- bearerAuth: []
components:
securitySchemes:
sessionCookie:
type: apiKey
in: cookie
name: gpm_session
description: 'Admin browser session, issued by /auth/login (OIDC) or /auth/local (bcrypt).
Cookie is HttpOnly and SameSite=Lax. It is named __Host-gpm_session when the cookie is
issued Secure, and gpm_session otherwise; both names are accepted on the way in, so a
session survives the deployment moving between the two. GPM_COOKIE_SECURE=auto (the
default) decides per request: Secure when the request reached gpm over TLS, when a trusted
proxy asserted X-Forwarded-Proto: https, or when settings.externalBaseURL is an https URL.
GPM_COOKIE_SECURE=1 always sets Secure and =0 never does. A session principal has whatever
access its role (admin/user) grants and is unaffected by API-token scopes. Mutating requests
also need the X-CSRF-Token header.'
bearerAuth:
type: http
scheme: bearer
bearerFormat: gpm_<random>
description: A scoped API token (config kind api-tokens), created via PUT /api/api-tokens/{name}.
Every token principal is admin-role by construction; real authorization is per-route scope checking
(see each operation's x-scope). No CSRF header is used or required.
schemas:
Error:
type: object
properties:
error:
type: string
description: Human-readable error message.
required:
- error
description: Uniform error shape returned by every endpoint on a non-2xx response.
Secret:
type: string
description: 'A secret-valued field. On write, must be a ${ENV:NAME} or ${FILE:/path} placeholder
(a literal value is accepted for local dev but never committed as-is - see docs/configuration.md#secrets).
On read: a placeholder returns verbatim, an empty secret returns "", and a literal non-empty value
is always redacted to "***".'
ObjectMeta:
type: object
properties:
name: &id001
type: string
description: Identity and YAML filename. Lowercase alphanumeric plus -_. , must start/end alphanumeric.
displayName: &id002
type: string
description: Optional human label.
labels: &id003
type: object
properties: {}
description: Arbitrary key/value metadata. `gpm.rake.pro/managed-by` is reserved for automated
reconcilers.
additionalProperties:
type: string
tags: &id004
type: array
items:
type: string
description: Free-form grouping/filter labels.
disabled: &id005
type: boolean
description: Keep the object in config but exclude it from the running proxy listeners. Default false.
createdAt: &id006
type: string
description: 'Creation timestamp, resolved by the store. On CREATE (no object with this
kind/name exists yet) a client-supplied createdAt is honoured if present, so an importer
or a migration can restore historical timestamps; omitted, it is set to server time. On
UPDATE the stored value is preserved and any createdAt in the request body is ignored -
the server''s stored value always wins, so a save can never move an existing object''s
creation time.'
format: date-time
updatedAt: &id007
type: string
description: Set by the store on every write. Read-only.
format: date-time
Upstream:
type: object
properties:
scheme:
type: string
description: http or https.
enum:
- http
- https
host:
type: string
port:
type: integer
minimum: 1
maximum: 65535
path:
type: string
description: Base path prefixed to every forwarded request (/api + /v1/x -> /api/v1/x). Absolute,
no dot-segments, no query string. Applied after any location prefix strip and any rewrite
middleware. Empty forwards the path unchanged.
hostHeader:
type: string
description: 'Host header sent upstream: empty keeps the client Host (default), "upstream" sends
the upstream''s own host:port, anything else is sent literally (a hostname, optionally host:port).'
required:
- scheme
- host
- port
HSTS:
type: object
properties:
enabled:
type: boolean
maxAge:
type: integer
description: Seconds.
includeSubdomains:
type: boolean
preload:
type: boolean
ClientCertHeaders:
type: object
properties:
subjectHeader:
type: string
description: Overrides the header carrying the certificate subject (RFC 2253). Empty selects
X-Client-Cert-Subject.
san:
type: boolean
description: Send X-Client-Cert-SAN.
serial:
type: boolean
description: Send X-Client-Cert-Serial (lower-case hex).
fingerprint:
type: boolean
description: Send X-Client-Cert-Fingerprint (SHA-256, lower-case hex).
ClientAuth:
type: object
properties:
caRef:
type: string
description: Name of the ClientCA trust anchor.
mode:
type: string
description: require (reject unverified) or optional (verify if presented). Default require.
enum:
- require
- optional
identityHeaders:
$ref: '#/components/schemas/ClientCertHeaders'
required:
- caRef
TLSSettings:
type: object
properties:
certificateRef:
type: string
description: Name of a Certificate object.
forceSSL:
type: boolean
description: Redirect http to https.
hsts:
$ref: '#/components/schemas/HSTS'
minTLSVersion:
type: string
description: 1.2 (default) or 1.3.
enum:
- ''
- '1.2'
- '1.3'
clientAuth:
$ref: '#/components/schemas/ClientAuth'
description: 'Requires forceSSL: true when clientAuth is set (mTLS must never be servable in the
clear).'
HostTimeouts:
type: object
properties:
connectSeconds:
type: integer
description: 0-3600. 0 uses the shared transport default.
minimum: 0
maximum: 3600
readSeconds:
type: integer
description: 0-3600. Time-to-first-byte only, not a streaming-body cap.
minimum: 0
maximum: 3600
Location:
type: object
properties:
path:
type: string
upstream:
$ref: '#/components/schemas/Upstream'
upstreamGroupRef:
type: string
description: Mutually exclusive with upstream.
stripPrefix:
type: boolean
description: Remove this location's matched prefix before forwarding (/app/foo -> /foo, /app ->
/). Applied inside the whole security chain, which still evaluates the original client path.
Default false.
middlewares:
type: array
items:
type: string
accessLists:
type: array
items:
type: string
auth:
allOf:
- $ref: '#/components/schemas/AuthMiddleware'
description: >-
Inline auth gate for this path, with no Middleware object. Same shape,
validation and handler as a type=auth middleware, stacked on top of
the host's own inline block and evaluated before any auth middleware
this location or its host references.
rateLimit:
allOf:
- $ref: '#/components/schemas/RateLimitMiddleware'
description: >-
Inline rate limit for this path, with no Middleware object. Same
shape, validation and limiter as a type=rate-limit middleware,
stacked on top of the host's own inline block.
required:
- path
DNSSyncPolicy:
type: object
properties:
lanDirect:
type: boolean
description: Publish a local (Pi-hole) CNAME.
publicCname:
type: boolean
description: Publish a public (Cloudflare) CNAME.
ProxyHost:
type: object
properties:
name: *id001
displayName: *id002
labels: *id003
tags: *id004
disabled: *id005
createdAt: *id006
updatedAt: *id007
domains:
type: array
items:
type: string
description: At least one required.
upstream:
$ref: '#/components/schemas/Upstream'
upstreamGroupRef:
type: string
description: Name of an UpstreamGroup. Exactly one of upstream/upstreamGroupRef is set.
robotsNoIndex:
type: boolean
description: 'Emit X-Robots-Tag: noindex, nofollow.'
maintenance:
type: boolean
description: >-
Take this host out of service without removing or disabling it: gpm
answers every request itself with a 503 maintenance response (with a
Retry-After from settings.maintenance) and never dials the upstream.
The host keeps its domains, certificate and DNS records, so clearing
the flag restores service. settings.maintenance.enabled turns
maintenance on fleet-wide regardless of this flag - the global switch
wins over a per-host false. Operator-owned: Kubernetes Ingress
discovery carries this value forward across a reconcile instead of
deriving it, exactly as it does for disabled.
timeouts:
$ref: '#/components/schemas/HostTimeouts'
tls:
$ref: '#/components/schemas/TLSSettings'
dns:
$ref: '#/components/schemas/DNSSyncPolicy'
middlewares:
type: array
items:
type: string
description: Host-wide, applied before any location-scoped ones.
accessLists:
type: array
items:
type: string
auth:
allOf:
- $ref: '#/components/schemas/AuthMiddleware'
description: >-
Gate this host through an identity provider with NO Middleware
object. Identical shape, validation and proxy-listener handler to a
type=auth middleware; Middleware objects remain the reuse path for a
gate shared across a fleet. Not mutually exclusive with middlewares:
the inline block runs at the auth chain position, before any auth
middleware this host references, and every gate must pass.
rateLimit:
allOf:
- $ref: '#/components/schemas/RateLimitMiddleware'
description: >-
Throttle this host with a per-client-IP token bucket with NO
Middleware object. Identical shape, validation and limiter to a
type=rate-limit middleware, applied at the rate-limit chain position
(outermost) before any rate-limit middleware this host references.
locations:
type: array
items:
$ref: '#/components/schemas/Location'
securityHeaders:
type: object
additionalProperties:
$ref: '#/components/schemas/SecurityHeaderValue'
description: >-
Per-host response headers, merged per key over
settings.securityHeaders (the host value - and its scope - wins for a
header it names; omitted headers fall through to the settings
default). Each header carries a scope (all / generated-only /
proxied-only) selecting which responses it lands on; the value is a
bare string (scope all) or a {value, scope} object. Applied
set-if-absent, so a proxied upstream's own header is never clobbered.
Strict-Transport-Security is not settable here (the per-host tls.hsts
setting owns it); hop-by-hop headers, CR/LF in names/values and an
unknown scope are rejected.
stripResponseHeaders:
type: array
items:
type: string
description: >-
Response headers removed from what this host's upstream sends, in
addition to settings.stripResponseHeaders (the effective set is the
UNION of the two - a host can only strip more, never re-expose a
header the fleet strips). Matching is case-insensitive. Invalid
header names, hop-by-hop headers, the response-semantic headers
(Content-Type/-Length/-Encoding, Vary, Location, Sec-WebSocket-*)
and case-insensitive duplicates are rejected.
trustedProxies:
type: array
nullable: true
items:
type: string
description: >-
CIDRs or bare IPs of the L7 proxies whose X-Forwarded-For is believed
when deriving this host's client IP. REPLACES settings.trustedProxies
for this host rather than extending it. Absent (or null) inherits the
fleet-wide list; PRESENT AND EMPTY ([]) trusts nobody for this host
whatever the fleet default is - the connection peer is the client and
X-Forwarded-For is never read. The derived address is
what access lists, geo, rate limits, every allowFrom exemption, the
access log and the upstream X-Forwarded-For/X-Real-IP all compare.
Entries must parse as a CIDR or an IP address; 0.0.0.0/0 and ::/0 are
accepted but warned about at load.
required:
- name
- domains
description: Terminates TLS for one or more domains and reverse-proxies to an upstream.
RedirectHost:
type: object
properties:
name: *id001
displayName: *id002
labels: *id003
tags: *id004
disabled: *id005
createdAt: *id006
updatedAt: *id007
domains:
type: array
items:
type: string
description: At least one required.
targetScheme:
type: string
description: http | https | auto.
enum:
- ''
- http
- https
- auto
targetDomain:
type: string
statusCode:
type: integer
description: 301|302|307|308. Default 301.
enum:
- 0
- 301
- 302
- 307
- 308
preservePath:
type: boolean
tls:
$ref: '#/components/schemas/TLSSettings'
required:
- name
- domains
- targetDomain
description: Issues HTTP redirects for its domains.
StreamHost:
type: object
properties:
name: *id001
displayName: *id002
labels: *id003
tags: *id004
disabled: *id005
createdAt: *id006
updatedAt: *id007
listenPort:
type: integer
minimum: 1
maximum: 65535
protocol:
type: string
description: tcp | udp | both.
enum:
- tcp
- udp
- both
target:
$ref: '#/components/schemas/StreamTarget'
tls:
$ref: '#/components/schemas/StreamTLS'
accessLists:
type: array
description: 'AccessList names gating the connection on the client IP, evaluated
before any backend dial. Only the ip rules and geo apply at L4; a list with
basicAuth users is rejected.'
items:
type: string
required:
- name
- listenPort
- protocol
- target
description: Forwards raw TCP/UDP from a listen port to a backend.
StreamTarget:
type: object
description: 'The backend a stream host forwards to. Mirrors Upstream''s host/port
vocabulary minus the scheme: a raw TCP/UDP stream carries an arbitrary protocol,
so an http/https scheme has no meaning for it.'
properties:
host:
type: string
port:
type: integer
minimum: 1
maximum: 65535
required:
- host
- port
StreamTLS:
type: object
description: 'TLS awareness for a TCP stream host: SNI routing on a shared listen
port, with the handshake either forwarded untouched or terminated at gpm. Requires
protocol tcp.'
properties:
mode:
type: string
description: passthrough (route on SNI, never decrypt) | terminate (handshake
at gpm, plaintext upstream).
enum:
- passthrough
- terminate
sniMatch:
type: array
description: 'Server names this host claims: exact, or a single-label *.suffix
wildcard. Required for every host that shares its listen port.'
items:
type: string
certificateRef:
type: string
description: Certificate to present. Required in terminate mode, forbidden in
passthrough.
required:
- mode
ParkedHost:
type: object
properties:
name: *id001
displayName: *id002
labels: *id003
tags: *id004
disabled: *id005
createdAt: *id006
updatedAt: *id007
domains:
type: array
items:
type: string
description: At least one required.
statusCode:
type: integer
description: Default 404.
tls:
$ref: '#/components/schemas/TLSSettings'
required:
- name
- domains
description: 'Serves a 404 (or custom status) for claimed domains: reserves a name
without serving anything, absorbing unmatched vhosts.'
ACMESpec:
type: object
properties:
email:
type: string
directoryURL:
type: string
description: Default Let's Encrypt production.
keyType:
type: string
description: ecdsa only (default when empty); rsa is not implemented and is rejected.
enum:
- ''
- ecdsa
challenge:
type: string
description: dns-01 is the only supported challenge.
enum:
- ''
- dns-01
dnsProvider:
type: string
description: Name of a DNSProvider object.
required:
- email
- dnsProvider
CustomCertSpec:
type: object
properties:
certFile:
type: string
description: PEM chain, relative to the cert store.
keyFile:
type: string
description: PEM private key, relative to the cert store.
required:
- certFile
- keyFile
Certificate:
type: object
properties:
name: *id001
displayName: *id002
labels: *id003
tags: *id004
disabled: *id005
createdAt: *id006
updatedAt: *id007
type:
type: string
description: custom | acme.
enum:
- custom
- acme
domains:
type: array
items:
type: string
description: At least one required.
acme:
$ref: '#/components/schemas/ACMESpec'
custom:
$ref: '#/components/schemas/CustomCertSpec'
notBefore:
type: string
format: date-time
readOnly: true
description: Leaf certificate's validity start. Absent for an acme certificate with no
completed order yet (state pending).
notAfter:
type: string
format: date-time
readOnly: true
description: Leaf certificate's expiry. Absent for an acme certificate with no completed
order yet (state pending).
daysRemaining:
type: integer
readOnly: true
description: Whole days until notAfter, negative once expired. Absent alongside notAfter.
issuer:
type: string
readOnly: true
description: Leaf certificate's issuer common name. Absent alongside notAfter.
state:
type: string
readOnly: true
enum:
- valid
- expiring
- expired
- pending
- error
description: 'valid: notAfter is more than 30 days out. expiring: at or inside 30 days.
expired: past notAfter. pending: acme certificate, no order has completed yet. error: the
last attempt (ACME order, or reading a custom certificate file) failed - see lastError.'
lastError:
type: string
readOnly: true
description: 'Most recent renewal/read failure. Empty or absent means the last attempt (if
any) succeeded. The text depends on the caller: an **admin** gets the raw ACME or
file/parse message, truncated to 300 characters; any **non-admin** caller (the read-only
viewer role, or a certificates:read token) gets the same short classified reason
GET /health uses, e.g. ''dns-01 challenge or DNS provider failure''. The raw text can
embed a third party''s HTTP response body, and certificates:read is held by the viewer
role, so it is not disclosed any more widely than /health does.'
lastAttempt:
type: string
format: date-time
readOnly: true
description: When the ACME manager last attempted to issue/renew this certificate. Acme
certificates only; absent for custom and for an acme certificate the manager has not
looked at yet (e.g. an HA follower, which does not run it).
sans:
type: array
items:
type: string
readOnly: true
description: Leaf certificate's subject alternative names (DNS names and IPs). Absent
alongside notAfter.
required:
- name
- type
- domains
description: Desired state for a TLS certificate, plus read-only status fields (notBefore
through sans) the server derives from the certificate store and the ACME manager's in-memory
state on every read. None of the status fields are accepted on write.
DNSProvider:
type: object
properties:
name: *id001
displayName: *id002
labels: *id003
tags: *id004
disabled: *id005
createdAt: *id006
updatedAt: *id007
provider:
type: string
enum:
- cloudflare
- digitalocean
- hetzner
- desec
- rfc2136
- acme-dns
description: >-
DNS-01 solver to use. cloudflare, digitalocean, hetzner and desec are
token-authenticated REST providers; rfc2136 sends TSIG-signed dynamic
updates to any nameserver; acme-dns writes to a joohoi/acme-dns
account reached through a CNAME.
config:
type: object
properties: {}
description: >-
Provider-specific credential map. The REST providers take apiToken,
e.g. {"apiToken": "${FILE:/run/secrets/cf_token}"}. rfc2136 takes
server, zone, tsigKeyName, tsigSecret and optional tsigAlgorithm,
ttl, transport, timeout. acme-dns takes baseURL, username, password
and subdomain, plus optional allowInsecureLocal ("true") to permit a
loopback baseURL - a link-local baseURL (the cloud metadata range) is
always refused, at write time and again at connect time.
additionalProperties:
$ref: '#/components/schemas/Secret'
required:
- name
- provider
description: Reusable credentials for an ACME DNS-01 provider.
ClientCA:
type: object
properties:
name: *id001
displayName: *id002
labels: *id003
tags: *id004
disabled: *id005
createdAt: *id006
updatedAt: *id007
caPEM:
type: string
description: PEM-encoded CA certificate bundle. Public; may be inline or a placeholder.
crlFile:
type: string
description: Optional CRL path, relative to the cert store. Mutually exclusive with crlPEM.
Re-read on reload and mtime watch.
crlPEM:
type: string
description: Optional inline PEM-encoded CRL. Mutually exclusive with crlFile.
crlPolicy:
type: string
description: fail-closed (default, reject on an unusable CRL) | fail-open.
enum:
- ''
- fail-closed
- fail-open
caKeyFile:
type: string
description: Optional signing key path, relative to the cert store (absolute and .. paths are
rejected). Set it to let this CA issue client certificates. Mutually exclusive with caKeyPEM.
caKeyPEM:
allOf:
- $ref: '#/components/schemas/Secret'
description: Optional inline signing key, as a ${FILE:...} / ${ENV:...} placeholder (a literal
key is refused at commit). Mutually exclusive with caKeyFile.
expiryWarningDays:
type: integer
minimum: 0
maximum: 3650
default: 30
description: How far ahead a certificate issued by this CA is reported as expiring. 0 or unset
uses the 30-day default. Advisory only - nothing renews on its own. Note PUT replaces the
whole object, so omitting it on a write resets it to the default.
required:
- name
- caPEM
description: Trust anchor for mTLS client-certificate verification. With a signing key it can also
issue client certificates (POST /api/client-cas/{name}/issue). Either bring your own CA (paste
caPEM, optionally point caKeyFile at a key you placed in the certificate store) or have gpm
generate one (POST /api/client-cas/{name}/generate), which fills both fields in for you.
ClientCertRequest:
type: object
properties:
commonName:
type: string
maxLength: 64
description: Subject common name of the issued certificate. Also the download filename stem,
sanitized.
validityDays:
type: integer
minimum: 0
maximum: 3650
default: 365
description: Certificate lifetime in days. Omit it, or send 0, for the 365-day default;
any other value must be 1-3650. A negative value is rejected.
password:
type: string
minLength: 12
description: Encrypts the returned PKCS#12 bundle. Required, at least 12 characters, never
stored or logged. The floor exists because the bundle uses the legacy PKCS#12 encoder for
device compatibility, which derives its integrity MAC with a single KDF iteration - the
password is effectively the only protection once the file leaves gpm.
sans:
type: array
maxItems: 32
items:
type: string
description: Optional subject alternative names, printable ASCII only (a certificate stores
them as IA5String, so an internationalised domain must be supplied punycoded as "xn--...").
An entry that parses as an IP becomes an IP SAN, one containing "@" an email SAN, anything
else a DNS SAN.
required:
- commonName
- password
description: One client-certificate issuance.
ClientCAGenerateRequest:
type: object
properties:
commonName:
type: string
maxLength: 64
description: Subject common name of the generated CA. Defaults to the ClientCA object name.
validityDays:
type: integer
minimum: 0
maximum: 7300
default: 3650
description: CA lifetime in days. Omit it, or send 0, for the ten-year default; any other
value must be 1-7300. A CA is a trust anchor pinned into device configuration, so rotating
it means re-provisioning every device - hence the long default.
organization:
type: string
maxLength: 64
description: Optional subject organization (O).
description: One CA generation. Every field is optional; an empty body is valid.
ClientCertRenewRequest:
type: object
properties:
password:
type: string
minLength: 12
description: Encrypts the renewed PKCS#12 bundle. Required, at least 12 characters, never
stored or logged. Same floor and reasoning as issuance.
validityDays:
type: integer
minimum: 0
maximum: 3650
default: 365
description: Lifetime of the renewed certificate in days. Omit it, or send 0, for the 365-day
default; any other value must be 1-3650. A negative value is rejected.
required:
- password
description: One renewal. The common name and SANs come from the record, not the request.
IssuedClientCert:
type: object
properties:
ca:
type: string
commonName:
type: string
sans:
type: array
items:
type: string
serial:
type: string
description: Lower-case hex.
notBefore:
type: string
format: date-time
notAfter:
type: string
format: date-time
issuedAt:
type: string
format: date-time
supersededBy:
type: string
description: Serial of the renewal that replaced this certificate, if any. Superseding does
not revoke - the old certificate stays valid until it expires.
supersededAt:
type: string
format: date-time
status:
type: string
description: Derived at request time from notAfter and the CA's expiryWarningDays.
enum:
- ok
- expiring
- expired
daysRemaining:
type: integer
description: Whole days until expiry, floored; negative once expired.
description: One client certificate this CA issued. Carries no key material.
IssuedClientCertList:
type: object
properties:
expiryWarningDays:
type: integer
description: The CA's effective warning window, so a client need not re-derive the default.
certificates:
type: array
items:
$ref: '#/components/schemas/IssuedClientCert'
required:
- expiryWarningDays
- certificates
description: Every client certificate this CA has issued, newest first.
OIDCSpec:
type: object
properties:
issuerURL:
type: string
clientID:
type: string
clientSecret:
$ref: '#/components/schemas/Secret'
scopes:
type: array
items:
type: string
description: Default [openid, profile, email, groups].
usePKCE:
type: boolean
description: Default true.
requireVerifiedEmail:
type: boolean
required:
- issuerURL
- clientID
ForwardAuthSpec:
type: object
properties:
trustedProxies:
type: array
items:
type: string
description: CIDRs allowed to assert identity headers. Required, non-empty.
userHeader:
type: string
description: e.g. X-authentik-username.
emailHeader:
type: string
nameHeader:
type: string
groupsHeader:
type: string
groupsDelimiter:
type: string
description: Default ",".
amrHeader:
type: string
description: Authentication-methods header, drives MFA delegation. Empty asserts no MFA.
required:
- trustedProxies
- userHeader
AuthRequestSpec:
type: object
properties:
outpostURL:
type: string
description: Base URL of the auth server, e.g. http://auth-outpost:9000.
pathPrefix:
type: string
description: Default /outpost.goauthentik.io.
authPath:
type: string
description: Default pathPrefix + /auth/nginx.
copyHeaders:
type: array
items:
type: string
description: Response headers copied from the auth subrequest onto the upstream request. Default
the Authentik X-authentik-* set.
required:
- outpostURL
RoleMapping:
type: object
properties:
groupsClaim:
type: string
description: Default "groups".
adminGroups:
type: array
items:
type: string
userGroups:
type: array
items:
type: string
defaultRole: