pub struct SecretManager { /* private fields */ }Expand description
High-level manager responsible for coordinating secret retrieval and caching.
The SecretManager wraps a SecretProvider (stored as source) and adds a
caching layer to reduce the overhead of frequent lookups, such as
database queries or remote API calls.
Implementations§
Source§impl SecretManager
impl SecretManager
Sourcepub fn new(source: Arc<dyn SecretSourceExt>, cache_ttl_secs: u64) -> Self
pub fn new(source: Arc<dyn SecretSourceExt>, cache_ttl_secs: u64) -> Self
Creates a new SecretManager with the specified secret source and cache expiration.
This constructor initializes an internal [SecretCache] that helps avoid redundant lookups for the same client IP, improving performance during high-frequency RADIUS requests.
§Arguments
source- An Arc-wrapped trait object that provides the actual shared secrets.cache_ttl_secs- The duration (in seconds) that a secret remains valid in the cache before being refreshed from the source.
Trait Implementations§
Source§impl SecretProvider for SecretManager
impl SecretProvider for SecretManager
Auto Trait Implementations§
impl Freeze for SecretManager
impl !RefUnwindSafe for SecretManager
impl Send for SecretManager
impl Sync for SecretManager
impl Unpin for SecretManager
impl !UnwindSafe for SecretManager
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