From de744d3f9ce703a60fa27f6b2eaf79541b74b769 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 25 Jul 2026 17:42:57 +0200 Subject: [PATCH 1/4] deps: updated tucana and code0-flow --- Cargo.lock | 16 ++++++++-------- Cargo.toml | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b496371..6a4f9be 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -231,9 +231,9 @@ dependencies = [ [[package]] name = "code0-flow" -version = "0.0.40" +version = "0.0.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6bac81931da426429ac4ca93b80ff246900d64e8190ec2c4e0382ff35157857" +checksum = "a5373ac809b37ed939f2fd9094d20cc8534a87d18ac5551ee7dfc69c6a7596ea" dependencies = [ "async-nats", "dotenv", @@ -506,7 +506,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" dependencies = [ "libc", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -1743,7 +1743,7 @@ dependencies = [ "errno", "libc", "linux-raw-sys", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -2060,10 +2060,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" dependencies = [ "fastrand", - "getrandom 0.3.4", + "getrandom 0.4.2", "once_cell", "rustix", - "windows-sys 0.52.0", + "windows-sys 0.61.2", ] [[package]] @@ -2496,9 +2496,9 @@ dependencies = [ [[package]] name = "tucana" -version = "0.0.75" +version = "0.0.76" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6a58d33f2013edc52c4d782b3bdcdccff2b6b7f2233b91fc833e2f69df2277b" +checksum = "473db4c6dff2f83d8275b92abe90873a5e68b5ca5cf02e2aa0154fdd69bc925a" dependencies = [ "pbjson", "pbjson-build", diff --git a/Cargo.toml b/Cargo.toml index f5b4f36..0d308c1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,8 +11,8 @@ opentelemetry = { version = "0.32.0", features = ["metrics"] } tracing = { version = "0.1.41", features = ["log"] } prost = "0.14.1" tonic = "0.14.1" -tucana = { version = "0.0.75", features = ["all"] } -code0-flow = { version = "0.0.40", features = ["flow_config", "flow_health", "flow_telemetry"] } +tucana = { version = "0.0.76", features = ["all"] } +code0-flow = { version = "0.0.41", features = ["flow_config", "flow_health", "flow_telemetry"] } serde_json = "1.0.140" async-nats = "0.49.0" tonic-health = "0.14.1" From 526b63a7dabe1e7bfdf67eb5a7021184b99da26e Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 25 Jul 2026 17:43:08 +0200 Subject: [PATCH 2/4] feat: added module service collection --- src/configuration/service.rs | 17 +++++++++++++++++ src/sagittarius/module_service_client_impl.rs | 11 ++++++++++- src/server/dynamic_server.rs | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/src/configuration/service.rs b/src/configuration/service.rs index cf76c57..236d76b 100644 --- a/src/configuration/service.rs +++ b/src/configuration/service.rs @@ -43,6 +43,8 @@ pub struct ActionServiceConfiguration { pub struct RuntimeServiceConfiguration { token: String, identifier: String, + #[serde(default)] + resolved_modules: Vec, } #[derive(Serialize, Deserialize, Clone, Default)] @@ -144,6 +146,18 @@ impl ServiceConfiguration { } } + pub fn collect_modules(&self) -> Vec { + let actions: Vec = self.actions.iter().map(|x| x.service_name.clone()).collect(); + let runtime: Vec = self.runtimes.iter().flat_map(|x| { + match x.resolved_modules.is_empty() { + true => vec![x.identifier.clone()], + false => x.resolved_modules.clone(), + } + }).collect(); + + vec![actions, runtime].concat() + } + pub fn from_path(path: impl AsRef) -> Self { let mut data = String::new(); @@ -203,14 +217,17 @@ mod tests { RuntimeServiceConfiguration { token: String::from("taurus-token"), identifier: String::from("taurus"), + resolved_modules: vec![String::from("taurus-boolean"), String::from("taurus-number")], }, RuntimeServiceConfiguration { token: String::from("draco-rest-token"), identifier: String::from("draco-rest"), + resolved_modules: vec![], }, RuntimeServiceConfiguration { token: String::from("draco-cron-token"), identifier: String::from("draco-cron"), + resolved_modules: vec![], }, ], } diff --git a/src/sagittarius/module_service_client_impl.rs b/src/sagittarius/module_service_client_impl.rs index 4bbbab2..f730f07 100644 --- a/src/sagittarius/module_service_client_impl.rs +++ b/src/sagittarius/module_service_client_impl.rs @@ -1,22 +1,30 @@ +use crate::configuration::service::ServiceConfiguration; use crate::{authorization::authorization::get_authorization_metadata, telemetry::errors}; use std::time::Duration; use tonic::transport::Channel; use tonic::{Extensions, Request}; pub struct SagittariusModuleServiceClient { + service: ServiceConfiguration, client: tucana::sagittarius::module_service_client::ModuleServiceClient, token: String, unary_rpc_timeout: Duration, } impl SagittariusModuleServiceClient { - pub fn new(channel: Channel, token: String, unary_rpc_timeout: Duration) -> Self { + pub fn new( + channel: Channel, + token: String, + unary_rpc_timeout: Duration, + service_configuration: ServiceConfiguration, + ) -> Self { let client = tucana::sagittarius::module_service_client::ModuleServiceClient::new(channel); Self { client, token, unary_rpc_timeout, + service: service_configuration, } } @@ -40,6 +48,7 @@ impl SagittariusModuleServiceClient { Extensions::new(), tucana::sagittarius::ModuleUpdateRequest { modules: modules_update_request.modules, + available_defintition_soruces: self.service.collect_modules(), }, ); request.set_timeout(self.unary_rpc_timeout); diff --git a/src/server/dynamic_server.rs b/src/server/dynamic_server.rs index 02ddc42..afd6bd1 100644 --- a/src/server/dynamic_server.rs +++ b/src/server/dynamic_server.rs @@ -93,6 +93,7 @@ impl AquilaDynamicServer { self.channel.clone(), self.token.clone(), self.sagittarius_unary_rpc_timeout, + self.service_configuration.clone(), ))); info!("ModuleService started"); From 5ba4eb73046e757b71e28fe966f45ed7a219106c Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 25 Jul 2026 17:45:02 +0200 Subject: [PATCH 3/4] feat: added resolved configuration --- service.configuration.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/service.configuration.json b/service.configuration.json index 983476f..bd4440e 100644 --- a/service.configuration.json +++ b/service.configuration.json @@ -3,7 +3,8 @@ "runtimes": [ { "identifier": "taurus", - "token": "HsCEzbCuaUtUGSCrvwsSbJSlS2HH6TrW0ZeEKUZGTiOH8vPEZxyAEOx974Ku72l4" + "token": "HsCEzbCuaUtUGSCrvwsSbJSlS2HH6TrW0ZeEKUZGTiOH8vPEZxyAEOx974Ku72l4", + "resolved_modules": ["taurus-boolean", "taurus-control", "taurus-http", "taurus-list", "taurus-number", "taurus-object", "taurus-text"] }, { "identifier": "draco-rest", From de3545ad47208415632146855e01722e6e90378a Mon Sep 17 00:00:00 2001 From: Raphael Date: Sat, 25 Jul 2026 18:01:42 +0200 Subject: [PATCH 4/4] feat: added a test and action format resolver --- src/configuration/service.rs | 37 ++++++++++++++++++++++++++++++------ 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/src/configuration/service.rs b/src/configuration/service.rs index 236d76b..f9fff1d 100644 --- a/src/configuration/service.rs +++ b/src/configuration/service.rs @@ -147,13 +147,19 @@ impl ServiceConfiguration { } pub fn collect_modules(&self) -> Vec { - let actions: Vec = self.actions.iter().map(|x| x.service_name.clone()).collect(); - let runtime: Vec = self.runtimes.iter().flat_map(|x| { - match x.resolved_modules.is_empty() { + let actions: Vec = self + .actions + .iter() + .map(|x| format!("action.{}", x.service_name)) + .collect(); + let runtime: Vec = self + .runtimes + .iter() + .flat_map(|x| match x.resolved_modules.is_empty() { true => vec![x.identifier.clone()], false => x.resolved_modules.clone(), - } - }).collect(); + }) + .collect(); vec![actions, runtime].concat() } @@ -217,7 +223,10 @@ mod tests { RuntimeServiceConfiguration { token: String::from("taurus-token"), identifier: String::from("taurus"), - resolved_modules: vec![String::from("taurus-boolean"), String::from("taurus-number")], + resolved_modules: vec![ + String::from("taurus-boolean"), + String::from("taurus-number"), + ], }, RuntimeServiceConfiguration { token: String::from("draco-rest-token"), @@ -295,6 +304,22 @@ mod tests { assert!(!config.has_service(&String::from("action-token"), &String::from("taurus-x"))); } + #[test] + fn collect_modules_uses_definition_source_identifiers() { + let config = fixture(); + + assert_eq!( + config.collect_modules(), + vec![ + String::from("action.action-identifier"), + String::from("taurus-boolean"), + String::from("taurus-number"), + String::from("draco-rest"), + String::from("draco-cron"), + ] + ); + } + #[test] fn get_action_configuration_requires_matching_token_and_identifier() { let config: ServiceConfiguration = SerializableServiceConfiguration {