From b95e9343f6bcd79e9f1df72d26b6ec9908ba6b83 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 24 Feb 2026 19:34:46 +0100 Subject: [PATCH 01/21] feat: added action configuration implementation --- ...ction_configuration_service_client_impl.rs | 53 +++++++++++++++++++ src/sagittarius/mod.rs | 1 + 2 files changed, 54 insertions(+) create mode 100644 src/sagittarius/action_configuration_service_client_impl.rs diff --git a/src/sagittarius/action_configuration_service_client_impl.rs b/src/sagittarius/action_configuration_service_client_impl.rs new file mode 100644 index 0000000..cc05d1a --- /dev/null +++ b/src/sagittarius/action_configuration_service_client_impl.rs @@ -0,0 +1,53 @@ +use crate::authorization::authorization::get_authorization_metadata; +use tonic::transport::Channel; +use tonic::{Extensions, Request}; + +pub struct SagittariusActionConfigurationServiceClient { + client: + tucana::sagittarius::action_configuration_service_client::ActionConfigurationServiceClient< + Channel, + >, + token: String, +} + +impl SagittariusActionConfigurationServiceClient { + pub fn new(channel: Channel, token: String) -> Self { + let client = tucana::sagittarius::action_configuration_service_client::ActionConfigurationServiceClient::new(channel); + + Self { client, token } + } + + pub async fn update_action_configuration( + &mut self, + action_configuration_update_request: tucana::aquila::ActionConfigurationUpdateRequest, + ) -> tucana::aquila::ActionConfigurationUpdateResponse { + let request = Request::from_parts( + get_authorization_metadata(&self.token), + Extensions::new(), + tucana::sagittarius::ActionConfigurationUpdateRequest { + action_identifier: action_configuration_update_request.action_identifier, + action_configurations: action_configuration_update_request.action_configurations, + }, + ); + + let response = match self.client.update(request).await { + Ok(response) => { + log::info!("Successfully transferred action configuration update.",); + response.into_inner() + } + Err(err) => { + log::error!("Failed to update action configurations: {:?}", err); + return tucana::aquila::ActionConfigurationUpdateResponse { success: false }; + } + }; + + match response.success { + true => log::info!("Sagittarius successfully updated ActionConfiguration."), + false => log::error!("Sagittarius didn't update any ActionConfiguration."), + }; + + tucana::aquila::ActionConfigurationUpdateResponse { + success: response.success, + } + } +} diff --git a/src/sagittarius/mod.rs b/src/sagittarius/mod.rs index a1fbb75..300d0c1 100644 --- a/src/sagittarius/mod.rs +++ b/src/sagittarius/mod.rs @@ -1,3 +1,4 @@ +pub mod action_configuration_service_client_impl; pub mod data_type_service_client_impl; pub mod flow_service_client_impl; pub mod flow_type_service_client_impl; From eb512453b7ac144c3533a9ac6ad62b828d33ce6c Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 24 Feb 2026 19:35:03 +0100 Subject: [PATCH 02/21] feat: wip action configuration service server --- ...ction_configuration_service_server_impl.rs | 50 +++++++++++++++++++ src/server/mod.rs | 1 + 2 files changed, 51 insertions(+) create mode 100644 src/server/action_configuration_service_server_impl.rs diff --git a/src/server/action_configuration_service_server_impl.rs b/src/server/action_configuration_service_server_impl.rs new file mode 100644 index 0000000..e8dad09 --- /dev/null +++ b/src/server/action_configuration_service_server_impl.rs @@ -0,0 +1,50 @@ +use crate::{configuration::action::ActionConfiguration, sagittarius::{action_configuration_service_client_impl::SagittariusActionConfigurationServiceClient, data_type_service_client_impl::SagittariusDataTypeServiceClient}}; +use std::sync::Arc; +use tokio::sync::Mutex; +use tonic::Status; +use tucana::aquila::{action_configuration_service_server::ActionConfigurationService, data_type_service_server::DataTypeService}; + +pub struct AquilaActionConfigurationServiceServer { + client: Arc>, + actions: ActionConfiguration, +} + +impl AquilaActionConfigurationServiceServer { + pub fn new(client: Arc>, actions: ActionConfiguration) -> Self { + Self { client, actions } + } +} + +#[tonic::async_trait] +impl ActionConfigurationService for AquilaActionConfigurationServiceServer { + async fn update( + &self, + request: tonic::Request, + ) -> Result, tonic::Status> { + + let token = match request.metadata().get("authorization") { + Some(_) => todo!(), + None => Err(Status::unauthenticated("")), + }; + + let data_type_update_request = request.into_inner(); + + log::debug!( + "Received DataTypes: {:?}", + data_type_update_request + .data_types + .iter() + .map(|d| d.identifier.clone()) + .collect::>() + ); + + let mut client = self.client.lock().await; + let response = client.update_data_types(data_type_update_request).await; + + Ok(tonic::Response::new( + tucana::aquila::DataTypeUpdateResponse { + success: response.success, + }, + )) + } +} diff --git a/src/server/mod.rs b/src/server/mod.rs index a36c9c1..72234c8 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -28,6 +28,7 @@ use tucana::aquila::{ runtime_usage_service_server::RuntimeUsageServiceServer, }; +mod action_configuration_service_server_impl; mod data_type_service_server_impl; mod flow_type_service_server_impl; mod runtime_function_service_server_impl; From a5ebafa4cfceeb9d21fb92629b34e38ea1b375ea Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 24 Feb 2026 19:35:15 +0100 Subject: [PATCH 03/21] dependencies: updated to tucana 0.0.53 --- Cargo.lock | 2567 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 2567 insertions(+) create mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 0000000..f98c9d9 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,2567 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "aho-corasick" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ddd31a130427c27518df266943a5308ed92d4b226cc639f5a8f1002816174301" +dependencies = [ + "memchr", +] + +[[package]] +name = "anstream" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "824a212faf96e9acacdbd09febd34438f8f711fb84e09a8916013cd7815ca28d" +dependencies = [ + "anstyle", + "anstyle-parse", + "anstyle-query", + "anstyle-wincon", + "colorchoice", + "is_terminal_polyfill", + "utf8parse", +] + +[[package]] +name = "anstyle" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "940b3a0ca603d1eade50a4846a2afffd5ef57a9feac2c0e2ec2e14f9ead76000" + +[[package]] +name = "anstyle-parse" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52ce7f38b242319f7cabaa6813055467063ecdc9d355bbb4ce0c68908cd8130e" +dependencies = [ + "utf8parse", +] + +[[package]] +name = "anstyle-query" +version = "1.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40c48f72fd53cd289104fc64099abca73db4166ad86ea0b4341abe65af83dadc" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "anstyle-wincon" +version = "3.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "291e6a250ff86cd4a820112fb8898808a366d8f9f58ce16d1f538353ad55747d" +dependencies = [ + "anstyle", + "once_cell_polyfill", + "windows-sys 0.61.2", +] + +[[package]] +name = "anyhow" +version = "1.0.102" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f202df86484c868dbad7eaa557ef785d5c66295e41b460ef922eca0723b842c" + +[[package]] +name = "aquila" +version = "0.1.0" +dependencies = [ + "async-nats", + "code0-flow", + "env_logger", + "futures", + "log", + "prost", + "serde", + "serde_json", + "tokio", + "tokio-stream", + "tonic", + "tonic-health", + "tucana 0.0.66", + "uuid", +] + +[[package]] +name = "async-nats" +version = "0.47.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07d6f157065c3461096d51aacde0c326fa49f3f6e0199e204c566842cdaa5299" +dependencies = [ + "base64", + "bytes", + "futures-util", + "memchr", + "nkeys", + "nuid", + "pin-project", + "portable-atomic", + "rand", + "regex", + "ring", + "rustls-native-certs", + "rustls-pki-types", + "rustls-webpki", + "serde", + "serde_json", + "serde_nanos", + "serde_repr", + "thiserror", + "time", + "tokio", + "tokio-rustls", + "tokio-stream", + "tokio-util", + "tokio-websockets", + "tracing", + "tryhard", + "url", +] + +[[package]] +name = "async-trait" +version = "0.1.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9035ad2d096bed7955a320ee7e2230574d28fd3c3a0f186cbea1ff3c7eed5dbb" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "axum" +version = "0.8.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b52af3cb4058c895d37317bb27508dccc8e5f2d39454016b297bf4a400597b8" +dependencies = [ + "axum-core", + "bytes", + "futures-util", + "http", + "http-body", + "http-body-util", + "itoa", + "matchit", + "memchr", + "mime", + "percent-encoding", + "pin-project-lite", + "serde_core", + "sync_wrapper", + "tower", + "tower-layer", + "tower-service", +] + +[[package]] +name = "axum-core" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08c78f31d7b1291f7ee735c1c6780ccde7785daae9a9206026862dab7d8792d1" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "http-body-util", + "mime", + "pin-project-lite", + "sync_wrapper", + "tower-layer", + "tower-service", +] + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2af50177e190e07a26ab74f8b1efbfe2ef87da2116221318cb1c2e82baf7de06" + +[[package]] +name = "bitflags" +version = "2.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "843867be96c8daad0d758b57df9392b6d8d271134fce549de6ce169ff98a92af" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d20789868f4b01b2f2caec9f5c4e0213b41e3e5702a50157d699ae31ced2fcb" + +[[package]] +name = "bytes" +version = "1.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e748733b7cbc798e1434b6ac524f0c1ff2ab456fe201501e6497c8417a4fc33" +dependencies = [ + "serde", +] + +[[package]] +name = "cc" +version = "1.2.59" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7a4d3ec6524d28a329fc53654bbadc9bdd7b0431f5d65f1a56ffb28a1ee5283" +dependencies = [ + "find-msvc-tools", + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9330f8b2ff13f34540b44e946ef35111825727b38d33286ef986142615121801" + +[[package]] +name = "chrono" +version = "0.4.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c673075a2e0e5f4a1dde27ce9dee1ea4558c7ffe648f576438a20ca1d2acc4b0" +dependencies = [ + "num-traits", +] + +[[package]] +name = "code0-flow" +version = "0.0.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7eacee3742e78ea0b84a3e5cb9eabd1eecb71391d362c42f36c941db6994016f" +dependencies = [ + "async-nats", + "async-trait", + "dotenv", + "futures-core", + "log", + "regex", + "serde", + "serde_json", + "tokio", + "tonic", + "tonic-health", + "tucana 0.0.65", + "walkdir", +] + +[[package]] +name = "colorchoice" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2a6cd9ae233e7f62ba4e9353e81a88df7fc8a5987b8d445b4d90c879bd156f6" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crypto-common" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78c8292055d1c1df0cce5d180393dc8cce0abec0a7102adb6c7b1eef6016d60a" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "data-encoding" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7a1e2f27636f116493b8b860f5546edb47c8d8f8ea73e1d2a20be88e28d1fea" + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "pem-rfc7468", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd812cc2bc1d69d4764bd80df88b4317eaef9e773c75226407d9bc0876b211c" +dependencies = [ + "powerfmt", + "serde_core", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "crypto-common", +] + +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "dotenv" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "sha2", + "signature", + "subtle", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "env_filter" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32e90c2accc4b07a8456ea0debdc2e7587bdd890680d71173a15d4ae604f6eef" +dependencies = [ + "log", + "regex", +] + +[[package]] +name = "env_logger" +version = "0.11.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0621c04f2196ac3f488dd583365b9c09be011a4ab8b9f37248ffcc8f6198b56a" +dependencies = [ + "anstream", + "anstyle", + "env_filter", + "jiff", + "log", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "errno" +version = "0.3.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39cab71617ae0d63f51a36d69f866391735b51691dbda63cf6f96d042b63efeb" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "fastrand" +version = "2.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a043dc74da1e37d6afe657061213aa6f425f855399a11d3463c6ecccc4dfda1f" + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "find-msvc-tools" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582" + +[[package]] +name = "fixedbitset" +version = "0.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "foldhash" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" + +[[package]] +name = "form_urlencoded" +version = "1.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cb4cb245038516f5f85277875cdaa4f7d2c9a0fa0468de06ed190163b1581fcf" +dependencies = [ + "percent-encoding", +] + +[[package]] +name = "futures" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b147ee9d1f6d097cef9ce628cd2ee62288d963e16fb287bd9286455b241382d" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07bbe89c50d7a535e539b8c17bc0b49bdb77747034daa8087407d655f3f7cc1d" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e3450815272ef58cec6d564423f6e755e25379b217b0bc688e295ba24df6b1d" + +[[package]] +name = "futures-executor" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf29c38818342a3b26b5b923639e7b1f4a61fc5e76102d4b1981c6dc7a7579d" +dependencies = [ + "futures-core", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-io" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cecba35d7ad927e23624b22ad55235f2239cfa44fd10428eecbeba6d6a717718" + +[[package]] +name = "futures-macro" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e835b70203e41293343137df5c0664546da5745f82ec9b84d40be8336958447b" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "futures-sink" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c39754e157331b013978ec91992bde1ac089843443c49cbc7f46150b0fad0893" + +[[package]] +name = "futures-task" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "037711b3d59c33004d3856fbdc83b99d4ff37a24768fa1be9ce3538a1cde4393" + +[[package]] +name = "futures-util" +version = "0.3.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "389ca41296e6190b48053de0321d02a77f32f8a5d2461dd38762c0593805c6d6" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "slab", +] + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff2abc00be7fca6ebc474524697ae276ad847ad0a6b3faa4bcb027e9a4614ad0" +dependencies = [ + "cfg-if", + "libc", + "wasi", +] + +[[package]] +name = "getrandom" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0de51e6874e94e7bf76d726fc5d13ba782deca734ff60d5bb2fb2607c7406555" +dependencies = [ + "cfg-if", + "libc", + "r-efi", + "wasip2", + "wasip3", +] + +[[package]] +name = "h2" +version = "0.4.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f44da3a8150a6703ed5d34e164b875fd14c2cdab9af1252a9a1020bde2bdc54" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +dependencies = [ + "foldhash", +] + +[[package]] +name = "hashbrown" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "841d1cc9bed7f9236f321df977030373f4a4163ae1a7dbfe1a51a2c1a51d9100" + +[[package]] +name = "heck" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" + +[[package]] +name = "http" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3ba2a386d7f85a81f119ad7498ebe444d2e22c2af0b86b069416ace48b3311a" +dependencies = [ + "bytes", + "itoa", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http", +] + +[[package]] +name = "http-body-util" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" +dependencies = [ + "bytes", + "futures-core", + "http", + "http-body", + "pin-project-lite", +] + +[[package]] +name = "httparse" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" + +[[package]] +name = "httpdate" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" + +[[package]] +name = "hyper" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6299f016b246a94207e63da54dbe807655bf9e00044f73ded42c3ac5305fbcca" +dependencies = [ + "atomic-waker", + "bytes", + "futures-channel", + "futures-core", + "h2", + "http", + "http-body", + "httparse", + "httpdate", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-timeout" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b90d566bffbce6a75bd8b09a05aa8c2cb1fabb6cb348f8840c9e4c90a0d83b0" +dependencies = [ + "hyper", + "hyper-util", + "pin-project-lite", + "tokio", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96547c2556ec9d12fb1578c4eaf448b04993e7fb79cbaad930a656880a6bdfa0" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http", + "http-body", + "hyper", + "libc", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", +] + +[[package]] +name = "icu_collections" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2984d1cd16c883d7935b9e07e44071dca8d917fd52ecc02c04d5fa0b5a3f191c" +dependencies = [ + "displaydoc", + "potential_utf", + "utf8_iter", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locale_core" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92219b62b3e2b4d88ac5119f8904c10f8f61bf7e95b640d25ba3075e6cac2c29" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_normalizer" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c56e5ee99d6e3d33bd91c5d85458b6005a22140021cc324cea84dd0e72cff3b4" +dependencies = [ + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da3be0ae77ea334f4da67c12f149704f19f81d1adf7c51cf482943e84a2bad38" + +[[package]] +name = "icu_properties" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bee3b67d0ea5c2cca5003417989af8996f8604e34fb9ddf96208a033901e70de" +dependencies = [ + "icu_collections", + "icu_locale_core", + "icu_properties_data", + "icu_provider", + "zerotrie", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e2bbb201e0c04f7b4b3e14382af113e17ba4f63e2c9d2ee626b720cbce54a14" + +[[package]] +name = "icu_provider" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "139c4cf31c8b5f33d7e199446eff9c1e02decfc2f0eec2c8d71f65befa45b421" +dependencies = [ + "displaydoc", + "icu_locale_core", + "writeable", + "yoke", + "zerofrom", + "zerotrie", + "zerovec", +] + +[[package]] +name = "id-arena" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d3067d79b975e8844ca9eb072e16b31c3c1c36928edf9c6789548c524d0d954" + +[[package]] +name = "idna" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b0875f23caa03898994f6ddc501886a45c7d3d62d04d2d90788d47be1b1e4de" +dependencies = [ + "idna_adapter", + "smallvec", + "utf8_iter", +] + +[[package]] +name = "idna_adapter" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" +dependencies = [ + "icu_normalizer", + "icu_properties", +] + +[[package]] +name = "indexmap" +version = "2.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "45a8a2b9cb3e0b0c1803dbb0758ffac5de2f425b23c28f518faabd9d805342ff" +dependencies = [ + "equivalent", + "hashbrown 0.16.1", + "serde", + "serde_core", +] + +[[package]] +name = "is_terminal_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" + +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682" + +[[package]] +name = "jiff" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a3546dc96b6d42c5f24902af9e2538e82e39ad350b0c766eb3fbf2d8f3d8359" +dependencies = [ + "jiff-static", + "log", + "portable-atomic", + "portable-atomic-util", + "serde_core", +] + +[[package]] +name = "jiff-static" +version = "0.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a8c8b344124222efd714b73bb41f8b5120b27a7cc1c75593a6ff768d9d05aa4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "js-sys" +version = "0.3.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e04e2ef80ce82e13552136fabeef8a5ed1f985a96805761cbb9a2c34e7664d9" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "leb128fmt" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09edd9e8b54e49e587e4f6295a7d29c3ea94d469cb40ab8ca70b288248a81db2" + +[[package]] +name = "libc" +version = "0.2.184" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48f5d2a454e16a5ea0f4ced81bd44e4cfc7bd3a507b61887c99fd3538b28e4af" + +[[package]] +name = "linux-raw-sys" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a66949e030da00e8c7d4434b251670a91556f4144941d37452769c25d58a53" + +[[package]] +name = "litemap" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92daf443525c4cce67b150400bc2316076100ce0b3686209eb8cf3c31612e6f0" + +[[package]] +name = "log" +version = "0.4.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e5032e24019045c762d3c0f28f5b6b8bbf38563a65908389bf7978758920897" + +[[package]] +name = "matchit" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47e1ffaa40ddd1f3ed91f717a33c8c0ee23fff369e3aa8772b9605cc1d22f4c3" + +[[package]] +name = "memchr" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8ca58f447f06ed17d5fc4043ce1b10dd205e060fb3ce5b979b8ed8e59ff3f79" + +[[package]] +name = "mime" +version = "0.3.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" + +[[package]] +name = "mio" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50b7e5b27aa02a74bac8c3f23f448f8d87ff11f92d3aac1a6ed369ee08cc56c1" +dependencies = [ + "libc", + "wasi", + "windows-sys 0.61.2", +] + +[[package]] +name = "multimap" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" + +[[package]] +name = "nkeys" +version = "0.4.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "879011babc47a1c7fdf5a935ae3cfe94f34645ca0cac1c7f6424b36fc743d1bf" +dependencies = [ + "data-encoding", + "ed25519", + "ed25519-dalek", + "getrandom 0.2.17", + "log", + "rand", + "signatory", +] + +[[package]] +name = "nuid" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc895af95856f929163a0aa20c26a78d26bfdc839f51b9d5aa7a5b79e52b7e83" +dependencies = [ + "rand", +] + +[[package]] +name = "num-conv" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6673768db2d862beb9b39a78fdcb1a69439615d5794a1be50caa9bc92c81967" + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f7c3e4beb33f85d45ae3e3a1792185706c8e16d043238c593331cc7cd313b50" + +[[package]] +name = "once_cell_polyfill" +version = "1.70.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "384b8ab6d37215f3c5301a95a4accb5d64aa607f1fcb26a11b5303878451b4fe" + +[[package]] +name = "openssl-probe" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" + +[[package]] +name = "pbjson" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8edd1efdd8ab23ba9cb9ace3d9987a72663d5d7c9f74fa00b51d6213645cf6c" +dependencies = [ + "base64", + "serde", +] + +[[package]] +name = "pbjson-build" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ed4d5c6ae95e08ac768883c8401cf0e8deb4e6e1d6a4e1fd3d2ec4f0ec63200" +dependencies = [ + "heck", + "itertools", + "prost", + "prost-types", +] + +[[package]] +name = "pbjson-types" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a14e2757d877c0f607a82ce1b8560e224370f159d66c5d52eb55ea187ef0350e" +dependencies = [ + "bytes", + "chrono", + "pbjson", + "pbjson-build", + "prost", + "prost-build", + "serde", +] + +[[package]] +name = "pem-rfc7468" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88b39c9bfcfc231068454382784bb460aae594343fb030d46e9f50a645418412" +dependencies = [ + "base64ct", +] + +[[package]] +name = "percent-encoding" +version = "2.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" + +[[package]] +name = "petgraph" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8701b58ea97060d5e5b155d383a69952a60943f0e6dfe30b04c287beb0b27455" +dependencies = [ + "fixedbitset", + "hashbrown 0.15.5", + "indexmap", +] + +[[package]] +name = "pin-project" +version = "1.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1749c7ed4bcaf4c3d0a3efc28538844fb29bcdd7d2b67b2be7e20ba861ff517" +dependencies = [ + "pin-project-internal", +] + +[[package]] +name = "pin-project-internal" +version = "1.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b20ed30f105399776b9c883e68e536ef602a16ae6f596d2c473591d6ad64c6" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "pin-project-lite" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a89322df9ebe1c1578d689c92318e070967d1042b512afbe49518723f4e6d5cd" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "portable-atomic" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c33a9471896f1c69cecef8d20cbe2f7accd12527ce60845ff44c153bb2a21b49" + +[[package]] +name = "portable-atomic-util" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "091397be61a01d4be58e7841595bd4bfedb15f1cd54977d79b8271e94ed799a3" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "potential_utf" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0103b1cef7ec0cf76490e969665504990193874ea05c85ff9bab8b911d0a0564" +dependencies = [ + "zerovec", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn", +] + +[[package]] +name = "proc-macro2" +version = "1.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fd00f0bb2e90d81d1044c2b32617f68fcb9fa3bb7640c23e9c748e53fb30934" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2ea70524a2f82d518bce41317d0fae74151505651af45faf1ffbd6fd33f0568" +dependencies = [ + "bytes", + "prost-derive", +] + +[[package]] +name = "prost-build" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "343d3bd7056eda839b03204e68deff7d1b13aba7af2b2fd16890697274262ee7" +dependencies = [ + "heck", + "itertools", + "log", + "multimap", + "petgraph", + "prettyplease", + "prost", + "prost-types", + "pulldown-cmark", + "pulldown-cmark-to-cmark", + "regex", + "syn", + "tempfile", +] + +[[package]] +name = "prost-derive" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27c6023962132f4b30eb4c172c91ce92d933da334c59c23cddee82358ddafb0b" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "prost-types" +version = "0.14.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8991c4cbdb8bc5b11f0b074ffe286c30e523de90fee5ba8132f1399f23cb3dd7" +dependencies = [ + "prost", +] + +[[package]] +name = "pulldown-cmark" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c3a14896dfa883796f1cb410461aef38810ea05f2b2c33c5aded3649095fdad" +dependencies = [ + "bitflags", + "memchr", + "unicase", +] + +[[package]] +name = "pulldown-cmark-to-cmark" +version = "22.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50793def1b900256624a709439404384204a5dc3a6ec580281bfaac35e882e90" +dependencies = [ + "pulldown-cmark", +] + +[[package]] +name = "quote" +version = "1.0.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41f2619966050689382d2b44f664f4bc593e129785a36d6ee376ddf37259b924" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.17", +] + +[[package]] +name = "regex" +version = "1.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e10754a14b9137dd7b1e3e5b0493cc9171fdd105e0ab477f51b72e7f3ac0e276" +dependencies = [ + "aho-corasick", + "memchr", + "regex-automata", + "regex-syntax", +] + +[[package]] +name = "regex-automata" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e1dd4122fc1595e8162618945476892eefca7b88c52820e74af6262213cae8f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.8.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc897dd8d9e8bd1ed8cdad82b5966c3e0ecae09fb1907d58efaa013543185d0a" + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.17", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustix" +version = "1.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6fe4565b9518b83ef4f91bb47ce29620ca828bd32cb7e408f0062e9930ba190" +dependencies = [ + "bitflags", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.61.2", +] + +[[package]] +name = "rustls" +version = "0.23.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "758025cb5fccfd3bc2fd74708fd4682be41d99e5dff73c377c0646c6012c73a4" +dependencies = [ + "once_cell", + "ring", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "612460d5f7bea540c490b2b6395d8e34a953e52b491accd6c86c8164c5932a63" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework", +] + +[[package]] +name = "rustls-pki-types" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be040f8b0a225e40375822a563fa9524378b9d63112f53e19ffff34df5d33fdd" +dependencies = [ + "zeroize", +] + +[[package]] +name = "rustls-webpki" +version = "0.103.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "df33b2b81ac578cabaf06b89b0631153a3f416b0a886e8a7a1707fb51abbd1ef" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "same-file" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "schannel" +version = "0.1.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91c1b7e4904c873ef0710c1f407dde2e6287de2bebc1bbbf7d430bb7cbffd939" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "security-framework" +version = "3.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" +dependencies = [ + "bitflags", + "core-foundation", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework-sys" +version = "2.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2691df843ecc5d231c0b14ece2acc3efb62c0a398c7e1d875f3983ce020e3" +dependencies = [ + "core-foundation-sys", + "libc", +] + +[[package]] +name = "semver" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7852d02fc848982e0c167ef163aaff9cd91dc640ba85e263cb1ce46fae51cd" + +[[package]] +name = "serde" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a8e94ea7f378bd32cbbd37198a4a91436180c5bb472411e48b5ec2e2124ae9e" +dependencies = [ + "serde_core", + "serde_derive", +] + +[[package]] +name = "serde_core" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41d385c7d4ca58e59fc732af25c3983b67ac852c1a25000afe1175de458b67ad" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.228" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d540f220d3187173da220f885ab66608367b6574e925011a9353e4badda91d79" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "serde_json" +version = "1.0.149" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fc039473c5595ace860d8c4fafa220ff474b3fc6bfdb4293327f1a37e94d86" +dependencies = [ + "itoa", + "memchr", + "serde", + "serde_core", + "zmij", +] + +[[package]] +name = "serde_nanos" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a93142f0367a4cc53ae0fead1bcda39e85beccfad3dcd717656cacab94b12985" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "175ee3e80ae9982737ca543e96133087cbd9a485eecc3bc4de9c1a37b47ea59c" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signal-hook-registry" +version = "1.4.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c4db69cba1110affc0e9f7bcd48bbf87b3f4fc7c61fc9155afd4c469eb3d6c1b" +dependencies = [ + "errno", + "libc", +] + +[[package]] +name = "signatory" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1e303f8205714074f6068773f0e29527e0453937fe837c9717d066635b65f31" +dependencies = [ + "pkcs8", + "rand_core", + "signature", + "zeroize", +] + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "slab" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c790de23124f9ab44544d7ac05d60440adc586479ce501c1d6d7da3cd8c9cf5" + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "socket2" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a766e1110788c36f4fa1c2b71b387a7815aa65f88ce0229841826633d93723e" +dependencies = [ + "libc", + "windows-sys 0.61.2", +] + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "stable_deref_trait" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "2.0.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "sync_wrapper" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bf256ce5efdfa370213c1dabab5935a12e49f2c58d15e9eac2870d3b4f27263" + +[[package]] +name = "synstructure" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tempfile" +version = "3.27.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32497e9a4c7b38532efcdebeef879707aa9f794296a4f0244f6f69e9bc8574bd" +dependencies = [ + "fastrand", + "getrandom 0.4.2", + "once_cell", + "rustix", + "windows-sys 0.61.2", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "time" +version = "0.3.47" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "743bd48c283afc0388f9b8827b976905fb217ad9e647fae3a379a9283c4def2c" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde_core", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7694e1cfe791f8d31026952abf09c69ca6f6fa4e1a1229e18988f06a04a12dca" + +[[package]] +name = "time-macros" +version = "0.2.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e70e4c5a0e0a8a4823ad65dfe1a6930e4f4d756dcd9dd7939022b5e8c501215" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tinystr" +version = "0.8.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8323304221c2a851516f22236c5722a72eaa19749016521d6dff0824447d96d" +dependencies = [ + "displaydoc", + "zerovec", +] + +[[package]] +name = "tokio" +version = "1.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bd1c4c0fc4a7ab90fc15ef6daaa3ec3b893f004f915f2392557ed23237820cd" +dependencies = [ + "bytes", + "libc", + "mio", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.61.2", +] + +[[package]] +name = "tokio-macros" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "385a6cb71ab9ab790c5fe8d67f1645e6c450a7ce006a33de03daa956cf70a496" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tokio-rustls" +version = "0.26.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1729aa945f29d91ba541258c8df89027d5792d85a8841fb65e8bf0f4ede4ef61" +dependencies = [ + "rustls", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32da49809aab5c3bc678af03902d4ccddea2a87d028d86392a4b1560c6906c70" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ae9cec805b01e8fc3fd2fe289f89149a9b66dd16786abd8b19cfa7b48cb0098" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tokio-websockets" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f591660438b3038dd04d16c938271c79e7e06260ad2ea2885a4861bfb238605d" +dependencies = [ + "base64", + "bytes", + "futures-core", + "futures-sink", + "http", + "httparse", + "rand", + "ring", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tokio-util", + "webpki-roots 0.26.11", +] + +[[package]] +name = "tonic" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fec7c61a0695dc1887c1b53952990f3ad2e3a31453e1f49f10e75424943a93ec" +dependencies = [ + "async-trait", + "axum", + "base64", + "bytes", + "h2", + "http", + "http-body", + "http-body-util", + "hyper", + "hyper-timeout", + "hyper-util", + "percent-encoding", + "pin-project", + "socket2", + "sync_wrapper", + "tokio", + "tokio-stream", + "tower", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tonic-build" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1882ac3bf5ef12877d7ed57aad87e75154c11931c2ba7e6cde5e22d63522c734" +dependencies = [ + "prettyplease", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tonic-health" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4ff0636fef47afb3ec02818f5bceb4377b8abb9d6a386aeade18bd6212f8eb7" +dependencies = [ + "prost", + "tokio", + "tokio-stream", + "tonic", + "tonic-prost", +] + +[[package]] +name = "tonic-prost" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a55376a0bbaa4975a3f10d009ad763d8f4108f067c7c2e74f3001fb49778d309" +dependencies = [ + "bytes", + "prost", + "tonic", +] + +[[package]] +name = "tonic-prost-build" +version = "0.14.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f3144df636917574672e93d0f56d7edec49f90305749c668df5101751bb8f95a" +dependencies = [ + "prettyplease", + "proc-macro2", + "prost-build", + "prost-types", + "quote", + "syn", + "tempfile", + "tonic-build", +] + +[[package]] +name = "tower" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" +dependencies = [ + "futures-core", + "futures-util", + "indexmap", + "pin-project-lite", + "slab", + "sync_wrapper", + "tokio", + "tokio-util", + "tower-layer", + "tower-service", + "tracing", +] + +[[package]] +name = "tower-layer" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "121c2a6cda46980bb0fcd1647ffaf6cd3fc79a013de288782836f6df9c48780e" + +[[package]] +name = "tower-service" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8df9b6e13f2d32c91b9bd719c00d1958837bc7dec474d94952798cc8e69eeec3" + +[[package]] +name = "tracing" +version = "0.1.44" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "63e71662fa4b2a2c3a26f570f037eb95bb1f85397f3cd8076caed2f026a6d100" +dependencies = [ + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] + +[[package]] +name = "tracing-attributes" +version = "0.1.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7490cfa5ec963746568740651ac6781f701c9c5ea257c58e057f3ba8cf69e8da" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "tracing-core" +version = "0.1.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "try-lock" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" + +[[package]] +name = "tryhard" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fe58ebd5edd976e0fe0f8a14d2a04b7c81ef153ea9a54eebc42e67c2c23b4e5" +dependencies = [ + "pin-project-lite", + "tokio", +] + +[[package]] +name = "tucana" +version = "0.0.65" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5670bcb2c6c455486e3b5be8b829d7a07bbd06a427d7c6db873259855f34e613" +dependencies = [ + "pbjson", + "pbjson-build", + "pbjson-types", + "prost", + "prost-build", + "prost-types", + "serde", + "serde_json", + "tonic", + "tonic-build", + "tonic-prost", + "tonic-prost-build", +] + +[[package]] +name = "tucana" +version = "0.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b01670c573a1860b047d9ed7aa2b0a242e4f30ce8354d44f57e459465d74a75f" +dependencies = [ + "pbjson", + "pbjson-build", + "pbjson-types", + "prost", + "prost-build", + "prost-types", + "serde", + "serde_json", + "tonic", + "tonic-build", + "tonic-prost", + "tonic-prost-build", +] + +[[package]] +name = "typenum" +version = "1.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "562d481066bde0658276a35467c4af00bdc6ee726305698a55b86e61d7ad82bb" + +[[package]] +name = "unicase" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dbc4bc3a9f746d862c45cb89d705aa10f187bb96c76001afab07a0d35ce60142" + +[[package]] +name = "unicode-ident" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" + +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + +[[package]] +name = "url" +version = "2.5.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff67a8a4397373c3ef660812acab3268222035010ab8680ec4215f38ba3d0eed" +dependencies = [ + "form_urlencoded", + "idna", + "percent-encoding", + "serde", +] + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + +[[package]] +name = "utf8parse" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" + +[[package]] +name = "uuid" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ac8b6f42ead25368cf5b098aeb3dc8a1a2c05a3eee8a9a1a68c640edbfc79d9" +dependencies = [ + "getrandom 0.4.2", + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "walkdir" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "29790946404f91d9c5d06f9874efddea1dc06c5efe94541a7d6863108e3a5e4b" +dependencies = [ + "same-file", + "winapi-util", +] + +[[package]] +name = "want" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +dependencies = [ + "try-lock", +] + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasip2" +version = "1.0.2+wasi-0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9517f9239f02c069db75e65f174b3da828fe5f5b945c4dd26bd25d89c03ebcf5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasip3" +version = "0.4.0+wasi-0.3.0-rc-2026-01-06" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5428f8bf88ea5ddc08faddef2ac4a67e390b88186c703ce6dbd955e1c145aca5" +dependencies = [ + "wit-bindgen", +] + +[[package]] +name = "wasm-bindgen" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0551fc1bb415591e3372d0bc4780db7e587d84e2a7e79da121051c5c4b89d0b0" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fbdf9a35adf44786aecd5ff89b4563a90325f9da0923236f6104e603c7e86be" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dca9693ef2bab6d4e6707234500350d8dad079eb508dca05530c85dc3a529ff2" +dependencies = [ + "bumpalo", + "proc-macro2", + "quote", + "syn", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.117" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "39129a682a6d2d841b6c429d0c51e5cb0ed1a03829d8b3d1e69a011e62cb3d3b" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasm-encoder" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "990065f2fe63003fe337b932cfb5e3b80e0b4d0f5ff650e6985b1048f62c8319" +dependencies = [ + "leb128fmt", + "wasmparser", +] + +[[package]] +name = "wasm-metadata" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb0e353e6a2fbdc176932bbaab493762eb1255a7900fe0fea1a2f96c296cc909" +dependencies = [ + "anyhow", + "indexmap", + "wasm-encoder", + "wasmparser", +] + +[[package]] +name = "wasmparser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "47b807c72e1bac69382b3a6fb3dbe8ea4c0ed87ff5629b8685ae6b9a611028fe" +dependencies = [ + "bitflags", + "hashbrown 0.15.5", + "indexmap", + "semver", +] + +[[package]] +name = "webpki-roots" +version = "0.26.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" +dependencies = [ + "webpki-roots 1.0.6", +] + +[[package]] +name = "webpki-roots" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22cfaf3c063993ff62e73cb4311efde4db1efb31ab78a3e5c457939ad5cc0bed" +dependencies = [ + "rustls-pki-types", +] + +[[package]] +name = "winapi-util" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2a7b1c03c876122aa43f3020e6c3c3ee5c05081c9a00739faf7503aeba10d22" +dependencies = [ + "windows-sys 0.61.2", +] + +[[package]] +name = "windows-link" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" + +[[package]] +name = "windows-sys" +version = "0.52.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" +dependencies = [ + "windows-targets", +] + +[[package]] +name = "windows-sys" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-targets" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" +dependencies = [ + "windows_aarch64_gnullvm", + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_gnullvm", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_gnullvm", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" + +[[package]] +name = "wit-bindgen" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7249219f66ced02969388cf2bb044a09756a083d0fab1e566056b04d9fbcaa5" +dependencies = [ + "wit-bindgen-rust-macro", +] + +[[package]] +name = "wit-bindgen-core" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea61de684c3ea68cb082b7a88508a8b27fcc8b797d738bfc99a82facf1d752dc" +dependencies = [ + "anyhow", + "heck", + "wit-parser", +] + +[[package]] +name = "wit-bindgen-rust" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7c566e0f4b284dd6561c786d9cb0142da491f46a9fbed79ea69cdad5db17f21" +dependencies = [ + "anyhow", + "heck", + "indexmap", + "prettyplease", + "syn", + "wasm-metadata", + "wit-bindgen-core", + "wit-component", +] + +[[package]] +name = "wit-bindgen-rust-macro" +version = "0.51.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c0f9bfd77e6a48eccf51359e3ae77140a7f50b1e2ebfe62422d8afdaffab17a" +dependencies = [ + "anyhow", + "prettyplease", + "proc-macro2", + "quote", + "syn", + "wit-bindgen-core", + "wit-bindgen-rust", +] + +[[package]] +name = "wit-component" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d66ea20e9553b30172b5e831994e35fbde2d165325bec84fc43dbf6f4eb9cb2" +dependencies = [ + "anyhow", + "bitflags", + "indexmap", + "log", + "serde", + "serde_derive", + "serde_json", + "wasm-encoder", + "wasm-metadata", + "wasmparser", + "wit-parser", +] + +[[package]] +name = "wit-parser" +version = "0.244.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc8ac4bc1dc3381b7f59c34f00b67e18f910c2c0f50015669dde7def656a736" +dependencies = [ + "anyhow", + "id-arena", + "indexmap", + "log", + "semver", + "serde", + "serde_derive", + "serde_json", + "unicode-xid", + "wasmparser", +] + +[[package]] +name = "writeable" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ffae5123b2d3fc086436f8834ae3ab053a283cfac8fe0a0b8eaae044768a4c4" + +[[package]] +name = "yoke" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abe8c5fda708d9ca3df187cae8bfb9ceda00dd96231bed36e445a1a48e66f9ca" +dependencies = [ + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de844c262c8848816172cef550288e7dc6c7b7814b4ee56b3e1553f275f1858e" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zerocopy" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eed437bf9d6692032087e337407a86f04cd8d6a16a37199ed57949d415bd68e9" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.48" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e3cd084b1788766f53af483dd21f93881ff30d7320490ec3ef7526d203bad4" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zerofrom" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "69faa1f2a1ea75661980b013019ed6687ed0e83d069bc1114e2cc74c6c04c4df" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11532158c46691caf0f2593ea8358fed6bbf68a0315e80aae9bd41fbade684a1" +dependencies = [ + "proc-macro2", + "quote", + "syn", + "synstructure", +] + +[[package]] +name = "zeroize" +version = "1.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b97154e67e32c85465826e8bcc1c59429aaaf107c1e4a9e53c8d8ccd5eff88d0" + +[[package]] +name = "zerotrie" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f9152d31db0792fa83f70fb2f83148effb5c1f5b8c7686c3459e361d9bc20bf" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", +] + +[[package]] +name = "zerovec" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90f911cbc359ab6af17377d242225f4d75119aec87ea711a880987b18cd7b239" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "625dc425cab0dca6dc3c3319506e6593dcb08a9f387ea3b284dbd52a92c40555" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "zmij" +version = "1.0.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8848ee67ecc8aedbaf3e4122217aff892639231befc6a1b58d29fff4c2cabaa" From 2ed3d94ab07e57cfd13bd4e51e5d8dba218beab0 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 25 Feb 2026 13:59:39 +0100 Subject: [PATCH 04/21] feat: finished action configuration server implementation --- src/configuration/action.rs | 15 +++--- src/main.rs | 13 ++++- ...ction_configuration_service_server_impl.rs | 50 ------------------- src/server/mod.rs | 35 +++++++++---- 4 files changed, 46 insertions(+), 67 deletions(-) delete mode 100644 src/server/action_configuration_service_server_impl.rs diff --git a/src/configuration/action.rs b/src/configuration/action.rs index 4127632..7f69edb 100644 --- a/src/configuration/action.rs +++ b/src/configuration/action.rs @@ -2,27 +2,30 @@ use serde::{Deserialize, Serialize}; use serde_json::from_str; use std::{fs::File, io::Read}; -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct ActionServiceConfiguration { token: String, service_name: String, } -#[derive(Serialize, Deserialize)] +#[derive(Serialize, Deserialize, Clone)] pub struct ActionConfiguration { actions: Vec, } impl ActionConfiguration { - - pub fn has_action(self, token: String) -> bool { - match self.actions.into_iter().find(|x| x.token == token) { + pub fn has_action(self, token: String, action_identifier: &String) -> bool { + match self + .actions + .into_iter() + .find(|x| x.token == token && x.service_name == *action_identifier) + { Some(_) => true, None => false, } } - pub fn from_path(path: String) -> Self { + pub fn from_path(path: &String) -> Self { let mut data = String::new(); let mut file = match File::open(path) { diff --git a/src/main.rs b/src/main.rs index 2adb5e2..a510477 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,7 @@ use crate::{ - configuration::{config::Config as AquilaConfig, state::AppReadiness}, + configuration::{ + action::ActionConfiguration, config::Config as AquilaConfig, state::AppReadiness, + }, flow::get_flow_identifier, sagittarius::retry::create_channel_with_retry, }; @@ -78,7 +80,14 @@ async fn main() { app_readiness.sagittarius_ready.clone(), ) .await; - let server = AquilaGRPCServer::new(&config, app_readiness.clone(), sagittarius_channel.clone()); + + let action_config = ActionConfiguration::from_path(&config.action_config_path); + let server = AquilaGRPCServer::new( + &config, + app_readiness.clone(), + sagittarius_channel.clone(), + action_config, + ); let kv_for_flow = kv_store.clone(); let mut server_task = tokio::spawn(async move { diff --git a/src/server/action_configuration_service_server_impl.rs b/src/server/action_configuration_service_server_impl.rs deleted file mode 100644 index e8dad09..0000000 --- a/src/server/action_configuration_service_server_impl.rs +++ /dev/null @@ -1,50 +0,0 @@ -use crate::{configuration::action::ActionConfiguration, sagittarius::{action_configuration_service_client_impl::SagittariusActionConfigurationServiceClient, data_type_service_client_impl::SagittariusDataTypeServiceClient}}; -use std::sync::Arc; -use tokio::sync::Mutex; -use tonic::Status; -use tucana::aquila::{action_configuration_service_server::ActionConfigurationService, data_type_service_server::DataTypeService}; - -pub struct AquilaActionConfigurationServiceServer { - client: Arc>, - actions: ActionConfiguration, -} - -impl AquilaActionConfigurationServiceServer { - pub fn new(client: Arc>, actions: ActionConfiguration) -> Self { - Self { client, actions } - } -} - -#[tonic::async_trait] -impl ActionConfigurationService for AquilaActionConfigurationServiceServer { - async fn update( - &self, - request: tonic::Request, - ) -> Result, tonic::Status> { - - let token = match request.metadata().get("authorization") { - Some(_) => todo!(), - None => Err(Status::unauthenticated("")), - }; - - let data_type_update_request = request.into_inner(); - - log::debug!( - "Received DataTypes: {:?}", - data_type_update_request - .data_types - .iter() - .map(|d| d.identifier.clone()) - .collect::>() - ); - - let mut client = self.client.lock().await; - let response = client.update_data_types(data_type_update_request).await; - - Ok(tonic::Response::new( - tucana::aquila::DataTypeUpdateResponse { - success: response.success, - }, - )) - } -} diff --git a/src/server/mod.rs b/src/server/mod.rs index 72234c8..e3df980 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -1,6 +1,7 @@ use crate::{ - configuration::{config::Config, state::AppReadiness}, + configuration::{action::ActionConfiguration, config::Config, state::AppReadiness}, sagittarius::{ + action_configuration_service_client_impl::SagittariusActionConfigurationServiceClient, data_type_service_client_impl::SagittariusDataTypeServiceClient, flow_type_service_client_impl::SagittariusFlowTypeServiceClient, runtime_function_service_client_impl::SagittariusRuntimeFunctionServiceClient, @@ -20,15 +21,17 @@ use tonic::{ Request, Status, transport::{Channel, Server}, }; -use tucana::aquila::{ - data_type_service_server::DataTypeServiceServer, - flow_type_service_server::FlowTypeServiceServer, - runtime_function_definition_service_server::RuntimeFunctionDefinitionServiceServer, - runtime_status_service_server::RuntimeStatusServiceServer, - runtime_usage_service_server::RuntimeUsageServiceServer, +use tucana::{ + aquila::{ + data_type_service_server::DataTypeServiceServer, + flow_type_service_server::FlowTypeServiceServer, + runtime_function_definition_service_server::RuntimeFunctionDefinitionServiceServer, + runtime_status_service_server::RuntimeStatusServiceServer, + runtime_usage_service_server::RuntimeUsageServiceServer, + }, + sagittarius::action_configuration_service_server::ActionConfigurationServiceServer, }; -mod action_configuration_service_server_impl; mod data_type_service_server_impl; mod flow_type_service_server_impl; mod runtime_function_service_server_impl; @@ -42,10 +45,16 @@ pub struct AquilaGRPCServer { with_health_service: bool, app_readiness: AppReadiness, channel: Channel, + action_configuration: ActionConfiguration, } impl AquilaGRPCServer { - pub fn new(config: &Config, app_readiness: AppReadiness, channel: Channel) -> Self { + pub fn new( + config: &Config, + app_readiness: AppReadiness, + channel: Channel, + action_configuration: ActionConfiguration, + ) -> Self { let address = match format!("{}:{}", config.grpc_host, config.grpc_port).parse() { Ok(addr) => { info!("Listening on {:?}", &addr); @@ -61,6 +70,7 @@ impl AquilaGRPCServer { address, app_readiness, channel, + action_configuration, } } @@ -97,6 +107,13 @@ impl AquilaGRPCServer { info!("RuntimeStatusService started"); + let action_configuration_service = Arc::new(Mutex::new( + SagittariusActionConfigurationServiceClient::new( + self.channel.clone(), + self.token.clone(), + ), + )); + let data_type_server = AquilaDataTypeServiceServer::new(data_type_service.clone()); let flow_type_server = AquilaFlowTypeServiceServer::new(flow_type_service.clone()); let runtime_function_server = From d34cff9d81d217a323f649ade07f9d09cb0b31bb Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 25 Feb 2026 15:13:06 +0100 Subject: [PATCH 05/21] dependencies: added futures-core --- Cargo.lock | 1 + Cargo.toml | 1 + 2 files changed, 2 insertions(+) diff --git a/Cargo.lock b/Cargo.lock index f98c9d9..642359e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -75,6 +75,7 @@ dependencies = [ "code0-flow", "env_logger", "futures", + "futures-core", "log", "prost", "serde", diff --git a/Cargo.toml b/Cargo.toml index 004b14d..e57e229 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,3 +18,4 @@ tonic-health = "0.14.1" tokio-stream = "0.1.17" uuid = { version = "1.18.0", features = ["v4"] } serde = "1.0.228" +futures-core = "0.3.32" From 1f0e45db2c8f2e870a46cdd5269f161084edba89 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 25 Feb 2026 15:13:17 +0100 Subject: [PATCH 06/21] feat: started to work on action transfer server --- .../action_transfer_service_server_impl.rs | 120 ++++++++++++++++++ src/server/mod.rs | 24 +--- 2 files changed, 127 insertions(+), 17 deletions(-) create mode 100644 src/server/action_transfer_service_server_impl.rs diff --git a/src/server/action_transfer_service_server_impl.rs b/src/server/action_transfer_service_server_impl.rs new file mode 100644 index 0000000..2a87932 --- /dev/null +++ b/src/server/action_transfer_service_server_impl.rs @@ -0,0 +1,120 @@ +use crate::configuration::action::ActionConfiguration; +use futures_core::Stream; +use std::pin::Pin; +use tokio_stream::StreamExt; +use tonic::Status; +use tucana::aquila::{ + ActionLogon, TransferRequest, TransferResponse, + action_transfer_service_server::ActionTransferService, +}; + +pub struct AquilaActionTransferServiceServer { + client: async_nats::Client, + actions: ActionConfiguration, +} + +impl AquilaActionTransferServiceServer { + pub fn new(client: async_nats::Client, actions: ActionConfiguration) -> Self { + Self { client, actions } + } +} + +#[tonic::async_trait] +impl ActionTransferService for AquilaActionTransferServiceServer { + type TransferStream = + Pin> + Send + 'static>>; + + async fn transfer( + &self, + request: tonic::Request>, + ) -> std::result::Result, tonic::Status> { + let mut first_request = true; + let mut action_props: Option = None; + let token = match request.metadata().get("authorization") { + Some(ascii) => match ascii.to_str() { + Ok(tk) => tk.to_string(), + Err(err) => { + log::error!("Cannot read authorization header because: {:?}", err); + return Err(Status::internal("cannot read authorization header")); + } + }, + None => return Err(Status::unauthenticated("missing authorization token")), + }; + + let mut stream = request.into_inner(); + tokio::spawn(async move { + while let Some(next) = stream.next().await { + let transfer_request = match next { + Ok(tr) => tr, + Err(status) => { + log::error!("Stream was closed with status code: {:?}", status); + break; + } + }; + + let data = match transfer_request.data { + Some(d) => d, + None => { + log::error!("Recieved empty request, waiting on next one"); + continue; + } + }; + + if first_request { + first_request = false; + + match data { + tucana::aquila::transfer_request::Data::Logon(action_logon) => { + log::info!("Action successfull logged on: {:?}", action_logon); + action_props = Some(action_logon); + todo!("check for authentication!") + } + _ => { + log::error!( + "Action tried to logon but was not sending a logon request!" + ); + //return Err(Status::internal("First request needs to be a 'ActionLogonRequest'")); + } + } + continue; + } + + let props = match action_props { + Some(ref p) => p.clone(), + None => todo!("return internal error"), + }; + + match data { + tucana::aquila::transfer_request::Data::Logon(action_logon) => todo!("Reject because already logged on"), + tucana::aquila::transfer_request::Data::Event(event) => todo!("check flows, push into execution queue"), + tucana::aquila::transfer_request::Data::Result(execution_result) => todo!("respond into nats with result"), + } + } + }); + + /* + let action_configuration_update_request = request.into_inner(); + match self.actions.clone().has_action( + token, + &action_configuration_update_request.action_identifier, + ) { + true => { + log::debug!( + "Action with identifer: {}, connected successfully", + action_configuration_update_request.action_identifier + ); + } + false => { + log::debug!( + "Rejected action with identifer: {}, becuase its not registered", + action_configuration_update_request.action_identifier + ); + return Err(Status::unauthenticated("")); + } + } + + */ + + unimplemented!(); + } +} diff --git a/src/server/mod.rs b/src/server/mod.rs index e3df980..ed21b94 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -1,7 +1,6 @@ use crate::{ configuration::{action::ActionConfiguration, config::Config, state::AppReadiness}, sagittarius::{ - action_configuration_service_client_impl::SagittariusActionConfigurationServiceClient, data_type_service_client_impl::SagittariusDataTypeServiceClient, flow_type_service_client_impl::SagittariusFlowTypeServiceClient, runtime_function_service_client_impl::SagittariusRuntimeFunctionServiceClient, @@ -21,17 +20,15 @@ use tonic::{ Request, Status, transport::{Channel, Server}, }; -use tucana::{ - aquila::{ - data_type_service_server::DataTypeServiceServer, - flow_type_service_server::FlowTypeServiceServer, - runtime_function_definition_service_server::RuntimeFunctionDefinitionServiceServer, - runtime_status_service_server::RuntimeStatusServiceServer, - runtime_usage_service_server::RuntimeUsageServiceServer, - }, - sagittarius::action_configuration_service_server::ActionConfigurationServiceServer, +use tucana::aquila::{ + data_type_service_server::DataTypeServiceServer, + flow_type_service_server::FlowTypeServiceServer, + runtime_function_definition_service_server::RuntimeFunctionDefinitionServiceServer, + runtime_status_service_server::RuntimeStatusServiceServer, + runtime_usage_service_server::RuntimeUsageServiceServer, }; +mod action_transfer_service_server_impl; mod data_type_service_server_impl; mod flow_type_service_server_impl; mod runtime_function_service_server_impl; @@ -107,13 +104,6 @@ impl AquilaGRPCServer { info!("RuntimeStatusService started"); - let action_configuration_service = Arc::new(Mutex::new( - SagittariusActionConfigurationServiceClient::new( - self.channel.clone(), - self.token.clone(), - ), - )); - let data_type_server = AquilaDataTypeServiceServer::new(data_type_service.clone()); let flow_type_server = AquilaFlowTypeServiceServer::new(flow_type_service.clone()); let runtime_function_server = From 0d861a7c18b2293ef89af34dc048ed3542242ae9 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 26 Feb 2026 10:53:02 +0100 Subject: [PATCH 07/21] drop: removed body validation part --- src/sagittarius/test_execution_client_impl.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/sagittarius/test_execution_client_impl.rs b/src/sagittarius/test_execution_client_impl.rs index 27cfd89..1fcd619 100644 --- a/src/sagittarius/test_execution_client_impl.rs +++ b/src/sagittarius/test_execution_client_impl.rs @@ -7,15 +7,12 @@ use futures::StreamExt; use prost::Message; use std::sync::Arc; -use std::time::SystemTime; use tokio_stream::wrappers::ReceiverStream; use tonic::Request; use tonic::transport::Channel; use tucana::sagittarius::execution_logon_request::Data; use tucana::sagittarius::execution_service_client::ExecutionServiceClient; -use tucana::sagittarius::{ - ApplicationLog, ExecutionLogonRequest, Log, Logon, TestExecutionResponse, -}; +use tucana::sagittarius::{ExecutionLogonRequest, Logon, TestExecutionResponse}; use tucana::shared::{ExecutionFlow, ValidationFlow, Value}; pub struct SagittariusTestExecutionServiceClient { @@ -99,8 +96,9 @@ impl SagittariusTestExecutionServiceClient { let uuid = uuid::Uuid::new_v4().to_string(); - // TODO: When triangulum is ready, validate the body with this service - // Task: Add back body validation using triangulum + // TODO: When the new validator is ready, the body needs to be validated at this + // point. + let execution_flow = ExecutionFlow { flow_id: request.flow_id, input_value: request.body, From a38465284d7177f855471cf32fbd232c96e5ef70 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 26 Feb 2026 13:22:58 +0100 Subject: [PATCH 08/21] fix: made has_action function not consume itself --- src/configuration/action.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/configuration/action.rs b/src/configuration/action.rs index 7f69edb..5efe84e 100644 --- a/src/configuration/action.rs +++ b/src/configuration/action.rs @@ -14,11 +14,11 @@ pub struct ActionConfiguration { } impl ActionConfiguration { - pub fn has_action(self, token: String, action_identifier: &String) -> bool { + pub fn has_action(&self, token: &String, action_identifier: &String) -> bool { match self .actions - .into_iter() - .find(|x| x.token == token && x.service_name == *action_identifier) + .iter() + .find(|x| &x.token == token && &x.service_name == action_identifier) { Some(_) => true, None => false, From 8f9cab37e7b0a9036ec6dc86caeddbd5e39ee7df Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 26 Feb 2026 13:23:16 +0100 Subject: [PATCH 09/21] fix: added missing project_id to flow identifier --- src/flow/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flow/mod.rs b/src/flow/mod.rs index 4127e67..245a398 100644 --- a/src/flow/mod.rs +++ b/src/flow/mod.rs @@ -3,5 +3,5 @@ use tucana::shared::ValidationFlow; /// Every flow identifier has this key /// .. pub fn get_flow_identifier(flow: &ValidationFlow) -> String { - format!("{}.{}.{}", flow.r#type, flow.project_slug, flow.flow_id) + format!("{}.{}.{}.{}", flow.r#type, flow.project_slug, flow.project_id, flow.flow_id) } From 0ba5d3c8cbc78b7c5c762a966a23a26f1dead204 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 26 Feb 2026 13:23:29 +0100 Subject: [PATCH 10/21] feat: added wip action configuration --- src/sagittarius/flow_service_client_impl.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sagittarius/flow_service_client_impl.rs b/src/sagittarius/flow_service_client_impl.rs index de99365..dc57ec2 100644 --- a/src/sagittarius/flow_service_client_impl.rs +++ b/src/sagittarius/flow_service_client_impl.rs @@ -147,9 +147,9 @@ impl SagittariusFlowClient { }; } } - Data::ActionConfigurations(_action_configurations) => unimplemented!( - "This will be implemented in the alpha edition. Do not use while service is in MVP!" - ), + Data::ActionConfigurations(_action_configurations) => { + todo!("Send to the correct Action") + } } } From 52eed394845aeb0f072e4e8edd575b4e7ef4b3b9 Mon Sep 17 00:00:00 2001 From: Raphael Date: Tue, 31 Mar 2026 21:21:04 +0200 Subject: [PATCH 11/21] feat: added project id to execution flow --- .../action_transfer_service_server_impl.rs | 207 ++++++++++++++---- 1 file changed, 167 insertions(+), 40 deletions(-) diff --git a/src/server/action_transfer_service_server_impl.rs b/src/server/action_transfer_service_server_impl.rs index 2a87932..a182740 100644 --- a/src/server/action_transfer_service_server_impl.rs +++ b/src/server/action_transfer_service_server_impl.rs @@ -1,24 +1,98 @@ use crate::configuration::action::ActionConfiguration; +use async_nats::Subscriber; +use futures::StreamExt; use futures_core::Stream; -use std::pin::Pin; -use tokio_stream::StreamExt; +use prost::Message; +use std::{pin::Pin, sync::Arc}; +use tokio::sync::Mutex; use tonic::Status; -use tucana::aquila::{ - ActionLogon, TransferRequest, TransferResponse, - action_transfer_service_server::ActionTransferService, +use tucana::{ + aquila::{ + ActionLogon, TransferRequest, TransferResponse, + action_transfer_service_server::ActionTransferService, + }, + shared::{ExecutionFlow, Flows, ValidationFlow, Value}, }; pub struct AquilaActionTransferServiceServer { client: async_nats::Client, + kv: async_nats::jetstream::kv::Store, actions: ActionConfiguration, } impl AquilaActionTransferServiceServer { - pub fn new(client: async_nats::Client, actions: ActionConfiguration) -> Self { - Self { client, actions } + pub fn new( + client: async_nats::Client, + kv: async_nats::jetstream::kv::Store, + actions: ActionConfiguration, + ) -> Self { + Self { + client, + kv, + actions, + } } } +enum FlowIdentificationError { + KVError, +} + +async fn get_flows( + pattern: String, + kv: async_nats::jetstream::kv::Store, +) -> Result { + let mut collector = Vec::new(); + let mut keys = match kv.keys().await { + Ok(keys) => keys.boxed(), + Err(err) => { + log::error!("Failed to get keys: {:?}", err); + return Err(FlowIdentificationError::KVError); + } + }; + + while let Ok(Some(key)) = tokio_stream::StreamExt::try_next(&mut keys).await { + if !is_matching_key(&pattern, &key) { + continue; + } + + if let Ok(Some(bytes)) = kv.get(key).await { + let decoded_flow = ValidationFlow::decode(bytes); + if let Ok(flow) = decoded_flow { + collector.push(flow.clone()); + }; + } + } + Ok(Flows { flows: collector }) +} + +fn is_matching_key(pattern: &String, key: &String) -> bool { + let split_pattern = pattern.split("."); + let split_key = key.split(".").collect::>(); + let zip = split_pattern.into_iter().zip(split_key); + + for (pattern_part, key_part) in zip { + if pattern_part == "*" { + continue; + } + + if pattern_part != key_part { + return false; + } + } + true +} + +fn convert_validation_flow(flow: ValidationFlow, input_value: Option) -> ExecutionFlow { + ExecutionFlow { + flow_id: flow.flow_id, + starting_node_id: flow.starting_node_id, + input_value, + node_functions: flow.node_functions, + project_id: flow.project_id, + } +} +//TODO: Aquila needs to listen to taurus exection requests and then send it to the action #[tonic::async_trait] impl ActionTransferService for AquilaActionTransferServiceServer { type TransferStream = @@ -28,8 +102,6 @@ impl ActionTransferService for AquilaActionTransferServiceServer { &self, request: tonic::Request>, ) -> std::result::Result, tonic::Status> { - let mut first_request = true; - let mut action_props: Option = None; let token = match request.metadata().get("authorization") { Some(ascii) => match ascii.to_str() { Ok(tk) => tk.to_string(), @@ -41,7 +113,16 @@ impl ActionTransferService for AquilaActionTransferServiceServer { None => return Err(Status::unauthenticated("missing authorization token")), }; + let mut first_request = true; + let mut action_props: Option = None; let mut stream = request.into_inner(); + + let actions = Arc::new(Mutex::new(self.actions.clone())); + let kv = self.kv.clone(); + let client = self.client.clone(); + + let mut sub: Option = None; + tokio::spawn(async move { while let Some(next) = stream.next().await { let transfer_request = match next { @@ -60,20 +141,58 @@ impl ActionTransferService for AquilaActionTransferServiceServer { } }; + // The first request needs to be an ActionLogon request to get the serive name + // If its not an ActionLogon request the connection is abborted if first_request { first_request = false; match data { tucana::aquila::transfer_request::Data::Logon(action_logon) => { log::info!("Action successfull logged on: {:?}", action_logon); - action_props = Some(action_logon); - todo!("check for authentication!") + let lock = actions.lock().await; + match lock.has_action(&token, &action_logon.action_identifier) { + true => { + log::debug!( + "Action with identifer: {}, connected successfully", + action_logon.action_identifier + ); + } + false => { + log::debug!( + "Rejected action with identifer: {}, becuase its not registered", + action_logon.action_identifier + ); + return Err(Status::unauthenticated( + "token not matching to action identifier", + )); + } + } + + action_props = Some(action_logon.clone()); + sub = match client + .subscribe(format!("action.{}.*", action_logon.action_identifier)) + .await + { + Ok(s) => Some(s), + Err(err) => { + log::error!( + "Cound not subscribe to action: {}. Reason: {:?}", + action_logon.action_identifier, + err + ); + return Err(Status::internal( + "cound not register action into execution loop", + )); + } + }; } _ => { log::error!( "Action tried to logon but was not sending a logon request!" ); - //return Err(Status::internal("First request needs to be a 'ActionLogonRequest'")); + return Err(Status::internal( + "First request needs to be a 'ActionLogonRequest'", + )); } } continue; @@ -81,40 +200,48 @@ impl ActionTransferService for AquilaActionTransferServiceServer { let props = match action_props { Some(ref p) => p.clone(), - None => todo!("return internal error"), + None => return Err(Status::internal("Missing actions informations")), }; match data { - tucana::aquila::transfer_request::Data::Logon(action_logon) => todo!("Reject because already logged on"), - tucana::aquila::transfer_request::Data::Event(event) => todo!("check flows, push into execution queue"), - tucana::aquila::transfer_request::Data::Result(execution_result) => todo!("respond into nats with result"), - } - } - }); + tucana::aquila::transfer_request::Data::Logon(_action_logon) => { + return Err(Status::internal( + "Already logged on. Send 'Logon' request only once", + )); + } + tucana::aquila::transfer_request::Data::Event(event) => { + //TODO get project id + let pattern = format!("{}.*.{}.*", event.event_type, "abc"); + let flows = match get_flows(pattern, kv.clone()).await { + Ok(f) => f, + Err(_) => { + log::error!("Cound not find any flows"); + continue; + } + }; - /* - let action_configuration_update_request = request.into_inner(); - match self.actions.clone().has_action( - token, - &action_configuration_update_request.action_identifier, - ) { - true => { - log::debug!( - "Action with identifer: {}, connected successfully", - action_configuration_update_request.action_identifier - ); + for flow in flows.flows { + let uuid = uuid::Uuid::new_v4().to_string(); + let flow_id = flow.flow_id; + let execution_flow: ExecutionFlow = + convert_validation_flow(flow, event.payload.clone()); + let bytes = execution_flow.encode_to_vec(); + let topic = format!("execution.{}", uuid); + log::info!( + "Requesting execution of flow {} with execution id {}", + flow_id, + uuid + ); + let _ = client.request(topic, bytes.into()).await; + } } - false => { - log::debug!( - "Rejected action with identifer: {}, becuase its not registered", - action_configuration_update_request.action_identifier - ); - return Err(Status::unauthenticated("")); + tucana::aquila::transfer_request::Data::Result(execution_result) => { + todo!("respond into nats with result") } } - - */ - - unimplemented!(); + } + Ok(()) + }); + unimplemented!() } } From 0f519b412080dccde199f4a35240008485eabc51 Mon Sep 17 00:00:00 2001 From: Raphael Date: Wed, 1 Apr 2026 21:03:27 +0200 Subject: [PATCH 12/21] feat: connected flow with action stream to transfer action configs --- src/main.rs | 4 ++ ...ction_configuration_service_client_impl.rs | 16 +++--- src/sagittarius/flow_service_client_impl.rs | 13 ++++- .../action_transfer_service_server_impl.rs | 53 +++++++++++++++++-- 4 files changed, 72 insertions(+), 14 deletions(-) diff --git a/src/main.rs b/src/main.rs index a510477..57dcdcf 100644 --- a/src/main.rs +++ b/src/main.rs @@ -81,6 +81,9 @@ async fn main() { ) .await; + let (action_config_tx, _) = + tokio::sync::broadcast::channel::(64); + let action_config = ActionConfiguration::from_path(&config.action_config_path); let server = AquilaGRPCServer::new( &config, @@ -124,6 +127,7 @@ async fn main() { config.runtime_token.clone(), ch, app_readiness.sagittarius_ready.clone(), + action_config_tx.clone(), ); match flow_client.init_flow_stream().await { diff --git a/src/sagittarius/action_configuration_service_client_impl.rs b/src/sagittarius/action_configuration_service_client_impl.rs index cc05d1a..0b19f94 100644 --- a/src/sagittarius/action_configuration_service_client_impl.rs +++ b/src/sagittarius/action_configuration_service_client_impl.rs @@ -1,6 +1,7 @@ use crate::authorization::authorization::get_authorization_metadata; use tonic::transport::Channel; use tonic::{Extensions, Request}; +use tucana::shared::ActionConfigurationDefinition; pub struct SagittariusActionConfigurationServiceClient { client: @@ -19,14 +20,15 @@ impl SagittariusActionConfigurationServiceClient { pub async fn update_action_configuration( &mut self, - action_configuration_update_request: tucana::aquila::ActionConfigurationUpdateRequest, - ) -> tucana::aquila::ActionConfigurationUpdateResponse { + action_identifier: String, + configs: Vec, + ) -> bool { let request = Request::from_parts( get_authorization_metadata(&self.token), Extensions::new(), tucana::sagittarius::ActionConfigurationUpdateRequest { - action_identifier: action_configuration_update_request.action_identifier, - action_configurations: action_configuration_update_request.action_configurations, + action_identifier: action_identifier, + action_configurations: configs, }, ); @@ -37,7 +39,7 @@ impl SagittariusActionConfigurationServiceClient { } Err(err) => { log::error!("Failed to update action configurations: {:?}", err); - return tucana::aquila::ActionConfigurationUpdateResponse { success: false }; + return true; } }; @@ -46,8 +48,6 @@ impl SagittariusActionConfigurationServiceClient { false => log::error!("Sagittarius didn't update any ActionConfiguration."), }; - tucana::aquila::ActionConfigurationUpdateResponse { - success: response.success, - } + response.success } } diff --git a/src/sagittarius/flow_service_client_impl.rs b/src/sagittarius/flow_service_client_impl.rs index dc57ec2..94c233c 100644 --- a/src/sagittarius/flow_service_client_impl.rs +++ b/src/sagittarius/flow_service_client_impl.rs @@ -3,6 +3,7 @@ use futures::{StreamExt, TryStreamExt}; use prost::Message; use std::{path::Path, sync::Arc}; use tokio::fs; +use tokio::sync::broadcast; use tonic::{Extensions, Request, transport::Channel}; use tucana::{ sagittarius::{ @@ -20,6 +21,7 @@ pub struct SagittariusFlowClient { env: String, token: String, sagittarius_ready: Arc, + action_config_tx: broadcast::Sender, } impl SagittariusFlowClient { @@ -29,6 +31,7 @@ impl SagittariusFlowClient { token: String, channel: Channel, sagittarius_ready: Arc, + action_config_tx: broadcast::Sender, ) -> SagittariusFlowClient { let client = FlowServiceClient::new(channel); @@ -38,6 +41,7 @@ impl SagittariusFlowClient { env, token, sagittarius_ready, + action_config_tx, } } @@ -147,8 +151,13 @@ impl SagittariusFlowClient { }; } } - Data::ActionConfigurations(_action_configurations) => { - todo!("Send to the correct Action") + Data::ActionConfigurations(action_configurations) => { + if let Err(err) = self.action_config_tx.send(action_configurations) { + log::warn!( + "No action configuration receivers available: {:?}", + err + ); + } } } } diff --git a/src/server/action_transfer_service_server_impl.rs b/src/server/action_transfer_service_server_impl.rs index a182740..f8cc90e 100644 --- a/src/server/action_transfer_service_server_impl.rs +++ b/src/server/action_transfer_service_server_impl.rs @@ -5,11 +5,12 @@ use futures_core::Stream; use prost::Message; use std::{pin::Pin, sync::Arc}; use tokio::sync::Mutex; +use tokio_stream::wrappers::ReceiverStream; use tonic::Status; use tucana::{ aquila::{ ActionLogon, TransferRequest, TransferResponse, - action_transfer_service_server::ActionTransferService, + action_transfer_service_server::ActionTransferService, transfer_response, }, shared::{ExecutionFlow, Flows, ValidationFlow, Value}, }; @@ -18,6 +19,7 @@ pub struct AquilaActionTransferServiceServer { client: async_nats::Client, kv: async_nats::jetstream::kv::Store, actions: ActionConfiguration, + action_config_tx: tokio::sync::broadcast::Sender, } impl AquilaActionTransferServiceServer { @@ -25,11 +27,13 @@ impl AquilaActionTransferServiceServer { client: async_nats::Client, kv: async_nats::jetstream::kv::Store, actions: ActionConfiguration, + action_config_tx: tokio::sync::broadcast::Sender, ) -> Self { Self { client, kv, actions, + action_config_tx, } } } @@ -92,6 +96,18 @@ fn convert_validation_flow(flow: ValidationFlow, input_value: Option) -> project_id: flow.project_id, } } + +fn applies_to_action( + configs: &tucana::shared::ActionConfigurations, + action_identifier: &str, +) -> bool { + configs.action_configurations.iter().any(|project_cfg| { + project_cfg + .action_configurations + .iter() + .any(|cfg| cfg.identifier == action_identifier) + }) +} //TODO: Aquila needs to listen to taurus exection requests and then send it to the action #[tonic::async_trait] impl ActionTransferService for AquilaActionTransferServiceServer { @@ -120,10 +136,15 @@ impl ActionTransferService for AquilaActionTransferServiceServer { let actions = Arc::new(Mutex::new(self.actions.clone())); let kv = self.kv.clone(); let client = self.client.clone(); + let mut cfg_rx = self.action_config_tx.subscribe(); let mut sub: Option = None; + let (tx, rx) = tokio::sync::mpsc::channel::>(32); + tokio::spawn(async move { + let mut cfg_forwarder_started = false; + while let Some(next) = stream.next().await { let transfer_request = match next { Ok(tr) => tr, @@ -185,6 +206,31 @@ impl ActionTransferService for AquilaActionTransferServiceServer { )); } }; + + if !cfg_forwarder_started { + cfg_forwarder_started = true; + let mut cfg_rx = cfg_rx.resubscribe(); + let tx = tx.clone(); + tokio::spawn(async move { + while let Ok(cfgs) = cfg_rx.recv().await { + // TODO: Replace incoming identifier with the correct action identifier. + if !applies_to_action( + &cfgs, + &action_logon.action_identifier, + ) { + continue; + } + let resp = TransferResponse { + data: Some( + transfer_response::Data::ActionConfigurations(cfgs), + ), + }; + if tx.send(Ok(resp)).await.is_err() { + break; + } + } + }); + } } _ => { log::error!( @@ -210,8 +256,7 @@ impl ActionTransferService for AquilaActionTransferServiceServer { )); } tucana::aquila::transfer_request::Data::Event(event) => { - //TODO get project id - let pattern = format!("{}.*.{}.*", event.event_type, "abc"); + let pattern = format!("{}.*.{}.*", event.event_type, event.project_id); let flows = match get_flows(pattern, kv.clone()).await { Ok(f) => f, Err(_) => { @@ -242,6 +287,6 @@ impl ActionTransferService for AquilaActionTransferServiceServer { } Ok(()) }); - unimplemented!() + Ok(tonic::Response::new(Box::pin(ReceiverStream::new(rx)))) } } From f183855585606323d392db41831504cea0ca51d8 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 2 Apr 2026 22:10:04 +0200 Subject: [PATCH 13/21] feat: completed action endpoint --- .../action_transfer_service_server_impl.rs | 366 +++++++++++++----- src/server/mod.rs | 29 +- 2 files changed, 287 insertions(+), 108 deletions(-) diff --git a/src/server/action_transfer_service_server_impl.rs b/src/server/action_transfer_service_server_impl.rs index f8cc90e..222f03e 100644 --- a/src/server/action_transfer_service_server_impl.rs +++ b/src/server/action_transfer_service_server_impl.rs @@ -9,7 +9,7 @@ use tokio_stream::wrappers::ReceiverStream; use tonic::Status; use tucana::{ aquila::{ - ActionLogon, TransferRequest, TransferResponse, + ActionLogon, Event, ExecutionRequest, ExecutionResult, TransferRequest, TransferResponse, action_transfer_service_server::ActionTransferService, transfer_response, }, shared::{ExecutionFlow, Flows, ValidationFlow, Value}, @@ -46,6 +46,7 @@ async fn get_flows( pattern: String, kv: async_nats::jetstream::kv::Store, ) -> Result { + log::debug!("Scanning flows with pattern: {}", pattern); let mut collector = Vec::new(); let mut keys = match kv.keys().await { Ok(keys) => keys.boxed(), @@ -60,13 +61,25 @@ async fn get_flows( continue; } - if let Ok(Some(bytes)) = kv.get(key).await { - let decoded_flow = ValidationFlow::decode(bytes); - if let Ok(flow) = decoded_flow { - collector.push(flow.clone()); - }; + match kv.get(key.clone()).await { + Ok(Some(bytes)) => { + let decoded_flow = ValidationFlow::decode(bytes); + match decoded_flow { + Ok(flow) => collector.push(flow), + Err(err) => { + log::error!("Failed to decode flow {}: {:?}", key, err); + } + } + } + Ok(None) => { + log::debug!("Flow key disappeared while reading: {}", key); + } + Err(err) => { + log::error!("Failed to fetch flow {}: {:?}", key, err); + } } } + log::debug!("Matched {} flows for pattern {}", collector.len(), pattern); Ok(Flows { flows: collector }) } @@ -81,6 +94,7 @@ fn is_matching_key(pattern: &String, key: &String) -> bool { } if pattern_part != key_part { + log::debug!("Key {} does not match pattern {}", key, pattern); return false; } } @@ -108,6 +122,189 @@ fn applies_to_action( .any(|cfg| cfg.identifier == action_identifier) }) } + +/// Extracts the bearer token from gRPC metadata. +fn extract_token( + request: &tonic::Request>, +) -> Result { + log::debug!("Extracting authorization token from metadata"); + match request.metadata().get("authorization") { + Some(ascii) => match ascii.to_str() { + Ok(tk) => Ok(tk.to_string()), + Err(err) => { + log::error!("Cannot read authorization header because: {:?}", err); + Err(Status::internal("cannot read authorization header")) + } + }, + None => { + log::error!("Missing authorization token"); + Err(Status::unauthenticated("missing authorization token")) + } + } +} + +/// Validates the logon request, starts NATS + config forwarders, and returns the accepted logon. +async fn handle_logon( + token: &str, + action_logon: ActionLogon, + actions: Arc>, + client: async_nats::Client, + cfg_tx: tokio::sync::broadcast::Sender, + tx: tokio::sync::mpsc::Sender>, + cfg_forwarder_started: &mut bool, +) -> Result { + log::info!("Action successfull logged on: {:?}", action_logon); + let lock = actions.lock().await; + if !lock.has_action(&token.to_string(), &action_logon.action_identifier) { + log::debug!( + "Rejected action with identifer: {}, becuase its not registered", + action_logon.action_identifier + ); + return Err(Status::unauthenticated( + "token not matching to action identifier", + )); + } + + log::debug!( + "Action with identifer: {}, connected successfully", + action_logon.action_identifier + ); + + let sub = match client + .subscribe(format!("action.{}.*", action_logon.action_identifier)) + .await + { + Ok(s) => s, + Err(err) => { + log::error!( + "Cound not subscribe to action: {}. Reason: {:?}", + action_logon.action_identifier, + err + ); + return Err(Status::internal( + "cound not register action into execution loop", + )); + } + }; + log::debug!( + "Subscribed to action subject action.{}.*", + action_logon.action_identifier + ); + let tx_clone = tx.clone(); + tokio::spawn(async move { + forward_nats_to_action(sub, tx_clone).await; + }); + + if !*cfg_forwarder_started { + *cfg_forwarder_started = true; + log::debug!( + "Starting config forwarder for action {}", + action_logon.action_identifier + ); + spawn_cfg_forwarder( + action_logon.action_identifier.clone(), + cfg_tx, + tx.clone(), + ); + } + + Ok(action_logon) +} + +/// Forwards config updates for the given action identifier to the gRPC stream. +fn spawn_cfg_forwarder( + action_identifier: String, + cfg_tx: tokio::sync::broadcast::Sender, + tx: tokio::sync::mpsc::Sender>, +) { + let mut cfg_rx = cfg_tx.subscribe(); + tokio::spawn(async move { + while let Ok(cfgs) = cfg_rx.recv().await { + // TODO: Replace incoming identifier with the correct action identifier. + if !applies_to_action(&cfgs, &action_identifier) { + log::debug!( + "Config update does not apply to action {}", + action_identifier + ); + continue; + } + log::debug!( + "Forwarding config update to action {}", + action_identifier + ); + let resp = TransferResponse { + data: Some(transfer_response::Data::ActionConfigurations(cfgs)), + }; + if tx.send(Ok(resp)).await.is_err() { + log::debug!("Config forwarder channel closed for {}", action_identifier); + break; + } + } + log::debug!("Config forwarder stopped for {}", action_identifier); + }); +} + +/// Looks up matching flows for an event and requests their execution. +async fn handle_event( + event: Event, + kv: async_nats::jetstream::kv::Store, + client: async_nats::Client, +) { + let pattern = format!("{}.*.{}.*", event.event_type, event.project_id); + log::debug!( + "Handling event type {} for project {}", + event.event_type, + event.project_id + ); + let flows = match get_flows(pattern, kv).await { + Ok(f) => f, + Err(_) => { + log::error!("Cound not find any flows"); + return; + } + }; + + for flow in flows.flows { + let uuid = uuid::Uuid::new_v4().to_string(); + let flow_id = flow.flow_id; + let execution_flow: ExecutionFlow = convert_validation_flow(flow, event.payload.clone()); + let bytes = execution_flow.encode_to_vec(); + let topic = format!("execution.{}", uuid); + log::info!( + "Requesting execution of flow {} with execution id {}", + flow_id, + uuid + ); + if let Err(err) = client.request(topic, bytes.into()).await { + log::error!( + "Failed to request execution for flow {}: {:?}", + flow_id, + err + ); + } + } +} + +/// Publishes execution results back to NATS for the waiting requester. +async fn handle_result( + action_identifier: &str, + execution_result: ExecutionResult, + client: async_nats::Client, +) { + let topic = format!( + "action.{}.{}", + action_identifier, execution_result.execution_identifier + ); + log::debug!( + "Publishing execution result to {}", + topic + ); + let payload = execution_result.encode_to_vec(); + if let Err(err) = client.publish(topic, payload.into()).await { + log::error!("Failed to publish action result: {:?}", err); + } + todo!("respond into nats with result") +} //TODO: Aquila needs to listen to taurus exection requests and then send it to the action #[tonic::async_trait] impl ActionTransferService for AquilaActionTransferServiceServer { @@ -118,16 +315,7 @@ impl ActionTransferService for AquilaActionTransferServiceServer { &self, request: tonic::Request>, ) -> std::result::Result, tonic::Status> { - let token = match request.metadata().get("authorization") { - Some(ascii) => match ascii.to_str() { - Ok(tk) => tk.to_string(), - Err(err) => { - log::error!("Cannot read authorization header because: {:?}", err); - return Err(Status::internal("cannot read authorization header")); - } - }, - None => return Err(Status::unauthenticated("missing authorization token")), - }; + let token = extract_token(&request)?; let mut first_request = true; let mut action_props: Option = None; @@ -136,14 +324,13 @@ impl ActionTransferService for AquilaActionTransferServiceServer { let actions = Arc::new(Mutex::new(self.actions.clone())); let kv = self.kv.clone(); let client = self.client.clone(); - let mut cfg_rx = self.action_config_tx.subscribe(); - - let mut sub: Option = None; + let cfg_tx = self.action_config_tx.clone(); let (tx, rx) = tokio::sync::mpsc::channel::>(32); tokio::spawn(async move { let mut cfg_forwarder_started = false; + log::debug!("Action transfer stream started"); while let Some(next) = stream.next().await { let transfer_request = match next { @@ -169,68 +356,21 @@ impl ActionTransferService for AquilaActionTransferServiceServer { match data { tucana::aquila::transfer_request::Data::Logon(action_logon) => { - log::info!("Action successfull logged on: {:?}", action_logon); - let lock = actions.lock().await; - match lock.has_action(&token, &action_logon.action_identifier) { - true => { - log::debug!( - "Action with identifer: {}, connected successfully", - action_logon.action_identifier - ); - } - false => { - log::debug!( - "Rejected action with identifer: {}, becuase its not registered", - action_logon.action_identifier - ); - return Err(Status::unauthenticated( - "token not matching to action identifier", - )); - } - } - - action_props = Some(action_logon.clone()); - sub = match client - .subscribe(format!("action.{}.*", action_logon.action_identifier)) - .await - { - Ok(s) => Some(s), - Err(err) => { - log::error!( - "Cound not subscribe to action: {}. Reason: {:?}", - action_logon.action_identifier, - err - ); - return Err(Status::internal( - "cound not register action into execution loop", - )); - } - }; - - if !cfg_forwarder_started { - cfg_forwarder_started = true; - let mut cfg_rx = cfg_rx.resubscribe(); - let tx = tx.clone(); - tokio::spawn(async move { - while let Ok(cfgs) = cfg_rx.recv().await { - // TODO: Replace incoming identifier with the correct action identifier. - if !applies_to_action( - &cfgs, - &action_logon.action_identifier, - ) { - continue; - } - let resp = TransferResponse { - data: Some( - transfer_response::Data::ActionConfigurations(cfgs), - ), - }; - if tx.send(Ok(resp)).await.is_err() { - break; - } - } - }); - } + log::debug!( + "Received logon for action {}", + action_logon.action_identifier + ); + let accepted = handle_logon( + &token, + action_logon, + actions.clone(), + client.clone(), + cfg_tx.clone(), + tx.clone(), + &mut cfg_forwarder_started, + ) + .await?; + action_props = Some(accepted); } _ => { log::error!( @@ -246,47 +386,61 @@ impl ActionTransferService for AquilaActionTransferServiceServer { let props = match action_props { Some(ref p) => p.clone(), - None => return Err(Status::internal("Missing actions informations")), + None => { + log::error!("Missing action properties after logon"); + return Err(Status::internal("Missing actions informations")); + } }; match data { tucana::aquila::transfer_request::Data::Logon(_action_logon) => { + log::error!("Received duplicate logon after initial logon"); return Err(Status::internal( "Already logged on. Send 'Logon' request only once", )); } tucana::aquila::transfer_request::Data::Event(event) => { - let pattern = format!("{}.*.{}.*", event.event_type, event.project_id); - let flows = match get_flows(pattern, kv.clone()).await { - Ok(f) => f, - Err(_) => { - log::error!("Cound not find any flows"); - continue; - } - }; - - for flow in flows.flows { - let uuid = uuid::Uuid::new_v4().to_string(); - let flow_id = flow.flow_id; - let execution_flow: ExecutionFlow = - convert_validation_flow(flow, event.payload.clone()); - let bytes = execution_flow.encode_to_vec(); - let topic = format!("execution.{}", uuid); - log::info!( - "Requesting execution of flow {} with execution id {}", - flow_id, - uuid - ); - let _ = client.request(topic, bytes.into()).await; - } + log::debug!("Received event from action {}", props.action_identifier); + handle_event(event, kv.clone(), client.clone()).await; } tucana::aquila::transfer_request::Data::Result(execution_result) => { - todo!("respond into nats with result") + log::debug!( + "Received execution result {} from action {}", + execution_result.execution_identifier, + props.action_identifier + ); + handle_result(&props.action_identifier, execution_result, client.clone()) + .await; } } } + log::debug!("Action transfer stream ended"); Ok(()) }); Ok(tonic::Response::new(Box::pin(ReceiverStream::new(rx)))) } } + +/// Forwards NATS execution requests to the connected action via gRPC. +async fn forward_nats_to_action( + mut sub: Subscriber, + tx: tokio::sync::mpsc::Sender>, +) { + while let Some(msg) = sub.next().await { + let execution = match ExecutionRequest::decode(msg.payload.as_ref()) { + Ok(req) => req, + Err(err) => { + log::error!("Invalid execution request payload: {:?}", err); + continue; + } + }; + let resp = TransferResponse { + data: Some(transfer_response::Data::Execution(execution)), + }; + if tx.send(Ok(resp)).await.is_err() { + log::debug!("Execution forwarder channel closed"); + break; + } + } + log::debug!("Execution forwarder stopped"); +} diff --git a/src/server/mod.rs b/src/server/mod.rs index ed21b94..3d0d9a4 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -7,9 +7,9 @@ use crate::{ runtime_status_service_client_impl::SagittariusRuntimeStatusServiceClient, runtime_usage_client_impl::SagittariusRuntimeUsageClient, }, - server::runtime_status_service_server_impl::AquilaRuntimeStatusServiceServer, - server::runtime_usage_service_server_impl::AquilaRuntimeUsageServiceServer, + server::{action_transfer_service_server_impl::AquilaActionTransferServiceServer, runtime_status_service_server_impl::AquilaRuntimeStatusServiceServer, runtime_usage_service_server_impl::AquilaRuntimeUsageServiceServer}, }; +use async_nats::jetstream::kv::Store; use data_type_service_server_impl::AquilaDataTypeServiceServer; use flow_type_service_server_impl::AquilaFlowTypeServiceServer; use log::info; @@ -21,6 +21,7 @@ use tonic::{ transport::{Channel, Server}, }; use tucana::aquila::{ + action_transfer_service_server::ActionTransferServiceServer, data_type_service_server::DataTypeServiceServer, flow_type_service_server::FlowTypeServiceServer, runtime_function_definition_service_server::RuntimeFunctionDefinitionServiceServer, @@ -43,6 +44,9 @@ pub struct AquilaGRPCServer { app_readiness: AppReadiness, channel: Channel, action_configuration: ActionConfiguration, + nats_client: async_nats::Client, + kv_store: Arc, + action_config_tx: tokio::sync::broadcast::Sender, } impl AquilaGRPCServer { @@ -51,6 +55,9 @@ impl AquilaGRPCServer { app_readiness: AppReadiness, channel: Channel, action_configuration: ActionConfiguration, + nats_client: async_nats::Client, + kv_store: Arc, + action_config_tx: tokio::sync::broadcast::Sender, ) -> Self { let address = match format!("{}:{}", config.grpc_host, config.grpc_port).parse() { Ok(addr) => { @@ -68,6 +75,9 @@ impl AquilaGRPCServer { app_readiness, channel, action_configuration, + nats_client, + kv_store, + action_config_tx, } } @@ -113,6 +123,13 @@ impl AquilaGRPCServer { let runtime_status_server = AquilaRuntimeStatusServiceServer::new(runtime_status_service.clone()); + let action_transfer_server = AquilaActionTransferServiceServer::new( + self.nats_client.clone(), + self.kv_store.as_ref().clone(), + self.action_configuration.clone(), + self.action_config_tx.clone(), + ); + info!("Starting gRPC Server..."); let readiness: Arc = Arc::new(self.app_readiness.clone()); @@ -159,6 +176,10 @@ impl AquilaGRPCServer { runtime_status_server, intercept.clone(), )) + .add_service(ActionTransferServiceServer::with_interceptor( + action_transfer_server, + intercept.clone(), + )) .serve(self.address) .await } else { @@ -183,6 +204,10 @@ impl AquilaGRPCServer { runtime_status_server, intercept.clone(), )) + .add_service(ActionTransferServiceServer::with_interceptor( + action_transfer_server, + intercept.clone(), + )) .serve(self.address) .await } From 24147699c0b570d93189cb0be5ac91c754e33264 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 2 Apr 2026 22:11:32 +0200 Subject: [PATCH 14/21] drop: removed unused stream logic --- src/stream/mod.rs | 79 ----------------------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 src/stream/mod.rs diff --git a/src/stream/mod.rs b/src/stream/mod.rs deleted file mode 100644 index 430d36e..0000000 --- a/src/stream/mod.rs +++ /dev/null @@ -1,79 +0,0 @@ -pub mod stream { - use futures::SinkExt; - use futures::channel::mpsc::Sender; - use std::collections::HashMap; - use std::sync::Arc; - use tokio::sync::Mutex; - use tonic::Status; - - // Type alias for our gRPC stream sender - type MessageSender = Sender>; - - // Stream manager to store and handle streams by ID - #[derive(Debug, Clone)] - pub struct StreamManager { - streams: Arc>>>, - } - - impl StreamManager { - // Create a new stream manager - pub fn new() -> Self { - Self { - streams: Arc::new(Mutex::new(HashMap::new())), - } - } - - // Store an existing stream with the given ID - pub async fn store_stream(&self, id: String, sender: MessageSender) { - let mut streams = self.streams.lock().await; - streams.insert(id, sender); - } - - // Remove a stream by ID - pub async fn remove_stream(&self, id: &str) -> bool { - let mut streams = self.streams.lock().await; - streams.remove(id).is_some() - } - - // Send a message to a specific stream - pub async fn send_message(&self, id: &str, message: T) -> Result<(), Status> { - let streams = self.streams.lock().await; - - if let Some(sender) = streams.get(id) { - sender.clone().send(Ok(message)).await.map_err(|_| { - Status::internal(format!("Failed to send message to stream {}", id)) - }) - } else { - Err(Status::not_found(format!( - "Stream with ID {} not found", - id - ))) - } - } - - // Check if a stream exists - pub async fn has_stream(&self, id: &str) -> bool { - let streams = self.streams.lock().await; - streams.contains_key(id) - } - - // Get the number of active streams - pub async fn count(&self) -> usize { - let streams = self.streams.lock().await; - streams.len() - } - - // Get a stream by ID - pub async fn get_stream(&self, id: &str) -> Option> { - let streams = self.streams.lock().await; - streams.get(id).cloned() - } - } - - // Default implementation to make it easier to create a new instance - impl Default for StreamManager { - fn default() -> Self { - Self::new() - } - } -} From 00679e10cbcf108e2113c2fec9f4b42dec97a2e0 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 2 Apr 2026 22:14:33 +0200 Subject: [PATCH 15/21] feat: correct params for aquila server --- src/main.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 57dcdcf..1314b62 100644 --- a/src/main.rs +++ b/src/main.rs @@ -19,7 +19,6 @@ pub mod configuration; pub mod flow; pub mod sagittarius; pub mod server; -pub mod stream; #[tokio::main] async fn main() { @@ -90,6 +89,9 @@ async fn main() { app_readiness.clone(), sagittarius_channel.clone(), action_config, + client.clone(), + kv_store.clone(), + action_config_tx.clone(), ); let kv_for_flow = kv_store.clone(); From 16773b8518d1dd178f010caeb53021a7f40c7863 Mon Sep 17 00:00:00 2001 From: Raphael Date: Thu, 2 Apr 2026 22:15:17 +0200 Subject: [PATCH 16/21] ref: cargo clippy & fmt --- src/configuration/config.rs | 5 ++++- src/configuration/mod.rs | 2 +- src/flow/mod.rs | 5 ++++- src/sagittarius/flow_service_client_impl.rs | 5 +---- .../action_transfer_service_server_impl.rs | 16 +++------------- src/server/mod.rs | 6 +++++- src/server/runtime_usage_service_server_impl.rs | 4 +--- 7 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/configuration/config.rs b/src/configuration/config.rs index 2d696fc..ef8440a 100644 --- a/src/configuration/config.rs +++ b/src/configuration/config.rs @@ -72,7 +72,10 @@ impl Config { "SAGITTARIUS_URL", String::from("http://localhost:50051"), ), - action_config_path: env_with_default("ACTION_CONFIG_PATH", String::from("./action.configuration.json")) + action_config_path: env_with_default( + "ACTION_CONFIG_PATH", + String::from("./action.configuration.json"), + ), } } diff --git a/src/configuration/mod.rs b/src/configuration/mod.rs index 75bdc90..6310344 100644 --- a/src/configuration/mod.rs +++ b/src/configuration/mod.rs @@ -1,3 +1,3 @@ pub mod action; -pub mod state; pub mod config; +pub mod state; diff --git a/src/flow/mod.rs b/src/flow/mod.rs index 245a398..731276a 100644 --- a/src/flow/mod.rs +++ b/src/flow/mod.rs @@ -3,5 +3,8 @@ use tucana::shared::ValidationFlow; /// Every flow identifier has this key /// .. pub fn get_flow_identifier(flow: &ValidationFlow) -> String { - format!("{}.{}.{}.{}", flow.r#type, flow.project_slug, flow.project_id, flow.flow_id) + format!( + "{}.{}.{}.{}", + flow.r#type, flow.project_slug, flow.project_id, flow.flow_id + ) } diff --git a/src/sagittarius/flow_service_client_impl.rs b/src/sagittarius/flow_service_client_impl.rs index 94c233c..fa68c6d 100644 --- a/src/sagittarius/flow_service_client_impl.rs +++ b/src/sagittarius/flow_service_client_impl.rs @@ -153,10 +153,7 @@ impl SagittariusFlowClient { } Data::ActionConfigurations(action_configurations) => { if let Err(err) = self.action_config_tx.send(action_configurations) { - log::warn!( - "No action configuration receivers available: {:?}", - err - ); + log::warn!("No action configuration receivers available: {:?}", err); } } } diff --git a/src/server/action_transfer_service_server_impl.rs b/src/server/action_transfer_service_server_impl.rs index 222f03e..e372e97 100644 --- a/src/server/action_transfer_service_server_impl.rs +++ b/src/server/action_transfer_service_server_impl.rs @@ -201,11 +201,7 @@ async fn handle_logon( "Starting config forwarder for action {}", action_logon.action_identifier ); - spawn_cfg_forwarder( - action_logon.action_identifier.clone(), - cfg_tx, - tx.clone(), - ); + spawn_cfg_forwarder(action_logon.action_identifier.clone(), cfg_tx, tx.clone()); } Ok(action_logon) @@ -228,10 +224,7 @@ fn spawn_cfg_forwarder( ); continue; } - log::debug!( - "Forwarding config update to action {}", - action_identifier - ); + log::debug!("Forwarding config update to action {}", action_identifier); let resp = TransferResponse { data: Some(transfer_response::Data::ActionConfigurations(cfgs)), }; @@ -295,10 +288,7 @@ async fn handle_result( "action.{}.{}", action_identifier, execution_result.execution_identifier ); - log::debug!( - "Publishing execution result to {}", - topic - ); + log::debug!("Publishing execution result to {}", topic); let payload = execution_result.encode_to_vec(); if let Err(err) = client.publish(topic, payload.into()).await { log::error!("Failed to publish action result: {:?}", err); diff --git a/src/server/mod.rs b/src/server/mod.rs index 3d0d9a4..85eba47 100644 --- a/src/server/mod.rs +++ b/src/server/mod.rs @@ -7,7 +7,11 @@ use crate::{ runtime_status_service_client_impl::SagittariusRuntimeStatusServiceClient, runtime_usage_client_impl::SagittariusRuntimeUsageClient, }, - server::{action_transfer_service_server_impl::AquilaActionTransferServiceServer, runtime_status_service_server_impl::AquilaRuntimeStatusServiceServer, runtime_usage_service_server_impl::AquilaRuntimeUsageServiceServer}, + server::{ + action_transfer_service_server_impl::AquilaActionTransferServiceServer, + runtime_status_service_server_impl::AquilaRuntimeStatusServiceServer, + runtime_usage_service_server_impl::AquilaRuntimeUsageServiceServer, + }, }; use async_nats::jetstream::kv::Store; use data_type_service_server_impl::AquilaDataTypeServiceServer; diff --git a/src/server/runtime_usage_service_server_impl.rs b/src/server/runtime_usage_service_server_impl.rs index a9422ac..6f053f2 100644 --- a/src/server/runtime_usage_service_server_impl.rs +++ b/src/server/runtime_usage_service_server_impl.rs @@ -26,9 +26,7 @@ impl RuntimeUsageService for AquilaRuntimeUsageServiceServer { log::debug!("Received RuntimeUsageRequest",); let mut client = self.client.lock().await; - let response = client - .update_runtime_usage(runtime_usage_request) - .await; + let response = client.update_runtime_usage(runtime_usage_request).await; Ok(tonic::Response::new(tucana::aquila::RuntimeUsageResponse { success: response.success, From 8e376240a10960eb7274d978b57e0f1c6e3628f5 Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 5 Apr 2026 15:41:25 +0200 Subject: [PATCH 17/21] feat: added example action config --- action.configuration.json | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 action.configuration.json diff --git a/action.configuration.json b/action.configuration.json new file mode 100644 index 0000000..aefd6e6 --- /dev/null +++ b/action.configuration.json @@ -0,0 +1,8 @@ +{ + "actions": [ + { + "token": "token", + "service_name": "example" + } + ] +} From 79c989a02986affec5c8ab4265a08db2c2c01bfe Mon Sep 17 00:00:00 2001 From: Raphael Date: Sun, 5 Apr 2026 17:19:18 +0200 Subject: [PATCH 18/21] fix: correct reqeust/reply logic --- .../action_transfer_service_server_impl.rs | 138 ++++++++++++++---- 1 file changed, 107 insertions(+), 31 deletions(-) diff --git a/src/server/action_transfer_service_server_impl.rs b/src/server/action_transfer_service_server_impl.rs index e372e97..30bc8e9 100644 --- a/src/server/action_transfer_service_server_impl.rs +++ b/src/server/action_transfer_service_server_impl.rs @@ -1,9 +1,9 @@ use crate::configuration::action::ActionConfiguration; -use async_nats::Subscriber; +use async_nats::{Subject, Subscriber}; use futures::StreamExt; use futures_core::Stream; use prost::Message; -use std::{pin::Pin, sync::Arc}; +use std::{collections::HashMap, pin::Pin, sync::Arc}; use tokio::sync::Mutex; use tokio_stream::wrappers::ReceiverStream; use tonic::Status; @@ -15,6 +15,8 @@ use tucana::{ shared::{ExecutionFlow, Flows, ValidationFlow, Value}, }; +type PendingReplies = Arc>>; + pub struct AquilaActionTransferServiceServer { client: async_nats::Client, kv: async_nats::jetstream::kv::Store, @@ -79,6 +81,7 @@ async fn get_flows( } } } + log::debug!("Matched {} flows for pattern {}", collector.len(), pattern); Ok(Flows { flows: collector }) } @@ -98,6 +101,7 @@ fn is_matching_key(pattern: &String, key: &String) -> bool { return false; } } + true } @@ -151,9 +155,11 @@ async fn handle_logon( client: async_nats::Client, cfg_tx: tokio::sync::broadcast::Sender, tx: tokio::sync::mpsc::Sender>, + pending_replies: PendingReplies, cfg_forwarder_started: &mut bool, ) -> Result { log::info!("Action successfull logged on: {:?}", action_logon); + let lock = actions.lock().await; if !lock.has_action(&token.to_string(), &action_logon.action_identifier) { log::debug!( @@ -186,13 +192,16 @@ async fn handle_logon( )); } }; + log::debug!( "Subscribed to action subject action.{}.*", action_logon.action_identifier ); + let tx_clone = tx.clone(); + let pending_replies_clone = pending_replies.clone(); tokio::spawn(async move { - forward_nats_to_action(sub, tx_clone).await; + forward_nats_to_action(sub, tx_clone, pending_replies_clone).await; }); if !*cfg_forwarder_started { @@ -216,7 +225,6 @@ fn spawn_cfg_forwarder( let mut cfg_rx = cfg_tx.subscribe(); tokio::spawn(async move { while let Ok(cfgs) = cfg_rx.recv().await { - // TODO: Replace incoming identifier with the correct action identifier. if !applies_to_action(&cfgs, &action_identifier) { log::debug!( "Config update does not apply to action {}", @@ -224,15 +232,18 @@ fn spawn_cfg_forwarder( ); continue; } + log::debug!("Forwarding config update to action {}", action_identifier); let resp = TransferResponse { data: Some(transfer_response::Data::ActionConfigurations(cfgs)), }; + if tx.send(Ok(resp)).await.is_err() { log::debug!("Config forwarder channel closed for {}", action_identifier); break; } } + log::debug!("Config forwarder stopped for {}", action_identifier); }); } @@ -249,6 +260,7 @@ async fn handle_event( event.event_type, event.project_id ); + let flows = match get_flows(pattern, kv).await { Ok(f) => f, Err(_) => { @@ -263,11 +275,13 @@ async fn handle_event( let execution_flow: ExecutionFlow = convert_validation_flow(flow, event.payload.clone()); let bytes = execution_flow.encode_to_vec(); let topic = format!("execution.{}", uuid); + log::info!( "Requesting execution of flow {} with execution id {}", flow_id, uuid ); + if let Err(err) = client.request(topic, bytes.into()).await { log::error!( "Failed to request execution for flow {}: {:?}", @@ -278,24 +292,43 @@ async fn handle_event( } } -/// Publishes execution results back to NATS for the waiting requester. +/// Publishes execution results back to the original NATS reply subject. async fn handle_result( - action_identifier: &str, execution_result: ExecutionResult, client: async_nats::Client, + pending_replies: PendingReplies, ) { - let topic = format!( - "action.{}.{}", - action_identifier, execution_result.execution_identifier + let execution_id = execution_result.execution_identifier.clone(); + + let reply_subject = { + let mut pending = pending_replies.lock().await; + pending.remove(&execution_id) + }; + + let Some(reply_subject) = reply_subject else { + log::error!( + "No pending NATS reply subject found for execution {}", + execution_id + ); + return; + }; + + log::debug!( + "Publishing execution result for {} to reply subject {}", + execution_id, + reply_subject ); - log::debug!("Publishing execution result to {}", topic); + let payload = execution_result.encode_to_vec(); - if let Err(err) = client.publish(topic, payload.into()).await { - log::error!("Failed to publish action result: {:?}", err); + if let Err(err) = client.publish(reply_subject, payload.into()).await { + log::error!( + "Failed to publish action result for execution {}: {:?}", + execution_id, + err + ); } - todo!("respond into nats with result") } -//TODO: Aquila needs to listen to taurus exection requests and then send it to the action + #[tonic::async_trait] impl ActionTransferService for AquilaActionTransferServiceServer { type TransferStream = @@ -315,6 +348,7 @@ impl ActionTransferService for AquilaActionTransferServiceServer { let kv = self.kv.clone(); let client = self.client.clone(); let cfg_tx = self.action_config_tx.clone(); + let pending_replies: PendingReplies = Arc::new(Mutex::new(HashMap::new())); let (tx, rx) = tokio::sync::mpsc::channel::>(32); @@ -339,8 +373,6 @@ impl ActionTransferService for AquilaActionTransferServiceServer { } }; - // The first request needs to be an ActionLogon request to get the serive name - // If its not an ActionLogon request the connection is abborted if first_request { first_request = false; @@ -350,44 +382,51 @@ impl ActionTransferService for AquilaActionTransferServiceServer { "Received logon for action {}", action_logon.action_identifier ); - let accepted = handle_logon( + + let accepted = match handle_logon( &token, action_logon, actions.clone(), client.clone(), cfg_tx.clone(), tx.clone(), + pending_replies.clone(), &mut cfg_forwarder_started, ) - .await?; + .await + { + Ok(v) => v, + Err(status) => { + log::error!("Logon failed: {:?}", status); + break; + } + }; + action_props = Some(accepted); } _ => { log::error!( "Action tried to logon but was not sending a logon request!" ); - return Err(Status::internal( - "First request needs to be a 'ActionLogonRequest'", - )); + break; } } + continue; } - let props = match action_props { - Some(ref p) => p.clone(), + let props = match action_props.clone() { + Some(p) => p, None => { log::error!("Missing action properties after logon"); - return Err(Status::internal("Missing actions informations")); + break; } }; match data { - tucana::aquila::transfer_request::Data::Logon(_action_logon) => { + tucana::aquila::transfer_request::Data::Logon(_) => { log::error!("Received duplicate logon after initial logon"); - return Err(Status::internal( - "Already logged on. Send 'Logon' request only once", - )); + break; } tucana::aquila::transfer_request::Data::Event(event) => { log::debug!("Received event from action {}", props.action_identifier); @@ -399,24 +438,31 @@ impl ActionTransferService for AquilaActionTransferServiceServer { execution_result.execution_identifier, props.action_identifier ); - handle_result(&props.action_identifier, execution_result, client.clone()) + + handle_result(execution_result, client.clone(), pending_replies.clone()) .await; } } } + log::debug!("Action transfer stream ended"); - Ok(()) }); + Ok(tonic::Response::new(Box::pin(ReceiverStream::new(rx)))) } } -/// Forwards NATS execution requests to the connected action via gRPC. +/// Forwards NATS execution requests to the connected action via gRPC and stores reply subjects. async fn forward_nats_to_action( mut sub: Subscriber, tx: tokio::sync::mpsc::Sender>, + pending_replies: PendingReplies, ) { + log::debug!("Waiting for incomming request"); + while let Some(msg) = sub.next().await { + log::debug!("Recieved RemoteRuntime execution request"); + let execution = match ExecutionRequest::decode(msg.payload.as_ref()) { Ok(req) => req, Err(err) => { @@ -424,13 +470,43 @@ async fn forward_nats_to_action( continue; } }; + + let execution_id = execution.execution_identifier.clone(); + + let Some(reply_subject) = msg.reply.clone() else { + log::error!( + "Received request for execution {} without NATS reply subject", + execution_id + ); + continue; + }; + + { + let mut pending = pending_replies.lock().await; + pending.insert(execution_id.clone(), reply_subject.clone()); + } + + log::debug!( + "Stored reply subject {} for execution {}", + reply_subject, + execution_id + ); + let resp = TransferResponse { data: Some(transfer_response::Data::Execution(execution)), }; + if tx.send(Ok(resp)).await.is_err() { log::debug!("Execution forwarder channel closed"); + + // cleanup, since the request can no longer be delivered to the action + let mut pending = pending_replies.lock().await; + pending.remove(&execution_id); + break; } } + log::debug!("Execution forwarder stopped"); } + From eebf84021fa2bdd24431fdcdf30fac23619abe14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20G=C3=B6tz?= <52959657+raphael-goetz@users.noreply.github.com> Date: Sun, 5 Apr 2026 22:06:13 +0200 Subject: [PATCH 19/21] Update src/server/action_transfer_service_server_impl.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com> --- src/server/action_transfer_service_server_impl.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/action_transfer_service_server_impl.rs b/src/server/action_transfer_service_server_impl.rs index 30bc8e9..e6aadb0 100644 --- a/src/server/action_transfer_service_server_impl.rs +++ b/src/server/action_transfer_service_server_impl.rs @@ -183,12 +183,12 @@ async fn handle_logon( Ok(s) => s, Err(err) => { log::error!( - "Cound not subscribe to action: {}. Reason: {:?}", + "Could not subscribe to action: {}. Reason: {:?}", action_logon.action_identifier, err ); return Err(Status::internal( - "cound not register action into execution loop", + "could not register action into execution loop", )); } }; From cef07dcddfb4cefd824601c9a6c44ded8ce24ee8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20G=C3=B6tz?= <52959657+raphael-goetz@users.noreply.github.com> Date: Sun, 5 Apr 2026 22:06:41 +0200 Subject: [PATCH 20/21] Update src/server/action_transfer_service_server_impl.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com> --- src/server/action_transfer_service_server_impl.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/server/action_transfer_service_server_impl.rs b/src/server/action_transfer_service_server_impl.rs index e6aadb0..cb0e462 100644 --- a/src/server/action_transfer_service_server_impl.rs +++ b/src/server/action_transfer_service_server_impl.rs @@ -458,10 +458,10 @@ async fn forward_nats_to_action( tx: tokio::sync::mpsc::Sender>, pending_replies: PendingReplies, ) { - log::debug!("Waiting for incomming request"); + log::debug!("Waiting for incoming request"); while let Some(msg) = sub.next().await { - log::debug!("Recieved RemoteRuntime execution request"); + log::debug!("Received RemoteRuntime execution request"); let execution = match ExecutionRequest::decode(msg.payload.as_ref()) { Ok(req) => req, From cc60592b7df915b86f6f732946ae52df76e73374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Raphael=20G=C3=B6tz?= <52959657+raphael-goetz@users.noreply.github.com> Date: Sun, 5 Apr 2026 22:06:55 +0200 Subject: [PATCH 21/21] Update src/flow/mod.rs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Raphael Götz <52959657+raphael-goetz@users.noreply.github.com> --- src/flow/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flow/mod.rs b/src/flow/mod.rs index 731276a..f6eb49f 100644 --- a/src/flow/mod.rs +++ b/src/flow/mod.rs @@ -1,7 +1,7 @@ use tucana::shared::ValidationFlow; /// Every flow identifier has this key -/// .. +/// ... pub fn get_flow_identifier(flow: &ValidationFlow) -> String { format!( "{}.{}.{}.{}",