[control] Domi CA and UI sign-in: intermediate renewal by CSR with manual offline signing, domi host certificates, device requests approved by code, one-time PKCS#12 installs, revocation; Remote-User trusted only with edge's per-boot proof

This commit is contained in:
2026-11-07 23:21:49 +01:00
parent 211b851c3e
commit c18ae154ad
17 changed files with 1300 additions and 54 deletions
+9 -3
View File
@@ -34,6 +34,11 @@ mod unix {
fn routes(doc: &Value) -> Vec<(String, String)> {
let mut out = Vec::new();
for (path, item) in doc["paths"].as_object().unwrap() {
// The one-time device download is the one call without a token: the link is
// the secret (G15). Every other call needs one.
if path.starts_with("/api/v1/device-bundles/") {
continue;
}
for method in ["get", "post", "put", "patch", "delete"] {
if item.get(method).is_some() {
let p = path
@@ -118,14 +123,14 @@ mod unix {
vec![("Authorization".into(), "Bearer ".into())],
"token.unknown",
),
// Identity headers do not authenticate (docs/ui-api.md G14).
// Identity headers without edge's proof are refused (docs/ui-api.md G14).
(
"remote-user".into(),
vec![
("Remote-User".into(), "mark".into()),
("Remote-Groups".into(), "admins".into()),
],
"token.missing",
"ui.no_proof",
),
];
for (what, headers, code) in &cases {
@@ -147,7 +152,8 @@ mod unix {
env.call_with("GET", "/api/v1/nope", &[], None).await.status,
401
);
assert_eq!(env.call_with("GET", "/", &[], None).await.status, 401);
// Outside /api/ only the built UI is served (no data, no token); none is set up here.
assert_eq!(env.call_with("GET", "/", &[], None).await.status, 404);
// A wrong Host header (DNS rebinding) is refused even with a good token.
let auth = format!("Bearer {}", env.token);