08c6e12a74
Refactor configuration loading to separate user credentials from server settings. Update dependencies to their latest compatible versions to leverage new features and security patches. Key changes include: - Moving user credentials (`api_key`, `web_password`, `role`) from `.env` to a dedicated `users.toml` file for better manageability and security. - Introducing an `AuthenticatedUser` struct and extractor for API key-based authentication. - Updating `axum` and related crates to leverage Rust edition 2024 improvements. - Adjusting configuration values and tests to reflect these changes.
16 lines
296 B
Rust
16 lines
296 B
Rust
pub mod auth;
|
|
pub mod config;
|
|
pub mod error;
|
|
pub mod routes;
|
|
|
|
use std::sync::Arc;
|
|
|
|
use axum::Router;
|
|
|
|
use config::Config;
|
|
|
|
/// Build the application router. Used by main.rs and integration tests.
|
|
pub fn create_router(config: Arc<Config>) -> Router {
|
|
routes::api_router().with_state(config)
|
|
}
|