@viaalink/caddy-api-client 0.0.0-stage → 0.10.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,3025 @@
1
+ import { e as CaddyRoute, c as AuthenticationPortal$1, d as AuthorizationPolicy$1, I as IdentityStore, L as LdapIdentityStore$1, t as LocalIdentityStore$1, O as OAuth2IdentityProvider$1, x as OidcIdentityProvider$1, S as SecurityApp$1, N as SecurityAuthenticatorHandler$1, Q as SecurityAuthorizationHandler$1, T as SecurityAuthorizerProvider, U as SecurityConfig$1, V as SecurityHandler } from './types-CccPerBC.js';
2
+ import { z } from 'zod';
3
+
4
+ /**
5
+ * Zod schemas for caddy-security plugin
6
+ *
7
+ * Provides runtime validation for caddy-security handler configurations.
8
+ *
9
+ * Base types are generated from Go source via tygo + ts-to-zod.
10
+ * Handler schemas extend these with the `handler` discriminator field
11
+ * that Caddy adds based on the module namespace.
12
+ *
13
+ * @see https://github.com/greenpau/caddy-security
14
+ * @see src/generated/plugins/caddy-security.ts (generated types)
15
+ * @see src/generated/plugins/caddy-security.zod.ts (generated schemas)
16
+ */
17
+
18
+ /**
19
+ * Authenticator portal handler schema
20
+ *
21
+ * Extends the generated AuthnMiddleware with the handler discriminator.
22
+ * Module ID: `http.handlers.authenticator`
23
+ *
24
+ * @example
25
+ * ```typescript
26
+ * const handler = SecurityAuthenticatorHandlerSchema.parse({
27
+ * handler: "authenticator",
28
+ * portal_name: "myportal",
29
+ * });
30
+ * ```
31
+ */
32
+ declare const SecurityAuthenticatorHandlerSchema: z.ZodObject<{
33
+ handler: z.ZodLiteral<"authenticator">;
34
+ portal_name: z.ZodOptional<z.ZodString>;
35
+ route_matcher: z.ZodOptional<z.ZodString>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ handler: "authenticator";
38
+ route_matcher?: string | undefined;
39
+ portal_name?: string | undefined;
40
+ }, {
41
+ handler: "authenticator";
42
+ route_matcher?: string | undefined;
43
+ portal_name?: string | undefined;
44
+ }>;
45
+ /**
46
+ * Authorizer provider schema
47
+ *
48
+ * Based on generated AuthzMiddleware (without handler field since it's a provider).
49
+ * Module ID: `http.authentication.providers.authorizer`
50
+ *
51
+ * @example
52
+ * ```typescript
53
+ * const provider = SecurityAuthorizerProviderSchema.parse({
54
+ * gatekeeper_name: "mygatekeeper",
55
+ * route_matcher: "*",
56
+ * });
57
+ * ```
58
+ */
59
+ declare const SecurityAuthorizerProviderSchema: z.ZodObject<{
60
+ gatekeeper_name: z.ZodOptional<z.ZodString>;
61
+ route_matcher: z.ZodOptional<z.ZodString>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ route_matcher?: string | undefined;
64
+ gatekeeper_name?: string | undefined;
65
+ }, {
66
+ route_matcher?: string | undefined;
67
+ gatekeeper_name?: string | undefined;
68
+ }>;
69
+ /**
70
+ * Authorization handler schema
71
+ *
72
+ * Uses Caddy's built-in `authentication` handler with the `authorizer` provider.
73
+ * The provider config is based on the generated AuthzMiddleware.
74
+ *
75
+ * @example
76
+ * ```typescript
77
+ * const handler = SecurityAuthorizationHandlerSchema.parse({
78
+ * handler: "authentication",
79
+ * providers: {
80
+ * authorizer: {
81
+ * gatekeeper_name: "mygatekeeper",
82
+ * },
83
+ * },
84
+ * });
85
+ * ```
86
+ */
87
+ declare const SecurityAuthorizationHandlerSchema: z.ZodObject<{
88
+ handler: z.ZodLiteral<"authentication">;
89
+ providers: z.ZodObject<{
90
+ authorizer: z.ZodObject<{
91
+ gatekeeper_name: z.ZodOptional<z.ZodString>;
92
+ route_matcher: z.ZodOptional<z.ZodString>;
93
+ }, "strip", z.ZodTypeAny, {
94
+ route_matcher?: string | undefined;
95
+ gatekeeper_name?: string | undefined;
96
+ }, {
97
+ route_matcher?: string | undefined;
98
+ gatekeeper_name?: string | undefined;
99
+ }>;
100
+ }, "strip", z.ZodTypeAny, {
101
+ authorizer: {
102
+ route_matcher?: string | undefined;
103
+ gatekeeper_name?: string | undefined;
104
+ };
105
+ }, {
106
+ authorizer: {
107
+ route_matcher?: string | undefined;
108
+ gatekeeper_name?: string | undefined;
109
+ };
110
+ }>;
111
+ }, "strip", z.ZodTypeAny, {
112
+ handler: "authentication";
113
+ providers: {
114
+ authorizer: {
115
+ route_matcher?: string | undefined;
116
+ gatekeeper_name?: string | undefined;
117
+ };
118
+ };
119
+ }, {
120
+ handler: "authentication";
121
+ providers: {
122
+ authorizer: {
123
+ route_matcher?: string | undefined;
124
+ gatekeeper_name?: string | undefined;
125
+ };
126
+ };
127
+ }>;
128
+ /**
129
+ * Combined security handler schema (discriminated union)
130
+ *
131
+ * - `authenticator` - Portal handler that serves login UI
132
+ * - `authentication` - Caddy's handler with the authorizer provider for token validation
133
+ */
134
+ declare const SecurityHandlerSchema: z.ZodDiscriminatedUnion<"handler", [z.ZodObject<{
135
+ handler: z.ZodLiteral<"authenticator">;
136
+ portal_name: z.ZodOptional<z.ZodString>;
137
+ route_matcher: z.ZodOptional<z.ZodString>;
138
+ }, "strip", z.ZodTypeAny, {
139
+ handler: "authenticator";
140
+ route_matcher?: string | undefined;
141
+ portal_name?: string | undefined;
142
+ }, {
143
+ handler: "authenticator";
144
+ route_matcher?: string | undefined;
145
+ portal_name?: string | undefined;
146
+ }>, z.ZodObject<{
147
+ handler: z.ZodLiteral<"authentication">;
148
+ providers: z.ZodObject<{
149
+ authorizer: z.ZodObject<{
150
+ gatekeeper_name: z.ZodOptional<z.ZodString>;
151
+ route_matcher: z.ZodOptional<z.ZodString>;
152
+ }, "strip", z.ZodTypeAny, {
153
+ route_matcher?: string | undefined;
154
+ gatekeeper_name?: string | undefined;
155
+ }, {
156
+ route_matcher?: string | undefined;
157
+ gatekeeper_name?: string | undefined;
158
+ }>;
159
+ }, "strip", z.ZodTypeAny, {
160
+ authorizer: {
161
+ route_matcher?: string | undefined;
162
+ gatekeeper_name?: string | undefined;
163
+ };
164
+ }, {
165
+ authorizer: {
166
+ route_matcher?: string | undefined;
167
+ gatekeeper_name?: string | undefined;
168
+ };
169
+ }>;
170
+ }, "strip", z.ZodTypeAny, {
171
+ handler: "authentication";
172
+ providers: {
173
+ authorizer: {
174
+ route_matcher?: string | undefined;
175
+ gatekeeper_name?: string | undefined;
176
+ };
177
+ };
178
+ }, {
179
+ handler: "authentication";
180
+ providers: {
181
+ authorizer: {
182
+ route_matcher?: string | undefined;
183
+ gatekeeper_name?: string | undefined;
184
+ };
185
+ };
186
+ }>]>;
187
+ /**
188
+ * Local identity store schema
189
+ * Uses the authcrunch wrapper structure: name, kind, params
190
+ */
191
+ declare const LocalIdentityStoreSchema: z.ZodObject<{
192
+ name: z.ZodString;
193
+ kind: z.ZodLiteral<"local">;
194
+ params: z.ZodObject<{
195
+ realm: z.ZodOptional<z.ZodString>;
196
+ path: z.ZodString;
197
+ }, "strip", z.ZodTypeAny, {
198
+ path: string;
199
+ realm?: string | undefined;
200
+ }, {
201
+ path: string;
202
+ realm?: string | undefined;
203
+ }>;
204
+ }, "strip", z.ZodTypeAny, {
205
+ params: {
206
+ path: string;
207
+ realm?: string | undefined;
208
+ };
209
+ name: string;
210
+ kind: "local";
211
+ }, {
212
+ params: {
213
+ path: string;
214
+ realm?: string | undefined;
215
+ };
216
+ name: string;
217
+ kind: "local";
218
+ }>;
219
+ /**
220
+ * LDAP identity store schema
221
+ * Uses the authcrunch wrapper structure: name, kind, params
222
+ * Uses passthrough() on params to ensure nested fields like groups are preserved
223
+ */
224
+ declare const LdapIdentityStoreSchema: z.ZodObject<{
225
+ name: z.ZodString;
226
+ kind: z.ZodLiteral<"ldap">;
227
+ params: z.ZodObject<{
228
+ realm: z.ZodOptional<z.ZodString>;
229
+ servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
230
+ address: z.ZodString;
231
+ port: z.ZodOptional<z.ZodNumber>;
232
+ }, "strip", z.ZodTypeAny, {
233
+ address: string;
234
+ port?: number | undefined;
235
+ }, {
236
+ address: string;
237
+ port?: number | undefined;
238
+ }>, "many">>;
239
+ bind_username: z.ZodOptional<z.ZodString>;
240
+ bind_password: z.ZodOptional<z.ZodString>;
241
+ search_base_dn: z.ZodOptional<z.ZodString>;
242
+ search_user_filter: z.ZodOptional<z.ZodString>;
243
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
244
+ dn: z.ZodString;
245
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
246
+ }, "strip", z.ZodTypeAny, {
247
+ dn: string;
248
+ roles?: string[] | undefined;
249
+ }, {
250
+ dn: string;
251
+ roles?: string[] | undefined;
252
+ }>, "many">>;
253
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
254
+ realm: z.ZodOptional<z.ZodString>;
255
+ servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
256
+ address: z.ZodString;
257
+ port: z.ZodOptional<z.ZodNumber>;
258
+ }, "strip", z.ZodTypeAny, {
259
+ address: string;
260
+ port?: number | undefined;
261
+ }, {
262
+ address: string;
263
+ port?: number | undefined;
264
+ }>, "many">>;
265
+ bind_username: z.ZodOptional<z.ZodString>;
266
+ bind_password: z.ZodOptional<z.ZodString>;
267
+ search_base_dn: z.ZodOptional<z.ZodString>;
268
+ search_user_filter: z.ZodOptional<z.ZodString>;
269
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
270
+ dn: z.ZodString;
271
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
272
+ }, "strip", z.ZodTypeAny, {
273
+ dn: string;
274
+ roles?: string[] | undefined;
275
+ }, {
276
+ dn: string;
277
+ roles?: string[] | undefined;
278
+ }>, "many">>;
279
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
280
+ realm: z.ZodOptional<z.ZodString>;
281
+ servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
282
+ address: z.ZodString;
283
+ port: z.ZodOptional<z.ZodNumber>;
284
+ }, "strip", z.ZodTypeAny, {
285
+ address: string;
286
+ port?: number | undefined;
287
+ }, {
288
+ address: string;
289
+ port?: number | undefined;
290
+ }>, "many">>;
291
+ bind_username: z.ZodOptional<z.ZodString>;
292
+ bind_password: z.ZodOptional<z.ZodString>;
293
+ search_base_dn: z.ZodOptional<z.ZodString>;
294
+ search_user_filter: z.ZodOptional<z.ZodString>;
295
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
296
+ dn: z.ZodString;
297
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
298
+ }, "strip", z.ZodTypeAny, {
299
+ dn: string;
300
+ roles?: string[] | undefined;
301
+ }, {
302
+ dn: string;
303
+ roles?: string[] | undefined;
304
+ }>, "many">>;
305
+ }, z.ZodTypeAny, "passthrough">>;
306
+ }, "strip", z.ZodTypeAny, {
307
+ params: {
308
+ servers?: {
309
+ address: string;
310
+ port?: number | undefined;
311
+ }[] | undefined;
312
+ realm?: string | undefined;
313
+ bind_username?: string | undefined;
314
+ bind_password?: string | undefined;
315
+ search_base_dn?: string | undefined;
316
+ search_user_filter?: string | undefined;
317
+ groups?: {
318
+ dn: string;
319
+ roles?: string[] | undefined;
320
+ }[] | undefined;
321
+ } & {
322
+ [k: string]: unknown;
323
+ };
324
+ name: string;
325
+ kind: "ldap";
326
+ }, {
327
+ params: {
328
+ servers?: {
329
+ address: string;
330
+ port?: number | undefined;
331
+ }[] | undefined;
332
+ realm?: string | undefined;
333
+ bind_username?: string | undefined;
334
+ bind_password?: string | undefined;
335
+ search_base_dn?: string | undefined;
336
+ search_user_filter?: string | undefined;
337
+ groups?: {
338
+ dn: string;
339
+ roles?: string[] | undefined;
340
+ }[] | undefined;
341
+ } & {
342
+ [k: string]: unknown;
343
+ };
344
+ name: string;
345
+ kind: "ldap";
346
+ }>;
347
+ /**
348
+ * OAuth 2.0 identity provider schema
349
+ * Uses the authcrunch wrapper structure: name, kind, params
350
+ */
351
+ declare const OAuth2IdentityProviderSchema: z.ZodObject<{
352
+ name: z.ZodString;
353
+ kind: z.ZodLiteral<"oauth">;
354
+ params: z.ZodObject<{
355
+ driver: z.ZodOptional<z.ZodString>;
356
+ realm: z.ZodOptional<z.ZodString>;
357
+ client_id: z.ZodOptional<z.ZodString>;
358
+ client_secret: z.ZodOptional<z.ZodString>;
359
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
360
+ authorization_url: z.ZodOptional<z.ZodString>;
361
+ token_url: z.ZodOptional<z.ZodString>;
362
+ }, "strip", z.ZodTypeAny, {
363
+ realm?: string | undefined;
364
+ driver?: string | undefined;
365
+ client_id?: string | undefined;
366
+ client_secret?: string | undefined;
367
+ scopes?: string[] | undefined;
368
+ authorization_url?: string | undefined;
369
+ token_url?: string | undefined;
370
+ }, {
371
+ realm?: string | undefined;
372
+ driver?: string | undefined;
373
+ client_id?: string | undefined;
374
+ client_secret?: string | undefined;
375
+ scopes?: string[] | undefined;
376
+ authorization_url?: string | undefined;
377
+ token_url?: string | undefined;
378
+ }>;
379
+ }, "strip", z.ZodTypeAny, {
380
+ params: {
381
+ realm?: string | undefined;
382
+ driver?: string | undefined;
383
+ client_id?: string | undefined;
384
+ client_secret?: string | undefined;
385
+ scopes?: string[] | undefined;
386
+ authorization_url?: string | undefined;
387
+ token_url?: string | undefined;
388
+ };
389
+ name: string;
390
+ kind: "oauth";
391
+ }, {
392
+ params: {
393
+ realm?: string | undefined;
394
+ driver?: string | undefined;
395
+ client_id?: string | undefined;
396
+ client_secret?: string | undefined;
397
+ scopes?: string[] | undefined;
398
+ authorization_url?: string | undefined;
399
+ token_url?: string | undefined;
400
+ };
401
+ name: string;
402
+ kind: "oauth";
403
+ }>;
404
+ /**
405
+ * OIDC identity provider schema
406
+ * Uses the authcrunch wrapper structure: name, kind, params
407
+ */
408
+ declare const OidcIdentityProviderSchema: z.ZodObject<{
409
+ name: z.ZodString;
410
+ kind: z.ZodLiteral<"oauth">;
411
+ params: z.ZodObject<{
412
+ driver: z.ZodOptional<z.ZodString>;
413
+ realm: z.ZodOptional<z.ZodString>;
414
+ client_id: z.ZodOptional<z.ZodString>;
415
+ client_secret: z.ZodOptional<z.ZodString>;
416
+ metadata_url: z.ZodOptional<z.ZodString>;
417
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
418
+ }, "strip", z.ZodTypeAny, {
419
+ realm?: string | undefined;
420
+ driver?: string | undefined;
421
+ client_id?: string | undefined;
422
+ client_secret?: string | undefined;
423
+ scopes?: string[] | undefined;
424
+ metadata_url?: string | undefined;
425
+ }, {
426
+ realm?: string | undefined;
427
+ driver?: string | undefined;
428
+ client_id?: string | undefined;
429
+ client_secret?: string | undefined;
430
+ scopes?: string[] | undefined;
431
+ metadata_url?: string | undefined;
432
+ }>;
433
+ }, "strip", z.ZodTypeAny, {
434
+ params: {
435
+ realm?: string | undefined;
436
+ driver?: string | undefined;
437
+ client_id?: string | undefined;
438
+ client_secret?: string | undefined;
439
+ scopes?: string[] | undefined;
440
+ metadata_url?: string | undefined;
441
+ };
442
+ name: string;
443
+ kind: "oauth";
444
+ }, {
445
+ params: {
446
+ realm?: string | undefined;
447
+ driver?: string | undefined;
448
+ client_id?: string | undefined;
449
+ client_secret?: string | undefined;
450
+ scopes?: string[] | undefined;
451
+ metadata_url?: string | undefined;
452
+ };
453
+ name: string;
454
+ kind: "oauth";
455
+ }>;
456
+ /**
457
+ * Identity store union schema
458
+ */
459
+ declare const IdentityStoreSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
460
+ name: z.ZodString;
461
+ kind: z.ZodLiteral<"local">;
462
+ params: z.ZodObject<{
463
+ realm: z.ZodOptional<z.ZodString>;
464
+ path: z.ZodString;
465
+ }, "strip", z.ZodTypeAny, {
466
+ path: string;
467
+ realm?: string | undefined;
468
+ }, {
469
+ path: string;
470
+ realm?: string | undefined;
471
+ }>;
472
+ }, "strip", z.ZodTypeAny, {
473
+ params: {
474
+ path: string;
475
+ realm?: string | undefined;
476
+ };
477
+ name: string;
478
+ kind: "local";
479
+ }, {
480
+ params: {
481
+ path: string;
482
+ realm?: string | undefined;
483
+ };
484
+ name: string;
485
+ kind: "local";
486
+ }>, z.ZodObject<{
487
+ name: z.ZodString;
488
+ kind: z.ZodLiteral<"ldap">;
489
+ params: z.ZodObject<{
490
+ realm: z.ZodOptional<z.ZodString>;
491
+ servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
492
+ address: z.ZodString;
493
+ port: z.ZodOptional<z.ZodNumber>;
494
+ }, "strip", z.ZodTypeAny, {
495
+ address: string;
496
+ port?: number | undefined;
497
+ }, {
498
+ address: string;
499
+ port?: number | undefined;
500
+ }>, "many">>;
501
+ bind_username: z.ZodOptional<z.ZodString>;
502
+ bind_password: z.ZodOptional<z.ZodString>;
503
+ search_base_dn: z.ZodOptional<z.ZodString>;
504
+ search_user_filter: z.ZodOptional<z.ZodString>;
505
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
506
+ dn: z.ZodString;
507
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
508
+ }, "strip", z.ZodTypeAny, {
509
+ dn: string;
510
+ roles?: string[] | undefined;
511
+ }, {
512
+ dn: string;
513
+ roles?: string[] | undefined;
514
+ }>, "many">>;
515
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
516
+ realm: z.ZodOptional<z.ZodString>;
517
+ servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
518
+ address: z.ZodString;
519
+ port: z.ZodOptional<z.ZodNumber>;
520
+ }, "strip", z.ZodTypeAny, {
521
+ address: string;
522
+ port?: number | undefined;
523
+ }, {
524
+ address: string;
525
+ port?: number | undefined;
526
+ }>, "many">>;
527
+ bind_username: z.ZodOptional<z.ZodString>;
528
+ bind_password: z.ZodOptional<z.ZodString>;
529
+ search_base_dn: z.ZodOptional<z.ZodString>;
530
+ search_user_filter: z.ZodOptional<z.ZodString>;
531
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
532
+ dn: z.ZodString;
533
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
534
+ }, "strip", z.ZodTypeAny, {
535
+ dn: string;
536
+ roles?: string[] | undefined;
537
+ }, {
538
+ dn: string;
539
+ roles?: string[] | undefined;
540
+ }>, "many">>;
541
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
542
+ realm: z.ZodOptional<z.ZodString>;
543
+ servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
544
+ address: z.ZodString;
545
+ port: z.ZodOptional<z.ZodNumber>;
546
+ }, "strip", z.ZodTypeAny, {
547
+ address: string;
548
+ port?: number | undefined;
549
+ }, {
550
+ address: string;
551
+ port?: number | undefined;
552
+ }>, "many">>;
553
+ bind_username: z.ZodOptional<z.ZodString>;
554
+ bind_password: z.ZodOptional<z.ZodString>;
555
+ search_base_dn: z.ZodOptional<z.ZodString>;
556
+ search_user_filter: z.ZodOptional<z.ZodString>;
557
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
558
+ dn: z.ZodString;
559
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
560
+ }, "strip", z.ZodTypeAny, {
561
+ dn: string;
562
+ roles?: string[] | undefined;
563
+ }, {
564
+ dn: string;
565
+ roles?: string[] | undefined;
566
+ }>, "many">>;
567
+ }, z.ZodTypeAny, "passthrough">>;
568
+ }, "strip", z.ZodTypeAny, {
569
+ params: {
570
+ servers?: {
571
+ address: string;
572
+ port?: number | undefined;
573
+ }[] | undefined;
574
+ realm?: string | undefined;
575
+ bind_username?: string | undefined;
576
+ bind_password?: string | undefined;
577
+ search_base_dn?: string | undefined;
578
+ search_user_filter?: string | undefined;
579
+ groups?: {
580
+ dn: string;
581
+ roles?: string[] | undefined;
582
+ }[] | undefined;
583
+ } & {
584
+ [k: string]: unknown;
585
+ };
586
+ name: string;
587
+ kind: "ldap";
588
+ }, {
589
+ params: {
590
+ servers?: {
591
+ address: string;
592
+ port?: number | undefined;
593
+ }[] | undefined;
594
+ realm?: string | undefined;
595
+ bind_username?: string | undefined;
596
+ bind_password?: string | undefined;
597
+ search_base_dn?: string | undefined;
598
+ search_user_filter?: string | undefined;
599
+ groups?: {
600
+ dn: string;
601
+ roles?: string[] | undefined;
602
+ }[] | undefined;
603
+ } & {
604
+ [k: string]: unknown;
605
+ };
606
+ name: string;
607
+ kind: "ldap";
608
+ }>]>;
609
+ /**
610
+ * Authentication portal schema
611
+ * @see https://pkg.go.dev/github.com/greenpau/go-authcrunch/pkg/authn#PortalConfig
612
+ */
613
+ declare const AuthenticationPortalSchema: z.ZodObject<{
614
+ name: z.ZodString;
615
+ ui: z.ZodOptional<z.ZodObject<{
616
+ theme: z.ZodOptional<z.ZodString>;
617
+ logo_url: z.ZodOptional<z.ZodString>;
618
+ custom_css: z.ZodOptional<z.ZodString>;
619
+ }, "strip", z.ZodTypeAny, {
620
+ theme?: string | undefined;
621
+ logo_url?: string | undefined;
622
+ custom_css?: string | undefined;
623
+ }, {
624
+ theme?: string | undefined;
625
+ logo_url?: string | undefined;
626
+ custom_css?: string | undefined;
627
+ }>>;
628
+ cookie_config: z.ZodOptional<z.ZodObject<{
629
+ domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
630
+ lifetime: z.ZodOptional<z.ZodNumber>;
631
+ insecure: z.ZodOptional<z.ZodBoolean>;
632
+ same_site: z.ZodOptional<z.ZodString>;
633
+ }, "strip", z.ZodTypeAny, {
634
+ lifetime?: number | undefined;
635
+ insecure?: boolean | undefined;
636
+ same_site?: string | undefined;
637
+ }, {
638
+ lifetime?: number | undefined;
639
+ insecure?: boolean | undefined;
640
+ same_site?: string | undefined;
641
+ }>>>;
642
+ path: z.ZodOptional<z.ZodString>;
643
+ lifetime: z.ZodOptional<z.ZodNumber>;
644
+ insecure: z.ZodOptional<z.ZodBoolean>;
645
+ same_site: z.ZodOptional<z.ZodString>;
646
+ }, "strip", z.ZodTypeAny, {
647
+ path?: string | undefined;
648
+ domains?: Record<string, {
649
+ lifetime?: number | undefined;
650
+ insecure?: boolean | undefined;
651
+ same_site?: string | undefined;
652
+ }> | undefined;
653
+ lifetime?: number | undefined;
654
+ insecure?: boolean | undefined;
655
+ same_site?: string | undefined;
656
+ }, {
657
+ path?: string | undefined;
658
+ domains?: Record<string, {
659
+ lifetime?: number | undefined;
660
+ insecure?: boolean | undefined;
661
+ same_site?: string | undefined;
662
+ }> | undefined;
663
+ lifetime?: number | undefined;
664
+ insecure?: boolean | undefined;
665
+ same_site?: string | undefined;
666
+ }>>;
667
+ identity_stores: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
668
+ identity_providers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
669
+ user_transformer_configs: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
670
+ }, "strip", z.ZodTypeAny, {
671
+ name: string;
672
+ ui?: {
673
+ theme?: string | undefined;
674
+ logo_url?: string | undefined;
675
+ custom_css?: string | undefined;
676
+ } | undefined;
677
+ cookie_config?: {
678
+ path?: string | undefined;
679
+ domains?: Record<string, {
680
+ lifetime?: number | undefined;
681
+ insecure?: boolean | undefined;
682
+ same_site?: string | undefined;
683
+ }> | undefined;
684
+ lifetime?: number | undefined;
685
+ insecure?: boolean | undefined;
686
+ same_site?: string | undefined;
687
+ } | undefined;
688
+ identity_stores?: string[] | undefined;
689
+ identity_providers?: string[] | undefined;
690
+ user_transformer_configs?: Record<string, unknown>[] | undefined;
691
+ }, {
692
+ name: string;
693
+ ui?: {
694
+ theme?: string | undefined;
695
+ logo_url?: string | undefined;
696
+ custom_css?: string | undefined;
697
+ } | undefined;
698
+ cookie_config?: {
699
+ path?: string | undefined;
700
+ domains?: Record<string, {
701
+ lifetime?: number | undefined;
702
+ insecure?: boolean | undefined;
703
+ same_site?: string | undefined;
704
+ }> | undefined;
705
+ lifetime?: number | undefined;
706
+ insecure?: boolean | undefined;
707
+ same_site?: string | undefined;
708
+ } | undefined;
709
+ identity_stores?: string[] | undefined;
710
+ identity_providers?: string[] | undefined;
711
+ user_transformer_configs?: Record<string, unknown>[] | undefined;
712
+ }>;
713
+ /**
714
+ * Authorization policy (gatekeeper) schema
715
+ * @see https://pkg.go.dev/github.com/greenpau/go-authcrunch/pkg/authz#PolicyConfig
716
+ */
717
+ declare const AuthorizationPolicySchema: z.ZodObject<{
718
+ name: z.ZodString;
719
+ access_list_rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
720
+ comment: z.ZodOptional<z.ZodString>;
721
+ conditions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
722
+ action: z.ZodOptional<z.ZodEnum<["allow", "deny"]>>;
723
+ }, "strip", z.ZodTypeAny, {
724
+ comment?: string | undefined;
725
+ conditions?: string[] | undefined;
726
+ action?: "allow" | "deny" | undefined;
727
+ }, {
728
+ comment?: string | undefined;
729
+ conditions?: string[] | undefined;
730
+ action?: "allow" | "deny" | undefined;
731
+ }>, "many">>;
732
+ crypto_key_configs: z.ZodOptional<z.ZodArray<z.ZodObject<{
733
+ token_name: z.ZodOptional<z.ZodString>;
734
+ source: z.ZodOptional<z.ZodString>;
735
+ }, "strip", z.ZodTypeAny, {
736
+ source?: string | undefined;
737
+ token_name?: string | undefined;
738
+ }, {
739
+ source?: string | undefined;
740
+ token_name?: string | undefined;
741
+ }>, "many">>;
742
+ bypass_configs: z.ZodOptional<z.ZodArray<z.ZodObject<{
743
+ match_type: z.ZodString;
744
+ uri: z.ZodOptional<z.ZodString>;
745
+ }, "strip", z.ZodTypeAny, {
746
+ match_type: string;
747
+ uri?: string | undefined;
748
+ }, {
749
+ match_type: string;
750
+ uri?: string | undefined;
751
+ }>, "many">>;
752
+ }, "strip", z.ZodTypeAny, {
753
+ name: string;
754
+ access_list_rules?: {
755
+ comment?: string | undefined;
756
+ conditions?: string[] | undefined;
757
+ action?: "allow" | "deny" | undefined;
758
+ }[] | undefined;
759
+ crypto_key_configs?: {
760
+ source?: string | undefined;
761
+ token_name?: string | undefined;
762
+ }[] | undefined;
763
+ bypass_configs?: {
764
+ match_type: string;
765
+ uri?: string | undefined;
766
+ }[] | undefined;
767
+ }, {
768
+ name: string;
769
+ access_list_rules?: {
770
+ comment?: string | undefined;
771
+ conditions?: string[] | undefined;
772
+ action?: "allow" | "deny" | undefined;
773
+ }[] | undefined;
774
+ crypto_key_configs?: {
775
+ source?: string | undefined;
776
+ token_name?: string | undefined;
777
+ }[] | undefined;
778
+ bypass_configs?: {
779
+ match_type: string;
780
+ uri?: string | undefined;
781
+ }[] | undefined;
782
+ }>;
783
+ /**
784
+ * Security configuration schema
785
+ *
786
+ * Validates the config object at `/config/apps/security/config`
787
+ */
788
+ declare const SecurityConfigSchema: z.ZodObject<{
789
+ authentication_portals: z.ZodOptional<z.ZodArray<z.ZodObject<{
790
+ name: z.ZodString;
791
+ ui: z.ZodOptional<z.ZodObject<{
792
+ theme: z.ZodOptional<z.ZodString>;
793
+ logo_url: z.ZodOptional<z.ZodString>;
794
+ custom_css: z.ZodOptional<z.ZodString>;
795
+ }, "strip", z.ZodTypeAny, {
796
+ theme?: string | undefined;
797
+ logo_url?: string | undefined;
798
+ custom_css?: string | undefined;
799
+ }, {
800
+ theme?: string | undefined;
801
+ logo_url?: string | undefined;
802
+ custom_css?: string | undefined;
803
+ }>>;
804
+ cookie_config: z.ZodOptional<z.ZodObject<{
805
+ domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
806
+ lifetime: z.ZodOptional<z.ZodNumber>;
807
+ insecure: z.ZodOptional<z.ZodBoolean>;
808
+ same_site: z.ZodOptional<z.ZodString>;
809
+ }, "strip", z.ZodTypeAny, {
810
+ lifetime?: number | undefined;
811
+ insecure?: boolean | undefined;
812
+ same_site?: string | undefined;
813
+ }, {
814
+ lifetime?: number | undefined;
815
+ insecure?: boolean | undefined;
816
+ same_site?: string | undefined;
817
+ }>>>;
818
+ path: z.ZodOptional<z.ZodString>;
819
+ lifetime: z.ZodOptional<z.ZodNumber>;
820
+ insecure: z.ZodOptional<z.ZodBoolean>;
821
+ same_site: z.ZodOptional<z.ZodString>;
822
+ }, "strip", z.ZodTypeAny, {
823
+ path?: string | undefined;
824
+ domains?: Record<string, {
825
+ lifetime?: number | undefined;
826
+ insecure?: boolean | undefined;
827
+ same_site?: string | undefined;
828
+ }> | undefined;
829
+ lifetime?: number | undefined;
830
+ insecure?: boolean | undefined;
831
+ same_site?: string | undefined;
832
+ }, {
833
+ path?: string | undefined;
834
+ domains?: Record<string, {
835
+ lifetime?: number | undefined;
836
+ insecure?: boolean | undefined;
837
+ same_site?: string | undefined;
838
+ }> | undefined;
839
+ lifetime?: number | undefined;
840
+ insecure?: boolean | undefined;
841
+ same_site?: string | undefined;
842
+ }>>;
843
+ identity_stores: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
844
+ identity_providers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
845
+ user_transformer_configs: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
846
+ }, "strip", z.ZodTypeAny, {
847
+ name: string;
848
+ ui?: {
849
+ theme?: string | undefined;
850
+ logo_url?: string | undefined;
851
+ custom_css?: string | undefined;
852
+ } | undefined;
853
+ cookie_config?: {
854
+ path?: string | undefined;
855
+ domains?: Record<string, {
856
+ lifetime?: number | undefined;
857
+ insecure?: boolean | undefined;
858
+ same_site?: string | undefined;
859
+ }> | undefined;
860
+ lifetime?: number | undefined;
861
+ insecure?: boolean | undefined;
862
+ same_site?: string | undefined;
863
+ } | undefined;
864
+ identity_stores?: string[] | undefined;
865
+ identity_providers?: string[] | undefined;
866
+ user_transformer_configs?: Record<string, unknown>[] | undefined;
867
+ }, {
868
+ name: string;
869
+ ui?: {
870
+ theme?: string | undefined;
871
+ logo_url?: string | undefined;
872
+ custom_css?: string | undefined;
873
+ } | undefined;
874
+ cookie_config?: {
875
+ path?: string | undefined;
876
+ domains?: Record<string, {
877
+ lifetime?: number | undefined;
878
+ insecure?: boolean | undefined;
879
+ same_site?: string | undefined;
880
+ }> | undefined;
881
+ lifetime?: number | undefined;
882
+ insecure?: boolean | undefined;
883
+ same_site?: string | undefined;
884
+ } | undefined;
885
+ identity_stores?: string[] | undefined;
886
+ identity_providers?: string[] | undefined;
887
+ user_transformer_configs?: Record<string, unknown>[] | undefined;
888
+ }>, "many">>;
889
+ authorization_policies: z.ZodOptional<z.ZodArray<z.ZodObject<{
890
+ name: z.ZodString;
891
+ access_list_rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
892
+ comment: z.ZodOptional<z.ZodString>;
893
+ conditions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
894
+ action: z.ZodOptional<z.ZodEnum<["allow", "deny"]>>;
895
+ }, "strip", z.ZodTypeAny, {
896
+ comment?: string | undefined;
897
+ conditions?: string[] | undefined;
898
+ action?: "allow" | "deny" | undefined;
899
+ }, {
900
+ comment?: string | undefined;
901
+ conditions?: string[] | undefined;
902
+ action?: "allow" | "deny" | undefined;
903
+ }>, "many">>;
904
+ crypto_key_configs: z.ZodOptional<z.ZodArray<z.ZodObject<{
905
+ token_name: z.ZodOptional<z.ZodString>;
906
+ source: z.ZodOptional<z.ZodString>;
907
+ }, "strip", z.ZodTypeAny, {
908
+ source?: string | undefined;
909
+ token_name?: string | undefined;
910
+ }, {
911
+ source?: string | undefined;
912
+ token_name?: string | undefined;
913
+ }>, "many">>;
914
+ bypass_configs: z.ZodOptional<z.ZodArray<z.ZodObject<{
915
+ match_type: z.ZodString;
916
+ uri: z.ZodOptional<z.ZodString>;
917
+ }, "strip", z.ZodTypeAny, {
918
+ match_type: string;
919
+ uri?: string | undefined;
920
+ }, {
921
+ match_type: string;
922
+ uri?: string | undefined;
923
+ }>, "many">>;
924
+ }, "strip", z.ZodTypeAny, {
925
+ name: string;
926
+ access_list_rules?: {
927
+ comment?: string | undefined;
928
+ conditions?: string[] | undefined;
929
+ action?: "allow" | "deny" | undefined;
930
+ }[] | undefined;
931
+ crypto_key_configs?: {
932
+ source?: string | undefined;
933
+ token_name?: string | undefined;
934
+ }[] | undefined;
935
+ bypass_configs?: {
936
+ match_type: string;
937
+ uri?: string | undefined;
938
+ }[] | undefined;
939
+ }, {
940
+ name: string;
941
+ access_list_rules?: {
942
+ comment?: string | undefined;
943
+ conditions?: string[] | undefined;
944
+ action?: "allow" | "deny" | undefined;
945
+ }[] | undefined;
946
+ crypto_key_configs?: {
947
+ source?: string | undefined;
948
+ token_name?: string | undefined;
949
+ }[] | undefined;
950
+ bypass_configs?: {
951
+ match_type: string;
952
+ uri?: string | undefined;
953
+ }[] | undefined;
954
+ }>, "many">>;
955
+ credentials: z.ZodOptional<z.ZodObject<{
956
+ generic: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
957
+ }, "strip", z.ZodTypeAny, {
958
+ generic?: Record<string, unknown> | undefined;
959
+ }, {
960
+ generic?: Record<string, unknown> | undefined;
961
+ }>>;
962
+ identity_stores: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
963
+ name: z.ZodString;
964
+ kind: z.ZodLiteral<"local">;
965
+ params: z.ZodObject<{
966
+ realm: z.ZodOptional<z.ZodString>;
967
+ path: z.ZodString;
968
+ }, "strip", z.ZodTypeAny, {
969
+ path: string;
970
+ realm?: string | undefined;
971
+ }, {
972
+ path: string;
973
+ realm?: string | undefined;
974
+ }>;
975
+ }, "strip", z.ZodTypeAny, {
976
+ params: {
977
+ path: string;
978
+ realm?: string | undefined;
979
+ };
980
+ name: string;
981
+ kind: "local";
982
+ }, {
983
+ params: {
984
+ path: string;
985
+ realm?: string | undefined;
986
+ };
987
+ name: string;
988
+ kind: "local";
989
+ }>, z.ZodObject<{
990
+ name: z.ZodString;
991
+ kind: z.ZodLiteral<"ldap">;
992
+ params: z.ZodObject<{
993
+ realm: z.ZodOptional<z.ZodString>;
994
+ servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
995
+ address: z.ZodString;
996
+ port: z.ZodOptional<z.ZodNumber>;
997
+ }, "strip", z.ZodTypeAny, {
998
+ address: string;
999
+ port?: number | undefined;
1000
+ }, {
1001
+ address: string;
1002
+ port?: number | undefined;
1003
+ }>, "many">>;
1004
+ bind_username: z.ZodOptional<z.ZodString>;
1005
+ bind_password: z.ZodOptional<z.ZodString>;
1006
+ search_base_dn: z.ZodOptional<z.ZodString>;
1007
+ search_user_filter: z.ZodOptional<z.ZodString>;
1008
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
1009
+ dn: z.ZodString;
1010
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1011
+ }, "strip", z.ZodTypeAny, {
1012
+ dn: string;
1013
+ roles?: string[] | undefined;
1014
+ }, {
1015
+ dn: string;
1016
+ roles?: string[] | undefined;
1017
+ }>, "many">>;
1018
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1019
+ realm: z.ZodOptional<z.ZodString>;
1020
+ servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
1021
+ address: z.ZodString;
1022
+ port: z.ZodOptional<z.ZodNumber>;
1023
+ }, "strip", z.ZodTypeAny, {
1024
+ address: string;
1025
+ port?: number | undefined;
1026
+ }, {
1027
+ address: string;
1028
+ port?: number | undefined;
1029
+ }>, "many">>;
1030
+ bind_username: z.ZodOptional<z.ZodString>;
1031
+ bind_password: z.ZodOptional<z.ZodString>;
1032
+ search_base_dn: z.ZodOptional<z.ZodString>;
1033
+ search_user_filter: z.ZodOptional<z.ZodString>;
1034
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
1035
+ dn: z.ZodString;
1036
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1037
+ }, "strip", z.ZodTypeAny, {
1038
+ dn: string;
1039
+ roles?: string[] | undefined;
1040
+ }, {
1041
+ dn: string;
1042
+ roles?: string[] | undefined;
1043
+ }>, "many">>;
1044
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1045
+ realm: z.ZodOptional<z.ZodString>;
1046
+ servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
1047
+ address: z.ZodString;
1048
+ port: z.ZodOptional<z.ZodNumber>;
1049
+ }, "strip", z.ZodTypeAny, {
1050
+ address: string;
1051
+ port?: number | undefined;
1052
+ }, {
1053
+ address: string;
1054
+ port?: number | undefined;
1055
+ }>, "many">>;
1056
+ bind_username: z.ZodOptional<z.ZodString>;
1057
+ bind_password: z.ZodOptional<z.ZodString>;
1058
+ search_base_dn: z.ZodOptional<z.ZodString>;
1059
+ search_user_filter: z.ZodOptional<z.ZodString>;
1060
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
1061
+ dn: z.ZodString;
1062
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1063
+ }, "strip", z.ZodTypeAny, {
1064
+ dn: string;
1065
+ roles?: string[] | undefined;
1066
+ }, {
1067
+ dn: string;
1068
+ roles?: string[] | undefined;
1069
+ }>, "many">>;
1070
+ }, z.ZodTypeAny, "passthrough">>;
1071
+ }, "strip", z.ZodTypeAny, {
1072
+ params: {
1073
+ servers?: {
1074
+ address: string;
1075
+ port?: number | undefined;
1076
+ }[] | undefined;
1077
+ realm?: string | undefined;
1078
+ bind_username?: string | undefined;
1079
+ bind_password?: string | undefined;
1080
+ search_base_dn?: string | undefined;
1081
+ search_user_filter?: string | undefined;
1082
+ groups?: {
1083
+ dn: string;
1084
+ roles?: string[] | undefined;
1085
+ }[] | undefined;
1086
+ } & {
1087
+ [k: string]: unknown;
1088
+ };
1089
+ name: string;
1090
+ kind: "ldap";
1091
+ }, {
1092
+ params: {
1093
+ servers?: {
1094
+ address: string;
1095
+ port?: number | undefined;
1096
+ }[] | undefined;
1097
+ realm?: string | undefined;
1098
+ bind_username?: string | undefined;
1099
+ bind_password?: string | undefined;
1100
+ search_base_dn?: string | undefined;
1101
+ search_user_filter?: string | undefined;
1102
+ groups?: {
1103
+ dn: string;
1104
+ roles?: string[] | undefined;
1105
+ }[] | undefined;
1106
+ } & {
1107
+ [k: string]: unknown;
1108
+ };
1109
+ name: string;
1110
+ kind: "ldap";
1111
+ }>]>, "many">>;
1112
+ identity_providers: z.ZodOptional<z.ZodArray<z.ZodObject<{
1113
+ name: z.ZodString;
1114
+ kind: z.ZodLiteral<"oauth">;
1115
+ params: z.ZodUnion<[z.ZodObject<{
1116
+ driver: z.ZodOptional<z.ZodString>;
1117
+ realm: z.ZodOptional<z.ZodString>;
1118
+ client_id: z.ZodOptional<z.ZodString>;
1119
+ client_secret: z.ZodOptional<z.ZodString>;
1120
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1121
+ authorization_url: z.ZodOptional<z.ZodString>;
1122
+ token_url: z.ZodOptional<z.ZodString>;
1123
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1124
+ driver: z.ZodOptional<z.ZodString>;
1125
+ realm: z.ZodOptional<z.ZodString>;
1126
+ client_id: z.ZodOptional<z.ZodString>;
1127
+ client_secret: z.ZodOptional<z.ZodString>;
1128
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1129
+ authorization_url: z.ZodOptional<z.ZodString>;
1130
+ token_url: z.ZodOptional<z.ZodString>;
1131
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1132
+ driver: z.ZodOptional<z.ZodString>;
1133
+ realm: z.ZodOptional<z.ZodString>;
1134
+ client_id: z.ZodOptional<z.ZodString>;
1135
+ client_secret: z.ZodOptional<z.ZodString>;
1136
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1137
+ authorization_url: z.ZodOptional<z.ZodString>;
1138
+ token_url: z.ZodOptional<z.ZodString>;
1139
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
1140
+ driver: z.ZodOptional<z.ZodString>;
1141
+ realm: z.ZodOptional<z.ZodString>;
1142
+ client_id: z.ZodOptional<z.ZodString>;
1143
+ client_secret: z.ZodOptional<z.ZodString>;
1144
+ metadata_url: z.ZodOptional<z.ZodString>;
1145
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1146
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1147
+ driver: z.ZodOptional<z.ZodString>;
1148
+ realm: z.ZodOptional<z.ZodString>;
1149
+ client_id: z.ZodOptional<z.ZodString>;
1150
+ client_secret: z.ZodOptional<z.ZodString>;
1151
+ metadata_url: z.ZodOptional<z.ZodString>;
1152
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1153
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1154
+ driver: z.ZodOptional<z.ZodString>;
1155
+ realm: z.ZodOptional<z.ZodString>;
1156
+ client_id: z.ZodOptional<z.ZodString>;
1157
+ client_secret: z.ZodOptional<z.ZodString>;
1158
+ metadata_url: z.ZodOptional<z.ZodString>;
1159
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1160
+ }, z.ZodTypeAny, "passthrough">>]>;
1161
+ }, "strip", z.ZodTypeAny, {
1162
+ params: z.objectOutputType<{
1163
+ driver: z.ZodOptional<z.ZodString>;
1164
+ realm: z.ZodOptional<z.ZodString>;
1165
+ client_id: z.ZodOptional<z.ZodString>;
1166
+ client_secret: z.ZodOptional<z.ZodString>;
1167
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1168
+ authorization_url: z.ZodOptional<z.ZodString>;
1169
+ token_url: z.ZodOptional<z.ZodString>;
1170
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
1171
+ driver: z.ZodOptional<z.ZodString>;
1172
+ realm: z.ZodOptional<z.ZodString>;
1173
+ client_id: z.ZodOptional<z.ZodString>;
1174
+ client_secret: z.ZodOptional<z.ZodString>;
1175
+ metadata_url: z.ZodOptional<z.ZodString>;
1176
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1177
+ }, z.ZodTypeAny, "passthrough">;
1178
+ name: string;
1179
+ kind: "oauth";
1180
+ }, {
1181
+ params: z.objectInputType<{
1182
+ driver: z.ZodOptional<z.ZodString>;
1183
+ realm: z.ZodOptional<z.ZodString>;
1184
+ client_id: z.ZodOptional<z.ZodString>;
1185
+ client_secret: z.ZodOptional<z.ZodString>;
1186
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1187
+ authorization_url: z.ZodOptional<z.ZodString>;
1188
+ token_url: z.ZodOptional<z.ZodString>;
1189
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
1190
+ driver: z.ZodOptional<z.ZodString>;
1191
+ realm: z.ZodOptional<z.ZodString>;
1192
+ client_id: z.ZodOptional<z.ZodString>;
1193
+ client_secret: z.ZodOptional<z.ZodString>;
1194
+ metadata_url: z.ZodOptional<z.ZodString>;
1195
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1196
+ }, z.ZodTypeAny, "passthrough">;
1197
+ name: string;
1198
+ kind: "oauth";
1199
+ }>, "many">>;
1200
+ }, "strip", z.ZodTypeAny, {
1201
+ identity_stores?: ({
1202
+ params: {
1203
+ path: string;
1204
+ realm?: string | undefined;
1205
+ };
1206
+ name: string;
1207
+ kind: "local";
1208
+ } | {
1209
+ params: {
1210
+ servers?: {
1211
+ address: string;
1212
+ port?: number | undefined;
1213
+ }[] | undefined;
1214
+ realm?: string | undefined;
1215
+ bind_username?: string | undefined;
1216
+ bind_password?: string | undefined;
1217
+ search_base_dn?: string | undefined;
1218
+ search_user_filter?: string | undefined;
1219
+ groups?: {
1220
+ dn: string;
1221
+ roles?: string[] | undefined;
1222
+ }[] | undefined;
1223
+ } & {
1224
+ [k: string]: unknown;
1225
+ };
1226
+ name: string;
1227
+ kind: "ldap";
1228
+ })[] | undefined;
1229
+ identity_providers?: {
1230
+ params: z.objectOutputType<{
1231
+ driver: z.ZodOptional<z.ZodString>;
1232
+ realm: z.ZodOptional<z.ZodString>;
1233
+ client_id: z.ZodOptional<z.ZodString>;
1234
+ client_secret: z.ZodOptional<z.ZodString>;
1235
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1236
+ authorization_url: z.ZodOptional<z.ZodString>;
1237
+ token_url: z.ZodOptional<z.ZodString>;
1238
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
1239
+ driver: z.ZodOptional<z.ZodString>;
1240
+ realm: z.ZodOptional<z.ZodString>;
1241
+ client_id: z.ZodOptional<z.ZodString>;
1242
+ client_secret: z.ZodOptional<z.ZodString>;
1243
+ metadata_url: z.ZodOptional<z.ZodString>;
1244
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1245
+ }, z.ZodTypeAny, "passthrough">;
1246
+ name: string;
1247
+ kind: "oauth";
1248
+ }[] | undefined;
1249
+ authentication_portals?: {
1250
+ name: string;
1251
+ ui?: {
1252
+ theme?: string | undefined;
1253
+ logo_url?: string | undefined;
1254
+ custom_css?: string | undefined;
1255
+ } | undefined;
1256
+ cookie_config?: {
1257
+ path?: string | undefined;
1258
+ domains?: Record<string, {
1259
+ lifetime?: number | undefined;
1260
+ insecure?: boolean | undefined;
1261
+ same_site?: string | undefined;
1262
+ }> | undefined;
1263
+ lifetime?: number | undefined;
1264
+ insecure?: boolean | undefined;
1265
+ same_site?: string | undefined;
1266
+ } | undefined;
1267
+ identity_stores?: string[] | undefined;
1268
+ identity_providers?: string[] | undefined;
1269
+ user_transformer_configs?: Record<string, unknown>[] | undefined;
1270
+ }[] | undefined;
1271
+ authorization_policies?: {
1272
+ name: string;
1273
+ access_list_rules?: {
1274
+ comment?: string | undefined;
1275
+ conditions?: string[] | undefined;
1276
+ action?: "allow" | "deny" | undefined;
1277
+ }[] | undefined;
1278
+ crypto_key_configs?: {
1279
+ source?: string | undefined;
1280
+ token_name?: string | undefined;
1281
+ }[] | undefined;
1282
+ bypass_configs?: {
1283
+ match_type: string;
1284
+ uri?: string | undefined;
1285
+ }[] | undefined;
1286
+ }[] | undefined;
1287
+ credentials?: {
1288
+ generic?: Record<string, unknown> | undefined;
1289
+ } | undefined;
1290
+ }, {
1291
+ identity_stores?: ({
1292
+ params: {
1293
+ path: string;
1294
+ realm?: string | undefined;
1295
+ };
1296
+ name: string;
1297
+ kind: "local";
1298
+ } | {
1299
+ params: {
1300
+ servers?: {
1301
+ address: string;
1302
+ port?: number | undefined;
1303
+ }[] | undefined;
1304
+ realm?: string | undefined;
1305
+ bind_username?: string | undefined;
1306
+ bind_password?: string | undefined;
1307
+ search_base_dn?: string | undefined;
1308
+ search_user_filter?: string | undefined;
1309
+ groups?: {
1310
+ dn: string;
1311
+ roles?: string[] | undefined;
1312
+ }[] | undefined;
1313
+ } & {
1314
+ [k: string]: unknown;
1315
+ };
1316
+ name: string;
1317
+ kind: "ldap";
1318
+ })[] | undefined;
1319
+ identity_providers?: {
1320
+ params: z.objectInputType<{
1321
+ driver: z.ZodOptional<z.ZodString>;
1322
+ realm: z.ZodOptional<z.ZodString>;
1323
+ client_id: z.ZodOptional<z.ZodString>;
1324
+ client_secret: z.ZodOptional<z.ZodString>;
1325
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1326
+ authorization_url: z.ZodOptional<z.ZodString>;
1327
+ token_url: z.ZodOptional<z.ZodString>;
1328
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
1329
+ driver: z.ZodOptional<z.ZodString>;
1330
+ realm: z.ZodOptional<z.ZodString>;
1331
+ client_id: z.ZodOptional<z.ZodString>;
1332
+ client_secret: z.ZodOptional<z.ZodString>;
1333
+ metadata_url: z.ZodOptional<z.ZodString>;
1334
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1335
+ }, z.ZodTypeAny, "passthrough">;
1336
+ name: string;
1337
+ kind: "oauth";
1338
+ }[] | undefined;
1339
+ authentication_portals?: {
1340
+ name: string;
1341
+ ui?: {
1342
+ theme?: string | undefined;
1343
+ logo_url?: string | undefined;
1344
+ custom_css?: string | undefined;
1345
+ } | undefined;
1346
+ cookie_config?: {
1347
+ path?: string | undefined;
1348
+ domains?: Record<string, {
1349
+ lifetime?: number | undefined;
1350
+ insecure?: boolean | undefined;
1351
+ same_site?: string | undefined;
1352
+ }> | undefined;
1353
+ lifetime?: number | undefined;
1354
+ insecure?: boolean | undefined;
1355
+ same_site?: string | undefined;
1356
+ } | undefined;
1357
+ identity_stores?: string[] | undefined;
1358
+ identity_providers?: string[] | undefined;
1359
+ user_transformer_configs?: Record<string, unknown>[] | undefined;
1360
+ }[] | undefined;
1361
+ authorization_policies?: {
1362
+ name: string;
1363
+ access_list_rules?: {
1364
+ comment?: string | undefined;
1365
+ conditions?: string[] | undefined;
1366
+ action?: "allow" | "deny" | undefined;
1367
+ }[] | undefined;
1368
+ crypto_key_configs?: {
1369
+ source?: string | undefined;
1370
+ token_name?: string | undefined;
1371
+ }[] | undefined;
1372
+ bypass_configs?: {
1373
+ match_type: string;
1374
+ uri?: string | undefined;
1375
+ }[] | undefined;
1376
+ }[] | undefined;
1377
+ credentials?: {
1378
+ generic?: Record<string, unknown> | undefined;
1379
+ } | undefined;
1380
+ }>;
1381
+ /**
1382
+ * Security app schema
1383
+ *
1384
+ * Validates the full security app at `/config/apps/security`
1385
+ *
1386
+ * @example
1387
+ * ```typescript
1388
+ * const securityApp = SecurityAppSchema.parse({
1389
+ * config: {
1390
+ * authentication_portals: [{
1391
+ * name: "myportal",
1392
+ * identity_stores: ["localdb"],
1393
+ * }],
1394
+ * },
1395
+ * });
1396
+ * ```
1397
+ */
1398
+ declare const SecurityAppSchema: z.ZodObject<{
1399
+ config: z.ZodOptional<z.ZodObject<{
1400
+ authentication_portals: z.ZodOptional<z.ZodArray<z.ZodObject<{
1401
+ name: z.ZodString;
1402
+ ui: z.ZodOptional<z.ZodObject<{
1403
+ theme: z.ZodOptional<z.ZodString>;
1404
+ logo_url: z.ZodOptional<z.ZodString>;
1405
+ custom_css: z.ZodOptional<z.ZodString>;
1406
+ }, "strip", z.ZodTypeAny, {
1407
+ theme?: string | undefined;
1408
+ logo_url?: string | undefined;
1409
+ custom_css?: string | undefined;
1410
+ }, {
1411
+ theme?: string | undefined;
1412
+ logo_url?: string | undefined;
1413
+ custom_css?: string | undefined;
1414
+ }>>;
1415
+ cookie_config: z.ZodOptional<z.ZodObject<{
1416
+ domains: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1417
+ lifetime: z.ZodOptional<z.ZodNumber>;
1418
+ insecure: z.ZodOptional<z.ZodBoolean>;
1419
+ same_site: z.ZodOptional<z.ZodString>;
1420
+ }, "strip", z.ZodTypeAny, {
1421
+ lifetime?: number | undefined;
1422
+ insecure?: boolean | undefined;
1423
+ same_site?: string | undefined;
1424
+ }, {
1425
+ lifetime?: number | undefined;
1426
+ insecure?: boolean | undefined;
1427
+ same_site?: string | undefined;
1428
+ }>>>;
1429
+ path: z.ZodOptional<z.ZodString>;
1430
+ lifetime: z.ZodOptional<z.ZodNumber>;
1431
+ insecure: z.ZodOptional<z.ZodBoolean>;
1432
+ same_site: z.ZodOptional<z.ZodString>;
1433
+ }, "strip", z.ZodTypeAny, {
1434
+ path?: string | undefined;
1435
+ domains?: Record<string, {
1436
+ lifetime?: number | undefined;
1437
+ insecure?: boolean | undefined;
1438
+ same_site?: string | undefined;
1439
+ }> | undefined;
1440
+ lifetime?: number | undefined;
1441
+ insecure?: boolean | undefined;
1442
+ same_site?: string | undefined;
1443
+ }, {
1444
+ path?: string | undefined;
1445
+ domains?: Record<string, {
1446
+ lifetime?: number | undefined;
1447
+ insecure?: boolean | undefined;
1448
+ same_site?: string | undefined;
1449
+ }> | undefined;
1450
+ lifetime?: number | undefined;
1451
+ insecure?: boolean | undefined;
1452
+ same_site?: string | undefined;
1453
+ }>>;
1454
+ identity_stores: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1455
+ identity_providers: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1456
+ user_transformer_configs: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
1457
+ }, "strip", z.ZodTypeAny, {
1458
+ name: string;
1459
+ ui?: {
1460
+ theme?: string | undefined;
1461
+ logo_url?: string | undefined;
1462
+ custom_css?: string | undefined;
1463
+ } | undefined;
1464
+ cookie_config?: {
1465
+ path?: string | undefined;
1466
+ domains?: Record<string, {
1467
+ lifetime?: number | undefined;
1468
+ insecure?: boolean | undefined;
1469
+ same_site?: string | undefined;
1470
+ }> | undefined;
1471
+ lifetime?: number | undefined;
1472
+ insecure?: boolean | undefined;
1473
+ same_site?: string | undefined;
1474
+ } | undefined;
1475
+ identity_stores?: string[] | undefined;
1476
+ identity_providers?: string[] | undefined;
1477
+ user_transformer_configs?: Record<string, unknown>[] | undefined;
1478
+ }, {
1479
+ name: string;
1480
+ ui?: {
1481
+ theme?: string | undefined;
1482
+ logo_url?: string | undefined;
1483
+ custom_css?: string | undefined;
1484
+ } | undefined;
1485
+ cookie_config?: {
1486
+ path?: string | undefined;
1487
+ domains?: Record<string, {
1488
+ lifetime?: number | undefined;
1489
+ insecure?: boolean | undefined;
1490
+ same_site?: string | undefined;
1491
+ }> | undefined;
1492
+ lifetime?: number | undefined;
1493
+ insecure?: boolean | undefined;
1494
+ same_site?: string | undefined;
1495
+ } | undefined;
1496
+ identity_stores?: string[] | undefined;
1497
+ identity_providers?: string[] | undefined;
1498
+ user_transformer_configs?: Record<string, unknown>[] | undefined;
1499
+ }>, "many">>;
1500
+ authorization_policies: z.ZodOptional<z.ZodArray<z.ZodObject<{
1501
+ name: z.ZodString;
1502
+ access_list_rules: z.ZodOptional<z.ZodArray<z.ZodObject<{
1503
+ comment: z.ZodOptional<z.ZodString>;
1504
+ conditions: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1505
+ action: z.ZodOptional<z.ZodEnum<["allow", "deny"]>>;
1506
+ }, "strip", z.ZodTypeAny, {
1507
+ comment?: string | undefined;
1508
+ conditions?: string[] | undefined;
1509
+ action?: "allow" | "deny" | undefined;
1510
+ }, {
1511
+ comment?: string | undefined;
1512
+ conditions?: string[] | undefined;
1513
+ action?: "allow" | "deny" | undefined;
1514
+ }>, "many">>;
1515
+ crypto_key_configs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1516
+ token_name: z.ZodOptional<z.ZodString>;
1517
+ source: z.ZodOptional<z.ZodString>;
1518
+ }, "strip", z.ZodTypeAny, {
1519
+ source?: string | undefined;
1520
+ token_name?: string | undefined;
1521
+ }, {
1522
+ source?: string | undefined;
1523
+ token_name?: string | undefined;
1524
+ }>, "many">>;
1525
+ bypass_configs: z.ZodOptional<z.ZodArray<z.ZodObject<{
1526
+ match_type: z.ZodString;
1527
+ uri: z.ZodOptional<z.ZodString>;
1528
+ }, "strip", z.ZodTypeAny, {
1529
+ match_type: string;
1530
+ uri?: string | undefined;
1531
+ }, {
1532
+ match_type: string;
1533
+ uri?: string | undefined;
1534
+ }>, "many">>;
1535
+ }, "strip", z.ZodTypeAny, {
1536
+ name: string;
1537
+ access_list_rules?: {
1538
+ comment?: string | undefined;
1539
+ conditions?: string[] | undefined;
1540
+ action?: "allow" | "deny" | undefined;
1541
+ }[] | undefined;
1542
+ crypto_key_configs?: {
1543
+ source?: string | undefined;
1544
+ token_name?: string | undefined;
1545
+ }[] | undefined;
1546
+ bypass_configs?: {
1547
+ match_type: string;
1548
+ uri?: string | undefined;
1549
+ }[] | undefined;
1550
+ }, {
1551
+ name: string;
1552
+ access_list_rules?: {
1553
+ comment?: string | undefined;
1554
+ conditions?: string[] | undefined;
1555
+ action?: "allow" | "deny" | undefined;
1556
+ }[] | undefined;
1557
+ crypto_key_configs?: {
1558
+ source?: string | undefined;
1559
+ token_name?: string | undefined;
1560
+ }[] | undefined;
1561
+ bypass_configs?: {
1562
+ match_type: string;
1563
+ uri?: string | undefined;
1564
+ }[] | undefined;
1565
+ }>, "many">>;
1566
+ credentials: z.ZodOptional<z.ZodObject<{
1567
+ generic: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1568
+ }, "strip", z.ZodTypeAny, {
1569
+ generic?: Record<string, unknown> | undefined;
1570
+ }, {
1571
+ generic?: Record<string, unknown> | undefined;
1572
+ }>>;
1573
+ identity_stores: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1574
+ name: z.ZodString;
1575
+ kind: z.ZodLiteral<"local">;
1576
+ params: z.ZodObject<{
1577
+ realm: z.ZodOptional<z.ZodString>;
1578
+ path: z.ZodString;
1579
+ }, "strip", z.ZodTypeAny, {
1580
+ path: string;
1581
+ realm?: string | undefined;
1582
+ }, {
1583
+ path: string;
1584
+ realm?: string | undefined;
1585
+ }>;
1586
+ }, "strip", z.ZodTypeAny, {
1587
+ params: {
1588
+ path: string;
1589
+ realm?: string | undefined;
1590
+ };
1591
+ name: string;
1592
+ kind: "local";
1593
+ }, {
1594
+ params: {
1595
+ path: string;
1596
+ realm?: string | undefined;
1597
+ };
1598
+ name: string;
1599
+ kind: "local";
1600
+ }>, z.ZodObject<{
1601
+ name: z.ZodString;
1602
+ kind: z.ZodLiteral<"ldap">;
1603
+ params: z.ZodObject<{
1604
+ realm: z.ZodOptional<z.ZodString>;
1605
+ servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
1606
+ address: z.ZodString;
1607
+ port: z.ZodOptional<z.ZodNumber>;
1608
+ }, "strip", z.ZodTypeAny, {
1609
+ address: string;
1610
+ port?: number | undefined;
1611
+ }, {
1612
+ address: string;
1613
+ port?: number | undefined;
1614
+ }>, "many">>;
1615
+ bind_username: z.ZodOptional<z.ZodString>;
1616
+ bind_password: z.ZodOptional<z.ZodString>;
1617
+ search_base_dn: z.ZodOptional<z.ZodString>;
1618
+ search_user_filter: z.ZodOptional<z.ZodString>;
1619
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
1620
+ dn: z.ZodString;
1621
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1622
+ }, "strip", z.ZodTypeAny, {
1623
+ dn: string;
1624
+ roles?: string[] | undefined;
1625
+ }, {
1626
+ dn: string;
1627
+ roles?: string[] | undefined;
1628
+ }>, "many">>;
1629
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1630
+ realm: z.ZodOptional<z.ZodString>;
1631
+ servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
1632
+ address: z.ZodString;
1633
+ port: z.ZodOptional<z.ZodNumber>;
1634
+ }, "strip", z.ZodTypeAny, {
1635
+ address: string;
1636
+ port?: number | undefined;
1637
+ }, {
1638
+ address: string;
1639
+ port?: number | undefined;
1640
+ }>, "many">>;
1641
+ bind_username: z.ZodOptional<z.ZodString>;
1642
+ bind_password: z.ZodOptional<z.ZodString>;
1643
+ search_base_dn: z.ZodOptional<z.ZodString>;
1644
+ search_user_filter: z.ZodOptional<z.ZodString>;
1645
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
1646
+ dn: z.ZodString;
1647
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1648
+ }, "strip", z.ZodTypeAny, {
1649
+ dn: string;
1650
+ roles?: string[] | undefined;
1651
+ }, {
1652
+ dn: string;
1653
+ roles?: string[] | undefined;
1654
+ }>, "many">>;
1655
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1656
+ realm: z.ZodOptional<z.ZodString>;
1657
+ servers: z.ZodOptional<z.ZodArray<z.ZodObject<{
1658
+ address: z.ZodString;
1659
+ port: z.ZodOptional<z.ZodNumber>;
1660
+ }, "strip", z.ZodTypeAny, {
1661
+ address: string;
1662
+ port?: number | undefined;
1663
+ }, {
1664
+ address: string;
1665
+ port?: number | undefined;
1666
+ }>, "many">>;
1667
+ bind_username: z.ZodOptional<z.ZodString>;
1668
+ bind_password: z.ZodOptional<z.ZodString>;
1669
+ search_base_dn: z.ZodOptional<z.ZodString>;
1670
+ search_user_filter: z.ZodOptional<z.ZodString>;
1671
+ groups: z.ZodOptional<z.ZodArray<z.ZodObject<{
1672
+ dn: z.ZodString;
1673
+ roles: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1674
+ }, "strip", z.ZodTypeAny, {
1675
+ dn: string;
1676
+ roles?: string[] | undefined;
1677
+ }, {
1678
+ dn: string;
1679
+ roles?: string[] | undefined;
1680
+ }>, "many">>;
1681
+ }, z.ZodTypeAny, "passthrough">>;
1682
+ }, "strip", z.ZodTypeAny, {
1683
+ params: {
1684
+ servers?: {
1685
+ address: string;
1686
+ port?: number | undefined;
1687
+ }[] | undefined;
1688
+ realm?: string | undefined;
1689
+ bind_username?: string | undefined;
1690
+ bind_password?: string | undefined;
1691
+ search_base_dn?: string | undefined;
1692
+ search_user_filter?: string | undefined;
1693
+ groups?: {
1694
+ dn: string;
1695
+ roles?: string[] | undefined;
1696
+ }[] | undefined;
1697
+ } & {
1698
+ [k: string]: unknown;
1699
+ };
1700
+ name: string;
1701
+ kind: "ldap";
1702
+ }, {
1703
+ params: {
1704
+ servers?: {
1705
+ address: string;
1706
+ port?: number | undefined;
1707
+ }[] | undefined;
1708
+ realm?: string | undefined;
1709
+ bind_username?: string | undefined;
1710
+ bind_password?: string | undefined;
1711
+ search_base_dn?: string | undefined;
1712
+ search_user_filter?: string | undefined;
1713
+ groups?: {
1714
+ dn: string;
1715
+ roles?: string[] | undefined;
1716
+ }[] | undefined;
1717
+ } & {
1718
+ [k: string]: unknown;
1719
+ };
1720
+ name: string;
1721
+ kind: "ldap";
1722
+ }>]>, "many">>;
1723
+ identity_providers: z.ZodOptional<z.ZodArray<z.ZodObject<{
1724
+ name: z.ZodString;
1725
+ kind: z.ZodLiteral<"oauth">;
1726
+ params: z.ZodUnion<[z.ZodObject<{
1727
+ driver: z.ZodOptional<z.ZodString>;
1728
+ realm: z.ZodOptional<z.ZodString>;
1729
+ client_id: z.ZodOptional<z.ZodString>;
1730
+ client_secret: z.ZodOptional<z.ZodString>;
1731
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1732
+ authorization_url: z.ZodOptional<z.ZodString>;
1733
+ token_url: z.ZodOptional<z.ZodString>;
1734
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1735
+ driver: z.ZodOptional<z.ZodString>;
1736
+ realm: z.ZodOptional<z.ZodString>;
1737
+ client_id: z.ZodOptional<z.ZodString>;
1738
+ client_secret: z.ZodOptional<z.ZodString>;
1739
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1740
+ authorization_url: z.ZodOptional<z.ZodString>;
1741
+ token_url: z.ZodOptional<z.ZodString>;
1742
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1743
+ driver: z.ZodOptional<z.ZodString>;
1744
+ realm: z.ZodOptional<z.ZodString>;
1745
+ client_id: z.ZodOptional<z.ZodString>;
1746
+ client_secret: z.ZodOptional<z.ZodString>;
1747
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1748
+ authorization_url: z.ZodOptional<z.ZodString>;
1749
+ token_url: z.ZodOptional<z.ZodString>;
1750
+ }, z.ZodTypeAny, "passthrough">>, z.ZodObject<{
1751
+ driver: z.ZodOptional<z.ZodString>;
1752
+ realm: z.ZodOptional<z.ZodString>;
1753
+ client_id: z.ZodOptional<z.ZodString>;
1754
+ client_secret: z.ZodOptional<z.ZodString>;
1755
+ metadata_url: z.ZodOptional<z.ZodString>;
1756
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1757
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1758
+ driver: z.ZodOptional<z.ZodString>;
1759
+ realm: z.ZodOptional<z.ZodString>;
1760
+ client_id: z.ZodOptional<z.ZodString>;
1761
+ client_secret: z.ZodOptional<z.ZodString>;
1762
+ metadata_url: z.ZodOptional<z.ZodString>;
1763
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1764
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1765
+ driver: z.ZodOptional<z.ZodString>;
1766
+ realm: z.ZodOptional<z.ZodString>;
1767
+ client_id: z.ZodOptional<z.ZodString>;
1768
+ client_secret: z.ZodOptional<z.ZodString>;
1769
+ metadata_url: z.ZodOptional<z.ZodString>;
1770
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1771
+ }, z.ZodTypeAny, "passthrough">>]>;
1772
+ }, "strip", z.ZodTypeAny, {
1773
+ params: z.objectOutputType<{
1774
+ driver: z.ZodOptional<z.ZodString>;
1775
+ realm: z.ZodOptional<z.ZodString>;
1776
+ client_id: z.ZodOptional<z.ZodString>;
1777
+ client_secret: z.ZodOptional<z.ZodString>;
1778
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1779
+ authorization_url: z.ZodOptional<z.ZodString>;
1780
+ token_url: z.ZodOptional<z.ZodString>;
1781
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
1782
+ driver: z.ZodOptional<z.ZodString>;
1783
+ realm: z.ZodOptional<z.ZodString>;
1784
+ client_id: z.ZodOptional<z.ZodString>;
1785
+ client_secret: z.ZodOptional<z.ZodString>;
1786
+ metadata_url: z.ZodOptional<z.ZodString>;
1787
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1788
+ }, z.ZodTypeAny, "passthrough">;
1789
+ name: string;
1790
+ kind: "oauth";
1791
+ }, {
1792
+ params: z.objectInputType<{
1793
+ driver: z.ZodOptional<z.ZodString>;
1794
+ realm: z.ZodOptional<z.ZodString>;
1795
+ client_id: z.ZodOptional<z.ZodString>;
1796
+ client_secret: z.ZodOptional<z.ZodString>;
1797
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1798
+ authorization_url: z.ZodOptional<z.ZodString>;
1799
+ token_url: z.ZodOptional<z.ZodString>;
1800
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
1801
+ driver: z.ZodOptional<z.ZodString>;
1802
+ realm: z.ZodOptional<z.ZodString>;
1803
+ client_id: z.ZodOptional<z.ZodString>;
1804
+ client_secret: z.ZodOptional<z.ZodString>;
1805
+ metadata_url: z.ZodOptional<z.ZodString>;
1806
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1807
+ }, z.ZodTypeAny, "passthrough">;
1808
+ name: string;
1809
+ kind: "oauth";
1810
+ }>, "many">>;
1811
+ }, "strip", z.ZodTypeAny, {
1812
+ identity_stores?: ({
1813
+ params: {
1814
+ path: string;
1815
+ realm?: string | undefined;
1816
+ };
1817
+ name: string;
1818
+ kind: "local";
1819
+ } | {
1820
+ params: {
1821
+ servers?: {
1822
+ address: string;
1823
+ port?: number | undefined;
1824
+ }[] | undefined;
1825
+ realm?: string | undefined;
1826
+ bind_username?: string | undefined;
1827
+ bind_password?: string | undefined;
1828
+ search_base_dn?: string | undefined;
1829
+ search_user_filter?: string | undefined;
1830
+ groups?: {
1831
+ dn: string;
1832
+ roles?: string[] | undefined;
1833
+ }[] | undefined;
1834
+ } & {
1835
+ [k: string]: unknown;
1836
+ };
1837
+ name: string;
1838
+ kind: "ldap";
1839
+ })[] | undefined;
1840
+ identity_providers?: {
1841
+ params: z.objectOutputType<{
1842
+ driver: z.ZodOptional<z.ZodString>;
1843
+ realm: z.ZodOptional<z.ZodString>;
1844
+ client_id: z.ZodOptional<z.ZodString>;
1845
+ client_secret: z.ZodOptional<z.ZodString>;
1846
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1847
+ authorization_url: z.ZodOptional<z.ZodString>;
1848
+ token_url: z.ZodOptional<z.ZodString>;
1849
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
1850
+ driver: z.ZodOptional<z.ZodString>;
1851
+ realm: z.ZodOptional<z.ZodString>;
1852
+ client_id: z.ZodOptional<z.ZodString>;
1853
+ client_secret: z.ZodOptional<z.ZodString>;
1854
+ metadata_url: z.ZodOptional<z.ZodString>;
1855
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1856
+ }, z.ZodTypeAny, "passthrough">;
1857
+ name: string;
1858
+ kind: "oauth";
1859
+ }[] | undefined;
1860
+ authentication_portals?: {
1861
+ name: string;
1862
+ ui?: {
1863
+ theme?: string | undefined;
1864
+ logo_url?: string | undefined;
1865
+ custom_css?: string | undefined;
1866
+ } | undefined;
1867
+ cookie_config?: {
1868
+ path?: string | undefined;
1869
+ domains?: Record<string, {
1870
+ lifetime?: number | undefined;
1871
+ insecure?: boolean | undefined;
1872
+ same_site?: string | undefined;
1873
+ }> | undefined;
1874
+ lifetime?: number | undefined;
1875
+ insecure?: boolean | undefined;
1876
+ same_site?: string | undefined;
1877
+ } | undefined;
1878
+ identity_stores?: string[] | undefined;
1879
+ identity_providers?: string[] | undefined;
1880
+ user_transformer_configs?: Record<string, unknown>[] | undefined;
1881
+ }[] | undefined;
1882
+ authorization_policies?: {
1883
+ name: string;
1884
+ access_list_rules?: {
1885
+ comment?: string | undefined;
1886
+ conditions?: string[] | undefined;
1887
+ action?: "allow" | "deny" | undefined;
1888
+ }[] | undefined;
1889
+ crypto_key_configs?: {
1890
+ source?: string | undefined;
1891
+ token_name?: string | undefined;
1892
+ }[] | undefined;
1893
+ bypass_configs?: {
1894
+ match_type: string;
1895
+ uri?: string | undefined;
1896
+ }[] | undefined;
1897
+ }[] | undefined;
1898
+ credentials?: {
1899
+ generic?: Record<string, unknown> | undefined;
1900
+ } | undefined;
1901
+ }, {
1902
+ identity_stores?: ({
1903
+ params: {
1904
+ path: string;
1905
+ realm?: string | undefined;
1906
+ };
1907
+ name: string;
1908
+ kind: "local";
1909
+ } | {
1910
+ params: {
1911
+ servers?: {
1912
+ address: string;
1913
+ port?: number | undefined;
1914
+ }[] | undefined;
1915
+ realm?: string | undefined;
1916
+ bind_username?: string | undefined;
1917
+ bind_password?: string | undefined;
1918
+ search_base_dn?: string | undefined;
1919
+ search_user_filter?: string | undefined;
1920
+ groups?: {
1921
+ dn: string;
1922
+ roles?: string[] | undefined;
1923
+ }[] | undefined;
1924
+ } & {
1925
+ [k: string]: unknown;
1926
+ };
1927
+ name: string;
1928
+ kind: "ldap";
1929
+ })[] | undefined;
1930
+ identity_providers?: {
1931
+ params: z.objectInputType<{
1932
+ driver: z.ZodOptional<z.ZodString>;
1933
+ realm: z.ZodOptional<z.ZodString>;
1934
+ client_id: z.ZodOptional<z.ZodString>;
1935
+ client_secret: z.ZodOptional<z.ZodString>;
1936
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1937
+ authorization_url: z.ZodOptional<z.ZodString>;
1938
+ token_url: z.ZodOptional<z.ZodString>;
1939
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
1940
+ driver: z.ZodOptional<z.ZodString>;
1941
+ realm: z.ZodOptional<z.ZodString>;
1942
+ client_id: z.ZodOptional<z.ZodString>;
1943
+ client_secret: z.ZodOptional<z.ZodString>;
1944
+ metadata_url: z.ZodOptional<z.ZodString>;
1945
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1946
+ }, z.ZodTypeAny, "passthrough">;
1947
+ name: string;
1948
+ kind: "oauth";
1949
+ }[] | undefined;
1950
+ authentication_portals?: {
1951
+ name: string;
1952
+ ui?: {
1953
+ theme?: string | undefined;
1954
+ logo_url?: string | undefined;
1955
+ custom_css?: string | undefined;
1956
+ } | undefined;
1957
+ cookie_config?: {
1958
+ path?: string | undefined;
1959
+ domains?: Record<string, {
1960
+ lifetime?: number | undefined;
1961
+ insecure?: boolean | undefined;
1962
+ same_site?: string | undefined;
1963
+ }> | undefined;
1964
+ lifetime?: number | undefined;
1965
+ insecure?: boolean | undefined;
1966
+ same_site?: string | undefined;
1967
+ } | undefined;
1968
+ identity_stores?: string[] | undefined;
1969
+ identity_providers?: string[] | undefined;
1970
+ user_transformer_configs?: Record<string, unknown>[] | undefined;
1971
+ }[] | undefined;
1972
+ authorization_policies?: {
1973
+ name: string;
1974
+ access_list_rules?: {
1975
+ comment?: string | undefined;
1976
+ conditions?: string[] | undefined;
1977
+ action?: "allow" | "deny" | undefined;
1978
+ }[] | undefined;
1979
+ crypto_key_configs?: {
1980
+ source?: string | undefined;
1981
+ token_name?: string | undefined;
1982
+ }[] | undefined;
1983
+ bypass_configs?: {
1984
+ match_type: string;
1985
+ uri?: string | undefined;
1986
+ }[] | undefined;
1987
+ }[] | undefined;
1988
+ credentials?: {
1989
+ generic?: Record<string, unknown> | undefined;
1990
+ } | undefined;
1991
+ }>>;
1992
+ secrets_managers: z.ZodOptional<z.ZodArray<z.ZodObject<{
1993
+ driver: z.ZodString;
1994
+ }, "passthrough", z.ZodTypeAny, z.objectOutputType<{
1995
+ driver: z.ZodString;
1996
+ }, z.ZodTypeAny, "passthrough">, z.objectInputType<{
1997
+ driver: z.ZodString;
1998
+ }, z.ZodTypeAny, "passthrough">>, "many">>;
1999
+ }, "strip", z.ZodTypeAny, {
2000
+ config?: {
2001
+ identity_stores?: ({
2002
+ params: {
2003
+ path: string;
2004
+ realm?: string | undefined;
2005
+ };
2006
+ name: string;
2007
+ kind: "local";
2008
+ } | {
2009
+ params: {
2010
+ servers?: {
2011
+ address: string;
2012
+ port?: number | undefined;
2013
+ }[] | undefined;
2014
+ realm?: string | undefined;
2015
+ bind_username?: string | undefined;
2016
+ bind_password?: string | undefined;
2017
+ search_base_dn?: string | undefined;
2018
+ search_user_filter?: string | undefined;
2019
+ groups?: {
2020
+ dn: string;
2021
+ roles?: string[] | undefined;
2022
+ }[] | undefined;
2023
+ } & {
2024
+ [k: string]: unknown;
2025
+ };
2026
+ name: string;
2027
+ kind: "ldap";
2028
+ })[] | undefined;
2029
+ identity_providers?: {
2030
+ params: z.objectOutputType<{
2031
+ driver: z.ZodOptional<z.ZodString>;
2032
+ realm: z.ZodOptional<z.ZodString>;
2033
+ client_id: z.ZodOptional<z.ZodString>;
2034
+ client_secret: z.ZodOptional<z.ZodString>;
2035
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2036
+ authorization_url: z.ZodOptional<z.ZodString>;
2037
+ token_url: z.ZodOptional<z.ZodString>;
2038
+ }, z.ZodTypeAny, "passthrough"> | z.objectOutputType<{
2039
+ driver: z.ZodOptional<z.ZodString>;
2040
+ realm: z.ZodOptional<z.ZodString>;
2041
+ client_id: z.ZodOptional<z.ZodString>;
2042
+ client_secret: z.ZodOptional<z.ZodString>;
2043
+ metadata_url: z.ZodOptional<z.ZodString>;
2044
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2045
+ }, z.ZodTypeAny, "passthrough">;
2046
+ name: string;
2047
+ kind: "oauth";
2048
+ }[] | undefined;
2049
+ authentication_portals?: {
2050
+ name: string;
2051
+ ui?: {
2052
+ theme?: string | undefined;
2053
+ logo_url?: string | undefined;
2054
+ custom_css?: string | undefined;
2055
+ } | undefined;
2056
+ cookie_config?: {
2057
+ path?: string | undefined;
2058
+ domains?: Record<string, {
2059
+ lifetime?: number | undefined;
2060
+ insecure?: boolean | undefined;
2061
+ same_site?: string | undefined;
2062
+ }> | undefined;
2063
+ lifetime?: number | undefined;
2064
+ insecure?: boolean | undefined;
2065
+ same_site?: string | undefined;
2066
+ } | undefined;
2067
+ identity_stores?: string[] | undefined;
2068
+ identity_providers?: string[] | undefined;
2069
+ user_transformer_configs?: Record<string, unknown>[] | undefined;
2070
+ }[] | undefined;
2071
+ authorization_policies?: {
2072
+ name: string;
2073
+ access_list_rules?: {
2074
+ comment?: string | undefined;
2075
+ conditions?: string[] | undefined;
2076
+ action?: "allow" | "deny" | undefined;
2077
+ }[] | undefined;
2078
+ crypto_key_configs?: {
2079
+ source?: string | undefined;
2080
+ token_name?: string | undefined;
2081
+ }[] | undefined;
2082
+ bypass_configs?: {
2083
+ match_type: string;
2084
+ uri?: string | undefined;
2085
+ }[] | undefined;
2086
+ }[] | undefined;
2087
+ credentials?: {
2088
+ generic?: Record<string, unknown> | undefined;
2089
+ } | undefined;
2090
+ } | undefined;
2091
+ secrets_managers?: z.objectOutputType<{
2092
+ driver: z.ZodString;
2093
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
2094
+ }, {
2095
+ config?: {
2096
+ identity_stores?: ({
2097
+ params: {
2098
+ path: string;
2099
+ realm?: string | undefined;
2100
+ };
2101
+ name: string;
2102
+ kind: "local";
2103
+ } | {
2104
+ params: {
2105
+ servers?: {
2106
+ address: string;
2107
+ port?: number | undefined;
2108
+ }[] | undefined;
2109
+ realm?: string | undefined;
2110
+ bind_username?: string | undefined;
2111
+ bind_password?: string | undefined;
2112
+ search_base_dn?: string | undefined;
2113
+ search_user_filter?: string | undefined;
2114
+ groups?: {
2115
+ dn: string;
2116
+ roles?: string[] | undefined;
2117
+ }[] | undefined;
2118
+ } & {
2119
+ [k: string]: unknown;
2120
+ };
2121
+ name: string;
2122
+ kind: "ldap";
2123
+ })[] | undefined;
2124
+ identity_providers?: {
2125
+ params: z.objectInputType<{
2126
+ driver: z.ZodOptional<z.ZodString>;
2127
+ realm: z.ZodOptional<z.ZodString>;
2128
+ client_id: z.ZodOptional<z.ZodString>;
2129
+ client_secret: z.ZodOptional<z.ZodString>;
2130
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2131
+ authorization_url: z.ZodOptional<z.ZodString>;
2132
+ token_url: z.ZodOptional<z.ZodString>;
2133
+ }, z.ZodTypeAny, "passthrough"> | z.objectInputType<{
2134
+ driver: z.ZodOptional<z.ZodString>;
2135
+ realm: z.ZodOptional<z.ZodString>;
2136
+ client_id: z.ZodOptional<z.ZodString>;
2137
+ client_secret: z.ZodOptional<z.ZodString>;
2138
+ metadata_url: z.ZodOptional<z.ZodString>;
2139
+ scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2140
+ }, z.ZodTypeAny, "passthrough">;
2141
+ name: string;
2142
+ kind: "oauth";
2143
+ }[] | undefined;
2144
+ authentication_portals?: {
2145
+ name: string;
2146
+ ui?: {
2147
+ theme?: string | undefined;
2148
+ logo_url?: string | undefined;
2149
+ custom_css?: string | undefined;
2150
+ } | undefined;
2151
+ cookie_config?: {
2152
+ path?: string | undefined;
2153
+ domains?: Record<string, {
2154
+ lifetime?: number | undefined;
2155
+ insecure?: boolean | undefined;
2156
+ same_site?: string | undefined;
2157
+ }> | undefined;
2158
+ lifetime?: number | undefined;
2159
+ insecure?: boolean | undefined;
2160
+ same_site?: string | undefined;
2161
+ } | undefined;
2162
+ identity_stores?: string[] | undefined;
2163
+ identity_providers?: string[] | undefined;
2164
+ user_transformer_configs?: Record<string, unknown>[] | undefined;
2165
+ }[] | undefined;
2166
+ authorization_policies?: {
2167
+ name: string;
2168
+ access_list_rules?: {
2169
+ comment?: string | undefined;
2170
+ conditions?: string[] | undefined;
2171
+ action?: "allow" | "deny" | undefined;
2172
+ }[] | undefined;
2173
+ crypto_key_configs?: {
2174
+ source?: string | undefined;
2175
+ token_name?: string | undefined;
2176
+ }[] | undefined;
2177
+ bypass_configs?: {
2178
+ match_type: string;
2179
+ uri?: string | undefined;
2180
+ }[] | undefined;
2181
+ }[] | undefined;
2182
+ credentials?: {
2183
+ generic?: Record<string, unknown> | undefined;
2184
+ } | undefined;
2185
+ } | undefined;
2186
+ secrets_managers?: z.objectInputType<{
2187
+ driver: z.ZodString;
2188
+ }, z.ZodTypeAny, "passthrough">[] | undefined;
2189
+ }>;
2190
+ type SecurityAuthenticatorHandler = z.infer<typeof SecurityAuthenticatorHandlerSchema>;
2191
+ type SecurityAuthorizationHandler = z.infer<typeof SecurityAuthorizationHandlerSchema>;
2192
+ type LocalIdentityStore = z.infer<typeof LocalIdentityStoreSchema>;
2193
+ type LdapIdentityStore = z.infer<typeof LdapIdentityStoreSchema>;
2194
+ type OAuth2IdentityProvider = z.infer<typeof OAuth2IdentityProviderSchema>;
2195
+ type OidcIdentityProvider = z.infer<typeof OidcIdentityProviderSchema>;
2196
+ type AuthenticationPortal = z.infer<typeof AuthenticationPortalSchema>;
2197
+ type AuthorizationPolicy = z.infer<typeof AuthorizationPolicySchema>;
2198
+ type SecurityConfig = z.infer<typeof SecurityConfigSchema>;
2199
+ type SecurityApp = z.infer<typeof SecurityAppSchema>;
2200
+
2201
+ /**
2202
+ * Options for building a local identity store
2203
+ */
2204
+ interface BuildLocalIdentityStoreOptions {
2205
+ /**
2206
+ * Name of the identity store (used to reference it in portals)
2207
+ * @default "local"
2208
+ */
2209
+ name?: string;
2210
+ /**
2211
+ * Path to the JSON file containing user credentials
2212
+ */
2213
+ path: string;
2214
+ /**
2215
+ * Realm name for this identity store
2216
+ * @default "local"
2217
+ */
2218
+ realm?: string;
2219
+ }
2220
+ /**
2221
+ * Build a local identity store configuration
2222
+ *
2223
+ * Creates a local JSON file-based identity store for user credentials.
2224
+ * Uses the authcrunch wrapper structure: name, kind, params
2225
+ *
2226
+ * @param options - Store options
2227
+ * @returns Validated local identity store configuration
2228
+ *
2229
+ * @example
2230
+ * ```typescript
2231
+ * import { buildLocalIdentityStore } from "@.../caddy-api-client/plugins/caddy-security";
2232
+ *
2233
+ * const store = buildLocalIdentityStore({
2234
+ * name: "localdb",
2235
+ * path: "/etc/caddy/users.json",
2236
+ * realm: "local",
2237
+ * });
2238
+ * ```
2239
+ */
2240
+ declare function buildLocalIdentityStore(options: BuildLocalIdentityStoreOptions): LocalIdentityStore;
2241
+ /**
2242
+ * LDAP server configuration
2243
+ */
2244
+ interface LdapServerConfig {
2245
+ /**
2246
+ * LDAP server address
2247
+ */
2248
+ address: string;
2249
+ /**
2250
+ * LDAP server port
2251
+ * @default 389
2252
+ */
2253
+ port?: number;
2254
+ }
2255
+ /**
2256
+ * LDAP group to role mapping
2257
+ */
2258
+ interface LdapGroupConfig {
2259
+ /**
2260
+ * LDAP group DN
2261
+ * @example "CN=Admins,OU=Groups,DC=example,DC=com"
2262
+ */
2263
+ groupDn?: string;
2264
+ /**
2265
+ * Roles to assign when user is member of this group
2266
+ */
2267
+ roles?: string[];
2268
+ }
2269
+ /**
2270
+ * Options for building an LDAP identity store
2271
+ */
2272
+ interface BuildLdapIdentityStoreOptions {
2273
+ /**
2274
+ * Name of the identity store (used to reference it in portals)
2275
+ * @default "ldapdb"
2276
+ */
2277
+ name?: string;
2278
+ /**
2279
+ * Realm name for this identity store
2280
+ * @default "ldap"
2281
+ */
2282
+ realm?: string;
2283
+ /**
2284
+ * LDAP server(s) to connect to
2285
+ */
2286
+ servers: LdapServerConfig[];
2287
+ /**
2288
+ * Bind username for LDAP queries (full DN)
2289
+ * @example "cn=admin,dc=example,dc=com"
2290
+ */
2291
+ bindUsername: string;
2292
+ /**
2293
+ * Bind password for LDAP authentication
2294
+ */
2295
+ bindPassword: string;
2296
+ /**
2297
+ * Base DN for user searches
2298
+ * @example "ou=users,dc=example,dc=com"
2299
+ */
2300
+ searchBaseDn: string;
2301
+ /**
2302
+ * LDAP search filter template for users
2303
+ * @default "(uid={username})"
2304
+ */
2305
+ searchUserFilter?: string;
2306
+ /**
2307
+ * Group to role mappings
2308
+ * @default []
2309
+ */
2310
+ groups?: LdapGroupConfig[];
2311
+ }
2312
+ /**
2313
+ * Build an LDAP identity store configuration
2314
+ *
2315
+ * Creates an LDAP-based identity store for user authentication.
2316
+ * Uses the authcrunch wrapper structure: name, kind, params
2317
+ *
2318
+ * @param options - Store options
2319
+ * @returns Validated LDAP identity store configuration
2320
+ *
2321
+ * @example
2322
+ * ```typescript
2323
+ * import { buildLdapIdentityStore } from "@.../caddy-api-client/plugins/caddy-security";
2324
+ *
2325
+ * const store = buildLdapIdentityStore({
2326
+ * name: "ldapdb",
2327
+ * servers: [{ address: "ldap.example.com", port: 389 }],
2328
+ * bindUsername: "cn=admin,dc=example,dc=com",
2329
+ * bindPassword: "secret",
2330
+ * searchBaseDn: "ou=users,dc=example,dc=com",
2331
+ * searchUserFilter: "(uid={username})",
2332
+ * });
2333
+ * ```
2334
+ */
2335
+ declare function buildLdapIdentityStore(options: BuildLdapIdentityStoreOptions): LdapIdentityStore;
2336
+ /**
2337
+ * Options for building an OAuth2 identity provider
2338
+ */
2339
+ interface BuildOAuth2ProviderOptions {
2340
+ /**
2341
+ * Name of the identity provider (used to reference it in portals)
2342
+ */
2343
+ name?: string;
2344
+ /**
2345
+ * Realm name for this provider
2346
+ */
2347
+ realm?: string;
2348
+ /**
2349
+ * Provider name/driver (github, google, facebook, etc.)
2350
+ */
2351
+ provider: string;
2352
+ /**
2353
+ * OAuth client ID
2354
+ */
2355
+ clientId: string;
2356
+ /**
2357
+ * OAuth client secret
2358
+ */
2359
+ clientSecret: string;
2360
+ /**
2361
+ * OAuth scopes to request
2362
+ * @default ["openid", "email", "profile"]
2363
+ */
2364
+ scopes?: string[];
2365
+ /**
2366
+ * Authorization URL (for non-standard providers)
2367
+ */
2368
+ authorizationUrl?: string;
2369
+ /**
2370
+ * Token URL (for non-standard providers)
2371
+ */
2372
+ tokenUrl?: string;
2373
+ }
2374
+ /**
2375
+ * Build an OAuth2 identity provider configuration
2376
+ *
2377
+ * Uses the authcrunch wrapper structure: name, kind, params
2378
+ *
2379
+ * @param options - Provider options
2380
+ * @returns Validated OAuth2 provider configuration
2381
+ *
2382
+ * @example
2383
+ * ```typescript
2384
+ * import { buildOAuth2Provider } from "@.../caddy-api-client/plugins/caddy-security";
2385
+ *
2386
+ * const provider = buildOAuth2Provider({
2387
+ * name: "github",
2388
+ * provider: "github",
2389
+ * clientId: "your-client-id",
2390
+ * clientSecret: "your-client-secret",
2391
+ * scopes: ["user:email", "read:user"],
2392
+ * });
2393
+ * ```
2394
+ */
2395
+ declare function buildOAuth2Provider(options: BuildOAuth2ProviderOptions): OAuth2IdentityProvider;
2396
+ /**
2397
+ * Options for building an OIDC identity provider
2398
+ */
2399
+ interface BuildOidcProviderOptions {
2400
+ /**
2401
+ * Name of the identity provider (used to reference it in portals)
2402
+ */
2403
+ name?: string;
2404
+ /**
2405
+ * Realm name for this provider
2406
+ */
2407
+ realm?: string;
2408
+ /**
2409
+ * OIDC provider name (keycloak, okta, auth0, etc.)
2410
+ */
2411
+ provider: string;
2412
+ /**
2413
+ * Client ID
2414
+ */
2415
+ clientId: string;
2416
+ /**
2417
+ * Client secret
2418
+ */
2419
+ clientSecret: string;
2420
+ /**
2421
+ * OIDC metadata/discovery URL (.well-known/openid-configuration)
2422
+ * @example "https://keycloak.example.com/realms/myrealm/.well-known/openid-configuration"
2423
+ */
2424
+ metadataUrl: string;
2425
+ /**
2426
+ * Scopes to request
2427
+ * @default ["openid", "email", "profile"]
2428
+ */
2429
+ scopes?: string[];
2430
+ }
2431
+ /**
2432
+ * Build an OIDC identity provider configuration
2433
+ *
2434
+ * Uses the authcrunch wrapper structure: name, kind, params
2435
+ *
2436
+ * @param options - Provider options
2437
+ * @returns Validated OIDC provider configuration
2438
+ *
2439
+ * @example
2440
+ * ```typescript
2441
+ * import { buildOidcProvider } from "@.../caddy-api-client/plugins/caddy-security";
2442
+ *
2443
+ * const provider = buildOidcProvider({
2444
+ * name: "keycloak",
2445
+ * provider: "keycloak",
2446
+ * clientId: "my-app",
2447
+ * clientSecret: "secret",
2448
+ * metadataUrl: "https://keycloak.example.com/realms/myrealm/.well-known/openid-configuration",
2449
+ * });
2450
+ * ```
2451
+ */
2452
+ declare function buildOidcProvider(options: BuildOidcProviderOptions): OidcIdentityProvider;
2453
+ /**
2454
+ * UI customization options for authentication portal
2455
+ */
2456
+ interface PortalUiOptions {
2457
+ /**
2458
+ * Theme name
2459
+ */
2460
+ theme?: string;
2461
+ /**
2462
+ * Logo URL
2463
+ */
2464
+ logoUrl?: string;
2465
+ /**
2466
+ * Custom CSS
2467
+ */
2468
+ customCss?: string;
2469
+ }
2470
+ /**
2471
+ * Cookie configuration options
2472
+ */
2473
+ interface CookieOptions {
2474
+ /**
2475
+ * Cookie domain (optional - used to create domain-specific config)
2476
+ */
2477
+ domain?: string;
2478
+ /**
2479
+ * Cookie path
2480
+ * @default "/"
2481
+ */
2482
+ path?: string;
2483
+ /**
2484
+ * Cookie lifetime in seconds
2485
+ * @default 86400 (24 hours)
2486
+ */
2487
+ lifetime?: number | string;
2488
+ /**
2489
+ * Whether to allow insecure cookies (HTTP)
2490
+ * @default false
2491
+ */
2492
+ insecure?: boolean;
2493
+ /**
2494
+ * SameSite attribute
2495
+ */
2496
+ sameSite?: string;
2497
+ }
2498
+ /**
2499
+ * Options for building an authentication portal
2500
+ */
2501
+ interface BuildAuthenticationPortalOptions {
2502
+ /**
2503
+ * Portal name (referenced by portal_name in handlers)
2504
+ */
2505
+ name: string;
2506
+ /**
2507
+ * UI customization settings
2508
+ */
2509
+ ui?: PortalUiOptions;
2510
+ /**
2511
+ * Cookie settings
2512
+ */
2513
+ cookie?: CookieOptions;
2514
+ /**
2515
+ * Identity store names enabled for this portal
2516
+ */
2517
+ identityStores?: string[];
2518
+ /**
2519
+ * Identity provider names enabled for this portal
2520
+ */
2521
+ identityProviders?: string[];
2522
+ /**
2523
+ * Transform rules for user claims
2524
+ */
2525
+ transformUser?: Record<string, unknown>;
2526
+ }
2527
+ /**
2528
+ * Build an authentication portal configuration
2529
+ *
2530
+ * @param options - Portal options
2531
+ * @returns Validated authentication portal configuration
2532
+ *
2533
+ * @example
2534
+ * ```typescript
2535
+ * import { buildAuthenticationPortal } from "@.../caddy-api-client/plugins/caddy-security";
2536
+ *
2537
+ * const portal = buildAuthenticationPortal({
2538
+ * name: "myportal",
2539
+ * identityStores: ["localdb"],
2540
+ * identityProviders: ["keycloak"],
2541
+ * cookie: { domain: ".example.com", lifetime: "24h" },
2542
+ * });
2543
+ * ```
2544
+ */
2545
+ declare function buildAuthenticationPortal(options: BuildAuthenticationPortalOptions): AuthenticationPortal;
2546
+ /**
2547
+ * Access list entry configuration
2548
+ */
2549
+ interface AccessListEntry {
2550
+ /**
2551
+ * Action: allow or deny
2552
+ * @default "allow"
2553
+ */
2554
+ action?: "allow" | "deny";
2555
+ /**
2556
+ * Claim to check
2557
+ * @example "roles"
2558
+ */
2559
+ claim: string;
2560
+ /**
2561
+ * Required values for the claim
2562
+ */
2563
+ values: string[];
2564
+ }
2565
+ /**
2566
+ * Crypto key configuration
2567
+ */
2568
+ interface CryptoKeyConfig {
2569
+ /**
2570
+ * Token name
2571
+ * @default "access_token"
2572
+ */
2573
+ tokenName?: string;
2574
+ /**
2575
+ * Token source (header, cookie, query)
2576
+ * @default "cookie"
2577
+ */
2578
+ source?: string;
2579
+ }
2580
+ /**
2581
+ * Options for building an authorization policy
2582
+ */
2583
+ interface BuildAuthorizationPolicyOptions {
2584
+ /**
2585
+ * Policy name (referenced by gatekeeper_name in handlers)
2586
+ */
2587
+ name: string;
2588
+ /**
2589
+ * Access control lists
2590
+ */
2591
+ accessLists?: AccessListEntry[];
2592
+ /**
2593
+ * Crypto key configuration for JWT validation
2594
+ */
2595
+ cryptoKey?: CryptoKeyConfig;
2596
+ /**
2597
+ * Bypass paths (no auth required)
2598
+ */
2599
+ bypass?: string[];
2600
+ }
2601
+ /**
2602
+ * Build an authorization policy (gatekeeper) configuration
2603
+ *
2604
+ * @param options - Policy options
2605
+ * @returns Validated authorization policy configuration
2606
+ *
2607
+ * @example
2608
+ * ```typescript
2609
+ * import { buildAuthorizationPolicy } from "@.../caddy-api-client/plugins/caddy-security";
2610
+ *
2611
+ * const policy = buildAuthorizationPolicy({
2612
+ * name: "admin-policy",
2613
+ * accessLists: [
2614
+ * { claim: "roles", values: ["admin", "editor"], action: "allow" },
2615
+ * ],
2616
+ * bypass: ["/health", "/metrics"],
2617
+ * });
2618
+ * ```
2619
+ */
2620
+ declare function buildAuthorizationPolicy(options: BuildAuthorizationPolicyOptions): AuthorizationPolicy;
2621
+ /**
2622
+ * Options for building a security configuration
2623
+ */
2624
+ interface BuildSecurityConfigOptions {
2625
+ /**
2626
+ * Authentication portals
2627
+ */
2628
+ portals?: AuthenticationPortal[];
2629
+ /**
2630
+ * Authorization policies (gatekeepers)
2631
+ */
2632
+ policies?: AuthorizationPolicy[];
2633
+ /**
2634
+ * Identity stores
2635
+ */
2636
+ identityStores?: (LocalIdentityStore | LdapIdentityStore)[];
2637
+ /**
2638
+ * Identity providers
2639
+ */
2640
+ identityProviders?: (OAuth2IdentityProvider | OidcIdentityProvider)[];
2641
+ }
2642
+ /**
2643
+ * Build a security configuration
2644
+ *
2645
+ * @param options - Configuration options
2646
+ * @returns Validated security configuration
2647
+ *
2648
+ * @example
2649
+ * ```typescript
2650
+ * import {
2651
+ * buildSecurityConfig,
2652
+ * buildLocalIdentityStore,
2653
+ * buildAuthenticationPortal,
2654
+ * buildAuthorizationPolicy,
2655
+ * } from "@.../caddy-api-client/plugins/caddy-security";
2656
+ *
2657
+ * const config = buildSecurityConfig({
2658
+ * identityStores: [
2659
+ * buildLocalIdentityStore({ path: "/etc/caddy/users.json" }),
2660
+ * ],
2661
+ * portals: [
2662
+ * buildAuthenticationPortal({
2663
+ * name: "myportal",
2664
+ * identityStores: ["local"],
2665
+ * }),
2666
+ * ],
2667
+ * policies: [
2668
+ * buildAuthorizationPolicy({
2669
+ * name: "mypolicy",
2670
+ * accessLists: [{ claim: "roles", values: ["user"] }],
2671
+ * }),
2672
+ * ],
2673
+ * });
2674
+ * ```
2675
+ */
2676
+ declare function buildSecurityConfig(options: BuildSecurityConfigOptions): SecurityConfig;
2677
+ /**
2678
+ * Options for building a complete security app configuration
2679
+ */
2680
+ interface BuildSecurityAppOptions {
2681
+ /**
2682
+ * Security configuration
2683
+ */
2684
+ config: SecurityConfig;
2685
+ }
2686
+ /**
2687
+ * Build a complete security app configuration
2688
+ *
2689
+ * Creates the full security app configuration for `/config/apps/security`.
2690
+ *
2691
+ * @param options - App options
2692
+ * @returns Validated security app configuration
2693
+ *
2694
+ * @example
2695
+ * ```typescript
2696
+ * import { buildSecurityApp, buildSecurityConfig } from "@.../caddy-api-client/plugins/caddy-security";
2697
+ *
2698
+ * const app = buildSecurityApp({
2699
+ * config: buildSecurityConfig({
2700
+ * // ... config options
2701
+ * }),
2702
+ * });
2703
+ *
2704
+ * // Apply to Caddy
2705
+ * await client.request("/config/apps/security", {
2706
+ * method: "PUT",
2707
+ * body: JSON.stringify(app),
2708
+ * });
2709
+ * ```
2710
+ */
2711
+ declare function buildSecurityApp(options: BuildSecurityAppOptions): SecurityApp;
2712
+ /**
2713
+ * Options for building an authenticator handler
2714
+ */
2715
+ interface BuildAuthenticatorHandlerOptions {
2716
+ /**
2717
+ * Name of the authentication portal defined in security app config
2718
+ */
2719
+ portalName: string;
2720
+ /**
2721
+ * Optional route matcher pattern
2722
+ */
2723
+ routeMatcher?: string;
2724
+ }
2725
+ /**
2726
+ * Build an authenticator portal handler
2727
+ *
2728
+ * Creates a caddy-security authenticator handler that serves the login portal
2729
+ * and handles credential validation.
2730
+ *
2731
+ * @param options - Handler options
2732
+ * @returns Validated authenticator handler configuration
2733
+ *
2734
+ * @example
2735
+ * ```typescript
2736
+ * import { buildAuthenticatorHandler } from "@.../caddy-api-client/plugins/caddy-security";
2737
+ *
2738
+ * const handler = buildAuthenticatorHandler({
2739
+ * portalName: "myportal",
2740
+ * });
2741
+ *
2742
+ * // Use in a route
2743
+ * const route: CaddyRoute = {
2744
+ * match: [{ host: ["auth.example.com"] }],
2745
+ * handle: [handler],
2746
+ * terminal: true,
2747
+ * };
2748
+ * ```
2749
+ */
2750
+ declare function buildAuthenticatorHandler(options: BuildAuthenticatorHandlerOptions): SecurityAuthenticatorHandler;
2751
+ /**
2752
+ * Options for building an authorization handler
2753
+ */
2754
+ interface BuildAuthorizationHandlerOptions {
2755
+ /**
2756
+ * Name of the gatekeeper/policy defined in security app config
2757
+ */
2758
+ gatekeeperName: string;
2759
+ /**
2760
+ * Optional route matcher pattern
2761
+ */
2762
+ routeMatcher?: string;
2763
+ }
2764
+ /**
2765
+ * Build an authorization handler
2766
+ *
2767
+ * Creates a caddy-security authorization handler that validates JWT/PASETO
2768
+ * tokens and enforces access control policies.
2769
+ *
2770
+ * This uses Caddy's built-in `authentication` handler with the caddy-security
2771
+ * `authorizer` provider.
2772
+ *
2773
+ * @param options - Handler options
2774
+ * @returns Validated authorization handler configuration
2775
+ *
2776
+ * @example
2777
+ * ```typescript
2778
+ * import { buildAuthorizationHandler } from "@.../caddy-api-client/plugins/caddy-security";
2779
+ *
2780
+ * const handler = buildAuthorizationHandler({
2781
+ * gatekeeperName: "mygatekeeper",
2782
+ * });
2783
+ *
2784
+ * // Protect a route
2785
+ * const route: CaddyRoute = {
2786
+ * match: [{ host: ["api.example.com"] }],
2787
+ * handle: [
2788
+ * handler, // Check auth first
2789
+ * { handler: "reverse_proxy", upstreams: [{ dial: "localhost:3000" }] },
2790
+ * ],
2791
+ * terminal: true,
2792
+ * };
2793
+ * ```
2794
+ */
2795
+ declare function buildAuthorizationHandler(options: BuildAuthorizationHandlerOptions): SecurityAuthorizationHandler;
2796
+ /**
2797
+ * Options for building an authentication portal route
2798
+ */
2799
+ interface BuildAuthenticationRouteOptions {
2800
+ /**
2801
+ * Host(s) to match for the authentication portal
2802
+ */
2803
+ hosts: string[];
2804
+ /**
2805
+ * Name of the authentication portal
2806
+ */
2807
+ portalName: string;
2808
+ /**
2809
+ * Route ID for tracking
2810
+ */
2811
+ routeId?: string;
2812
+ }
2813
+ /**
2814
+ * Build a complete authentication portal route
2815
+ *
2816
+ * Creates a Caddy route that serves the authentication portal on specified hosts.
2817
+ *
2818
+ * @param options - Route options
2819
+ * @returns Complete Caddy route configuration
2820
+ *
2821
+ * @example
2822
+ * ```typescript
2823
+ * import { buildAuthenticatorRoute } from "@.../caddy-api-client/plugins/caddy-security";
2824
+ *
2825
+ * const route = buildAuthenticatorRoute({
2826
+ * hosts: ["auth.example.com"],
2827
+ * portalName: "myportal",
2828
+ * routeId: "auth-portal",
2829
+ * });
2830
+ *
2831
+ * await client.addRoute("https_server", route);
2832
+ * ```
2833
+ */
2834
+ declare function buildAuthenticatorRoute(options: BuildAuthenticationRouteOptions): CaddyRoute;
2835
+ /**
2836
+ * Options for building a protected route
2837
+ */
2838
+ interface BuildProtectedRouteOptions {
2839
+ /**
2840
+ * Host(s) to match
2841
+ */
2842
+ hosts: string[];
2843
+ /**
2844
+ * Path(s) to match (optional)
2845
+ */
2846
+ paths?: string[];
2847
+ /**
2848
+ * Name of the gatekeeper/policy for authorization
2849
+ */
2850
+ gatekeeperName: string;
2851
+ /**
2852
+ * Upstream dial address (host:port)
2853
+ */
2854
+ dial: string;
2855
+ /**
2856
+ * Route ID for tracking
2857
+ */
2858
+ routeId?: string;
2859
+ }
2860
+ /**
2861
+ * Build a protected route with authorization
2862
+ *
2863
+ * Creates a Caddy route that requires valid JWT/PASETO tokens before
2864
+ * proxying to the upstream service.
2865
+ *
2866
+ * @param options - Route options
2867
+ * @returns Complete Caddy route configuration
2868
+ *
2869
+ * @example
2870
+ * ```typescript
2871
+ * import { buildProtectedRoute } from "@.../caddy-api-client/plugins/caddy-security";
2872
+ *
2873
+ * const route = buildProtectedRoute({
2874
+ * hosts: ["api.example.com"],
2875
+ * paths: ["/admin/*"],
2876
+ * gatekeeperName: "admin-policy",
2877
+ * dial: "localhost:3000",
2878
+ * routeId: "protected-admin-api",
2879
+ * });
2880
+ *
2881
+ * await client.addRoute("https_server", route);
2882
+ * ```
2883
+ */
2884
+ declare function buildProtectedRoute(options: BuildProtectedRouteOptions): CaddyRoute;
2885
+
2886
+ /**
2887
+ * Caddy Security Configuration Templates
2888
+ *
2889
+ * IMPORTANT: These templates serve as the SINGLE SOURCE OF TRUTH for:
2890
+ * 1. VSCode snippets (auto-generated from these templates)
2891
+ * 2. Documentation examples
2892
+ * 3. Test fixtures
2893
+ *
2894
+ * All templates are validated by templates.test.ts to ensure they produce
2895
+ * valid Caddy configurations. If you add a new template, it will automatically:
2896
+ * - Be tested for validity
2897
+ * - Be exported as a VSCode snippet
2898
+ *
2899
+ * @see templates.test.ts - Validates all templates
2900
+ * @see vscode-extension/scripts/generate-snippets.js - Generates snippets from templates
2901
+ */
2902
+ interface TemplateVariable {
2903
+ name: string;
2904
+ description: string;
2905
+ default: string;
2906
+ placeholder?: string;
2907
+ }
2908
+ interface SecurityTemplate {
2909
+ /** Template identifier (used as snippet prefix) */
2910
+ id: string;
2911
+ /** Display name */
2912
+ name: string;
2913
+ /** Description shown in IntelliSense */
2914
+ description: string;
2915
+ /** Category for grouping */
2916
+ category: "identity-store" | "identity-provider" | "portal" | "policy" | "route" | "full-setup";
2917
+ /** Variables that users can customize */
2918
+ variables: TemplateVariable[];
2919
+ /** Function that builds the configuration (used for testing) */
2920
+ build: () => unknown;
2921
+ /** Raw snippet body for VSCode (with $1, $2 placeholders) */
2922
+ snippet: string[];
2923
+ }
2924
+ /**
2925
+ * All available security templates.
2926
+ * This is the SINGLE SOURCE OF TRUTH for snippets and tests.
2927
+ */
2928
+ declare const SECURITY_TEMPLATES: SecurityTemplate[];
2929
+ /**
2930
+ * Get templates by category
2931
+ */
2932
+ declare function getTemplatesByCategory(category: SecurityTemplate["category"]): SecurityTemplate[];
2933
+ /**
2934
+ * Get a template by ID
2935
+ */
2936
+ declare function getTemplateById(id: string): SecurityTemplate | undefined;
2937
+
2938
+ /**
2939
+ * caddy-security plugin integration
2940
+ *
2941
+ * Provides types, schemas, and builders for the caddy-security plugin,
2942
+ * enabling type-safe authentication and authorization configurations.
2943
+ *
2944
+ * @see https://github.com/greenpau/caddy-security
2945
+ * @see https://docs.authcrunch.com
2946
+ *
2947
+ * @example
2948
+ * ```typescript
2949
+ * import {
2950
+ * buildAuthenticatorHandler,
2951
+ * buildAuthorizationHandler,
2952
+ * buildProtectedRoute,
2953
+ * SecurityAuthenticatorHandlerSchema,
2954
+ * } from "@viaalink/caddy-api-client/plugins/caddy-security";
2955
+ *
2956
+ * // Build handlers with validation
2957
+ * const authHandler = buildAuthenticatorHandler({ portalName: "myportal" });
2958
+ * const authzHandler = buildAuthorizationHandler({ gatekeeperName: "mypolicy" });
2959
+ *
2960
+ * // Or build complete protected routes
2961
+ * const protectedRoute = buildProtectedRoute({
2962
+ * hosts: ["api.example.com"],
2963
+ * gatekeeperName: "api-policy",
2964
+ * dial: "localhost:3000",
2965
+ * });
2966
+ * ```
2967
+ *
2968
+ * @packageDocumentation
2969
+ */
2970
+
2971
+ type index_AccessListEntry = AccessListEntry;
2972
+ declare const index_AuthenticationPortalSchema: typeof AuthenticationPortalSchema;
2973
+ declare const index_AuthorizationPolicySchema: typeof AuthorizationPolicySchema;
2974
+ type index_BuildAuthenticationPortalOptions = BuildAuthenticationPortalOptions;
2975
+ type index_BuildAuthenticationRouteOptions = BuildAuthenticationRouteOptions;
2976
+ type index_BuildAuthenticatorHandlerOptions = BuildAuthenticatorHandlerOptions;
2977
+ type index_BuildAuthorizationHandlerOptions = BuildAuthorizationHandlerOptions;
2978
+ type index_BuildAuthorizationPolicyOptions = BuildAuthorizationPolicyOptions;
2979
+ type index_BuildLdapIdentityStoreOptions = BuildLdapIdentityStoreOptions;
2980
+ type index_BuildLocalIdentityStoreOptions = BuildLocalIdentityStoreOptions;
2981
+ type index_BuildOAuth2ProviderOptions = BuildOAuth2ProviderOptions;
2982
+ type index_BuildOidcProviderOptions = BuildOidcProviderOptions;
2983
+ type index_BuildProtectedRouteOptions = BuildProtectedRouteOptions;
2984
+ type index_BuildSecurityAppOptions = BuildSecurityAppOptions;
2985
+ type index_BuildSecurityConfigOptions = BuildSecurityConfigOptions;
2986
+ type index_CookieOptions = CookieOptions;
2987
+ type index_CryptoKeyConfig = CryptoKeyConfig;
2988
+ declare const index_IdentityStore: typeof IdentityStore;
2989
+ declare const index_IdentityStoreSchema: typeof IdentityStoreSchema;
2990
+ declare const index_LdapIdentityStoreSchema: typeof LdapIdentityStoreSchema;
2991
+ type index_LdapServerConfig = LdapServerConfig;
2992
+ declare const index_LocalIdentityStoreSchema: typeof LocalIdentityStoreSchema;
2993
+ declare const index_OAuth2IdentityProviderSchema: typeof OAuth2IdentityProviderSchema;
2994
+ declare const index_OidcIdentityProviderSchema: typeof OidcIdentityProviderSchema;
2995
+ type index_PortalUiOptions = PortalUiOptions;
2996
+ declare const index_SECURITY_TEMPLATES: typeof SECURITY_TEMPLATES;
2997
+ declare const index_SecurityAppSchema: typeof SecurityAppSchema;
2998
+ declare const index_SecurityAuthenticatorHandlerSchema: typeof SecurityAuthenticatorHandlerSchema;
2999
+ declare const index_SecurityAuthorizationHandlerSchema: typeof SecurityAuthorizationHandlerSchema;
3000
+ declare const index_SecurityAuthorizerProvider: typeof SecurityAuthorizerProvider;
3001
+ declare const index_SecurityAuthorizerProviderSchema: typeof SecurityAuthorizerProviderSchema;
3002
+ declare const index_SecurityConfigSchema: typeof SecurityConfigSchema;
3003
+ declare const index_SecurityHandler: typeof SecurityHandler;
3004
+ declare const index_SecurityHandlerSchema: typeof SecurityHandlerSchema;
3005
+ type index_SecurityTemplate = SecurityTemplate;
3006
+ type index_TemplateVariable = TemplateVariable;
3007
+ declare const index_buildAuthenticationPortal: typeof buildAuthenticationPortal;
3008
+ declare const index_buildAuthenticatorHandler: typeof buildAuthenticatorHandler;
3009
+ declare const index_buildAuthenticatorRoute: typeof buildAuthenticatorRoute;
3010
+ declare const index_buildAuthorizationHandler: typeof buildAuthorizationHandler;
3011
+ declare const index_buildAuthorizationPolicy: typeof buildAuthorizationPolicy;
3012
+ declare const index_buildLdapIdentityStore: typeof buildLdapIdentityStore;
3013
+ declare const index_buildLocalIdentityStore: typeof buildLocalIdentityStore;
3014
+ declare const index_buildOAuth2Provider: typeof buildOAuth2Provider;
3015
+ declare const index_buildOidcProvider: typeof buildOidcProvider;
3016
+ declare const index_buildProtectedRoute: typeof buildProtectedRoute;
3017
+ declare const index_buildSecurityApp: typeof buildSecurityApp;
3018
+ declare const index_buildSecurityConfig: typeof buildSecurityConfig;
3019
+ declare const index_getTemplateById: typeof getTemplateById;
3020
+ declare const index_getTemplatesByCategory: typeof getTemplatesByCategory;
3021
+ declare namespace index {
3022
+ export { type index_AccessListEntry as AccessListEntry, AuthenticationPortal$1 as AuthenticationPortal, index_AuthenticationPortalSchema as AuthenticationPortalSchema, AuthorizationPolicy$1 as AuthorizationPolicy, index_AuthorizationPolicySchema as AuthorizationPolicySchema, type index_BuildAuthenticationPortalOptions as BuildAuthenticationPortalOptions, type index_BuildAuthenticationRouteOptions as BuildAuthenticationRouteOptions, type index_BuildAuthenticatorHandlerOptions as BuildAuthenticatorHandlerOptions, type index_BuildAuthorizationHandlerOptions as BuildAuthorizationHandlerOptions, type index_BuildAuthorizationPolicyOptions as BuildAuthorizationPolicyOptions, type index_BuildLdapIdentityStoreOptions as BuildLdapIdentityStoreOptions, type index_BuildLocalIdentityStoreOptions as BuildLocalIdentityStoreOptions, type index_BuildOAuth2ProviderOptions as BuildOAuth2ProviderOptions, type index_BuildOidcProviderOptions as BuildOidcProviderOptions, type index_BuildProtectedRouteOptions as BuildProtectedRouteOptions, type index_BuildSecurityAppOptions as BuildSecurityAppOptions, type index_BuildSecurityConfigOptions as BuildSecurityConfigOptions, type index_CookieOptions as CookieOptions, type index_CryptoKeyConfig as CryptoKeyConfig, index_IdentityStore as IdentityStore, index_IdentityStoreSchema as IdentityStoreSchema, LdapIdentityStore$1 as LdapIdentityStore, index_LdapIdentityStoreSchema as LdapIdentityStoreSchema, type index_LdapServerConfig as LdapServerConfig, LocalIdentityStore$1 as LocalIdentityStore, index_LocalIdentityStoreSchema as LocalIdentityStoreSchema, OAuth2IdentityProvider$1 as OAuth2IdentityProvider, index_OAuth2IdentityProviderSchema as OAuth2IdentityProviderSchema, OidcIdentityProvider$1 as OidcIdentityProvider, index_OidcIdentityProviderSchema as OidcIdentityProviderSchema, type index_PortalUiOptions as PortalUiOptions, index_SECURITY_TEMPLATES as SECURITY_TEMPLATES, SecurityApp$1 as SecurityApp, index_SecurityAppSchema as SecurityAppSchema, SecurityAuthenticatorHandler$1 as SecurityAuthenticatorHandler, index_SecurityAuthenticatorHandlerSchema as SecurityAuthenticatorHandlerSchema, SecurityAuthorizationHandler$1 as SecurityAuthorizationHandler, index_SecurityAuthorizationHandlerSchema as SecurityAuthorizationHandlerSchema, index_SecurityAuthorizerProvider as SecurityAuthorizerProvider, index_SecurityAuthorizerProviderSchema as SecurityAuthorizerProviderSchema, SecurityConfig$1 as SecurityConfig, index_SecurityConfigSchema as SecurityConfigSchema, index_SecurityHandler as SecurityHandler, index_SecurityHandlerSchema as SecurityHandlerSchema, type index_SecurityTemplate as SecurityTemplate, type index_TemplateVariable as TemplateVariable, index_buildAuthenticationPortal as buildAuthenticationPortal, index_buildAuthenticatorHandler as buildAuthenticatorHandler, index_buildAuthenticatorRoute as buildAuthenticatorRoute, index_buildAuthorizationHandler as buildAuthorizationHandler, index_buildAuthorizationPolicy as buildAuthorizationPolicy, index_buildLdapIdentityStore as buildLdapIdentityStore, index_buildLocalIdentityStore as buildLocalIdentityStore, index_buildOAuth2Provider as buildOAuth2Provider, index_buildOidcProvider as buildOidcProvider, index_buildProtectedRoute as buildProtectedRoute, index_buildSecurityApp as buildSecurityApp, index_buildSecurityConfig as buildSecurityConfig, index_getTemplateById as getTemplateById, index_getTemplatesByCategory as getTemplatesByCategory };
3023
+ }
3024
+
3025
+ export { type AccessListEntry as A, type BuildAuthenticationPortalOptions as B, type CookieOptions as C, buildAuthenticatorRoute as D, buildAuthorizationHandler as E, buildAuthorizationPolicy as F, buildLdapIdentityStore as G, buildLocalIdentityStore as H, IdentityStoreSchema as I, buildOAuth2Provider as J, buildOidcProvider as K, LdapIdentityStoreSchema as L, buildProtectedRoute as M, buildSecurityApp as N, OAuth2IdentityProviderSchema as O, type PortalUiOptions as P, buildSecurityConfig as Q, getTemplateById as R, SECURITY_TEMPLATES as S, type TemplateVariable as T, getTemplatesByCategory as U, index as V, AuthenticationPortalSchema as a, AuthorizationPolicySchema as b, type BuildAuthenticationRouteOptions as c, type BuildAuthenticatorHandlerOptions as d, type BuildAuthorizationHandlerOptions as e, type BuildAuthorizationPolicyOptions as f, type BuildLdapIdentityStoreOptions as g, type BuildLocalIdentityStoreOptions as h, type BuildOAuth2ProviderOptions as i, type BuildOidcProviderOptions as j, type BuildProtectedRouteOptions as k, type BuildSecurityAppOptions as l, type BuildSecurityConfigOptions as m, type CryptoKeyConfig as n, type LdapServerConfig as o, LocalIdentityStoreSchema as p, OidcIdentityProviderSchema as q, SecurityAppSchema as r, SecurityAuthenticatorHandlerSchema as s, SecurityAuthorizationHandlerSchema as t, SecurityAuthorizerProviderSchema as u, SecurityConfigSchema as v, SecurityHandlerSchema as w, type SecurityTemplate as x, buildAuthenticationPortal as y, buildAuthenticatorHandler as z };