tsa: ensure that we have the status endpoint in the default ACL

This commit is contained in:
Wez Furlong
2026-03-03 19:39:20 +00:00
parent c4c161543f
commit ead20faa0f
3 changed files with 63 additions and 0 deletions
+6
View File
@@ -84,6 +84,12 @@ allow = true
privileges = ["POST"]
identity.Group = "kumomta:http-listener-trusted-ip"
# Explicitly allow blanket unauthenticated access to the health status endpoint
[[acl."http_listener/*/tsa/status"]]
allow = true
privileges = ["GET"]
identity.Any = {}
### TSA config access -----------------------------
[[acl."http_listener/*/get_config_v1"]]
allow = true
@@ -0,0 +1,56 @@
use crate::kumod::{DaemonWithMaildir, DaemonWithTsa};
use anyhow::Context;
#[tokio::test]
async fn http_liveness_kumod() -> anyhow::Result<()> {
let mut daemon = DaemonWithMaildir::start().await?;
let client = reqwest::Client::new();
let response = client
.get(&format!(
"http://{}/api/check-liveness/v1",
daemon.sink.listener("http")
))
.send()
.await?;
let status = response.status();
let body_bytes = response
.text()
.await
.context("failed to read error response body")?;
k9::assert_equal!(format!("{status} {body_bytes}"), "200 OK OK");
daemon.stop_both().await?;
Ok(())
}
#[tokio::test]
async fn http_liveness_tsa() -> anyhow::Result<()> {
let mut daemon = DaemonWithTsa::start().await?;
let client = reqwest::Client::new();
let response = client
.get(&format!(
"http://{}/tsa/status",
daemon.tsa.listener("http")
))
.send()
.await?;
let status = response.status();
let body_bytes = response
.text()
.await
.context("failed to read error response body")?;
k9::assert_equal!(format!("{status} {body_bytes}"), "200 OK TSA Daemon OK");
daemon.stop().await?;
Ok(())
}
+1
View File
@@ -20,6 +20,7 @@ mod http_inject_compression;
mod http_inject_deferred;
mod http_inject_size_limit;
mod http_inject_template_syntax_error;
mod http_liveness;
mod log_oob_arf;
mod maildir_batch;
mod maildir_batch_452;