Skip to main content

TenantStore

Trait TenantStore 

Source
pub trait TenantStore: Send + Sync {
    // Required method
    fn authenticate(&self, api_key: &str) -> Option<Arc<Tenant>>;
}
Expand description

Resolves a presented high-entropy API key without retaining its plaintext.

Required Methods§

Source

fn authenticate(&self, api_key: &str) -> Option<Arc<Tenant>>

Return the matching tenant, or None for an invalid key.

Returning an Arc rather than an owned Tenant because this runs once per request and a PriceBook is two BTreeMaps: handing back a value meant deep-copying every priced tool name on every call, for data the request only reads.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§