pub struct AuthCfg {
pub mode: String,
pub realm: String,
pub users: BTreeMap<String, String>,
pub api_keys: Vec<String>,
pub api_key_header: String,
pub jwt: JwtCfg,
}Fields§
§mode: String“none” | “basic” | “apikey” | “jwt”. Selects the gate applied to every proxied
request; the internal /__edgeguard/* endpoints are always exempt.
realm: String§users: BTreeMap<String, String>username -> password. Value may be plaintext (dev) or a $argon2... PHC hash.
Used when mode = "basic".
api_keys: Vec<String>Accepted API keys (compared in constant time). Used when mode = "apikey". A request
may present a key either as Authorization: Bearer <key> or in api_key_header.
Overridable from the env via EDGEGUARD_API_KEYS (comma-separated) so keys need not
live in the config file.
api_key_header: StringHeader carrying the API key (in addition to Authorization: Bearer), default
X-API-Key. Used when mode = "apikey".
jwt: JwtCfgJWT verification policy. Used when mode = "jwt".
Trait Implementations§
Source§impl<'de> Deserialize<'de> for AuthCfg
impl<'de> Deserialize<'de> for AuthCfg
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 AuthCfg
impl RefUnwindSafe for AuthCfg
impl Send for AuthCfg
impl Sync for AuthCfg
impl Unpin for AuthCfg
impl UnsafeUnpin for AuthCfg
impl UnwindSafe for AuthCfg
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