AS AgentScopeAPI 手册 / API Reference

VaultCredentialResolver

@Component public class VaultCredentialResolver
源码Source io/agentscope/builder/web/managed/VaultCredentialResolver.java:39–363

Vault 凭证解析器,承载智能体的部署、调度与服务化运行。位于 io.agentscope.builder.web.managed 包。核心成员包括 resolveToolsConfig、resolveSessionToolsConfig、resolveEnvSecrets、VaultCredentialResolver。

Resolves vault credentials into MCP ToolsConfig env substitutions so session vault mounts actually reach MCP server processes.

构造器摘要Constructor Summary

构造器Constructor说明Description
public VaultCredentialResolver(VaultService vaultService, VaultCredentialEntityRepository credentialRepository)
初始化 `VaultCredentialResolver` 实例。
Creates a new instance.

方法摘要Method Summary

方法Method说明Description
public ToolsConfig resolveToolsConfig(String ownerId, ToolsConfig base, List<String> vaultIds)
解析工具配置。
Patches an in-memory `ToolsConfig` (typically derived from the agent version snapshot) with vault secrets: substitutes `${ENV}` placeholders and merges targeted credentials into MCP server env maps.
public ToolsConfig resolveSessionToolsConfig(ToolsConfig base, List<Map<String, Object>> credentials)
解析会话工具配置。
Resolves only session-authorized CP credentials.
public Map<String, String> resolveEnvSecrets(String ownerId, List<String> vaultIds)
解析 `resolveEnvSecrets`。
Flattens vault credentials into env-var → plaintext secret.

构造器详情Constructor Detail

VaultCredentialResolver

public VaultCredentialResolver(VaultService vaultService, VaultCredentialEntityRepository credentialRepository)

初始化 VaultCredentialResolver 实例。

Creates a new instance.

参数Parameters
名称Name类型Type说明Description
vaultServiceVaultServicevault 服务(类型 `VaultService`)。The vault service.
credentialRepositoryVaultCredentialEntityRepository凭证仓库(类型 `VaultCredentialEntityRepository`)。The credential repository.
源码Source io/agentscope/builder/web/managed/VaultCredentialResolver.java:51–55

方法详情Method Detail

resolveToolsConfig

public ToolsConfig resolveToolsConfig(String ownerId, ToolsConfig base, List<String> vaultIds)

解析工具配置。

Patches an in-memory ToolsConfig (typically derived from the agent version snapshot) with vault secrets: substitutes ${ENV} placeholders and merges targeted credentials into MCP server env maps.

参数Parameters
名称Name类型Type说明Description
ownerIdString所有者标识(类型 `String`)。The owner id.
baseToolsConfig基类(类型 `ToolsConfig`)。config to patch; when `null`, returns `null`
vaultIdsList<String>vault Ids(类型 `List`)。The vault ids.
返回Returns ToolsConfig
返回ToolsConfig。a new patched config, or `base` unchanged when no vault secrets apply
源码Source io/agentscope/builder/web/managed/VaultCredentialResolver.java:65–87

resolveSessionToolsConfig

public ToolsConfig resolveSessionToolsConfig(ToolsConfig base, List<Map<String, Object>> credentials)

解析会话工具配置。

Resolves only session-authorized CP credentials.

参数Parameters
名称Name类型Type说明Description
baseToolsConfig基类(类型 `ToolsConfig`)。The base.
credentialsList<Map<String, Object>>凭证(类型 `List >`)。The credentials.
返回Returns ToolsConfig
返回ToolsConfig。Returns tools config.
源码Source io/agentscope/builder/web/managed/VaultCredentialResolver.java:90–149

resolveEnvSecrets

public Map<String, String> resolveEnvSecrets(String ownerId, List<String> vaultIds)

解析 resolveEnvSecrets。

Flattens vault credentials into env-var → plaintext secret.

参数Parameters
名称Name类型Type说明Description
ownerIdString所有者标识(类型 `String`)。The owner id.
vaultIdsList<String>vault Ids(类型 `List`)。The vault ids.
返回Returns Map<String, String>
返回映射。Returns map.
源码Source io/agentscope/builder/web/managed/VaultCredentialResolver.java:221–274
基于官方固定版本源码静态生成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.