From 4a530898afc704baf05ec62553405c8e1e74e583 Mon Sep 17 00:00:00 2001 From: Moe Dashti Date: Fri, 16 Oct 2026 22:59:02 -0700 Subject: [PATCH 1/4] Moved the stream service connection and owner client into the crate. Lang connects the service with its client Connection and runtime meter, so Core needs no streams feature. --- CHANGELOG.md | 2 + Cargo.lock | 94 +++++++++++++++ Cargo.toml | 6 + README.md | 6 +- crates/streams/Cargo.toml | 8 +- crates/streams/src/connection.rs | 192 +++++++++++++++++++++++++++++++ crates/streams/src/lib.rs | 2 + crates/streams/src/service.rs | 19 ++- 8 files changed, 323 insertions(+), 6 deletions(-) create mode 100644 crates/streams/src/connection.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c9713b..fbeaae6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,3 +6,5 @@ cursor format, the record helpers and the lang byte call `StreamService`. - Added the `coresdk.streams` and `temporal.sdk.streams.v1` protos, built in the crate against the pinned sdk-rust. +- Added `connect_stream_service`, which builds the process-wide service over a client + `Connection` and takes lang's runtime meter. diff --git a/Cargo.lock b/Cargo.lock index 04d4dc6..762209c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,12 @@ # It is not intended for manual editing. version = 4 +[[package]] +name = "adler2" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "320119579fcad9c21884f5c4861d16174d0e06250625266f50fe6898340abefa" + [[package]] name = "aho-corasick" version = "1.1.5" @@ -401,6 +407,12 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + [[package]] name = "either" version = "1.19.0" @@ -472,6 +484,17 @@ version = "0.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d674e81391d1e1ab681a28d99df07927c6d4aa5b027d7da16ba32d1d21ecd99" +[[package]] +name = "flate2" +version = "1.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e634e2e0ebac1ee034020da1ca582e17ffe4e0f5e985823721e168928136dcb" +dependencies = [ + "crc32fast", + "miniz_oxide", + "zlib-rs", +] + [[package]] name = "fnv" version = "1.0.7" @@ -507,6 +530,7 @@ checksum = "9a31d2a3fbaaeb2af2368bbdd904aa8e812d3c04a1ee10d3171f52d556e5d0a3" dependencies = [ "futures-channel", "futures-core", + "futures-executor", "futures-io", "futures-sink", "futures-task", @@ -557,6 +581,17 @@ dependencies = [ "syn 3.0.9", ] +[[package]] +name = "futures-retry" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fde5a672a61f96552aa5ed9fd9c81c3fbdae4be9b1e205d6eaf17c83705adc0f" +dependencies = [ + "futures", + "pin-project-lite", + "tokio", +] + [[package]] name = "futures-sink" version = "0.3.34" @@ -575,6 +610,7 @@ version = "0.3.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d50a92467f8ba5dd6e3ee5d4bd04d73ab2e4e1c44474a0674821dfce14b79bc" dependencies = [ + "futures-channel", "futures-core", "futures-io", "futures-macro", @@ -1082,6 +1118,16 @@ version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" +[[package]] +name = "miniz_oxide" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b63fbc4a50860e98e7b2aa7804ded1db5cbc3aff9193adaff57a6931bf7c4b4c" +dependencies = [ + "adler2", + "simd-adler32", +] + [[package]] name = "mio" version = "1.2.4" @@ -2000,6 +2046,12 @@ version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" +[[package]] +name = "simd-adler32" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" + [[package]] name = "simd_cesu8" version = "1.2.0" @@ -2111,6 +2163,39 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "temporalio-client" +version = "1.1.0" +source = "git+https://github.com/moetemp/sdk-rust?rev=4ebdacab5d78dfaf13cfdb1f340ba96b6ad7f6c0#4ebdacab5d78dfaf13cfdb1f340ba96b6ad7f6c0" +dependencies = [ + "anyhow", + "async-trait", + "backon", + "base64 0.23.1", + "bon", + "bytes", + "derive_more", + "dyn-clone", + "futures-retry", + "futures-util", + "http", + "http-body-util", + "hyper", + "hyper-util", + "parking_lot", + "rand 0.10.3", + "serde_json", + "temporalio-common", + "thiserror", + "tokio", + "tokio-rustls", + "tonic", + "tower", + "tracing", + "url", + "uuid", +] + [[package]] name = "temporalio-common" version = "1.1.0" @@ -2203,9 +2288,11 @@ dependencies = [ "serde", "serde_json", "sha2", + "temporalio-client", "temporalio-common", "thiserror", "tokio", + "tonic", "tonic-prost-build", "tracing", "tracing-subscriber", @@ -2365,6 +2452,7 @@ dependencies = [ "async-trait", "base64 0.22.1", "bytes", + "flate2", "h2", "http", "http-body", @@ -3001,6 +3089,12 @@ dependencies = [ "syn 3.0.9", ] +[[package]] +name = "zlib-rs" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b268e58e7c693d7c271f93ffc4ba3b380412554231c85bf61ca7af91042a4112" + [[package]] name = "zmij" version = "1.0.23" diff --git a/Cargo.toml b/Cargo.toml index a26d80a..94bb302 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ prost-types = { version = "0.7", package = "prost-wkt-types" } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" thiserror = "2" +tonic = { version = "0.14.6", default-features = false } tonic-prost-build = "0.14.6" # One sdk-rust commit for every sdk-rust crate. It must equal the `sdk-core` submodule commit of @@ -23,6 +24,11 @@ git = "https://github.com/moetemp/sdk-rust" rev = "4ebdacab5d78dfaf13cfdb1f340ba96b6ad7f6c0" default-features = false +[workspace.dependencies.temporalio-client] +git = "https://github.com/moetemp/sdk-rust" +rev = "4ebdacab5d78dfaf13cfdb1f340ba96b6ad7f6c0" +default-features = false + [workspace.lints.rust] unreachable_pub = "warn" diff --git a/README.md b/README.md index e7c2c94..48be9d3 100644 --- a/README.md +++ b/README.md @@ -8,8 +8,9 @@ link this crate through their bridges. Temporal Core holds no stream code. ## Stage pins -The crate depends on `temporalio-common` from one sdk-rust commit per stage. That commit must equal -the `sdk-core` submodule commit of the sdk-python stage that links the crate. +The crate depends on `temporalio-common` and `temporalio-client` from one sdk-rust commit per +stage. That commit must equal the `sdk-core` submodule commit of the sdk-python stage that links +the crate. | Stage | sdk-streams branch | sdk-rust commit | |---|---|---| @@ -31,6 +32,7 @@ features = ["redis"] [patch."https://github.com/moetemp/sdk-rust"] temporalio-common = { path = "./sdk-core/crates/common" } +temporalio-client = { path = "./sdk-core/crates/client" } ``` The crate features `tls-ring`, `tls-aws-lc` and `envconfig` forward to the sdk-rust crates. A FIPS diff --git a/crates/streams/Cargo.toml b/crates/streams/Cargo.toml index 0a0e4e0..ae8afd6 100644 --- a/crates/streams/Cargo.toml +++ b/crates/streams/Cargo.toml @@ -15,9 +15,9 @@ categories = ["development-tools"] default = ["envconfig", "tls-ring"] # The TLS providers and the config loader of the sdk-rust crates. A FIPS build takes # `tls-aws-lc` with no default features, so no crate in the build pulls `ring`. -tls-ring = ["temporalio-common/tls-ring"] -tls-aws-lc = ["temporalio-common/tls-aws-lc"] -envconfig = ["temporalio-common/envconfig"] +tls-ring = ["temporalio-client/tls-ring", "temporalio-common/tls-ring"] +tls-aws-lc = ["temporalio-client/tls-aws-lc", "temporalio-common/tls-aws-lc"] +envconfig = ["temporalio-client/envconfig", "temporalio-common/envconfig"] serde_serialize = ["dep:serde", "temporalio-common/serde_serialize"] # The Redis store. Off by default, so a build that needs only the trait takes no Redis client. # TLS uses the rustls provider the process installs, the same one Core uses. @@ -37,8 +37,10 @@ redis = { version = "1.7", optional = true, default-features = false, features = ] } serde = { workspace = true, optional = true } sha2 = "0.10" +temporalio-client = { workspace = true } temporalio-common = { workspace = true } thiserror = { workspace = true } +tonic = { workspace = true } tokio = { version = "1.47", default-features = false, features = ["sync", "time"] } tracing = "0.1" diff --git a/crates/streams/src/connection.rs b/crates/streams/src/connection.rs new file mode 100644 index 0000000..c272463 --- /dev/null +++ b/crates/streams/src/connection.rs @@ -0,0 +1,192 @@ +//! Streams for lang: one process-wide stream service over the configured store, asking the +//! client's server about streams' owners. + +use crate::{OwnerClient, OwnerDescription, OwnerError, StreamResult, StreamService, proto}; +use prost::Message; +use std::sync::Arc; +use temporalio_client::Connection; +use temporalio_common::{ + protos::{ + google::rpc::Status as RpcStatus, + temporal::api::{ + common::v1::WorkflowExecution, + workflowservice::v1::{ + DescribeWorkflowExecutionRequest, DescribeWorkflowExecutionResponse, + }, + }, + }, + telemetry::metrics::TemporalMeter, +}; +use tonic::IntoRequest; + +/// Connects to the store `config` names. The service asks `connection`'s server about streams' +/// owners, and counts on `meter` when lang gives its runtime's meter. +pub async fn connect_stream_service( + config: proto::StreamStoreConfig, + connection: Connection, + meter: Option, +) -> StreamResult> { + let owner = Arc::new(ConnectionOwnerClient { connection }); + let mut service = StreamService::connect(config, owner).await?; + if let Some(meter) = meter { + service = service.with_meter(meter); + } + Ok(Arc::new(service)) +} + +/// Asks a Temporal server about owners through a client connection. +struct ConnectionOwnerClient { + connection: Connection, +} + +#[async_trait::async_trait] +impl OwnerClient for ConnectionOwnerClient { + async fn describe( + &self, + namespace: &str, + workflow_id: &str, + run_id: &str, + ) -> Result { + let response = self + .connection + .workflow_service() + .describe_workflow_execution( + DescribeWorkflowExecutionRequest { + namespace: namespace.to_string(), + execution: Some(WorkflowExecution { + workflow_id: workflow_id.to_string(), + run_id: run_id.to_string(), + }), + } + .into_request(), + ) + .await + .map_err(owner_error)?; + owner_description(response.into_inner()) + } +} + +fn owner_error(status: tonic::Status) -> OwnerError { + // A missing namespace says nothing about the Workflow. A failover or a namespace being + // set up answers it for a while, and a chain must not close on it. + if status.code() == tonic::Code::NotFound && !namespace_not_found(&status) { + OwnerError::NotFound(status.message().to_string()) + } else { + OwnerError::Failed(status.to_string()) + } +} + +fn namespace_not_found(status: &tonic::Status) -> bool { + RpcStatus::decode(status.details()).is_ok_and(|details| { + details.details.iter().any(|detail| { + detail + .type_url + .ends_with("/temporal.api.errordetails.v1.NamespaceNotFoundFailure") + }) + }) +} + +fn owner_description( + response: DescribeWorkflowExecutionResponse, +) -> Result { + let info = response + .workflow_execution_info + .ok_or_else(|| OwnerError::Failed("the server described no execution".to_string()))?; + let run_id = info + .execution + .as_ref() + .map(|execution| execution.run_id.clone()) + .unwrap_or_default(); + // A run that started its chain may leave the first run id unset. + let first_run_id = if info.first_run_id.is_empty() { + run_id.clone() + } else { + info.first_run_id.clone() + }; + Ok(OwnerDescription { + status: info.status(), + run_id, + first_run_id, + }) +} + +#[cfg(test)] +mod tests { + use super::*; + use temporalio_common::protos::temporal::api::{ + enums::v1::WorkflowExecutionStatus, workflow::v1::WorkflowExecutionInfo, + }; + + fn described(run_id: &str, first_run_id: &str) -> DescribeWorkflowExecutionResponse { + DescribeWorkflowExecutionResponse { + workflow_execution_info: Some(WorkflowExecutionInfo { + execution: Some(WorkflowExecution { + workflow_id: "wf".to_string(), + run_id: run_id.to_string(), + }), + first_run_id: first_run_id.to_string(), + status: WorkflowExecutionStatus::ContinuedAsNew as i32, + ..Default::default() + }), + ..Default::default() + } + } + + #[test] + fn a_description_names_the_run_its_chain_and_its_status() { + assert_eq!( + owner_description(described("run-2", "run-1")).unwrap(), + OwnerDescription { + run_id: "run-2".to_string(), + first_run_id: "run-1".to_string(), + status: WorkflowExecutionStatus::ContinuedAsNew, + } + ); + } + + #[test] + fn a_run_without_a_first_run_id_starts_its_chain() { + assert_eq!( + owner_description(described("run-1", "")) + .unwrap() + .first_run_id, + "run-1" + ); + } + + #[test] + fn a_missing_namespace_is_a_failure_not_a_gone_owner() { + let details = RpcStatus { + code: tonic::Code::NotFound as i32, + message: "namespace ns not found".to_string(), + details: vec![prost_types::Any { + type_url: + "type.googleapis.com/temporal.api.errordetails.v1.NamespaceNotFoundFailure" + .to_string(), + value: Vec::new(), + }], + }; + let status = tonic::Status::with_details( + tonic::Code::NotFound, + "namespace ns not found", + details.encode_to_vec().into(), + ); + assert!(matches!(owner_error(status), OwnerError::Failed(_))); + } + + #[test] + fn not_found_says_the_owner_is_gone_and_anything_else_that_the_server_failed() { + assert!(matches!( + owner_error(tonic::Status::not_found("no such workflow")), + OwnerError::NotFound(message) if message == "no such workflow" + )); + assert!(matches!( + owner_error(tonic::Status::unavailable("down")), + OwnerError::Failed(_) + )); + assert!(matches!( + owner_description(DescribeWorkflowExecutionResponse::default()), + Err(OwnerError::Failed(_)) + )); + } +} diff --git a/crates/streams/src/lib.rs b/crates/streams/src/lib.rs index 080d1c5..a5137ee 100644 --- a/crates/streams/src/lib.rs +++ b/crates/streams/src/lib.rs @@ -9,6 +9,7 @@ //! [StreamService]. mod close; +mod connection; mod conventions; mod cursor; mod error; @@ -26,6 +27,7 @@ mod store; #[cfg(feature = "redis")] pub use self::redis::{RedisStore, RedisStoreOptions}; pub use close::{CHAIN_LOG, append_batch, close_chain, close_topic}; +pub use connection::connect_stream_service; pub use conventions::{ CONTENT_HASH_KEY, MAX_TOPIC_BYTES, METADATA_ENCODING, check_topic, content_hash_text, }; diff --git a/crates/streams/src/service.rs b/crates/streams/src/service.rs index 685b389..d5bb672 100644 --- a/crates/streams/src/service.rs +++ b/crates/streams/src/service.rs @@ -10,6 +10,7 @@ use crate::{ }; use prost::Message; use std::{sync::Arc, time::Duration}; +use temporalio_common::telemetry::metrics::TemporalMeter; /// How long a store keeps records when its configuration doesn't say. const DEFAULT_RETENTION: Duration = Duration::from_secs(7 * 24 * 60 * 60); @@ -26,6 +27,7 @@ const MAX_READ_WAIT: Duration = Duration::from_secs(60); pub struct StreamService { store: Arc, streams: Streams, + meter: TemporalMeter, } impl std::fmt::Debug for StreamService { @@ -73,7 +75,22 @@ impl StreamService { options: StreamsOptions, ) -> Self { let streams = Streams::new(store.clone(), owner, options); - Self { store, streams } + Self { + store, + streams, + meter: TemporalMeter::no_op(), + } + } + + /// Counts on `meter`, which is the no-op meter until lang gives one. + pub fn with_meter(mut self, meter: TemporalMeter) -> Self { + self.meter = meter; + self + } + + /// The meter the service counts on. + pub fn meter(&self) -> &TemporalMeter { + &self.meter } /// The store, for the Workers that append Workflow output to it. From e890911a0b31ee3a99f21524b81f8e71f17ec172 Mon Sep 17 00:00:00 2001 From: Moe Dashti Date: Fri, 16 Oct 2026 23:45:43 -0700 Subject: [PATCH 2/4] Added the fips feature and checked normal and build edges for ring. A lang bridge's fips feature can forward to it, and the tests' own dependencies no longer fail the check. --- .github/workflows/ci.yml | 11 ++-- CHANGELOG.md | 1 + Cargo.lock | 123 ++++++++++++++++++++++++++++++++++++-- README.md | 5 +- crates/streams/Cargo.toml | 6 ++ 5 files changed, 132 insertions(+), 14 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 790668b..d114a71 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,13 +51,12 @@ jobs: with: repo-token: ${{ secrets.GITHUB_TOKEN }} - uses: Swatinem/rust-cache@v2 - - run: cargo build --workspace --no-default-features --features tls-aws-lc,redis + - run: cargo build --workspace --no-default-features --features fips,redis + # Normal and build edges only, since the tests' own dependencies may take `ring`. - run: | - if cargo tree -e normal --no-default-features --features tls-aws-lc,redis -i ring \ - --target all 2>/dev/null | grep -q ring; then - cargo tree -e normal --no-default-features --features tls-aws-lc,redis -i ring - exit 1 - fi + tree=$(cargo tree -e normal,build --no-default-features --features fips,redis \ + -i ring --target all 2>/dev/null || true) + if [ -n "$tree" ]; then echo "$tree"; exit 1; fi redis: name: Redis store tests (standalone and cluster) diff --git a/CHANGELOG.md b/CHANGELOG.md index fbeaae6..e8fee99 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,3 +8,4 @@ pinned sdk-rust. - Added `connect_stream_service`, which builds the process-wide service over a client `Connection` and takes lang's runtime meter. +- Added the `fips` feature, which builds TLS on `aws-lc-rs` in FIPS mode with no `ring`. diff --git a/Cargo.lock b/Cargo.lock index 762209c..329e2e7 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,13 +72,30 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" +[[package]] +name = "aws-lc-fips-sys" +version = "0.14.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03367707e92796b190a4207d4d39b0a4271d574503d2969c2b0cfbf5c87658ee" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", + "pkg-config", + "regex", +] + [[package]] name = "aws-lc-rs" version = "1.18.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "faac5829c2b74c28f830747e7818ccfb684261b5f48a1118b1e2a13d36dfab13" dependencies = [ + "aws-lc-fips-sys", "aws-lc-sys", + "untrusted 0.7.1", "zeroize", ] @@ -116,6 +133,26 @@ version = "0.23.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac07cdecf99051d9a5238b80f35af32cdeba5b336e55d957b318b50137e18da5" +[[package]] +name = "bindgen" +version = "0.72.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "itertools 0.13.0", + "log", + "prettyplease 0.2.37", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex 1.3.0", + "syn 2.0.119", +] + [[package]] name = "bitflags" version = "2.13.2" @@ -175,7 +212,16 @@ dependencies = [ "find-msvc-tools", "jobserver", "libc", - "shlex", + "shlex 2.0.1", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", ] [[package]] @@ -211,6 +257,17 @@ dependencies = [ "serde", ] +[[package]] +name = "clang-sys" +version = "1.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "157a8ba7b480713b56f4c09fd13fc3e0a22a5dfab8097ba61cbc5feef950788a" +dependencies = [ + "glob", + "libc", + "libloading", +] + [[package]] name = "cmake" version = "0.1.58" @@ -670,6 +727,12 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "glob" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4eba85ea1d0a966a983acd07deee566e67395d2d96b6fb39e62b5a833f1eb0b" + [[package]] name = "h2" version = "0.4.20" @@ -964,6 +1027,15 @@ version = "2.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.14.0" @@ -1061,6 +1133,16 @@ version = "0.2.191" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" +[[package]] +name = "libloading" +version = "0.8.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d7c4b02199fee7c5d21a5ae7d8cfa79a6ef5bb2fc834d6e9058e89c825efdc55" +dependencies = [ + "cfg-if", + "windows-link", +] + [[package]] name = "libredox" version = "0.1.25" @@ -1118,6 +1200,12 @@ version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" version = "0.9.1" @@ -1145,6 +1233,16 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d87ecb2933e8aeadb3e3a02b828fed80a7528047e68b4f424523a0981a3a084" +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "nu-ansi-term" version = "0.50.3" @@ -1301,7 +1399,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2ed4d5c6ae95e08ac768883c8401cf0e8deb4e6e1d6a4e1fd3d2ec4f0ec63200" dependencies = [ "heck", - "itertools", + "itertools 0.14.0", "prost", "prost-types", ] @@ -1425,7 +1523,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03da047801ff44bb6a4d407d4860c05fd70bb81714e6b2f3812603d5b145b042" dependencies = [ "heck", - "itertools", + "itertools 0.14.0", "log", "multimap", "petgraph", @@ -1446,7 +1544,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b570b25f7617e43d59005d0990ccb79e950a423952cea19671b7a876da390adf" dependencies = [ "anyhow", - "itertools", + "itertools 0.14.0", "proc-macro2", "quote", "syn 2.0.119", @@ -1788,7 +1886,7 @@ dependencies = [ "cfg-if", "getrandom 0.2.17", "libc", - "untrusted", + "untrusted 0.9.0", "windows-sys 0.52.0", ] @@ -1894,7 +1992,7 @@ dependencies = [ "aws-lc-rs", "ring", "rustls-pki-types", - "untrusted", + "untrusted 0.9.0", ] [[package]] @@ -2040,6 +2138,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + [[package]] name = "shlex" version = "2.0.1" @@ -2281,6 +2385,7 @@ name = "temporalio-streams" version = "0.1.0" dependencies = [ "async-trait", + "aws-lc-rs", "crc16", "prost", "prost-wkt-types", @@ -2701,6 +2806,12 @@ version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" +[[package]] +name = "untrusted" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + [[package]] name = "untrusted" version = "0.9.0" diff --git a/README.md b/README.md index 48be9d3..5d14947 100644 --- a/README.md +++ b/README.md @@ -36,7 +36,8 @@ temporalio-client = { path = "./sdk-core/crates/client" } ``` The crate features `tls-ring`, `tls-aws-lc` and `envconfig` forward to the sdk-rust crates. A FIPS -build takes `tls-aws-lc` with no default features. +build takes `fips` with no default features. It turns on `tls-aws-lc` and the FIPS build of +`aws-lc-rs`, which needs CMake and Go. ## Building and testing @@ -48,7 +49,7 @@ when the copy differs. - Format and lint: `cargo fmt --all -- --check`, then `cargo clippy --workspace --all-features --tests -- -D warnings`. - Memory store: `cargo test --workspace --all-features`. -- FIPS: `cargo tree -e normal --no-default-features --features tls-aws-lc,redis -i ring` prints +- FIPS: `cargo tree -e normal,build --no-default-features --features fips,redis -i ring` prints nothing. - Redis: run `crates/streams/scripts/redis-test-servers.sh`, then the test command with the two URLs it prints. diff --git a/crates/streams/Cargo.toml b/crates/streams/Cargo.toml index ae8afd6..64f76b3 100644 --- a/crates/streams/Cargo.toml +++ b/crates/streams/Cargo.toml @@ -18,6 +18,9 @@ default = ["envconfig", "tls-ring"] tls-ring = ["temporalio-client/tls-ring", "temporalio-common/tls-ring"] tls-aws-lc = ["temporalio-client/tls-aws-lc", "temporalio-common/tls-aws-lc"] envconfig = ["temporalio-client/envconfig", "temporalio-common/envconfig"] +# A FIPS build: `tls-aws-lc`, and `aws-lc-rs` in FIPS mode, so the shared rustls provider links +# `aws-lc-fips-sys`. Take it with no default features, so no crate in the build pulls `ring`. +fips = ["tls-aws-lc", "dep:aws-lc-rs"] serde_serialize = ["dep:serde", "temporalio-common/serde_serialize"] # The Redis store. Off by default, so a build that needs only the trait takes no Redis client. # TLS uses the rustls provider the process installs, the same one Core uses. @@ -25,6 +28,9 @@ redis = ["dep:redis", "dep:crc16"] [dependencies] async-trait = "0.1" +# Only under `fips`. The crate never calls it. Its `fips` feature switches the one `aws-lc-rs` in +# the build into FIPS mode. +aws-lc-rs = { version = "1", features = ["fips"], optional = true } crc16 = { version = "0.4", optional = true } prost = { workspace = true } prost-types = { workspace = true } From adebf91dcd18ca7a04b8abddb2dc26fd7f3f6553 Mon Sep 17 00:00:00 2001 From: Mohammad Dashti Date: Sat, 17 Oct 2026 21:43:03 -0700 Subject: [PATCH 3/4] Pinned the client crate at the same sdk-rust k1 commit. --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index d72f4bc..037ba74 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2270,7 +2270,7 @@ dependencies = [ [[package]] name = "temporalio-client" version = "1.1.0" -source = "git+https://github.com/moetemp/sdk-rust?rev=4ebdacab5d78dfaf13cfdb1f340ba96b6ad7f6c0#4ebdacab5d78dfaf13cfdb1f340ba96b6ad7f6c0" +source = "git+https://github.com/moetemp/sdk-rust?rev=5dd6f0ec32f5f1f951c0ef8faa38ade5808cef0b#5dd6f0ec32f5f1f951c0ef8faa38ade5808cef0b" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index d81dce5..0b859e9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ default-features = false [workspace.dependencies.temporalio-client] git = "https://github.com/moetemp/sdk-rust" -rev = "4ebdacab5d78dfaf13cfdb1f340ba96b6ad7f6c0" +rev = "5dd6f0ec32f5f1f951c0ef8faa38ade5808cef0b" default-features = false [workspace.lints.rust] From fa0467423e0ded7508c528fd45fd9cebbd5261d4 Mon Sep 17 00:00:00 2001 From: Mohammad Dashti Date: Sun, 18 Oct 2026 00:29:40 -0700 Subject: [PATCH 4/4] Pinned the client crate to the same sdk-rust k1. --- Cargo.lock | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3d86e4..418d888 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2270,7 +2270,7 @@ dependencies = [ [[package]] name = "temporalio-client" version = "1.1.0" -source = "git+https://github.com/moetemp/sdk-rust?rev=5dd6f0ec32f5f1f951c0ef8faa38ade5808cef0b#5dd6f0ec32f5f1f951c0ef8faa38ade5808cef0b" +source = "git+https://github.com/moetemp/sdk-rust?rev=d6cad205043d4d99928e67a7859247da3c91e368#d6cad205043d4d99928e67a7859247da3c91e368" dependencies = [ "anyhow", "async-trait", diff --git a/Cargo.toml b/Cargo.toml index dfb9dfd..e42945a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -26,7 +26,7 @@ default-features = false [workspace.dependencies.temporalio-client] git = "https://github.com/moetemp/sdk-rust" -rev = "5dd6f0ec32f5f1f951c0ef8faa38ade5808cef0b" +rev = "d6cad205043d4d99928e67a7859247da3c91e368" default-features = false [workspace.lints.rust]