huskies: merge 898
This commit is contained in:
@@ -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");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user