pub struct AgentCredentialResolver { /* private fields */ }Expand description
Hot-reloadable resolver. Bindings + warnings + strict level live in
ArcSwap/ArcSwap/atomic so the runtime can swap them without
re-creating the Arc<AgentCredentialResolver> every plugin/tool
holds.
Implementations§
Source§impl AgentCredentialResolver
impl AgentCredentialResolver
pub fn empty() -> Self
Sourcepub fn resolve(
&self,
agent_id: &str,
channel: Channel,
) -> Result<CredentialHandle, ResolveError>
pub fn resolve( &self, agent_id: &str, channel: Channel, ) -> Result<CredentialHandle, ResolveError>
Lookup the outbound handle for (agent, channel). Never panics
on missing bindings — returns ResolveError::Unbound so the
calling tool can surface a clean error to the LLM.
pub fn version(&self) -> u64
pub fn warnings(&self) -> Vec<String>
pub fn strict(&self) -> StrictLevel
Sourcepub fn replace_state(
&self,
new_bindings: HashMap<AgentId, HashMap<Channel, CredentialHandle>>,
new_warnings: Vec<String>,
new_strict: StrictLevel,
)
pub fn replace_state( &self, new_bindings: HashMap<AgentId, HashMap<Channel, CredentialHandle>>, new_warnings: Vec<String>, new_strict: StrictLevel, )
Atomic hot-reload — replaces bindings, warnings, and strict
level in one swap. Existing CredentialHandles already issued
to in-flight tool calls keep working (handles are by-value
clones, the resolver only mediates lookup of future calls).
Sourcepub fn build(
agents: &[AgentCredentialsInput],
stores: &CredentialStores,
strict: StrictLevel,
) -> Result<Self, Vec<BuildError>>
pub fn build( agents: &[AgentCredentialsInput], stores: &CredentialStores, strict: StrictLevel, ) -> Result<Self, Vec<BuildError>>
Sourcepub fn rebuild(
&self,
agents: &[AgentCredentialsInput],
stores: &CredentialStores,
strict: StrictLevel,
) -> Result<(), Vec<BuildError>>
pub fn rebuild( &self, agents: &[AgentCredentialsInput], stores: &CredentialStores, strict: StrictLevel, ) -> Result<(), Vec<BuildError>>
Reload entry point — runs build against fresh inputs and
atomically swaps the new state into self. Used by the
admin endpoint and integration tests.