feat(acp): replace raw config and secret methods (#9000)

Signed-off-by: Kalvin Chau <kalvin@block.xyz>
This commit is contained in:
Kalvin C
2026-05-04 18:24:28 -07:00
committed by GitHub
parent e82c4fdcb7
commit 2fe4c3d0bb
39 changed files with 1481 additions and 855 deletions
+14
View File
@@ -719,6 +719,20 @@ impl Config {
self.save_values(&values)
}
/// Set multiple configuration values in the config file with one read and one write.
pub fn set_param_values(&self, updates: &[(String, Value)]) -> Result<(), ConfigError> {
if updates.is_empty() {
return Ok(());
}
let _guard = self.guard.lock().unwrap();
let mut values = self.load_write_config()?;
for (key, value) in updates {
values.insert(serde_yaml::to_value(key)?, serde_yaml::to_value(value)?);
}
self.save_values(&values)
}
/// Delete a configuration value in the config file.
///
/// This will immediately write the value to the config file. The value