pub struct AuthConfig {
pub passwords: Vec<String>,
pub users: Vec<UserEntry>,
pub http_url: Option<String>,
pub http_node_token: Option<String>,
pub http_codec: Option<String>,
pub http_cache_ttl_secs: u64,
pub http_cache_stale_ttl_secs: u64,
pub http_cache_neg_ttl_secs: u64,
}Fields§
§passwords: Vec<String>Simple password list (no user IDs).
passwords = ["password1", "password2"]users: Vec<UserEntry>User entries with explicit IDs.
[[auth.users]]
id = "alice"
password = "secret1"http_url: Option<String>HTTP remote auth-worker URL.
http_url = "https://auth.example.workers.dev"http_node_token: Option<String>Bearer token for node authentication with the auth-worker.
http_codec: Option<String>Serialization codec for HTTP auth: “bincode” (default) or “json”.
http_cache_ttl_secs: u64HTTP auth cache TTL in seconds (default: 300 = 5 min).
Only applies when http_url is set.
http_cache_stale_ttl_secs: u64HTTP auth stale-while-revalidate window in seconds (default: 600 = 10 min). Stale cache entries are served immediately while revalidated in the background.
http_cache_neg_ttl_secs: u64HTTP auth negative cache TTL in seconds (default: 10). Invalid hashes are cached for this duration to prevent request flooding.
Trait Implementations§
Source§impl Clone for AuthConfig
impl Clone for AuthConfig
Source§fn clone(&self) -> AuthConfig
fn clone(&self) -> AuthConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuthConfig
impl Debug for AuthConfig
Source§impl Default for AuthConfig
impl Default for AuthConfig
Source§fn default() -> AuthConfig
fn default() -> AuthConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for AuthConfig
impl<'de> Deserialize<'de> for AuthConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AuthConfig
impl RefUnwindSafe for AuthConfig
impl Send for AuthConfig
impl Sync for AuthConfig
impl Unpin for AuthConfig
impl UnsafeUnpin for AuthConfig
impl UnwindSafe for AuthConfig
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