Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

feat(secret_storage): add read-only profile lookup to disabled backend

Steven Enamakel85e0522090b9
diff --git a/crates/openhuman-core/src/security/secret_storage/encrypted_file_backend_disabled.rs b/crates/openhuman-core/src/security/secret_storage/encrypted_file_backend_disabled.rs
index ddccdabcb3..cf9cefdd40 100644
--- a/crates/openhuman-core/src/security/secret_storage/encrypted_file_backend_disabled.rs
+++ b/crates/openhuman-core/src/security/secret_storage/encrypted_file_backend_disabled.rs
@@ -83,6 +83,17 @@ impl EncryptedFileBackend {
pub fn new(_workspace_dir: &Path) -> Self {
Self
}
+
+ /// Read one profile secret without initializing keyring state.
+ ///
+ /// This adapter cannot read encrypted files, so the lookup fails closed
+ /// with the same unavailable error as every other operation.
+ pub fn get_profile_read_only(
+ &self,
+ _namespaced_key: &str,
+ ) -> Result<Option<String>, SecretStorageError> {
+ Err(unavailable())
+ }
}
impl SecretBackend for EncryptedFileBackend {
diff --git a/crates/openhuman-core/src/security/secret_storage/encrypted_file_backend_disabled_tests.rs b/crates/openhuman-core/src/security/secret_storage/encrypted_file_backend_disabled_tests.rs
index d89ce7b205..ad85402320 100644
--- a/crates/openhuman-core/src/security/secret_storage/encrypted_file_backend_disabled_tests.rs
+++ b/crates/openhuman-core/src/security/secret_storage/encrypted_file_backend_disabled_tests.rs
@@ -15,3 +15,13 @@ fn selecting_encrypted_file_fails_closed_when_the_feature_is_disabled() {
.to_string()
.contains("enable the secret-file feature"));
}
+
+#[test]
+fn profile_read_only_lookup_fails_closed_when_the_feature_is_disabled() {
+ let backend = EncryptedFileBackend::new(Path::new("unused"));
+ assert!(backend
+ .get_profile_read_only("user:token")
+ .unwrap_err()
+ .to_string()
+ .contains("enable the secret-file feature"));
+}