Preserve login shell default in config reads

This commit is contained in:
Abhinav Vedmala
2026-06-17 05:04:16 +00:00
parent 498a1b3c28
commit 0c6d72adf7
2 changed files with 21 additions and 0 deletions
@@ -131,6 +131,7 @@ impl ConfigManager {
layers
.requirements_toml()
.apply_exact_to_config(&mut effective_config_toml);
effective_config_toml.allow_login_shell.get_or_insert(true);
let json_value = serde_json::to_value(&effective_config_toml)
.map_err(|err| ConfigManagerError::json("failed to serialize configuration", err))?;
@@ -807,6 +807,26 @@ async fn read_reflects_exact_managed_requirement() {
);
}
#[tokio::test]
async fn read_materializes_default_allow_login_shell() {
let tmp = tempdir().expect("tempdir");
std::fs::write(tmp.path().join(CONFIG_TOML_FILE), "").unwrap();
let service = ConfigManager::without_managed_config_for_tests(tmp.path().to_path_buf());
let response = service
.read(ConfigReadParams {
include_layers: false,
cwd: None,
})
.await
.expect("config read should succeed");
assert_eq!(
response.config.additional.get("allow_login_shell"),
Some(&serde_json::json!(true))
);
}
#[tokio::test]
async fn write_value_allows_unmanaged_sibling_of_exact_requirement() {
let tmp = tempdir().expect("tempdir");