1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! JWT (JSON Web Token) authentication middleware.
//!
//! Trait-based: implement [`JwtVerifier`] with your preferred JWT library
//! and pass it to [`JwtAuth`]. Enable the `jwt-simple` cargo feature for the
//! batteries-included verifier built on top of `jwt-simple` — it supports
//! HMAC, RSA, RSA-PSS, ECDSA, `EdDSA` and `BLAKE2b`.
//!
//! v2 additions:
//!
//! - **JWKS rotation** via [`stores::JwksProvider`](crate::stores::JwksProvider).
//! The bundled `MultiKeyVerifier` (under the `jwt-simple` feature) selects keys by `kid`, falling back to
//! the configured static map when the provider returns no match.
//! - **Configurable issuer / audience / leeway** through
//! [`VerifyConstraints`]. Applied uniformly across every algorithm.
//! - **Revocation list** via the [`RevocationList`] trait — simple in-memory
//! `HashSet<String>` of revoked `jti` values is provided.
//! - **Optional remote introspection** via [`IntrospectionFn`] — the
//! middleware calls back on every request when configured, which is the
//! correct hook for opaque tokens or tenant-scoped revocation.
pub use AnyVerifyKey;
pub use MultiKeyVerifier;
pub use JwtAuth;
pub use InMemoryRevocationList;
pub use IntrospectionFn;
pub use JtiExtractorFn;
pub use RevocationCheck;
pub use RevocationList;
pub use ConstraintsNotSupported;
pub use JwtVerifier;
pub use VerifyConstraints;