Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions crates/openhuman-core/src/inbound/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ pub fn module_config(config: &Config) -> Value {
"[inbound] configuring the tinyeventqueues module"
);
let resolved = remember(resolved);
// The module keeps its queues in host storage and refuses to load without
// the bus name that serves it; the host still derives the scope and grant
// from the authenticated caller, never from this value.
json!({
"storage_callback": tinystoragedrivers_bus::STORAGE_INTERFACE.to_string(),
"queues": resolved.queues_json,
"pipeline": resolved.pipeline_json,
})
Expand Down
2 changes: 2 additions & 0 deletions crates/openhuman-core/src/inbound/settings_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ async fn the_module_config_is_what_the_storage_grant_declares() {
config.inbound.queues_path = Some(queues.path().to_path_buf());

let blob = module_config(&config);
// The module refuses to load without the bus name serving its storage.
assert_eq!(blob["storage_callback"], "ai.tinyhumans.tinystorage.Storage");
assert_eq!(blob["queues"]["queues"][0]["max_attempts"], 4);
assert_eq!(blob["pipeline"]["version"], 1);
let grant = queue_grant().unwrap();
Expand Down
Loading