mobius_gateway/auth/
config.rs1use crate::Result;
4
5mobius::embedded_config! {
6 copy;
7#[derive(Debug, Clone, Copy, PartialEq, Eq)]
9pub struct AuthConfig {
10 pub paired_clients: usize,
12 pub pairing_lifetime_seconds: u64,
14}
15 defaults = include_str!("defaults.toml");
16}
17impl AuthConfig {
18 pub fn validate(&self) -> Result<()> {
22 crate::config::bounded(
23 "auth.paired_clients",
24 self.paired_clients,
25 1..=crate::config::MAX_CAPACITY,
26 )?;
27 crate::config::bounded(
28 "auth.pairing_lifetime_seconds",
29 self.pairing_lifetime_seconds,
30 1..=86_400,
31 )?;
32 Ok(())
33 }
34}