From b0a25f2794560e0ec5a7114b2c7d9dc90bd72fb1 Mon Sep 17 00:00:00 2001 From: "Parker J. Rule" Date: Thu, 25 Sep 2025 17:17:33 -0400 Subject: [PATCH] feat(cli): add flag in HttpConfig for auth on custom routes (#6193) We currently only support auth on the default routes; we'd like to be able to support it on all (non-meta/liveness probe) routes by default. This is the first step in that direction. --- libs/cli/langgraph_cli/config.py | 8 ++++++++ libs/cli/schemas/schema.json | 4 ++++ libs/cli/schemas/schema.v0.json | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/libs/cli/langgraph_cli/config.py b/libs/cli/langgraph_cli/config.py index 3b47788eb..022e99e18 100644 --- a/libs/cli/langgraph_cli/config.py +++ b/libs/cli/langgraph_cli/config.py @@ -371,6 +371,14 @@ class HttpConfig(TypedDict, total=False): Default is `middleware_first`. """ + enable_custom_route_auth: bool + """Optional. If True, authentication is enabled for custom routes, + not just the routes that are protected by default. + (Routes protected by default include /assistants, /threads, and /runs). + + Default is False. This flag only affects authentication behavior + if `app` is provided and contains custom routes. + """ class Config(TypedDict, total=False): diff --git a/libs/cli/schemas/schema.json b/libs/cli/schemas/schema.json index 03fe74ee8..1dc83c607 100644 --- a/libs/cli/schemas/schema.json +++ b/libs/cli/schemas/schema.json @@ -577,6 +577,10 @@ "type": "boolean", "description": "Optional. If True, /threads routes are removed.\n\nDefault is False.\n" }, + "enable_custom_route_auth": { + "type": "boolean", + "description": "Optional. If True, authentication is enabled for custom routes,\nnot just the routes that are protected by default.\n(Routes protected by default include /assistants, /threads, and /runs).\n\nDefault is False. This flag only affects authentication behavior\nif `app` is provided and contains custom routes.\n" + }, "logging_headers": { "anyOf": [ { diff --git a/libs/cli/schemas/schema.v0.json b/libs/cli/schemas/schema.v0.json index 03fe74ee8..1dc83c607 100644 --- a/libs/cli/schemas/schema.v0.json +++ b/libs/cli/schemas/schema.v0.json @@ -577,6 +577,10 @@ "type": "boolean", "description": "Optional. If True, /threads routes are removed.\n\nDefault is False.\n" }, + "enable_custom_route_auth": { + "type": "boolean", + "description": "Optional. If True, authentication is enabled for custom routes,\nnot just the routes that are protected by default.\n(Routes protected by default include /assistants, /threads, and /runs).\n\nDefault is False. This flag only affects authentication behavior\nif `app` is provided and contains custom routes.\n" + }, "logging_headers": { "anyOf": [ {