huskies: merge 898

This commit is contained in:
dave
2026-05-12 21:29:04 +00:00
parent d78dd9e8f9
commit 937792f208
10 changed files with 829 additions and 23 deletions
+11 -1
View File
@@ -19,6 +19,12 @@ pub struct GatewayConfig {
/// Map of project name → container URL.
#[serde(default)]
pub projects: BTreeMap<String, ProjectEntry>,
/// Map of sled_id → shared secret token for sled-uplink authentication.
///
/// Each entry allows a sled identified by `sled_id` to connect to
/// `/api/sled-uplink` using the given secret token as a bearer credential.
#[serde(default)]
pub sled_tokens: BTreeMap<String, String>,
}
/// Validate that a gateway config has at least one project.
@@ -113,6 +119,7 @@ url = "http://localhost:3002"
fn validate_config_rejects_empty() {
let config = GatewayConfig {
projects: BTreeMap::new(),
sled_tokens: BTreeMap::new(),
};
assert!(validate_config(&config).is_err());
}
@@ -132,7 +139,10 @@ url = "http://localhost:3002"
url: "http://a".into(),
},
);
let config = GatewayConfig { projects };
let config = GatewayConfig {
projects,
sled_tokens: BTreeMap::new(),
};
assert_eq!(validate_config(&config).unwrap(), "alpha");
}