[core] Schema: reject wildcard header names, cap file size and upstreams, require <hostname>.toml

This commit is contained in:
2026-11-07 15:44:09 +01:00
parent 58d0397875
commit 60aee5d78a
11 changed files with 221 additions and 59 deletions
+15
View File
@@ -108,6 +108,21 @@ fn check_path(p: &str) -> Result<(), &'static str> {
Ok(())
}
/// Identity headers never accepted from clients on forward-auth hosts: Authelia's four, then
/// any other configured copy header (case-insensitive, no duplicates).
fn strip_headers(fa: &crate::ForwardAuth) -> Vec<String> {
let mut out: Vec<String> = crate::AUTHELIA_COPY_HEADERS
.iter()
.map(|h| (*h).to_owned())
.collect();
for h in &fa.copy_headers {
if !out.iter().any(|o| o.eq_ignore_ascii_case(h)) {
out.push(h.clone());
}
}
out
}
/// Join a validated directory and a validated file name.
fn join(dir: &str, file: &str) -> String {
format!("{}/{}", dir.trim_end_matches('/'), file)