feat(cli): add configuration for server customization ordering (#6179)

This adds a configuration option in `HttpConfig` that allows LangGraph
Platform users to apply custom authentication hooks before (other)
custom middleware. Currently, the order is fixed (custom middleware is
always evaluated before custom auth).

(Apologies for the noise in
[de187a9](https://github.com/langchain-ai/langgraph/pull/6179/commits/de187a989e807c5687c22db1fc065d24030fa6b7),
apparently from the forced application of new linter rules.)
This commit is contained in:
Parker J. Rule
2025-09-22 11:17:24 -04:00
committed by GitHub
parent fe4029b3b8
commit fb531b2473
4 changed files with 115 additions and 40 deletions
+12
View File
@@ -18,6 +18,7 @@ DEFAULT_IMAGE_DISTRO = "debian"
Distros = Literal["debian", "wolfi", "bullseye", "bookworm"]
MiddlewareOrders = Literal["auth_first", "middleware_first"]
class TTLConfig(TypedDict, total=False):
@@ -359,6 +360,17 @@ class HttpConfig(TypedDict, total=False):
agent's behavior or permissions on a request's headers."""
logging_headers: Optional[ConfigurableHeaderConfig]
"""Optional. Defines which headers are excluded from logging."""
middleware_order: Optional[MiddlewareOrders]
"""Optional. Defines the order in which to apply server customizations.
Choices:
- "auth_first": Authentication hooks (custom or default) are evaluated
before custom middleware.
- "middleware_first": Custom middleware is evaluated
before authentication hooks (custom or default).
Default is `middleware_first`.
"""
class Config(TypedDict, total=False):