OpenAgentID documentation
Source referencesRust module referencearsenal-store

arsenal-store · variable_resolver

Declared module signatures, types, configuration, and source documentation.

Source: arsenal/crates/arsenal-store/src/variable_resolver.rs. SHA-256: d20f8680464033e18d84d462ef627d5ab542791643cc94740744a31f9016ebff.

This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.

variable_resolver::VariableResolverResult

Result type for variable resolver operations

pub type VariableResolverResult<T> = Result<T, SecretStoreError>;

Source line: 21.

variable_resolver::VariableMappings

Variable mappings (variable name -> secret reference)

pub type VariableMappings = BTreeMap<String, SecretRef>;

Source line: 24.

variable_resolver::VariableResolver

Trait for template variable resolution backends

pub trait VariableResolver: Send + Sync {
    /// Resolve a variable name to a secret reference
    fn resolve<'a>(
        &'a self,
        tenant_id: &'a TenantId,
        variable: &'a str,
    ) -> Pin<Box<dyn Future<Output = VariableResolverResult<Option<SecretRef>>> + Send + 'a>>;

    /// Register a variable-to-secret mapping
    fn register<'a>(
        &'a self,
        tenant_id: &'a TenantId,
        variable: &'a str,
        secret_ref: SecretRef,
    ) -> Pin<Box<dyn Future<Output = VariableResolverResult<()>> + Send + 'a>>;

    /// Remove a variable mapping
    fn unregister<'a>(
        &'a self,
        tenant_id: &'a TenantId,
        variable: &'a str,
    ) -> Pin<Box<dyn Future<Output = VariableResolverResult<()>> + Send + 'a>>;

    /// List all variable mappings for a tenant
    fn list<'a>(
        &'a self,
        tenant_id: &'a TenantId,
    ) -> Pin<Box<dyn Future<Output = VariableResolverResult<VariableMappings>> + Send + 'a>>;
}

Source line: 27.

variable_resolver::InMemoryVariableResolver

In-memory variable resolver for development and testing

#[derive(Debug, Clone)]
pub struct InMemoryVariableResolver {

}

Source line: 59.

variable_resolver::InMemoryVariableResolver::new

Create a new empty in-memory variable resolver

#[must_use]
pub fn new() -> Self;

Source line: 67.

variable_resolver::SqlVariableResolver

SQL-backed variable resolver (Postgres / SQLite) using sqlx.

Stores variable-to-secret mappings in a SQL table with the SecretRef serialized as JSON TEXT. Follows the same dual-pool pattern as SqlRevocationStore in arsenal-broker.

#[cfg(any(feature = "sqlite", feature = "postgres"))]
pub struct SqlVariableResolver {

}

Source line: 157.

variable_resolver::SqlVariableResolver::connect

Create a new SQL-backed variable resolver and ensure the schema exists.

Errors

Returns an error if the database cannot be reached or schema init fails.

#[cfg(any(feature = "sqlite", feature = "postgres"))]
pub async fn connect(
        database_url: &str,
        table: String,
        max_connections: u32,
        connect_timeout: std::time::Duration,
    ) -> VariableResolverResult<Self>;

Source line: 201.

On this page