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
//! Flat index of every Tower Layer modo ships.
//!
//! Wiring-site ergonomics: `use modo::middlewares as mw;` then
//! `.layer(mw::session(...))`, `.layer(mw::cors(...))`, etc.
//!
//! Two calling conventions are exported, matching how the underlying
//! domain modules construct their layers:
//!
//! - **lower_case names are functions** — call them directly:
//! `mw::session(store, cookie_cfg, key)`, `mw::role(extractor)`,
//! `mw::tenant(strategy, resolver)`, `mw::cors(cors_cfg)`.
//! - **PascalCase names are `Layer` structs** — call `::new(...)`:
//! `mw::Jwt::new(cfg)`, `mw::ApiKey::new(store)`,
//! `mw::Flash::new(cookie_cfg)`, `mw::ClientIp::new(trusted_proxies)`.
//!
//! The split reflects upstream constructor design (some modules expose
//! free constructors, others only their `Layer` type). It avoids
//! inventing wrapper functions just for uniformity.
// Free constructor functions.
pub use cratemiddleware as role;
// NOTE: session layer constructor removed in v0.8 — SessionStore is now pub(crate);
// use modo::auth::session::layer directly within-crate, or via TestSession in tests.
pub use cratemiddleware as tenant;
// Layer structs — users call `::new(...)`.
pub use crateApiKeyLayer as ApiKey;
pub use crateJwtLayer as Jwt;
pub use crateFlashLayer as Flash;
pub use crateGeoLayer as Geo;
pub use crateClientIpLayer as ClientIp;
pub use crateTemplateContextLayer as TemplateContext;
pub use crateTierLayer as Tier;
// Always-available middleware — free functions.
pub use crate;