lib.rs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. //! `d_oauth` — OAuth 2.1-only authorization server library.
  2. //!
  3. //! Module layout (authoritative; see `.omo/plans/rust-oauth21-server.md`):
  4. //! `config`, `keys`, `error`, `state`, `crypto::*`, `jose::*`, `db::*`,
  5. //! `store::*`, `protocol::*`, `ui::*`, `middleware::*`, `resilience`, `routes`,
  6. //! `serve`, `tls`, `cli`.
  7. //! Every later todo places new code in exactly one of these modules.
  8. #![forbid(unsafe_code)]
  9. pub mod cli;
  10. pub mod config;
  11. pub mod crypto;
  12. pub mod db;
  13. pub mod error;
  14. pub mod jose;
  15. pub mod keys;
  16. pub mod middleware;
  17. pub mod protocol;
  18. pub mod resilience;
  19. pub mod routes;
  20. pub mod serve;
  21. pub mod state;
  22. pub mod store;
  23. #[cfg(test)]
  24. pub(crate) mod test_guard;
  25. #[cfg(test)]
  26. pub(crate) mod test_support;
  27. pub mod tls;
  28. pub mod ui;
  29. /// Build the axum router for the authorization server.
  30. ///
  31. /// Minimal skeleton: routes and middleware land here in later todos.
  32. ///
  33. /// TODO(task 40): mount health, OAuth, and UI routes with the middleware chain.
  34. pub fn app() -> axum::Router {
  35. axum::Router::new()
  36. }
  37. #[cfg(test)]
  38. mod tests {
  39. /// Smoke test proving the crate builds and the router constructs.
  40. #[test]
  41. fn crate_builds() {
  42. let _router: axum::Router = super::app();
  43. }
  44. }