[control] Fix round 1: changes apply while Caddy serves (admin socket, watch through Caddy), revocations that fail are errors and catch up, proof only on the forward-auth UI host, root keys found by content, intermediates checked before install, stale SNI cleared before each handshake
This commit is contained in:
@@ -203,11 +203,19 @@ mod unix {
|
||||
"tls": "domi", "auth": "none",
|
||||
"request_headers": [{"action": "set", "name": "X-Ianitor-Proof", "secret": "ui-proof"}]
|
||||
}});
|
||||
let rec = env.apply("POST", "/api/v1/hosts", Some(host)).await;
|
||||
// Refused before it goes live: the proof belongs to the [ui] host behind forward-auth.
|
||||
assert_eq!(rec["state"], "failed", "{rec}");
|
||||
assert!(rec.to_string().contains("host.header.proof"), "{rec}");
|
||||
if rec["state"] != "kept" {
|
||||
let r = env.call("POST", "/api/v1/hosts", Some(host)).await;
|
||||
// Refused at the door: the proof belongs to the [ui] host behind forward-auth.
|
||||
assert_eq!(r.status, 422, "{}", r.text);
|
||||
assert_eq!(
|
||||
r.json["errors"][0]["code"], "host.header.proof",
|
||||
"{}",
|
||||
r.text
|
||||
);
|
||||
assert!(
|
||||
env.call("GET", "/api/v1/hosts/a.test", None).await.status == 404,
|
||||
"the host went live"
|
||||
);
|
||||
if r.status != 202 {
|
||||
return;
|
||||
}
|
||||
let edge = env.edge.as_ref().unwrap();
|
||||
@@ -265,7 +273,7 @@ mod unix {
|
||||
assert_eq!(r.status, 200, "{}", r.text());
|
||||
eprintln!(
|
||||
"QC viewer: {}",
|
||||
&r.text()[r.text().find("\"viewer\"").unwrap_or(0)..]
|
||||
r.text()[r.text().find("\"viewer\"").unwrap_or(0)..]
|
||||
.chars()
|
||||
.take(80)
|
||||
.collect::<String>()
|
||||
|
||||
Reference in New Issue
Block a user