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: StringRealm shown in the WWW-Authenticate challenge on a 401, i.e. the name the browser’s
password prompt displays. Only used when mode = "basic".
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".