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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
//! Shared infrastructure for projects spawned from `rust-template`.
//!
//! This crate extracts the generic plumbing (config loading, logging,
//! health checks, metrics, OpenAPI, OIDC auth, systemd integration) so
//! downstream projects consume it as a git dependency and receive
//! improvements via `cargo update`.
//!
//! # Feature flags
//!
//! - **`cli`** — `CommonConfigFile` (file side of the CLI/file merge),
//! CLI logging, `CliApp` trait, the `MergeConfig` derive (which
//! generates `CliRaw` with per-app-prefixed env vars), and
//! `#[foundation_main]`.
//! - **`server`** — Health registry, metrics endpoint, OpenAPI/Scalar
//! helpers, SPA fallback, systemd notify/watchdog, server logging.
//! - **`auth`** (implies `server` + `cli`) — OIDC login/callback/logout
//! handlers, `require_auth` middleware, `Server` runner, `ServerApp`
//! trait, and `BaseServerState`.
/// Convenience re-exports used by most downstream crates.
// Re-export proc macros so users write
// `use rust_template_foundation::main` and
// `use rust_template_foundation::MergeConfig`.
pub use foundation_main as main;
pub use MergeConfig;
// Re-exported for the `MergeConfig` derive macro to reference without
// requiring downstream crates to depend on `thiserror` directly. Not
// part of the public API.
pub use thiserror;
// Re-export CliApp at crate root for CLI apps.
pub use CliApp;
// Re-export key runner types at crate root for server apps.
pub use ;