revert changes to harmony_secret local_file
Some checks failed
Run Check Script / check (pull_request) Failing after 1m3s

This commit is contained in:
Ian Letourneau 2025-09-08 11:45:46 -04:00
parent 14566e0327
commit a8d421efdc

View File

@ -29,20 +29,12 @@ impl SecretStore for LocalFileSecretStore {
file_path.display() file_path.display()
); );
let content = tokio::fs::read(&file_path)
tokio::fs::read(&file_path) .await
.await .map_err(|_| SecretStoreError::NotFound {
.map_err(|_| SecretStoreError::NotFound { namespace: ns.to_string(),
namespace: ns.to_string(), key: key.to_string(),
key: key.to_string(), })
})?;
info!(
"Sum of all vec get {ns} {key} {:?}",
content
.iter()
.fold(0, |acc: u64, val: &u8| { acc + *val as u64 })
);
Ok(content)
} }
async fn set_raw(&self, ns: &str, key: &str, val: &[u8]) -> Result<(), SecretStoreError> { async fn set_raw(&self, ns: &str, key: &str, val: &[u8]) -> Result<(), SecretStoreError> {
@ -64,12 +56,6 @@ impl SecretStore for LocalFileSecretStore {
.map_err(|e| SecretStoreError::Store(Box::new(e)))?; .map_err(|e| SecretStoreError::Store(Box::new(e)))?;
} }
info!(
"Sum of all vec set {ns} {key} {:?}",
val.iter()
.fold(0, |acc: u64, val: &u8| { acc + *val as u64 })
);
tokio::fs::write(&file_path, val) tokio::fs::write(&file_path, val)
.await .await
.map_err(|e| SecretStoreError::Store(Box::new(e))) .map_err(|e| SecretStoreError::Store(Box::new(e)))