SecretSource

Trait SecretSource 

Source
pub trait SecretSource:
    Send
    + Sync
    + 'static {
    // Required method
    fn get_all_secrets(
        &self,
    ) -> impl Future<Output = Result<Vec<(Cidr, Vec<u8>)>, BoxError>> + Send;
}
Expand description

A provider that maps incoming client IP ranges to their shared secrets.

In the RADIUS protocol, the server identifies which password (shared secret) to use based on the source IP address of the Network Access Server (NAS).

Implement this trait to define how your server looks up these secrets—whether from a static list, a configuration file, or a database.

Required Methods§

Source

fn get_all_secrets( &self, ) -> impl Future<Output = Result<Vec<(Cidr, Vec<u8>)>, BoxError>> + Send

Retrieves a complete list of IP networks and their associated secrets.

The server’s secret manager will call this periodically to refresh its internal cache.

§Returns

A list of tuples where:

  • Cidr - The IP range (e.g., 192.168.1.0/24) allowed to connect.
  • Vec<u8> - The shared secret used to sign and encrypt packets for that range.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§