AS AgentScopeAPI 手册 / API Reference

InternalTokenAuthFilter

public class InternalTokenAuthFilter implements WebFilter
源码Source 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_HEADER
staticfinal
String
内部令牌请求头字段。
The INTERNAL TOKEN HEADER field.
INTERNAL_USER_HEADER
staticfinal
String
内部用户请求头字段。
The INTERNAL USER HEADER field.
ROLE_INTERNAL
staticfinal
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
staticfinal

内部令牌请求头字段。声明为 public static final String INTERNAL_TOKEN_HEADER。

The INTERNAL TOKEN HEADER field.

源码Source io/agentscope/builder/web/auth/InternalTokenAuthFilter.java:42

INTERNAL_USER_HEADER

public static final String INTERNAL_USER_HEADER
staticfinal

内部用户请求头字段。声明为 public static final String INTERNAL_USER_HEADER。

The INTERNAL USER HEADER field.

源码Source io/agentscope/builder/web/auth/InternalTokenAuthFilter.java:43

ROLE_INTERNAL

public static final String ROLE_INTERNAL
staticfinal

角色内部字段。声明为 public static final String ROLE_INTERNAL。

The ROLE INTERNAL field.

源码Source io/agentscope/builder/web/auth/InternalTokenAuthFilter.java:44

构造器详情Constructor Detail

InternalTokenAuthFilter

public InternalTokenAuthFilter(String internalToken)

初始化 InternalTokenAuthFilter 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
internalTokenString内部令牌(类型 `String`)。The internal token.
源码Source io/agentscope/builder/web/auth/InternalTokenAuthFilter.java:48–50

方法详情Method Detail

filter

public Mono<Void> filter(ServerWebExchange exchange, WebFilterChain chain)

执行过滤器相关操作。

Performs the filter operation.

参数Parameters
名称Name类型Type说明Description
exchangeServerWebExchangeexchange(类型 `ServerWebExchange`)。The exchange.
chainWebFilterChainchain(类型 `WebFilterChain`)。The chain.
返回Returns Mono<Void>
返回Mono。Returns mono.
源码Source io/agentscope/builder/web/auth/InternalTokenAuthFilter.java:52–68
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.