Add HTTP Basic Auth
All write endpoints and the manage routes are gated behind HTTP Basic Auth middleware; credentials are configured via [auth] in config.toml or APP__AUTH__USERNAME / APP__AUTH__PASSWORD environment variables.
This commit is contained in:
@@ -37,12 +37,19 @@ fn default_port() -> u16 {
|
||||
3000
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct AuthConfig {
|
||||
pub username: String,
|
||||
pub password: String,
|
||||
}
|
||||
|
||||
#[derive(Debug, Deserialize, Clone)]
|
||||
pub struct AppConfig {
|
||||
pub s3: S3Config,
|
||||
pub database: DatabaseConfig,
|
||||
#[serde(default)]
|
||||
pub server: ServerConfig,
|
||||
pub auth: Option<AuthConfig>,
|
||||
}
|
||||
|
||||
impl Default for ServerConfig {
|
||||
|
||||
Reference in New Issue
Block a user