pub struct KeyVault { /* private fields */ }Expand description
The configured vault entries. Built once per config (re)load and carried on the proxy
Runtime.
Implementations§
Source§impl KeyVault
impl KeyVault
Sourcepub fn build(cfg: &LlmCfg) -> Result<Option<KeyVault>>
pub fn build(cfg: &LlmCfg) -> Result<Option<KeyVault>>
Build the vault from [llm].keys. Returns Ok(None) when no keys are configured (the proxy
then skips vault enforcement entirely). Rejects an empty virtual/provider key or a duplicate
virtual key, so a broken config fails at startup/reload rather than per-request.
Sourcepub fn lookup(&self, presented: &str) -> Option<&VaultEntry>
pub fn lookup(&self, presented: &str) -> Option<&VaultEntry>
Resolve a presented virtual key to its entry, or None if unknown. Scans every entry
with a constant-time comparison so the lookup time doesn’t reveal which key matched (the same
discipline as crate::auth’s API-key check).
Auto Trait Implementations§
impl Freeze for KeyVault
impl RefUnwindSafe for KeyVault
impl Send for KeyVault
impl Sync for KeyVault
impl Unpin for KeyVault
impl UnsafeUnpin for KeyVault
impl UnwindSafe for KeyVault
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more