pub enum AuthEngine {
Open,
Basic,
ApiKey {
keys: Vec<String>,
header: HeaderName,
},
Jwt(Box<JwtValidator>),
}Expand description
Per-request authentication engine, built once from AuthCfg and held in the
hot-swappable runtime.
Variants§
Open
No authentication — every request is allowed with no principal.
Basic
ApiKey
Jwt(Box<JwtValidator>)
Implementations§
Source§impl AuthEngine
impl AuthEngine
Sourcepub fn build(cfg: &AuthCfg) -> Result<AuthEngine>
pub fn build(cfg: &AuthCfg) -> Result<AuthEngine>
Build the engine for the configured mode. Fails fast on a malformed JWT policy (bad
algorithm, unparseable static key) so a misconfiguration surfaces at startup/reload
rather than as a blanket 401 at request time.
Apply the gate to a request’s headers. Async because the JWT path may fetch a JWKS.
Auto Trait Implementations§
impl !Freeze for AuthEngine
impl !RefUnwindSafe for AuthEngine
impl !UnwindSafe for AuthEngine
impl Send for AuthEngine
impl Sync for AuthEngine
impl Unpin for AuthEngine
impl UnsafeUnpin for AuthEngine
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