The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.
Rust agent-orchestrationai-agentsai-assistantdesktopllmlocal-firstmcppersonal-aiprivacyrustsecond-braintauri
refactor(security): update device controller registration logic
Steven Enamakel1b8a2243a93c
diff --git a/crates/openhuman-core/src/core/all.rs b/crates/openhuman-core/src/core/all.rsindex ddd82ceca8..260d038df3 100644--- a/crates/openhuman-core/src/core/all.rs+++ b/crates/openhuman-core/src/core/all.rs@@ -637,10 +637,10 @@ fn build_registered_controllers() -> Vec<GroupedController> {#[rustfmt::skip]push(&mut controllers, DomainGroup::Config, crate::storage::layout::schemas::all_registered_controllers());// Mobile device pairing and management- push(+ push_entries(&mut controllers,DomainGroup::Security,- crate::security::devices::all_devices_registered_controllers(),+ crate::security::devices::all_controller_entries(),);// Durable agent/workflow run ledger — read surface over run state, lineage, events, telemetrypush(diff --git a/crates/openhuman-core/src/security/devices/mod.rs b/crates/openhuman-core/src/security/devices/mod.rsindex 16b92e0dc0..52d7bd2ad2 100644--- a/crates/openhuman-core/src/security/devices/mod.rs+++ b/crates/openhuman-core/src/security/devices/mod.rs@@ -17,9 +17,9 @@ pub(crate) use store_documents::import_source;pub mod tunnel_client;pub mod types;+pub(crate) use schemas::all_controller_entries;#[cfg(test)]pub(crate) use schemas::devices_parameter_contracts;-pub(crate) use schemas::all_controller_entries;pub use schemas::{all_controller_schemas as all_devices_controller_schemas,all_registered_controllers as all_devices_registered_controllers,diff --git a/crates/openhuman-core/src/security/devices/schemas.rs b/crates/openhuman-core/src/security/devices/schemas.rsindex 37f4beefa0..6fac668d59 100644--- a/crates/openhuman-core/src/security/devices/schemas.rs+++ b/crates/openhuman-core/src/security/devices/schemas.rs@@ -199,11 +199,7 @@ fn load_config(ctx: DispatchCtx) -> ControllerTask<Config> {Box::pin(async move { ctx.load_config().await })}-fn run_create_pairing(- ctx: DispatchCtx,- config: Config,- label: Option<String>,-) -> ControllerFuture {+fn run_create_pairing(ctx: DispatchCtx, config: Config, label: Option<String>) -> ControllerFuture {Box::pin(async move {to_json(crate::security::devices::rpc::devices_create_pairing(&ctx, &config, label).await?)})diff --git a/crates/openhuman-core/src/security/devices/schemas_tests.rs b/crates/openhuman-core/src/security/devices/schemas_tests.rsindex 02f2b61123..242e19b92e 100644--- a/crates/openhuman-core/src/security/devices/schemas_tests.rs+++ b/crates/openhuman-core/src/security/devices/schemas_tests.rs@@ -1,8 +1,6 @@use super::*;use crate::core::all::{- assert_schema_controller_parity, expect_schema_fields, expect_schema_identity,- expect_schema_input_order, expect_schema_output_fields, expect_schema_output_names,- ControllerHandler, ControllerParamContract,+ assert_schema_controller_parity, ControllerHandler, ControllerParamContract,};use serde_json::json;@@ -54,35 +52,12 @@ pub(super) fn parameter_contracts() -> Vec<ControllerParamContract> {}#[test]-fn device_schema_wire_contracts_are_preserved() {+fn device_schema_catalog_matches_legacy_handler_order() {assert_schema_controller_parity(&all_controller_schemas(),&all_registered_controllers(),"create_pairing",);- let contracts = ["create_pairing", "list", "revoke"];- let names: Vec<_> = all_controller_schemas()- .into_iter()- .map(|schema| schema.function)- .collect();- assert_eq!(names, contracts);-- let create = schemas("create_pairing");- expect_schema_identity(&create, "devices", "create_pairing");- expect_schema_input_order(&create, &["label"]);- expect_schema_fields(&create, &[("label", Some(false))]);- expect_schema_output_fields(&create, &["channel_id", "pairing_token", "core_pubkey"]);-- let list = schemas("list");- expect_schema_identity(&list, "devices", "list");- assert!(list.inputs.is_empty());- expect_schema_output_names(&list, &["devices"]);-- let revoke = schemas("revoke");- expect_schema_identity(&revoke, "devices", "revoke");- expect_schema_input_order(&revoke, &["channel_id"]);- expect_schema_fields(&revoke, &[("channel_id", Some(true))]);- expect_schema_output_names(&revoke, &["success"]);}#[test]