diff --git a/app/(dashboard)/proxy-hosts/actions.ts b/app/(dashboard)/proxy-hosts/actions.ts index a25eaf6f..1c26cb36 100644 --- a/app/(dashboard)/proxy-hosts/actions.ts +++ b/app/(dashboard)/proxy-hosts/actions.ts @@ -77,6 +77,7 @@ function parseAuthentikConfig(formData: FormData): ProxyHostAuthentikInput | und const copyHeaders = parseCsv(formData.get("authentik_copy_headers")); const trustedProxies = parseCsv(formData.get("authentik_trusted_proxies")); const protectedPaths = parseCsv(formData.get("authentik_protected_paths")); + const excludedPaths = parseCsv(formData.get("authentik_excluded_paths")); const setHostHeader = formData.has("authentik_set_host_header_present") ? parseCheckbox(formData.get("authentik_set_host_header")) : undefined; @@ -103,6 +104,9 @@ function parseAuthentikConfig(formData: FormData): ProxyHostAuthentikInput | und if (protectedPaths.length > 0 || formData.has("authentik_protected_paths")) { result.protectedPaths = protectedPaths; } + if (excludedPaths.length > 0 || formData.has("authentik_excluded_paths")) { + result.excludedPaths = excludedPaths; + } if (setHostHeader !== undefined) { result.setOutpostHostHeader = setHostHeader; } @@ -122,6 +126,7 @@ function parseCpmForwardAuthConfig(formData: FormData): CpmForwardAuthInput | un : false : undefined; const protectedPaths = parseCsv(formData.get("cpm_forward_auth_protected_paths")); + const excludedPaths = parseCsv(formData.get("cpm_forward_auth_excluded_paths")); const result: CpmForwardAuthInput = {}; if (enabledValue !== undefined) { @@ -130,6 +135,9 @@ function parseCpmForwardAuthConfig(formData: FormData): CpmForwardAuthInput | un if (protectedPaths.length > 0 || formData.has("cpm_forward_auth_protected_paths")) { result.protected_paths = protectedPaths.length > 0 ? protectedPaths : null; } + if (excludedPaths.length > 0 || formData.has("cpm_forward_auth_excluded_paths")) { + result.excluded_paths = excludedPaths.length > 0 ? excludedPaths : null; + } return Object.keys(result).length > 0 ? result : undefined; } diff --git a/app/api/v1/openapi.json/route.ts b/app/api/v1/openapi.json/route.ts index 92ba74a4..a37f3eb1 100644 --- a/app/api/v1/openapi.json/route.ts +++ b/app/api/v1/openapi.json/route.ts @@ -1448,6 +1448,7 @@ const spec = { trustedProxies: { type: "array", items: { type: "string" }, example: ["private_ranges"] }, setOutpostHostHeader: { type: "boolean" }, protectedPaths: { type: ["array", "null"], items: { type: "string" }, description: "Paths to protect (null = all)" }, + excludedPaths: { type: ["array", "null"], items: { type: "string" }, description: "Paths to exclude from auth (bypassed while rest is protected)" }, }, }, LoadBalancerConfig: { diff --git a/src/components/proxy-hosts/AuthentikFields.tsx b/src/components/proxy-hosts/AuthentikFields.tsx index ed1c5abe..f2b950b9 100644 --- a/src/components/proxy-hosts/AuthentikFields.tsx +++ b/src/components/proxy-hosts/AuthentikFields.tsx @@ -162,6 +162,19 @@ export function AuthentikFields({ Leave empty to protect entire domain. Specify paths to protect specific routes only.

+
+ +