Skip to content

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

test(storage_grants): tighten capabilities test to a single object

Steven Enamakel00d3a919c856
diff --git a/crates/openhuman-core/src/modules/storage_grants_tests.rs b/crates/openhuman-core/src/modules/storage_grants_tests.rs
index 7ce39bed20..98b31f1369 100644
--- a/crates/openhuman-core/src/modules/storage_grants_tests.rs
+++ b/crates/openhuman-core/src/modules/storage_grants_tests.rs
@@ -138,12 +138,12 @@ fn capabilities_are_answered_for_an_object_the_grant_does_not_hold() {
writable: true,
..StorageGrant::default()
};
- for object in [Object::Streams, Object::Blobs, Object::Secrets] {
- assert!(
- authorize(&documents_only, object, "Capabilities", &json!(null)).is_ok(),
- "{object:?}"
- );
- }
+ assert!(authorize(&documents_only, Object::Blobs, "Capabilities", &json!(null)).is_ok());
+ // Anything else on that object is still refused.
+ assert_eq!(
+ authorize(&documents_only, Object::Blobs, "Head", &json!({"key": "files/a"})),
+ Err(Denied::Object)
+ );
}
#[test]