@viaalink/caddy-api-client 0.0.0-stage → 0.10.0
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.
- package/LICENSE +21 -0
- package/README.md +671 -2
- package/dist/caddy/index.d.ts +5 -0
- package/dist/caddy/index.js +5 -0
- package/dist/caddy-http-DLxwstYo.d.ts +2735 -0
- package/dist/caddy-http.zod-Cx-dcFkE.d.ts +2243 -0
- package/dist/caddy-types.d.ts +941 -0
- package/dist/caddy-types.js +1 -0
- package/dist/client-Bf2QoSWQ.d.ts +6712 -0
- package/dist/generated/extension-assets.d.ts +92 -0
- package/dist/generated/extension-assets.js +302 -0
- package/dist/index-BijF7qR9.d.ts +336 -0
- package/dist/index-BmimANG7.d.ts +1920 -0
- package/dist/index-Q5Jc47QL.d.ts +3025 -0
- package/dist/index.d.ts +101 -0
- package/dist/index.js +6 -0
- package/dist/mitm/index.d.ts +218 -0
- package/dist/mitm/index.js +2 -0
- package/dist/plugins/caddy-dns/index.d.ts +2 -0
- package/dist/plugins/caddy-dns/index.js +1 -0
- package/dist/plugins/caddy-security/index.d.ts +3 -0
- package/dist/plugins/caddy-security/index.js +2 -0
- package/dist/plugins/index.d.ts +4 -0
- package/dist/plugins/index.js +2 -0
- package/dist/types-DIjkvykh.d.ts +1041 -0
- package/package.json +168 -4
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extension assets for VSCode extension and tooling
|
|
3
|
+
*
|
|
4
|
+
* AUTO-GENERATED FILE - DO NOT EDIT
|
|
5
|
+
* Generated from source files by scripts/extract-metadata.ts
|
|
6
|
+
* Run: npm run generate:extension
|
|
7
|
+
*
|
|
8
|
+
* @generated
|
|
9
|
+
* @version 0.5.2
|
|
10
|
+
* @generatedAt 2026-04-01T16:38:14.519Z
|
|
11
|
+
*/
|
|
12
|
+
interface ParamMetadata {
|
|
13
|
+
name: string;
|
|
14
|
+
type: string;
|
|
15
|
+
required: boolean;
|
|
16
|
+
description: string;
|
|
17
|
+
default?: string;
|
|
18
|
+
example?: string;
|
|
19
|
+
}
|
|
20
|
+
interface SnippetDefinition {
|
|
21
|
+
prefix: string;
|
|
22
|
+
body: string[];
|
|
23
|
+
description: string;
|
|
24
|
+
}
|
|
25
|
+
interface BuilderMetadata {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
params: ParamMetadata[];
|
|
29
|
+
returnType: string;
|
|
30
|
+
example?: string;
|
|
31
|
+
snippet: SnippetDefinition;
|
|
32
|
+
}
|
|
33
|
+
interface HandlerMetadata {
|
|
34
|
+
name: string;
|
|
35
|
+
displayName: string;
|
|
36
|
+
description: string;
|
|
37
|
+
discriminator: string;
|
|
38
|
+
commonFields: string[];
|
|
39
|
+
caddyDocsPath: string;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Library version this metadata was generated from
|
|
43
|
+
*/
|
|
44
|
+
declare const METADATA_VERSION = "0.5.2";
|
|
45
|
+
/**
|
|
46
|
+
* Timestamp when this metadata was generated
|
|
47
|
+
*/
|
|
48
|
+
declare const GENERATED_AT = "2026-04-01T16:38:14.519Z";
|
|
49
|
+
/**
|
|
50
|
+
* Builder function metadata extracted from JSDoc and type definitions
|
|
51
|
+
*
|
|
52
|
+
* Use this for:
|
|
53
|
+
* - Generating VSCode snippets
|
|
54
|
+
* - Powering wizard step generation
|
|
55
|
+
* - Providing hover documentation
|
|
56
|
+
*/
|
|
57
|
+
declare const BUILDER_METADATA: Record<string, BuilderMetadata>;
|
|
58
|
+
/**
|
|
59
|
+
* Handler type metadata for Caddy route handlers
|
|
60
|
+
*
|
|
61
|
+
* Use this for:
|
|
62
|
+
* - Autocomplete for handler discriminator
|
|
63
|
+
* - Hover documentation with Caddy docs links
|
|
64
|
+
* - Handler-specific field suggestions
|
|
65
|
+
*/
|
|
66
|
+
declare const HANDLER_METADATA: Record<string, HandlerMetadata>;
|
|
67
|
+
/**
|
|
68
|
+
* All handler discriminator values for autocomplete
|
|
69
|
+
*/
|
|
70
|
+
declare const HANDLER_NAMES: readonly string[];
|
|
71
|
+
/**
|
|
72
|
+
* All builder function names for autocomplete
|
|
73
|
+
*/
|
|
74
|
+
declare const BUILDER_NAMES: readonly string[];
|
|
75
|
+
/**
|
|
76
|
+
* Get snippets in VSCode snippet format
|
|
77
|
+
*/
|
|
78
|
+
declare function getVSCodeSnippets(): Record<string, {
|
|
79
|
+
prefix: string;
|
|
80
|
+
body: string[];
|
|
81
|
+
description: string;
|
|
82
|
+
}>;
|
|
83
|
+
/**
|
|
84
|
+
* Get handler completion items for VSCode
|
|
85
|
+
*/
|
|
86
|
+
declare function getHandlerCompletions(): Array<{
|
|
87
|
+
label: string;
|
|
88
|
+
detail: string;
|
|
89
|
+
documentation: string;
|
|
90
|
+
}>;
|
|
91
|
+
|
|
92
|
+
export { BUILDER_METADATA, BUILDER_NAMES, type BuilderMetadata, GENERATED_AT, HANDLER_METADATA, HANDLER_NAMES, type HandlerMetadata, METADATA_VERSION, type ParamMetadata, type SnippetDefinition, getHandlerCompletions, getVSCodeSnippets };
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
var a="0.5.2",o="2026-04-01T16:38:14.519Z",t={buildLocalIdentityStore:{name:"buildLocalIdentityStore",description:`Build a local identity store configuration
|
|
2
|
+
|
|
3
|
+
Creates a local JSON file-based identity store for user credentials.
|
|
4
|
+
Uses the authcrunch wrapper structure: name, kind, params`,params:[{name:"name",type:"string",required:false,description:"Name of the identity store (used to reference it in portals)",default:"local"},{name:"path",type:"string",required:true,description:"Path to the JSON file containing user credentials"},{name:"realm",type:"string",required:false,description:"Realm name for this identity store",default:"local"}],returnType:"LocalIdentityStore",example:`import { buildLocalIdentityStore } from "@.../caddy-api-client/plugins/caddy-security";
|
|
5
|
+
|
|
6
|
+
const store = buildLocalIdentityStore({
|
|
7
|
+
name: "localdb",
|
|
8
|
+
path: "/etc/caddy/users.json",
|
|
9
|
+
realm: "local",
|
|
10
|
+
});`,snippet:{prefix:"caddy-local-identity-store",body:["buildLocalIdentityStore({"," // name: ${1:local},"," path: ${2:/etc/caddy/config.json},"," // realm: ${3:local}","})"],description:"Build Local Identity Store"}},buildLdapIdentityStore:{name:"buildLdapIdentityStore",description:`Build an LDAP identity store configuration
|
|
11
|
+
|
|
12
|
+
Creates an LDAP-based identity store for user authentication.
|
|
13
|
+
Uses the authcrunch wrapper structure: name, kind, params`,params:[{name:"name",type:"string",required:false,description:"Name of the identity store (used to reference it in portals)",default:"ldapdb"},{name:"realm",type:"string",required:false,description:"Realm name for this identity store",default:"ldap"},{name:"servers",type:"LdapServerConfig[]",required:true,description:"LDAP server(s) to connect to"},{name:"bindUsername",type:"string",required:true,description:"Bind username for LDAP queries (full DN)",example:"cn=admin,dc=example,dc=com"},{name:"bindPassword",type:"string",required:true,description:"Bind password for LDAP authentication"},{name:"searchBaseDn",type:"string",required:true,description:"Base DN for user searches",example:"ou=users,dc=example,dc=com"},{name:"searchUserFilter",type:"string",required:false,description:"LDAP search filter template for users",default:"(uid={username})"},{name:"groups",type:"LdapGroupConfig[]",required:false,description:"Group to role mappings",default:"[]"}],returnType:"LdapIdentityStore",example:`import { buildLdapIdentityStore } from "@.../caddy-api-client/plugins/caddy-security";
|
|
14
|
+
|
|
15
|
+
const store = buildLdapIdentityStore({
|
|
16
|
+
name: "ldapdb",
|
|
17
|
+
servers: [{ address: "ldap.example.com", port: 389 }],
|
|
18
|
+
bindUsername: "cn=admin,dc=example,dc=com",
|
|
19
|
+
bindPassword: "secret",
|
|
20
|
+
searchBaseDn: "ou=users,dc=example,dc=com",
|
|
21
|
+
searchUserFilter: "(uid={username})",
|
|
22
|
+
});`,snippet:{prefix:"caddy-ldap-identity-store",body:["buildLdapIdentityStore({"," // name: ${1:ldapdb},"," // realm: ${2:ldap},",' servers: ${3:""},'," bindUsername: ${4:my-name},",' bindPassword: ${5:""},',' searchBaseDn: ${6:""},'," // searchUserFilter: ${7:(uid={username})},"," // groups: ${8:[]}","})"],description:"Build LDAP Identity Store"}},buildOAuth2Provider:{name:"buildOAuth2Provider",description:`Build an OAuth2 identity provider configuration
|
|
23
|
+
|
|
24
|
+
Uses the authcrunch wrapper structure: name, kind, params`,params:[{name:"name",type:"string",required:false,description:"Name of the identity provider (used to reference it in portals)"},{name:"realm",type:"string",required:false,description:"Realm name for this provider"},{name:"provider",type:"string",required:true,description:"Provider name/driver (github, google, facebook, etc.)"},{name:"clientId",type:"string",required:true,description:"OAuth client ID"},{name:"clientSecret",type:"string",required:true,description:"OAuth client secret"},{name:"scopes",type:"string[]",required:false,description:"OAuth scopes to request",default:'["openid", "email", "profile"]'},{name:"authorizationUrl",type:"string",required:false,description:"Authorization URL (for non-standard providers)"},{name:"tokenUrl",type:"string",required:false,description:"Token URL (for non-standard providers)"}],returnType:"OAuth2IdentityProvider",example:`import { buildOAuth2Provider } from "@.../caddy-api-client/plugins/caddy-security";
|
|
25
|
+
|
|
26
|
+
const provider = buildOAuth2Provider({
|
|
27
|
+
name: "github",
|
|
28
|
+
provider: "github",
|
|
29
|
+
clientId: "your-client-id",
|
|
30
|
+
clientSecret: "your-client-secret",
|
|
31
|
+
scopes: ["user:email", "read:user"],
|
|
32
|
+
});`,snippet:{prefix:"caddy-oauth2-provider",body:["buildOAuth2Provider({",' provider: ${1:""},'," clientId: ${2:your-client-id},"," clientSecret: ${3:your-client-secret},",' // scopes: ${4:["openid", "email", "profile"]},',"})"],description:"Build OAuth2 Provider"}},buildOidcProvider:{name:"buildOidcProvider",description:`Build an OIDC identity provider configuration
|
|
33
|
+
|
|
34
|
+
Uses the authcrunch wrapper structure: name, kind, params`,params:[{name:"name",type:"string",required:false,description:"Name of the identity provider (used to reference it in portals)"},{name:"realm",type:"string",required:false,description:"Realm name for this provider"},{name:"provider",type:"string",required:true,description:"OIDC provider name (keycloak, okta, auth0, etc.)"},{name:"clientId",type:"string",required:true,description:"Client ID"},{name:"clientSecret",type:"string",required:true,description:"Client secret"},{name:"metadataUrl",type:"string",required:true,description:"OIDC metadata/discovery URL (.well-known/openid-configuration)",example:"https://keycloak.example.com/realms/myrealm/.well-known/openid-configuration"},{name:"scopes",type:"string[]",required:false,description:"Scopes to request",default:'["openid", "email", "profile"]'}],returnType:"OidcIdentityProvider",example:`import { buildOidcProvider } from "@.../caddy-api-client/plugins/caddy-security";
|
|
35
|
+
|
|
36
|
+
const provider = buildOidcProvider({
|
|
37
|
+
name: "keycloak",
|
|
38
|
+
provider: "keycloak",
|
|
39
|
+
clientId: "my-app",
|
|
40
|
+
clientSecret: "secret",
|
|
41
|
+
metadataUrl: "https://keycloak.example.com/realms/myrealm/.well-known/openid-configuration",
|
|
42
|
+
});`,snippet:{prefix:"caddy-oidc-provider",body:["buildOidcProvider({",' provider: ${1:""},'," clientId: ${2:your-client-id},"," clientSecret: ${3:your-client-secret},",' metadataUrl: ${4:""},',' // scopes: ${5:["openid", "email", "profile"]},',"})"],description:"Build OIDC Provider"}},buildAuthenticationPortal:{name:"buildAuthenticationPortal",description:"Build an authentication portal configuration",params:[{name:"name",type:"string",required:true,description:"Portal name (referenced by portal_name in handlers)"},{name:"ui",type:"PortalUiOptions",required:false,description:"UI customization settings"},{name:"cookie",type:"CookieOptions",required:false,description:"Cookie settings"},{name:"identityStores",type:"string[]",required:false,description:"Identity store names enabled for this portal"},{name:"identityProviders",type:"string[]",required:false,description:"Identity provider names enabled for this portal"},{name:"transformUser",type:"Record<string, unknown>",required:false,description:"Transform rules for user claims"}],returnType:"AuthenticationPortal",example:`import { buildAuthenticationPortal } from "@.../caddy-api-client/plugins/caddy-security";
|
|
43
|
+
|
|
44
|
+
const portal = buildAuthenticationPortal({
|
|
45
|
+
name: "myportal",
|
|
46
|
+
identityStores: ["localdb"],
|
|
47
|
+
identityProviders: ["keycloak"],
|
|
48
|
+
cookie: { domain: ".example.com", lifetime: "24h" },
|
|
49
|
+
});`,snippet:{prefix:"caddy-authentication-portal",body:["buildAuthenticationPortal({"," name: ${1:my-name},","})"],description:"Build Authentication Portal"}},buildAuthorizationPolicy:{name:"buildAuthorizationPolicy",description:"Build an authorization policy (gatekeeper) configuration",params:[{name:"name",type:"string",required:true,description:"Policy name (referenced by gatekeeper_name in handlers)"},{name:"accessLists",type:"AccessListEntry[]",required:false,description:"Access control lists"},{name:"cryptoKey",type:"CryptoKeyConfig",required:false,description:"Crypto key configuration for JWT validation"},{name:"bypass",type:"string[]",required:false,description:"Bypass paths (no auth required)"}],returnType:"AuthorizationPolicy",example:`import { buildAuthorizationPolicy } from "@.../caddy-api-client/plugins/caddy-security";
|
|
50
|
+
|
|
51
|
+
const policy = buildAuthorizationPolicy({
|
|
52
|
+
name: "admin-policy",
|
|
53
|
+
accessLists: [
|
|
54
|
+
{ claim: "roles", values: ["admin", "editor"], action: "allow" },
|
|
55
|
+
],
|
|
56
|
+
bypass: ["/health", "/metrics"],
|
|
57
|
+
});`,snippet:{prefix:"caddy-authorization-policy",body:["buildAuthorizationPolicy({"," name: ${1:my-name},","})"],description:"Build Authorization Policy"}},buildSecurityConfig:{name:"buildSecurityConfig",description:"Build a security configuration",params:[{name:"portals",type:"AuthenticationPortal[]",required:false,description:"Authentication portals"},{name:"policies",type:"AuthorizationPolicy[]",required:false,description:"Authorization policies (gatekeepers)"},{name:"identityStores",type:"(LocalIdentityStore | LdapIdentityStore)[]",required:false,description:"Identity stores"},{name:"identityProviders",type:"(OAuth2IdentityProvider | OidcIdentityProvider)[]",required:false,description:"Identity providers"}],returnType:"SecurityConfig",example:`import {
|
|
58
|
+
buildSecurityConfig,
|
|
59
|
+
buildLocalIdentityStore,
|
|
60
|
+
buildAuthenticationPortal,
|
|
61
|
+
buildAuthorizationPolicy,
|
|
62
|
+
} from "@.../caddy-api-client/plugins/caddy-security";
|
|
63
|
+
|
|
64
|
+
const config = buildSecurityConfig({
|
|
65
|
+
identityStores: [
|
|
66
|
+
buildLocalIdentityStore({ path: "/etc/caddy/users.json" }),
|
|
67
|
+
],
|
|
68
|
+
portals: [
|
|
69
|
+
buildAuthenticationPortal({
|
|
70
|
+
name: "myportal",
|
|
71
|
+
identityStores: ["local"],
|
|
72
|
+
}),
|
|
73
|
+
],
|
|
74
|
+
policies: [
|
|
75
|
+
buildAuthorizationPolicy({
|
|
76
|
+
name: "mypolicy",
|
|
77
|
+
accessLists: [{ claim: "roles", values: ["user"] }],
|
|
78
|
+
}),
|
|
79
|
+
],
|
|
80
|
+
});`,snippet:{prefix:"caddy-security-config",body:["buildSecurityConfig({","})"],description:"Build Security Config"}},buildSecurityApp:{name:"buildSecurityApp",description:"Build a complete security app configuration\n\nCreates the full security app configuration for `/config/apps/security`.",params:[{name:"config",type:"SecurityConfig",required:true,description:"Security configuration"}],returnType:"SecurityApp",example:`import { buildSecurityApp, buildSecurityConfig } from "@.../caddy-api-client/plugins/caddy-security";
|
|
81
|
+
|
|
82
|
+
const app = buildSecurityApp({
|
|
83
|
+
config: buildSecurityConfig({
|
|
84
|
+
// ... config options
|
|
85
|
+
}),
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
// Apply to Caddy
|
|
89
|
+
await client.request("/config/apps/security", {
|
|
90
|
+
method: "PUT",
|
|
91
|
+
body: JSON.stringify(app),
|
|
92
|
+
});`,snippet:{prefix:"caddy-security-app",body:["buildSecurityApp({",' config: ${1:""}',"})"],description:"Build Security App"}},buildAuthenticatorHandler:{name:"buildAuthenticatorHandler",description:`Build an authenticator portal handler
|
|
93
|
+
|
|
94
|
+
Creates a caddy-security authenticator handler that serves the login portal
|
|
95
|
+
and handles credential validation.`,params:[{name:"portalName",type:"string",required:true,description:"Name of the authentication portal defined in security app config"},{name:"routeMatcher",type:"string",required:false,description:"Optional route matcher pattern"}],returnType:"SecurityAuthenticatorHandler",example:`import { buildAuthenticatorHandler } from "@.../caddy-api-client/plugins/caddy-security";
|
|
96
|
+
|
|
97
|
+
const handler = buildAuthenticatorHandler({
|
|
98
|
+
portalName: "myportal",
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
// Use in a route
|
|
102
|
+
const route: CaddyRoute = {
|
|
103
|
+
match: [{ host: ["auth.example.com"] }],
|
|
104
|
+
handle: [handler],
|
|
105
|
+
terminal: true,
|
|
106
|
+
};`,snippet:{prefix:"caddy-authenticator-handler",body:["buildAuthenticatorHandler({",' portalName: ${1:""},',"})"],description:"Build Authenticator Handler"}},buildAuthorizationHandler:{name:"buildAuthorizationHandler",description:`Build an authorization handler
|
|
107
|
+
|
|
108
|
+
Creates a caddy-security authorization handler that validates JWT/PASETO
|
|
109
|
+
tokens and enforces access control policies.
|
|
110
|
+
|
|
111
|
+
This uses Caddy's built-in \`authentication\` handler with the caddy-security
|
|
112
|
+
\`authorizer\` provider.`,params:[{name:"gatekeeperName",type:"string",required:true,description:"Name of the gatekeeper/policy defined in security app config"},{name:"routeMatcher",type:"string",required:false,description:"Optional route matcher pattern"}],returnType:"SecurityAuthorizationHandler",example:`import { buildAuthorizationHandler } from "@.../caddy-api-client/plugins/caddy-security";
|
|
113
|
+
|
|
114
|
+
const handler = buildAuthorizationHandler({
|
|
115
|
+
gatekeeperName: "mygatekeeper",
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
// Protect a route
|
|
119
|
+
const route: CaddyRoute = {
|
|
120
|
+
match: [{ host: ["api.example.com"] }],
|
|
121
|
+
handle: [
|
|
122
|
+
handler, // Check auth first
|
|
123
|
+
{ handler: "reverse_proxy", upstreams: [{ dial: "localhost:3000" }] },
|
|
124
|
+
],
|
|
125
|
+
terminal: true,
|
|
126
|
+
};`,snippet:{prefix:"caddy-authorization-handler",body:["buildAuthorizationHandler({",' gatekeeperName: ${1:""},',"})"],description:"Build Authorization Handler"}},buildAuthenticatorRoute:{name:"buildAuthenticatorRoute",description:`Build a complete authentication portal route
|
|
127
|
+
|
|
128
|
+
Creates a Caddy route that serves the authentication portal on specified hosts.`,params:[{name:"hosts",type:"string[]",required:true,description:"Host(s) to match for the authentication portal"},{name:"portalName",type:"string",required:true,description:"Name of the authentication portal"},{name:"routeId",type:"string",required:false,description:"Route ID for tracking"}],returnType:"CaddyRoute",example:`import { buildAuthenticatorRoute } from "@.../caddy-api-client/plugins/caddy-security";
|
|
129
|
+
|
|
130
|
+
const route = buildAuthenticatorRoute({
|
|
131
|
+
hosts: ["auth.example.com"],
|
|
132
|
+
portalName: "myportal",
|
|
133
|
+
routeId: "auth-portal",
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
await client.addRoute("https_server", route);`,snippet:{prefix:"caddy-authenticator-route",body:["buildAuthenticatorRoute({"," hosts: ${1:example.com},",' portalName: ${2:""},',"})"],description:"Build Authenticator Route"}},buildProtectedRoute:{name:"buildProtectedRoute",description:`Build a protected route with authorization
|
|
137
|
+
|
|
138
|
+
Creates a Caddy route that requires valid JWT/PASETO tokens before
|
|
139
|
+
proxying to the upstream service.`,params:[{name:"hosts",type:"string[]",required:true,description:"Host(s) to match"},{name:"paths",type:"string[]",required:false,description:"Path(s) to match (optional)"},{name:"gatekeeperName",type:"string",required:true,description:"Name of the gatekeeper/policy for authorization"},{name:"dial",type:"string",required:true,description:"Upstream dial address (host:port)"},{name:"routeId",type:"string",required:false,description:"Route ID for tracking"}],returnType:"CaddyRoute",example:`import { buildProtectedRoute } from "@.../caddy-api-client/plugins/caddy-security";
|
|
140
|
+
|
|
141
|
+
const route = buildProtectedRoute({
|
|
142
|
+
hosts: ["api.example.com"],
|
|
143
|
+
paths: ["/admin/*"],
|
|
144
|
+
gatekeeperName: "admin-policy",
|
|
145
|
+
dial: "localhost:3000",
|
|
146
|
+
routeId: "protected-admin-api",
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
await client.addRoute("https_server", route);`,snippet:{prefix:"caddy-protected-route",body:["buildProtectedRoute({"," hosts: ${1:example.com},",' gatekeeperName: ${2:""},'," dial: ${3:localhost:3000},","})"],description:"Build Protected Route"}},buildServiceRoutes:{name:"buildServiceRoutes",description:"Build routes for a service (host-based and/or path-based)",params:[],returnType:"CaddyRoute[]",snippet:{prefix:"caddy-service-routes",body:["buildServiceRoutes({","})"],description:"Build Service Routes"}},buildHealthCheckRoute:{name:"buildHealthCheckRoute",description:"Build a health check route",params:[],returnType:"CaddyRoute",snippet:{prefix:"caddy-health-check-route",body:["buildHealthCheckRoute({","})"],description:"Build Health Check Route"}},buildHostRoute:{name:"buildHostRoute",description:"Build a host-based route",params:[],returnType:"CaddyRoute",snippet:{prefix:"caddy-host-route",body:["buildHostRoute({","})"],description:"Build Host Route"}},buildPathRoute:{name:"buildPathRoute",description:"Build a path-based route",params:[],returnType:"CaddyRoute",snippet:{prefix:"caddy-path-route",body:["buildPathRoute({","})"],description:"Build Path Route"}},buildLoadBalancerRoute:{name:"buildLoadBalancerRoute",description:"Build a load balancer route",params:[],returnType:"CaddyRoute",snippet:{prefix:"caddy-load-balancer-route",body:["buildLoadBalancerRoute({","})"],description:"Build Load Balancer Route"}},buildReverseProxyHandler:{name:"buildReverseProxyHandler",description:"Build a reverse proxy handler",params:[],returnType:"CaddyRouteHandler",example:`// HTTP backend (default)
|
|
150
|
+
buildReverseProxyHandler("nginx:80")`,snippet:{prefix:"caddy-reverse-proxy-handler",body:["buildReverseProxyHandler({","})"],description:"Build Reverse Proxy Handler"}},buildSecurityHeadersHandler:{name:"buildSecurityHeadersHandler",description:"Build a security headers handler",params:[],returnType:"CaddyRouteHandler",snippet:{prefix:"caddy-security-headers-handler",body:["buildSecurityHeadersHandler({","})"],description:"Build Security Headers Handler"}},buildBasicAuthHandler:{name:"buildBasicAuthHandler",description:`Build a basic auth handler
|
|
151
|
+
Supports both single account (legacy) and multiple accounts`,params:[],returnType:"CaddyRouteHandler",example:`// Single account (legacy)
|
|
152
|
+
buildBasicAuthHandler({
|
|
153
|
+
enabled: true,
|
|
154
|
+
username: "admin",
|
|
155
|
+
passwordHash: "$2a$10$...",
|
|
156
|
+
realm: "Admin Area"
|
|
157
|
+
})`,snippet:{prefix:"caddy-basic-auth-handler",body:["buildBasicAuthHandler({","})"],description:"Build Basic Auth Handler"}},buildRewriteHandler:{name:"buildRewriteHandler",description:"Build a rewrite handler (strip path prefix)",params:[],returnType:"CaddyRouteHandler",snippet:{prefix:"caddy-rewrite-handler",body:["buildRewriteHandler({","})"],description:"Build Rewrite Handler"}},buildServiceMetadataHeadersHandler:{name:"buildServiceMetadataHeadersHandler",description:`Build a service metadata headers handler
|
|
158
|
+
Sets X-ASD-Service-ID and X-ASD-Service-Type headers`,params:[],returnType:"CaddyRouteHandler | null",snippet:{prefix:"caddy-service-metadata-headers-handler",body:["buildServiceMetadataHeadersHandler({","})"],description:"Build Service Metadata Headers Handler"}},buildIngressTagHeadersHandler:{name:"buildIngressTagHeadersHandler",description:"Build an ingress tag header handler",params:[],returnType:"CaddyRouteHandler",snippet:{prefix:"caddy-ingress-tag-headers-handler",body:["buildIngressTagHeadersHandler({","})"],description:"Build Ingress Tag Headers Handler"}},buildProjectIdHeadersHandler:{name:"buildProjectIdHeadersHandler",description:"Build a project identity header handler",params:[],returnType:"CaddyRouteHandler",snippet:{prefix:"caddy-project-id-headers-handler",body:["buildProjectIdHeadersHandler({","})"],description:"Build Project Id Headers Handler"}},buildIframeHeadersHandler:{name:"buildIframeHeadersHandler",description:"Build CORS/CSP headers for iframe embedding",params:[],returnType:"CaddyRouteHandler",snippet:{prefix:"caddy-iframe-headers-handler",body:["buildIframeHeadersHandler({","})"],description:"Build Iframe Headers Handler"}},buildRedirectRoute:{name:"buildRedirectRoute",description:"Build a redirect route for domain redirects (www <-> non-www)",params:[],returnType:"CaddyRoute",snippet:{prefix:"caddy-redirect-route",body:["buildRedirectRoute({","})"],description:"Build Redirect Route"}},buildCompressionHandler:{name:"buildCompressionHandler",description:`Build a compression (encode) handler
|
|
159
|
+
Supports gzip, zstd, and brotli compression`,params:[],returnType:"CaddyRouteHandler",snippet:{prefix:"caddy-compression-handler",body:["buildCompressionHandler({","})"],description:"Build Compression Handler"}},buildWwwRedirect:{name:"buildWwwRedirect",description:`Build a WWW redirect route (www.example.com \u2194 example.com)
|
|
160
|
+
|
|
161
|
+
Common patterns:
|
|
162
|
+
- "www-to-domain": www.example.com \u2192 example.com
|
|
163
|
+
- "domain-to-www": example.com \u2192 www.example.com`,params:[],returnType:"CaddyRoute",example:`// Redirect www.example.com \u2192 example.com
|
|
164
|
+
const route = buildWwwRedirect({
|
|
165
|
+
domain: "example.com",
|
|
166
|
+
mode: "www-to-domain",
|
|
167
|
+
permanent: true
|
|
168
|
+
});`,snippet:{prefix:"caddy-www-redirect",body:["buildWwwRedirect({","})"],description:"Build Www Redirect"}},buildMitmproxyRoute:{name:"buildMitmproxyRoute",description:`Build a route that forwards traffic through MITMproxy for inspection
|
|
169
|
+
|
|
170
|
+
This is a convenience function that creates a route pointing to a MITMproxy
|
|
171
|
+
instance running in reverse proxy mode. Use this to transparently intercept
|
|
172
|
+
and inspect HTTP traffic for debugging without modifying client or backend code.`,params:[],returnType:"CaddyRoute",example:`// Route traffic for api.example.com through MITMproxy
|
|
173
|
+
const route = buildMitmproxyRoute({
|
|
174
|
+
host: "api.example.com",
|
|
175
|
+
mitmproxyHost: "localhost",
|
|
176
|
+
mitmproxyPort: 8080,
|
|
177
|
+
});
|
|
178
|
+
await client.addRoute("https_server", route, "api_debug");`,snippet:{prefix:"caddy-mitmproxy-route",body:["buildMitmproxyRoute({","})"],description:"Build Mitmproxy Route"}},buildMitmproxyRoutePair:{name:"buildMitmproxyRoutePair",description:`Create a hot-swappable route pair for enabling/disabling MITMproxy interception
|
|
179
|
+
|
|
180
|
+
Returns both a direct route and a MITMproxy-intercepted route with the same ID.
|
|
181
|
+
Use this to easily toggle between direct and intercepted traffic at runtime.`,params:[],returnType:`{
|
|
182
|
+
/** Direct route (Client \u2192 Caddy \u2192 Backend) */
|
|
183
|
+
direct: CaddyRoute;
|
|
184
|
+
/** Proxied route (Client \u2192 Caddy \u2192 MITMproxy \u2192 Backend) */
|
|
185
|
+
proxied: CaddyRoute;
|
|
186
|
+
}`,example:`const routes = buildMitmproxyRoutePair({
|
|
187
|
+
host: "api.example.com",
|
|
188
|
+
backendHost: "backend-service",
|
|
189
|
+
backendPort: 3000,
|
|
190
|
+
mitmproxyHost: "mitmproxy",
|
|
191
|
+
routeId: "api_route",
|
|
192
|
+
});
|
|
193
|
+
|
|
194
|
+
// Start with direct routing
|
|
195
|
+
await client.addRoute("https_server", routes.direct, routes.direct["@id"]);
|
|
196
|
+
|
|
197
|
+
// Hot-swap to enable interception (no downtime)
|
|
198
|
+
await client.removeRouteById("https_server", routes.direct["@id"]);
|
|
199
|
+
await client.addRoute("https_server", routes.proxied, routes.proxied["@id"]);
|
|
200
|
+
|
|
201
|
+
// Hot-swap back to direct (disable interception)
|
|
202
|
+
await client.removeRouteById("https_server", routes.proxied["@id"]);
|
|
203
|
+
await client.addRoute("https_server", routes.direct, routes.direct["@id"]);`,snippet:{prefix:"caddy-mitmproxy-route-pair",body:["buildMitmproxyRoutePair({","})"],description:"Build Mitmproxy Route Pair"}},buildIframeProxyRoute:{name:"buildIframeProxyRoute",description:`Build a route for proxying a web UI with iframe embedding support
|
|
204
|
+
|
|
205
|
+
This creates a route that proxies a web interface and optionally adds
|
|
206
|
+
headers to allow embedding in iframes. Can also override Host/Origin
|
|
207
|
+
headers for services with DNS rebinding protection.`,params:[{name:"pathPrefix",type:"string",required:true,description:'Path prefix for the route (e.g., "/panel")'},{name:"upstreamHost",type:"string",required:true,description:"Upstream host to proxy to"},{name:"upstreamPort",type:"number",required:true,description:"Upstream port to proxy to"},{name:"routeId",type:"string",required:false,description:"Route ID (optional, auto-generated from pathPrefix if not provided)"},{name:"iframeEmbed",type:"boolean",required:false,description:"Whether to enable iframe embedding headers (default: true)"},{name:"overrideHost",type:"string",required:false,description:"Custom Host header to send to upstream (for DNS rebinding bypass)"}],returnType:"CaddyRoute",example:`// Proxy a web panel at /panel/* to panel-service:8080
|
|
208
|
+
const route = buildIframeProxyRoute({
|
|
209
|
+
pathPrefix: "/panel",
|
|
210
|
+
upstreamHost: "panel-service",
|
|
211
|
+
upstreamPort: 8080,
|
|
212
|
+
iframeEmbed: true,
|
|
213
|
+
});
|
|
214
|
+
|
|
215
|
+
// Proxy with DNS rebinding bypass (e.g., for mitmweb)
|
|
216
|
+
const mitmRoute = buildIframeProxyRoute({
|
|
217
|
+
pathPrefix: "/mitmproxy",
|
|
218
|
+
upstreamHost: "mitmproxy",
|
|
219
|
+
upstreamPort: 8081,
|
|
220
|
+
overrideHost: "127.0.0.1:8081",
|
|
221
|
+
});`,snippet:{prefix:"caddy-iframe-proxy-route",body:["buildIframeProxyRoute({",' pathPrefix: ${1:""},',' upstreamHost: ${2:""},'," upstreamPort: ${3:0},","})"],description:"Build Iframe Proxy Route"}},buildMitmproxyWebUiRoute:{name:"buildMitmproxyWebUiRoute",description:"",params:[],returnType:"CaddyRoute",snippet:{prefix:"caddy-mitmproxy-web-ui-route",body:["buildMitmproxyWebUiRoute({","})"],description:"Build Mitmproxy Web Ui Route"}},buildWebSocketProxyRoute:{name:"buildWebSocketProxyRoute",description:`Build a route for WebSocket proxy
|
|
222
|
+
|
|
223
|
+
This creates a route that proxies WebSocket connections to an upstream
|
|
224
|
+
service. Can optionally override Host/Origin headers for services
|
|
225
|
+
with DNS rebinding protection.`,params:[{name:"path",type:"string",required:true,description:'WebSocket path to match (e.g., "/ws", "/updates")'},{name:"upstreamHost",type:"string",required:true,description:"Upstream host to proxy to"},{name:"upstreamPort",type:"number",required:true,description:"Upstream port to proxy to"},{name:"routeId",type:"string",required:false,description:"Route ID (optional)"},{name:"overrideHost",type:"string",required:false,description:"Custom Host header to send to upstream (for DNS rebinding bypass)"}],returnType:"CaddyRoute",example:`// Simple WebSocket proxy
|
|
226
|
+
const route = buildWebSocketProxyRoute({
|
|
227
|
+
path: "/ws",
|
|
228
|
+
upstreamHost: "ws-server",
|
|
229
|
+
upstreamPort: 8080,
|
|
230
|
+
});
|
|
231
|
+
|
|
232
|
+
// WebSocket with DNS rebinding bypass
|
|
233
|
+
const mitmRoute = buildWebSocketProxyRoute({
|
|
234
|
+
path: "/updates",
|
|
235
|
+
upstreamHost: "mitmproxy",
|
|
236
|
+
upstreamPort: 8081,
|
|
237
|
+
overrideHost: "127.0.0.1:8081",
|
|
238
|
+
});`,snippet:{prefix:"caddy-web-socket-proxy-route",body:["buildWebSocketProxyRoute({"," path: ${1:/etc/caddy/config.json},",' upstreamHost: ${2:""},'," upstreamPort: ${3:0},","})"],description:"Build Web Socket Proxy Route"}},buildMitmproxyWebSocketRoute:{name:"buildMitmproxyWebSocketRoute",description:"",params:[],returnType:"CaddyRoute",snippet:{prefix:"caddy-mitmproxy-web-socket-route",body:["buildMitmproxyWebSocketRoute({","})"],description:"Build Mitmproxy Web Socket Route"}},buildIframePermissiveHandler:{name:"buildIframePermissiveHandler",description:`Build a header handler that removes restrictive headers for iframe embedding
|
|
239
|
+
|
|
240
|
+
Removes X-Frame-Options, Content-Security-Policy, and X-Xss-Protection
|
|
241
|
+
headers while adding permissive CORS and frame-ancestors headers.`,params:[],returnType:"CaddyRouteHandler",example:`const handler = buildIframePermissiveHandler();
|
|
242
|
+
// Use in a route's handle array`,snippet:{prefix:"caddy-iframe-permissive-handler",body:["buildIframePermissiveHandler({","})"],description:"Build Iframe Permissive Handler"}},buildDnsRebindingBypassHandler:{name:"buildDnsRebindingBypassHandler",description:`Build a header handler for DNS rebinding bypass
|
|
243
|
+
|
|
244
|
+
Sets Host and Origin headers to bypass MITMproxy's DNS rebinding protection.
|
|
245
|
+
Use this when proxying to MITMproxy from a different hostname.`,params:[],returnType:"CaddyRouteHandler",example:`const handler = buildDnsRebindingBypassHandler({
|
|
246
|
+
targetHost: "127.0.0.1:8081",
|
|
247
|
+
});`,snippet:{prefix:"caddy-dns-rebinding-bypass-handler",body:["buildDnsRebindingBypassHandler({","})"],description:"Build Dns Rebinding Bypass Handler"}},buildFileServerRoute:{name:"buildFileServerRoute",description:"Build a file server route for serving static files",params:[{name:"path",type:"string",required:true,description:'Path prefix to match (e.g., "/static/*")'},{name:"root",type:"string",required:true,description:"Root directory to serve files from"},{name:"browse",type:"boolean",required:false,description:"Enable directory browsing"},{name:"browseTemplate",type:"string",required:false,description:"Custom browse template file path"},{name:"hidePatterns",type:"string[]",required:false,description:'File patterns to hide (e.g., [".git", ".env"])'},{name:"indexNames",type:"string[]",required:false,description:'Index file names (default: ["index.html"])'},{name:"precompressed",type:"boolean",required:false,description:"Enable precompressed file support (gzip, brotli)"},{name:"id",type:"string",required:false,description:"Route ID"},{name:"priority",type:"number",required:false,description:"Route priority"}],returnType:"CaddyRoute",example:`// Basic static file serving
|
|
248
|
+
const route = buildFileServerRoute({
|
|
249
|
+
path: "/static/*",
|
|
250
|
+
root: "/var/www/static",
|
|
251
|
+
});
|
|
252
|
+
|
|
253
|
+
// With directory browsing and hidden files
|
|
254
|
+
const route = buildFileServerRoute({
|
|
255
|
+
path: "/files/*",
|
|
256
|
+
root: "/var/www/files",
|
|
257
|
+
browse: true,
|
|
258
|
+
hidePatterns: [".git", ".env", "*.secret"],
|
|
259
|
+
precompressed: true,
|
|
260
|
+
});`,snippet:{prefix:"caddy-file-server-route",body:["buildFileServerRoute({"," path: ${1:/etc/caddy/config.json},",' root: ${2:""},',"})"],description:"Build File Server Route"}},buildTemplatesRoute:{name:"buildTemplatesRoute",description:"Build a templates route for server-side template rendering",params:[{name:"path",type:"string",required:true,description:'Path prefix to match (e.g., "/*.html")'},{name:"fileRoot",type:"string",required:true,description:"Root directory for template files"},{name:"mimeTypes",type:"string[]",required:false,description:"MIME types to process as templates"},{name:"delimiters",type:"[string, string]",required:false,description:'Custom delimiters (default: ["{{", "}}"])'},{name:"id",type:"string",required:false,description:"Route ID"},{name:"priority",type:"number",required:false,description:"Route priority"}],returnType:"CaddyRoute",example:`// Process HTML files as templates
|
|
261
|
+
const route = buildTemplatesRoute({
|
|
262
|
+
path: "/*.html",
|
|
263
|
+
fileRoot: "/var/www/templates",
|
|
264
|
+
mimeTypes: ["text/html"],
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
// With custom delimiters
|
|
268
|
+
const route = buildTemplatesRoute({
|
|
269
|
+
path: "/*.tmpl",
|
|
270
|
+
fileRoot: "/templates",
|
|
271
|
+
delimiters: ["<%", "%>"],
|
|
272
|
+
});`,snippet:{prefix:"caddy-templates-route",body:["buildTemplatesRoute({"," path: ${1:/etc/caddy/config.json},",' fileRoot: ${2:""},',"})"],description:"Build Templates Route"}},buildErrorRoute:{name:"buildErrorRoute",description:"Build an error route that returns a static error response",params:[{name:"match",type:"{ path?: string[]; host?: string[] }",required:false,description:"Route matchers (optional, applies to all requests if not specified)"},{name:"statusCode",type:"number",required:true,description:"HTTP status code"},{name:"message",type:"string",required:false,description:"Error message body"},{name:"headers",type:"Record<string, string[]>",required:false,description:"Custom headers to include"},{name:"id",type:"string",required:false,description:"Route ID"},{name:"priority",type:"number",required:false,description:"Route priority"}],returnType:"CaddyRoute",example:`// Simple 404 handler
|
|
273
|
+
const route = buildErrorRoute({
|
|
274
|
+
statusCode: 404,
|
|
275
|
+
message: "Page not found",
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
// JSON error response for API
|
|
279
|
+
const route = buildErrorRoute({
|
|
280
|
+
match: { path: ["/api/*"] },
|
|
281
|
+
statusCode: 500,
|
|
282
|
+
message: '{"error":"Internal server error"}',
|
|
283
|
+
headers: { "Content-Type": ["application/json"] },
|
|
284
|
+
});`,snippet:{prefix:"caddy-error-route",body:["buildErrorRoute({"," statusCode: ${1:0},","})"],description:"Build Error Route"}},buildRequestBodyHandler:{name:"buildRequestBodyHandler",description:"Build a request body handler for limiting request body size",params:[{name:"maxSize",type:"number",required:true,description:"Maximum request body size in bytes"}],returnType:"CaddyRouteHandler",example:`// Limit request body to 10MB
|
|
285
|
+
const handler = buildRequestBodyHandler({ maxSize: 10 * 1024 * 1024 });`,snippet:{prefix:"caddy-request-body-handler",body:["buildRequestBodyHandler({"," maxSize: ${1:0}","})"],description:"Build Request Body Handler"}},buildVarsHandler:{name:"buildVarsHandler",description:"Build a vars handler for setting request variables",params:[{name:"vars",type:"Record<string, string>",required:true,description:"Variables to set (key-value pairs)"}],returnType:"CaddyRouteHandler",example:`// Set custom variables for downstream handlers
|
|
286
|
+
const handler = buildVarsHandler({
|
|
287
|
+
vars: {
|
|
288
|
+
root: "/var/www",
|
|
289
|
+
backend: "api-server",
|
|
290
|
+
environment: "production",
|
|
291
|
+
}
|
|
292
|
+
});`,snippet:{prefix:"caddy-vars-handler",body:["buildVarsHandler({",' vars: ${1:""}',"})"],description:"Build Vars Handler"}},buildTracingHandler:{name:"buildTracingHandler",description:"Build a tracing handler for distributed tracing",params:[{name:"span",type:"string",required:false,description:"Span name for tracing"}],returnType:"CaddyRouteHandler",example:'const handler = buildTracingHandler({ span: "http.request" });',snippet:{prefix:"caddy-tracing-handler",body:["buildTracingHandler({","})"],description:"Build Tracing Handler"}},buildMapHandler:{name:"buildMapHandler",description:"Build a map handler for variable mapping",params:[{name:"source",type:"string",required:true,description:'Source placeholder (e.g., "{http.request.uri.path}")'},{name:"destinations",type:"string[]",required:true,description:'Destination placeholder names (e.g., ["{my_var}"])'},{name:"mappings",type:"{ input: string; outputs: string[] }[]",required:true,description:"Mappings from input patterns to outputs"},{name:"defaults",type:"string[]",required:false,description:"Default outputs if no mappings match"}],returnType:"CaddyRouteHandler",example:`// Map request paths to backend names
|
|
293
|
+
const handler = buildMapHandler({
|
|
294
|
+
source: "{http.request.uri.path}",
|
|
295
|
+
destinations: ["{backend}"],
|
|
296
|
+
mappings: [
|
|
297
|
+
{ input: "/api/*", outputs: ["api-server"] },
|
|
298
|
+
{ input: "/admin/*", outputs: ["admin-server"] },
|
|
299
|
+
],
|
|
300
|
+
defaults: ["default-server"],
|
|
301
|
+
});`,snippet:{prefix:"caddy-map-handler",body:["buildMapHandler({",' source: ${1:""},',' destinations: ${2:["value"]},',' mappings: ${3:["value"]},',"})"],description:"Build Map Handler"}}},i={authenticator:{name:"authenticator",displayName:"Authenticator (caddy-security)",description:"Serve authentication portal for caddy-security plugin",discriminator:"authenticator",commonFields:["portal_name","route_matcher"],caddyDocsPath:"https://github.com/greenpau/caddy-security"},authentication:{name:"authentication",displayName:"Authentication",description:"HTTP Basic authentication or custom auth providers",discriminator:"authentication",commonFields:["providers"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/authentication/"},reverse_proxy:{name:"reverse_proxy",displayName:"Reverse Proxy",description:"Proxy requests to upstream backend servers with load balancing",discriminator:"reverse_proxy",commonFields:["upstreams","transport","load_balancing","health_checks","headers"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/reverse_proxy/"},headers:{name:"headers",displayName:"Headers",description:"Modify request and response headers",discriminator:"headers",commonFields:["request","response"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/headers/"},static_response:{name:"static_response",displayName:"Static Response",description:"Return a static response without proxying",discriminator:"static_response",commonFields:["status_code","body","headers","close","abort"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/static_response/"},rewrite:{name:"rewrite",displayName:"Rewrite",description:"Rewrite the request URI before processing",discriminator:"rewrite",commonFields:["uri","strip_path_prefix","strip_path_suffix","uri_substring"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/rewrite/"},encode:{name:"encode",displayName:"Encode",description:"Compress responses with gzip, zstd, or brotli",discriminator:"encode",commonFields:["encodings","prefer","minimum_length"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/encode/"},subroute:{name:"subroute",displayName:"Subroute",description:"Process requests through nested routes",discriminator:"subroute",commonFields:["routes"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/subroute/"},file_server:{name:"file_server",displayName:"File Server",description:"Serve static files from disk",discriminator:"file_server",commonFields:["root","index_names","browse","hide"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/file_server/"},templates:{name:"templates",displayName:"Templates",description:"Render Go templates in responses",discriminator:"templates",commonFields:["file_root","mime_types","delimiters"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/templates/"},map:{name:"map",displayName:"Map",description:"Map input to output values for use in other handlers",discriminator:"map",commonFields:["source","destinations","mappings","defaults"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/map/"},push:{name:"push",displayName:"HTTP/2 Push",description:"Push resources to clients over HTTP/2",discriminator:"push",commonFields:["resources","headers"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/push/"},request_body:{name:"request_body",displayName:"Request Body",description:"Configure request body size limits",discriminator:"request_body",commonFields:["max_size"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/request_body/"},vars:{name:"vars",displayName:"Variables",description:"Set variables for use in other handlers",discriminator:"vars",commonFields:[],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/vars/"},intercept:{name:"intercept",displayName:"Intercept",description:"Intercept and modify responses from upstreams",discriminator:"intercept",commonFields:["handle_response"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/intercept/"},invoke:{name:"invoke",displayName:"Invoke",description:"Invoke a named route by reference",discriminator:"invoke",commonFields:["name"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/invoke/"},tracing:{name:"tracing",displayName:"Tracing",description:"Add distributed tracing spans",discriminator:"tracing",commonFields:["span"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/tracing/"},log_append:{name:"log_append",displayName:"Log Append",description:"Append custom fields to access logs",discriminator:"log_append",commonFields:["key","value"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/log_append/"},error:{name:"error",displayName:"Error",description:"Trigger an error response",discriminator:"error",commonFields:["error","status_code"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/error/"},copy_response:{name:"copy_response",displayName:"Copy Response",description:"Copy response from another handler",discriminator:"copy_response",commonFields:["status_code"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/copy_response/"},copy_response_headers:{name:"copy_response_headers",displayName:"Copy Response Headers",description:"Copy specific headers from another response",discriminator:"copy_response_headers",commonFields:["include","exclude"],caddyDocsPath:"/docs/json/apps/http/servers/routes/handle/copy_response_headers/"}},d=Object.keys(i),s=Object.keys(t);function p(){let e={};for(let[n,r]of Object.entries(t))e[n]={prefix:r.snippet.prefix,body:r.snippet.body,description:r.snippet.description};return e}function u(){return Object.values(i).map(e=>({label:e.name,detail:e.displayName,documentation:e.description}))}
|
|
302
|
+
export{t as BUILDER_METADATA,s as BUILDER_NAMES,o as GENERATED_AT,i as HANDLER_METADATA,d as HANDLER_NAMES,a as METADATA_VERSION,u as getHandlerCompletions,p as getVSCodeSnippets};
|