InternalTokenAuthFilter
public class InternalTokenAuthFilter implements WebFilter
io/agentscope/builder/web/auth/InternalTokenAuthFilter.java:40–75内部令牌认证过滤器,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.auth 包,实现 WebFilter。核心成员包括 filter、InternalTokenAuthFilter、INTERNAL_TOKEN_HEADER、INTERNAL_USER_HEADER、ROLE_INTERNAL。
Authenticates cross-plane internal calls via a shared static token carried in X-Builder-Internal-Token. Used on control-plane /api/internal/** routes and on
data-plane endpoints invoked by the control plane or scheduler (never by browsers). The acting
owner is carried in X-Builder-Internal-User and exposed as the authentication principal
so the receiving plane can attribute the operation without a user JWT.
The filter is a no-op when the configured token is blank (internal endpoints stay closed: without an authentication the security chain rejects them with 401) or when the presented token does not match — in both cases the request continues unauthenticated.
字段摘要Field Summary
| 字段Field | 类型Type | 说明Description |
|---|---|---|
INTERNAL_TOKEN_HEADERstaticfinal | String | 内部令牌请求头字段。 The INTERNAL TOKEN HEADER field. |
INTERNAL_USER_HEADERstaticfinal | String | 内部用户请求头字段。 The INTERNAL USER HEADER field. |
ROLE_INTERNALstaticfinal | String | 角色内部字段。 The ROLE INTERNAL field. |
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public InternalTokenAuthFilter(String internalToken) | 初始化 `InternalTokenAuthFilter` 实例。 Creates a new instance. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain) | 执行过滤器相关操作。 Performs the filter operation. |
字段详情Field Detail
INTERNAL_TOKEN_HEADER
public static final String INTERNAL_TOKEN_HEADER
内部令牌请求头字段。声明为 public static final String INTERNAL_TOKEN_HEADER。
The INTERNAL TOKEN HEADER field.
io/agentscope/builder/web/auth/InternalTokenAuthFilter.java:42INTERNAL_USER_HEADER
public static final String INTERNAL_USER_HEADER
内部用户请求头字段。声明为 public static final String INTERNAL_USER_HEADER。
The INTERNAL USER HEADER field.
io/agentscope/builder/web/auth/InternalTokenAuthFilter.java:43ROLE_INTERNAL
public static final String ROLE_INTERNAL
角色内部字段。声明为 public static final String ROLE_INTERNAL。
The ROLE INTERNAL field.
io/agentscope/builder/web/auth/InternalTokenAuthFilter.java:44构造器详情Constructor Detail
InternalTokenAuthFilter
public InternalTokenAuthFilter(String internalToken)
初始化 InternalTokenAuthFilter 实例。
Creates a new instance.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
internalToken | String | 内部令牌(类型 `String`)。The internal token. |
io/agentscope/builder/web/auth/InternalTokenAuthFilter.java:48–50方法详情Method Detail
filter
public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain)
执行过滤器相关操作。
Performs the filter operation.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
exchange | ServerWebExchange | exchange(类型 `ServerWebExchange`)。The exchange. |
chain | WebFilterChain | chain(类型 `WebFilterChain`)。The chain. |
Mono<Void>io/agentscope/builder/web/auth/InternalTokenAuthFilter.java:52–68