From 3719af463f75e490d872ab2893567180f91ea517 Mon Sep 17 00:00:00 2001 From: Blake Hatch Date: Wed, 18 Oct 2023 12:31:29 -0400 Subject: [PATCH] TLS Integration and tests added --- .gitignore | 1 + Cargo.Bazel.lock | 1438 ++++++++++++--- Cargo.lock | 1571 +++-------------- Cargo.toml | 4 + cas/BUILD | 4 + cas/cas_main.rs | 68 +- config/cas_server.rs | 18 + .../docker-compose/docker-compose.yml | 2 +- .../example-do-not-use-in-prod-key.pem | 52 + .../example-do-not-use-in-prod-rootca.crt | 29 + .../docker-compose/local-storage-cas.json | 27 + gencargo/cas/Cargo.toml | 4 + integration_tests/simple_tls_test.sh | 29 + tools/cargo_shared.bzl | 13 + 14 files changed, 1749 insertions(+), 1511 deletions(-) create mode 100644 deployment-examples/docker-compose/example-do-not-use-in-prod-key.pem create mode 100644 deployment-examples/docker-compose/example-do-not-use-in-prod-rootca.crt create mode 100755 integration_tests/simple_tls_test.sh diff --git a/.gitignore b/.gitignore index 3a403bb39..98f9a23a2 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,4 @@ terraform.tfstate* __pycache__ .devenv/ .direnv/ +.DS_Store diff --git a/Cargo.Bazel.lock b/Cargo.Bazel.lock index 321f2e581..287fb6773 100644 --- a/Cargo.Bazel.lock +++ b/Cargo.Bazel.lock @@ -1,5 +1,5 @@ { - "checksum": "2c3f1e765c34a9f17991d83113aef0f1ba948d0bffedde6568223a3053d148ef", + "checksum": "746ebd4616dceaa9a3a3d5b582e8cee3642e8398f6ea6454b6a2deb9b05e6e08", "crates": { "addr2line 0.20.0": { "name": "addr2line", @@ -284,7 +284,7 @@ "deps": { "common": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -1114,7 +1114,7 @@ "target": "cfg_if" }, { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" }, { @@ -1142,7 +1142,7 @@ "deps": { "common": [ { - "id": "cc 1.0.79", + "id": "cc 1.0.83", "target": "cc" } ], @@ -1215,6 +1215,7 @@ ], "crate_features": { "common": [ + "alloc", "default", "std" ], @@ -1417,7 +1418,7 @@ "deps": { "common": [ { - "id": "cc 1.0.79", + "id": "cc 1.0.83", "target": "cc" } ], @@ -1608,13 +1609,13 @@ }, "license": "MIT" }, - "cc 1.0.79": { + "cc 1.0.83": { "name": "cc", - "version": "1.0.79", + "version": "1.0.83", "repository": { "Http": { - "url": "https://crates.io/api/v1/crates/cc/1.0.79/download", - "sha256": "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" + "url": "https://crates.io/api/v1/crates/cc/1.0.83/download", + "sha256": "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" } }, "targets": [ @@ -1633,8 +1634,19 @@ "compile_data_glob": [ "**" ], + "deps": { + "common": [], + "selects": { + "cfg(unix)": [ + { + "id": "libc 0.2.149", + "target": "libc" + } + ] + } + }, "edition": "2018", - "version": "1.0.79" + "version": "1.0.83" }, "license": "MIT OR Apache-2.0" }, @@ -2066,7 +2078,7 @@ "target": "core_foundation_sys" }, { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -2137,19 +2149,19 @@ "selects": { "aarch64-linux-android": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], "cfg(all(target_arch = \"aarch64\", target_os = \"linux\"))": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], "cfg(all(target_arch = \"aarch64\", target_vendor = \"apple\"))": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ] @@ -2359,6 +2371,43 @@ }, "license": "Apache-2.0 OR MIT" }, + "deranged 0.3.9": { + "name": "deranged", + "version": "0.3.9", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/deranged/0.3.9/download", + "sha256": "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" + } + }, + "targets": [ + { + "Library": { + "crate_name": "deranged", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "deranged", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "alloc", + "std" + ], + "selects": {} + }, + "edition": "2021", + "version": "0.3.9" + }, + "license": "MIT OR Apache-2.0" + }, "diff 0.1.13": { "name": "diff", "version": "0.1.13", @@ -2644,6 +2693,10 @@ "id": "rand 0.8.5", "target": "rand" }, + { + "id": "rcgen 0.11.3", + "target": "rcgen" + }, { "id": "relative-path 1.8.0", "target": "relative_path" @@ -2664,6 +2717,10 @@ "id": "rusoto_signature 0.48.0", "target": "rusoto_signature" }, + { + "id": "rustls-pemfile 1.0.3", + "target": "rustls_pemfile" + }, { "id": "scopeguard 1.2.0", "target": "scopeguard" @@ -2688,10 +2745,18 @@ "id": "stdext 0.3.1", "target": "stdext" }, + { + "id": "tls-listener 0.7.0", + "target": "tls_listener" + }, { "id": "tokio 1.29.1", "target": "tokio" }, + { + "id": "tokio-rustls 0.24.1", + "target": "tokio_rustls" + }, { "id": "tokio-stream 0.1.14", "target": "tokio_stream" @@ -2860,7 +2925,7 @@ ], "cfg(unix)": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -2913,7 +2978,7 @@ ], "cfg(unix)": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -3098,19 +3163,19 @@ ], "cfg(target_os = \"hermit\")": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], "cfg(target_os = \"wasi\")": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], "cfg(unix)": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -3168,7 +3233,7 @@ "target": "build_script_build" }, { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -3184,7 +3249,7 @@ "deps": { "common": [ { - "id": "cc 1.0.79", + "id": "cc 1.0.83", "target": "cc" } ], @@ -3302,7 +3367,7 @@ ], "cfg(unix)": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -4064,6 +4129,7 @@ "async-await", "async-await-macro", "channel", + "default", "futures-channel", "futures-io", "futures-macro", @@ -4259,7 +4325,7 @@ ], "cfg(unix)": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ] @@ -5224,7 +5290,7 @@ "deps": { "common": [ { - "id": "cc 1.0.79", + "id": "cc 1.0.83", "target": "cc" } ], @@ -5554,13 +5620,13 @@ }, "license": "MIT/Apache-2.0" }, - "libc 0.2.147": { + "libc 0.2.149": { "name": "libc", - "version": "0.2.147", + "version": "0.2.149", "repository": { "Http": { - "url": "https://crates.io/api/v1/crates/libc/0.2.147/download", - "sha256": "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" + "url": "https://crates.io/api/v1/crates/libc/0.2.149/download", + "sha256": "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" } }, "targets": [ @@ -5599,14 +5665,14 @@ "deps": { "common": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "build_script_build" } ], "selects": {} }, "edition": "2015", - "version": "0.2.147" + "version": "0.2.149" }, "build_script_attrs": { "data_glob": [ @@ -6136,7 +6202,7 @@ "selects": { "cfg(any(target_os = \"linux\", target_os = \"android\", target_os = \"macos\", target_os = \"ios\"))": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -6266,7 +6332,7 @@ "selects": { "cfg(target_os = \"wasi\")": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" }, { @@ -6276,7 +6342,7 @@ ], "cfg(unix)": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -6407,7 +6473,7 @@ "target": "lazy_static" }, { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" }, { @@ -6546,7 +6612,7 @@ "target": "cfg_if" }, { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" }, { @@ -6664,7 +6730,7 @@ "selects": { "cfg(not(windows))": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -6845,7 +6911,7 @@ "target": "foreign_types" }, { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" }, { @@ -7007,7 +7073,7 @@ "deps": { "common": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" }, { @@ -7027,7 +7093,7 @@ "deps": { "common": [ { - "id": "cc 1.0.79", + "id": "cc 1.0.83", "target": "cc" }, { @@ -7182,7 +7248,7 @@ ], "cfg(unix)": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -7204,6 +7270,52 @@ }, "license": "MIT OR Apache-2.0" }, + "pem 3.0.2": { + "name": "pem", + "version": "3.0.2", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/pem/3.0.2/download", + "sha256": "3163d2912b7c3b52d651a055f2c7eec9ba5cd22d26ef75b8dd3a59980b185923" + } + }, + "targets": [ + { + "Library": { + "crate_name": "pem", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "pem", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default", + "std" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "base64 0.21.2", + "target": "base64" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "3.0.2" + }, + "license": "MIT" + }, "percent-encoding 2.3.0": { "name": "percent-encoding", "version": "2.3.0", @@ -8366,7 +8478,7 @@ "selects": { "cfg(unix)": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ] @@ -8473,6 +8585,64 @@ }, "license": "MIT OR Apache-2.0" }, + "rcgen 0.11.3": { + "name": "rcgen", + "version": "0.11.3", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/rcgen/0.11.3/download", + "sha256": "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" + } + }, + "targets": [ + { + "Library": { + "crate_name": "rcgen", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "rcgen", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default", + "pem" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "pem 3.0.2", + "target": "pem" + }, + { + "id": "ring 0.16.20", + "target": "ring" + }, + { + "id": "time 0.3.26", + "target": "time" + }, + { + "id": "yasna 0.5.2", + "target": "yasna" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.11.3" + }, + "license": "MIT OR Apache-2.0" + }, "redox_syscall 0.2.16": { "name": "redox_syscall", "version": "0.2.16", @@ -8802,19 +8972,19 @@ }, "license": "MIT/Apache-2.0" }, - "rusoto_core 0.48.0": { - "name": "rusoto_core", - "version": "0.48.0", + "ring 0.16.20": { + "name": "ring", + "version": "0.16.20", "repository": { "Http": { - "url": "https://crates.io/api/v1/crates/rusoto_core/0.48.0/download", - "sha256": "1db30db44ea73551326269adcf7a2169428a054f14faf9e1768f2163494f2fa2" + "url": "https://crates.io/api/v1/crates/ring/0.16.20/download", + "sha256": "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" } }, "targets": [ { "Library": { - "crate_name": "rusoto_core", + "crate_name": "ring", "crate_root": "src/lib.rs", "srcs": [ "**/*.rs" @@ -8831,99 +9001,70 @@ } } ], - "library_target_name": "rusoto_core", + "library_target_name": "ring", "common_attrs": { "compile_data_glob": [ "**" ], "crate_features": { "common": [ + "alloc", "default", - "hyper-tls", - "native-tls" + "dev_urandom_fallback", + "once_cell" ], "selects": {} }, "deps": { "common": [ { - "id": "base64 0.13.1", - "target": "base64" - }, - { - "id": "bytes 1.4.0", - "target": "bytes" - }, - { - "id": "crc32fast 1.3.2", - "target": "crc32fast" - }, - { - "id": "futures 0.3.28", - "target": "futures" - }, - { - "id": "http 0.2.9", - "target": "http" - }, - { - "id": "hyper 0.14.27", - "target": "hyper" - }, - { - "id": "hyper-tls 0.5.0", - "target": "hyper_tls" - }, - { - "id": "lazy_static 1.4.0", - "target": "lazy_static" - }, - { - "id": "log 0.4.19", - "target": "log" - }, - { - "id": "rusoto_core 0.48.0", + "id": "ring 0.16.20", "target": "build_script_build" }, { - "id": "rusoto_credential 0.48.0", - "target": "rusoto_credential" - }, - { - "id": "rusoto_signature 0.48.0", - "target": "rusoto_signature" - }, - { - "id": "serde 1.0.171", - "target": "serde" - }, - { - "id": "serde_json 1.0.103", - "target": "serde_json" - }, - { - "id": "tokio 1.29.1", - "target": "tokio" - }, - { - "id": "xml-rs 0.8.16", - "target": "xml" + "id": "untrusted 0.7.1", + "target": "untrusted" } ], - "selects": {} + "selects": { + "cfg(all(target_arch = \"wasm32\", target_vendor = \"unknown\", target_os = \"unknown\", target_env = \"\"))": [ + { + "id": "web-sys 0.3.64", + "target": "web_sys" + } + ], + "cfg(any(target_arch = \"x86\", target_arch = \"x86_64\", all(any(target_arch = \"aarch64\", target_arch = \"arm\"), any(target_os = \"android\", target_os = \"fuchsia\", target_os = \"linux\"))))": [ + { + "id": "spin 0.5.2", + "target": "spin" + } + ], + "cfg(any(target_os = \"android\", target_os = \"linux\"))": [ + { + "id": "libc 0.2.149", + "target": "libc" + }, + { + "id": "once_cell 1.18.0", + "target": "once_cell" + } + ], + "cfg(any(target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"illumos\", target_os = \"netbsd\", target_os = \"openbsd\", target_os = \"solaris\"))": [ + { + "id": "once_cell 1.18.0", + "target": "once_cell" + } + ], + "cfg(target_os = \"windows\")": [ + { + "id": "winapi 0.3.9", + "target": "winapi" + } + ] + } }, "edition": "2018", - "proc_macro_deps": { - "common": [ - { - "id": "async-trait 0.1.71", - "target": "async_trait" - } - ], - "selects": {} - }, - "version": "0.48.0" + "version": "0.16.20" }, "build_script_attrs": { "data_glob": [ @@ -8932,38 +9073,276 @@ "deps": { "common": [ { - "id": "rustc_version 0.4.0", - "target": "rustc_version" + "id": "cc 1.0.83", + "target": "cc" } ], "selects": {} - } + }, + "links": "ring-asm" }, - "license": "MIT" + "license": null }, - "rusoto_credential 0.48.0": { - "name": "rusoto_credential", - "version": "0.48.0", + "ring 0.17.5": { + "name": "ring", + "version": "0.17.5", "repository": { "Http": { - "url": "https://crates.io/api/v1/crates/rusoto_credential/0.48.0/download", - "sha256": "ee0a6c13db5aad6047b6a44ef023dbbc21a056b6dab5be3b79ce4283d5c02d05" + "url": "https://crates.io/api/v1/crates/ring/0.17.5/download", + "sha256": "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" } }, "targets": [ { "Library": { - "crate_name": "rusoto_credential", + "crate_name": "ring", "crate_root": "src/lib.rs", "srcs": [ "**/*.rs" ] } - } - ], - "library_target_name": "rusoto_credential", - "common_attrs": { - "compile_data_glob": [ + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "ring", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "alloc", + "default", + "dev_urandom_fallback" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "getrandom 0.2.10", + "target": "getrandom" + }, + { + "id": "ring 0.17.5", + "target": "build_script_build" + }, + { + "id": "untrusted 0.9.0", + "target": "untrusted" + } + ], + "selects": { + "cfg(all(target_arch = \"aarch64\", target_os = \"windows\"))": [ + { + "id": "windows-sys 0.48.0", + "target": "windows_sys" + } + ], + "cfg(any(target_arch = \"x86\", target_arch = \"x86_64\", all(any(target_arch = \"aarch64\", target_arch = \"arm\"), any(target_os = \"android\", target_os = \"fuchsia\", target_os = \"linux\", target_os = \"windows\"))))": [ + { + "id": "spin 0.9.8", + "target": "spin" + } + ], + "cfg(any(target_os = \"android\", target_os = \"linux\"))": [ + { + "id": "libc 0.2.149", + "target": "libc" + } + ] + } + }, + "edition": "2021", + "version": "0.17.5" + }, + "build_script_attrs": { + "data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "cc 1.0.83", + "target": "cc" + } + ], + "selects": {} + }, + "links": "ring_core_0_17_5" + }, + "license": null + }, + "rusoto_core 0.48.0": { + "name": "rusoto_core", + "version": "0.48.0", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/rusoto_core/0.48.0/download", + "sha256": "1db30db44ea73551326269adcf7a2169428a054f14faf9e1768f2163494f2fa2" + } + }, + "targets": [ + { + "Library": { + "crate_name": "rusoto_core", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "rusoto_core", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default", + "hyper-tls", + "native-tls" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "base64 0.13.1", + "target": "base64" + }, + { + "id": "bytes 1.4.0", + "target": "bytes" + }, + { + "id": "crc32fast 1.3.2", + "target": "crc32fast" + }, + { + "id": "futures 0.3.28", + "target": "futures" + }, + { + "id": "http 0.2.9", + "target": "http" + }, + { + "id": "hyper 0.14.27", + "target": "hyper" + }, + { + "id": "hyper-tls 0.5.0", + "target": "hyper_tls" + }, + { + "id": "lazy_static 1.4.0", + "target": "lazy_static" + }, + { + "id": "log 0.4.19", + "target": "log" + }, + { + "id": "rusoto_core 0.48.0", + "target": "build_script_build" + }, + { + "id": "rusoto_credential 0.48.0", + "target": "rusoto_credential" + }, + { + "id": "rusoto_signature 0.48.0", + "target": "rusoto_signature" + }, + { + "id": "serde 1.0.171", + "target": "serde" + }, + { + "id": "serde_json 1.0.103", + "target": "serde_json" + }, + { + "id": "tokio 1.29.1", + "target": "tokio" + }, + { + "id": "xml-rs 0.8.16", + "target": "xml" + } + ], + "selects": {} + }, + "edition": "2018", + "proc_macro_deps": { + "common": [ + { + "id": "async-trait 0.1.71", + "target": "async_trait" + } + ], + "selects": {} + }, + "version": "0.48.0" + }, + "build_script_attrs": { + "data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "rustc_version 0.4.0", + "target": "rustc_version" + } + ], + "selects": {} + } + }, + "license": "MIT" + }, + "rusoto_credential 0.48.0": { + "name": "rusoto_credential", + "version": "0.48.0", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/rusoto_credential/0.48.0/download", + "sha256": "ee0a6c13db5aad6047b6a44ef023dbbc21a056b6dab5be3b79ce4283d5c02d05" + } + }, + "targets": [ + { + "Library": { + "crate_name": "rusoto_credential", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "rusoto_credential", + "common_attrs": { + "compile_data_glob": [ "**" ], "deps": { @@ -9410,7 +9789,7 @@ "alias": "libc_errno" }, { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -9428,14 +9807,190 @@ } }, "edition": "2021", - "version": "0.38.8" - }, - "build_script_attrs": { - "data_glob": [ - "**" - ] + "version": "0.38.8" + }, + "build_script_attrs": { + "data_glob": [ + "**" + ] + }, + "license": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + }, + "rustls 0.21.8": { + "name": "rustls", + "version": "0.21.8", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/rustls/0.21.8/download", + "sha256": "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" + } + }, + "targets": [ + { + "Library": { + "crate_name": "rustls", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + }, + { + "BuildScript": { + "crate_name": "build_script_build", + "crate_root": "build.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "rustls", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "log", + "logging", + "tls12" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "log 0.4.19", + "target": "log" + }, + { + "id": "ring 0.17.5", + "target": "ring" + }, + { + "id": "rustls 0.21.8", + "target": "build_script_build" + }, + { + "id": "rustls-webpki 0.101.7", + "target": "webpki" + }, + { + "id": "sct 0.7.1", + "target": "sct" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.21.8" + }, + "build_script_attrs": { + "data_glob": [ + "**" + ], + "link_deps": { + "common": [ + { + "id": "ring 0.17.5", + "target": "ring" + } + ], + "selects": {} + } + }, + "license": "Apache-2.0 OR ISC OR MIT" + }, + "rustls-pemfile 1.0.3": { + "name": "rustls-pemfile", + "version": "1.0.3", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/rustls-pemfile/1.0.3/download", + "sha256": "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" + } + }, + "targets": [ + { + "Library": { + "crate_name": "rustls_pemfile", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "rustls_pemfile", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "base64 0.21.2", + "target": "base64" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "1.0.3" + }, + "license": "Apache-2.0 OR ISC OR MIT" + }, + "rustls-webpki 0.101.7": { + "name": "rustls-webpki", + "version": "0.101.7", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/rustls-webpki/0.101.7/download", + "sha256": "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" + } + }, + "targets": [ + { + "Library": { + "crate_name": "webpki", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "webpki", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "alloc", + "default", + "std" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "ring 0.17.5", + "target": "ring" + }, + { + "id": "untrusted 0.9.0", + "target": "untrusted" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.101.7" }, - "license": "Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT" + "license": "ISC" }, "rustversion 1.0.14": { "name": "rustversion", @@ -9596,6 +10151,49 @@ }, "license": "MIT OR Apache-2.0" }, + "sct 0.7.1": { + "name": "sct", + "version": "0.7.1", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/sct/0.7.1/download", + "sha256": "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" + } + }, + "targets": [ + { + "Library": { + "crate_name": "sct", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "sct", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "ring 0.17.5", + "target": "ring" + }, + { + "id": "untrusted 0.9.0", + "target": "untrusted" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.7.1" + }, + "license": "Apache-2.0 OR ISC OR MIT" + }, "security-framework 2.9.2": { "name": "security-framework", "version": "2.9.2", @@ -9636,7 +10234,7 @@ "target": "core_foundation_sys" }, { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" }, { @@ -9683,7 +10281,7 @@ "target": "core_foundation_sys" }, { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -10280,7 +10878,7 @@ "deps": { "common": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -10426,7 +11024,7 @@ "selects": { "cfg(unix)": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -10443,6 +11041,72 @@ }, "license": "MIT OR Apache-2.0" }, + "spin 0.5.2": { + "name": "spin", + "version": "0.5.2", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/spin/0.5.2/download", + "sha256": "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + } + }, + "targets": [ + { + "Library": { + "crate_name": "spin", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "spin", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "edition": "2015", + "version": "0.5.2" + }, + "license": "MIT" + }, + "spin 0.9.8": { + "name": "spin", + "version": "0.9.8", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/spin/0.9.8/download", + "sha256": "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + } + }, + "targets": [ + { + "Library": { + "crate_name": "spin", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "spin", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "once" + ], + "selects": {} + }, + "edition": "2015", + "version": "0.9.8" + }, + "license": "MIT" + }, "static_assertions 1.1.0": { "name": "static_assertions", "version": "1.1.0", @@ -10905,14 +11569,163 @@ "version": "1.0.43", "repository": { "Http": { - "url": "https://crates.io/api/v1/crates/thiserror-impl/1.0.43/download", - "sha256": "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" + "url": "https://crates.io/api/v1/crates/thiserror-impl/1.0.43/download", + "sha256": "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" + } + }, + "targets": [ + { + "ProcMacro": { + "crate_name": "thiserror_impl", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "thiserror_impl", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "proc-macro2 1.0.66", + "target": "proc_macro2" + }, + { + "id": "quote 1.0.31", + "target": "quote" + }, + { + "id": "syn 2.0.26", + "target": "syn" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "1.0.43" + }, + "license": "MIT OR Apache-2.0" + }, + "time 0.1.45": { + "name": "time", + "version": "0.1.45", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/time/0.1.45/download", + "sha256": "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" + } + }, + "targets": [ + { + "Library": { + "crate_name": "time", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "time", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "libc 0.2.149", + "target": "libc" + } + ], + "selects": { + "cfg(target_os = \"wasi\")": [ + { + "id": "wasi 0.10.0+wasi-snapshot-preview1", + "target": "wasi" + } + ], + "cfg(windows)": [ + { + "id": "winapi 0.3.9", + "target": "winapi" + } + ] + } + }, + "edition": "2015", + "version": "0.1.45" + }, + "license": "MIT/Apache-2.0" + }, + "time 0.3.26": { + "name": "time", + "version": "0.3.26", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/time/0.3.26/download", + "sha256": "a79d09ac6b08c1ab3906a2f7cc2e81a0e27c7ae89c63812df75e52bef0751e07" + } + }, + "targets": [ + { + "Library": { + "crate_name": "time", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "time", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "alloc", + "std" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "deranged 0.3.9", + "target": "deranged" + }, + { + "id": "time-core 0.1.1", + "target": "time_core" + } + ], + "selects": {} + }, + "edition": "2021", + "version": "0.3.26" + }, + "license": "MIT OR Apache-2.0" + }, + "time-core 0.1.1": { + "name": "time-core", + "version": "0.1.1", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/time-core/0.1.1/download", + "sha256": "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" } }, "targets": [ { - "ProcMacro": { - "crate_name": "thiserror_impl", + "Library": { + "crate_name": "time_core", "crate_root": "src/lib.rs", "srcs": [ "**/*.rs" @@ -10920,46 +11733,29 @@ } } ], - "library_target_name": "thiserror_impl", + "library_target_name": "time_core", "common_attrs": { "compile_data_glob": [ "**" ], - "deps": { - "common": [ - { - "id": "proc-macro2 1.0.66", - "target": "proc_macro2" - }, - { - "id": "quote 1.0.31", - "target": "quote" - }, - { - "id": "syn 2.0.26", - "target": "syn" - } - ], - "selects": {} - }, "edition": "2021", - "version": "1.0.43" + "version": "0.1.1" }, "license": "MIT OR Apache-2.0" }, - "time 0.1.45": { - "name": "time", - "version": "0.1.45", + "tls-listener 0.7.0": { + "name": "tls-listener", + "version": "0.7.0", "repository": { "Http": { - "url": "https://crates.io/api/v1/crates/time/0.1.45/download", - "sha256": "1b797afad3f312d1c66a56d11d0316f916356d11bd158fbc6ca6389ff6bf805a" + "url": "https://crates.io/api/v1/crates/tls-listener/0.7.0/download", + "sha256": "81294c017957a1a69794f506723519255879e15a870507faf45dfed288b763dd" } }, "targets": [ { "Library": { - "crate_name": "time", + "crate_name": "tls_listener", "crate_root": "src/lib.rs", "srcs": [ "**/*.rs" @@ -10967,37 +11763,55 @@ } } ], - "library_target_name": "time", + "library_target_name": "tls_listener", "common_attrs": { "compile_data_glob": [ "**" ], + "crate_features": { + "common": [ + "default", + "hyper", + "hyper-h2", + "rustls", + "tokio-net", + "tokio-rustls" + ], + "selects": {} + }, "deps": { "common": [ { - "id": "libc 0.2.147", - "target": "libc" + "id": "futures-util 0.3.28", + "target": "futures_util" + }, + { + "id": "hyper 0.14.27", + "target": "hyper" + }, + { + "id": "pin-project-lite 0.2.10", + "target": "pin_project_lite" + }, + { + "id": "thiserror 1.0.43", + "target": "thiserror" + }, + { + "id": "tokio 1.29.1", + "target": "tokio" + }, + { + "id": "tokio-rustls 0.24.1", + "target": "tokio_rustls" } ], - "selects": { - "cfg(target_os = \"wasi\")": [ - { - "id": "wasi 0.10.0+wasi-snapshot-preview1", - "target": "wasi" - } - ], - "cfg(windows)": [ - { - "id": "winapi 0.3.9", - "target": "winapi" - } - ] - } + "selects": {} }, - "edition": "2015", - "version": "0.1.45" + "edition": "2018", + "version": "0.7.0" }, - "license": "MIT/Apache-2.0" + "license": "Apache-2.0" }, "tokio 1.29.1": { "name": "tokio", @@ -11100,7 +11914,7 @@ ], "cfg(unix)": [ { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" }, { @@ -11277,6 +12091,57 @@ }, "license": "MIT" }, + "tokio-rustls 0.24.1": { + "name": "tokio-rustls", + "version": "0.24.1", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/tokio-rustls/0.24.1/download", + "sha256": "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" + } + }, + "targets": [ + { + "Library": { + "crate_name": "tokio_rustls", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "tokio_rustls", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default", + "logging", + "tls12" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "rustls 0.21.8", + "target": "rustls" + }, + { + "id": "tokio 1.29.1", + "target": "tokio" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "0.24.1" + }, + "license": "MIT/Apache-2.0" + }, "tokio-stream 0.1.14": { "name": "tokio-stream", "version": "0.1.14", @@ -12131,6 +12996,66 @@ }, "license": "(MIT OR Apache-2.0) AND Unicode-DFS-2016" }, + "untrusted 0.7.1": { + "name": "untrusted", + "version": "0.7.1", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/untrusted/0.7.1/download", + "sha256": "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" + } + }, + "targets": [ + { + "Library": { + "crate_name": "untrusted", + "crate_root": "src/untrusted.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "untrusted", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "edition": "2018", + "version": "0.7.1" + }, + "license": "ISC" + }, + "untrusted 0.9.0": { + "name": "untrusted", + "version": "0.9.0", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/untrusted/0.9.0/download", + "sha256": "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + } + }, + "targets": [ + { + "Library": { + "crate_name": "untrusted", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "untrusted", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "edition": "2018", + "version": "0.9.0" + }, + "license": "ISC" + }, "utf8parse 0.2.1": { "name": "utf8parse", "version": "0.2.1", @@ -12656,6 +13581,49 @@ }, "license": "MIT/Apache-2.0" }, + "web-sys 0.3.64": { + "name": "web-sys", + "version": "0.3.64", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/web-sys/0.3.64/download", + "sha256": "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" + } + }, + "targets": [ + { + "Library": { + "crate_name": "web_sys", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "web_sys", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "deps": { + "common": [ + { + "id": "js-sys 0.3.64", + "target": "js_sys" + }, + { + "id": "wasm-bindgen 0.2.87", + "target": "wasm_bindgen" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "0.3.64" + }, + "license": "MIT/Apache-2.0" + }, "which 4.4.0": { "name": "which", "version": "4.4.0", @@ -12688,7 +13656,7 @@ "target": "either" }, { - "id": "libc 0.2.147", + "id": "libc 0.2.149", "target": "libc" } ], @@ -12750,6 +13718,7 @@ "minwinbase", "minwindef", "ntdef", + "ntsecapi", "objbase", "processenv", "processthreadsapi", @@ -12764,7 +13733,8 @@ "winerror", "winnt", "ws2ipdef", - "ws2tcpip" + "ws2tcpip", + "wtypesbase" ], "selects": {} }, @@ -13566,6 +14536,53 @@ }, "license": "MIT/Apache-2.0" }, + "yasna 0.5.2": { + "name": "yasna", + "version": "0.5.2", + "repository": { + "Http": { + "url": "https://crates.io/api/v1/crates/yasna/0.5.2/download", + "sha256": "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" + } + }, + "targets": [ + { + "Library": { + "crate_name": "yasna", + "crate_root": "src/lib.rs", + "srcs": [ + "**/*.rs" + ] + } + } + ], + "library_target_name": "yasna", + "common_attrs": { + "compile_data_glob": [ + "**" + ], + "crate_features": { + "common": [ + "default", + "std", + "time" + ], + "selects": {} + }, + "deps": { + "common": [ + { + "id": "time 0.3.26", + "target": "time" + } + ], + "selects": {} + }, + "edition": "2018", + "version": "0.5.2" + }, + "license": "MIT OR Apache-2.0" + }, "zeroize 1.6.0": { "name": "zeroize", "version": "1.6.0", @@ -13632,8 +14649,10 @@ "cfg(all(target_arch = \"aarch64\", target_os = \"linux\"))": [ "aarch64-unknown-linux-gnu" ], + "cfg(all(target_arch = \"aarch64\", target_os = \"windows\"))": [], "cfg(all(target_arch = \"aarch64\", target_vendor = \"apple\"))": [], "cfg(all(target_arch = \"wasm32\", not(any(target_os = \"emscripten\", target_os = \"wasi\"))))": [], + "cfg(all(target_arch = \"wasm32\", target_vendor = \"unknown\", target_os = \"unknown\", target_env = \"\"))": [], "cfg(all(target_arch = \"x86\", target_env = \"gnu\", not(windows_raw_dylib)))": [], "cfg(all(target_arch = \"x86\", target_env = \"msvc\", not(windows_raw_dylib)))": [], "cfg(all(target_arch = \"x86_64\", target_env = \"gnu\", not(target_abi = \"llvm\"), not(windows_raw_dylib)))": [ @@ -13647,6 +14666,27 @@ "x86_64-pc-windows-msvc", "x86_64-unknown-linux-gnu" ], + "cfg(any(target_arch = \"x86\", target_arch = \"x86_64\", all(any(target_arch = \"aarch64\", target_arch = \"arm\"), any(target_os = \"android\", target_os = \"fuchsia\", target_os = \"linux\"))))": [ + "aarch64-unknown-linux-gnu", + "arm-unknown-linux-gnueabi", + "armv7-unknown-linux-gnueabi", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu" + ], + "cfg(any(target_arch = \"x86\", target_arch = \"x86_64\", all(any(target_arch = \"aarch64\", target_arch = \"arm\"), any(target_os = \"android\", target_os = \"fuchsia\", target_os = \"linux\", target_os = \"windows\"))))": [ + "aarch64-unknown-linux-gnu", + "arm-unknown-linux-gnueabi", + "armv7-unknown-linux-gnueabi", + "x86_64-pc-windows-msvc", + "x86_64-unknown-linux-gnu" + ], + "cfg(any(target_os = \"android\", target_os = \"linux\"))": [ + "aarch64-unknown-linux-gnu", + "arm-unknown-linux-gnueabi", + "armv7-unknown-linux-gnueabi", + "x86_64-unknown-linux-gnu" + ], + "cfg(any(target_os = \"dragonfly\", target_os = \"freebsd\", target_os = \"illumos\", target_os = \"netbsd\", target_os = \"openbsd\", target_os = \"solaris\"))": [], "cfg(any(target_os = \"linux\", target_os = \"android\", target_os = \"macos\", target_os = \"ios\"))": [ "aarch64-unknown-linux-gnu", "arm-unknown-linux-gnueabi", diff --git a/Cargo.lock b/Cargo.lock index 256abfdf1..38c824456 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,100 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "ac_server" -version = "0.0.0" -dependencies = [ - "ac_utils", - "bytes", - "common", - "config", - "error", - "grpc_store", - "prost", - "proto", - "store", - "tonic", -] - -[[package]] -name = "ac_server_test" -version = "0.0.0" -dependencies = [ - "ac_server", - "bytes", - "common", - "config", - "default_store_factory", - "error", - "maplit", - "pretty_assertions", - "prometheus-client", - "prost", - "proto", - "store", - "tokio", - "tonic", -] - -[[package]] -name = "ac_utils" -version = "0.0.0" -dependencies = [ - "buf_channel", - "bytes", - "common", - "error", - "futures", - "prost", - "sha2 0.10.7", - "store", - "tokio", -] - -[[package]] -name = "ac_utils_test" -version = "0.0.0" -dependencies = [ - "ac_utils", - "common", - "config", - "error", - "memory_store", - "pretty_assertions", - "rand", - "store", - "tokio", -] - -[[package]] -name = "action_messages" -version = "0.0.0" -dependencies = [ - "common", - "error", - "metrics_utils", - "platform_property_manager", - "prost", - "prost-types", - "proto", - "sha2 0.10.7", - "tonic", -] - -[[package]] -name = "action_messages_test" -version = "0.0.0" -dependencies = [ - "action_messages", - "common", - "error", - "platform_property_manager", - "pretty_assertions", - "proto", - "tokio", -] - [[package]] name = "addr2line" version = "0.20.0" @@ -239,28 +145,6 @@ dependencies = [ "syn 2.0.26", ] -[[package]] -name = "async_fixed_buffer" -version = "0.0.0" -dependencies = [ - "fixed-buffer", - "futures", - "parking_lot", - "pin-project-lite", - "tokio", -] - -[[package]] -name = "async_fixed_buffer_test" -version = "0.0.0" -dependencies = [ - "async_fixed_buffer", - "error", - "futures", - "pretty_assertions", - "tokio", -] - [[package]] name = "autocfg" version = "1.1.0" @@ -396,29 +280,6 @@ dependencies = [ "generic-array", ] -[[package]] -name = "buf_channel" -version = "0.0.0" -dependencies = [ - "bytes", - "error", - "futures", - "tokio", - "tokio-util", -] - -[[package]] -name = "buf_channel_test" -version = "0.0.0" -dependencies = [ - "buf_channel", - "bytes", - "error", - "futures", - "pretty_assertions", - "tokio", -] - [[package]] name = "bumpalo" version = "3.13.0" @@ -437,177 +298,14 @@ version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" -[[package]] -name = "bytestream_server" -version = "0.0.0" -dependencies = [ - "buf_channel", - "common", - "config", - "error", - "futures", - "grpc_store", - "parking_lot", - "proto", - "resource_info", - "store", - "tokio", - "tonic", - "write_request_stream_wrapper", -] - -[[package]] -name = "bytestream_server_test" -version = "0.0.0" -dependencies = [ - "bytestream_server", - "common", - "config", - "default_store_factory", - "error", - "futures", - "hyper", - "maplit", - "pretty_assertions", - "prometheus-client", - "proto", - "store", - "tokio", - "tokio-stream", - "tonic", -] - -[[package]] -name = "cache_lookup_scheduler" -version = "0.0.0" -dependencies = [ - "ac_utils", - "action_messages", - "async-trait", - "common", - "config", - "error", - "futures", - "grpc_store", - "parking_lot", - "platform_property_manager", - "proto", - "scheduler", - "scopeguard", - "store", - "tokio", - "tokio-stream", - "tonic", - "worker", -] - -[[package]] -name = "cache_lookup_scheduler_test" -version = "0.0.0" -dependencies = [ - "action_messages", - "cache_lookup_scheduler", - "common", - "config", - "error", - "memory_store", - "mock_scheduler", - "platform_property_manager", - "pretty_assertions", - "prost", - "proto", - "scheduler", - "scheduler_utils", - "store", - "tokio", - "tokio-stream", -] - -[[package]] -name = "capabilities_server" -version = "0.0.0" -dependencies = [ - "config", - "error", - "proto", - "scheduler", - "store", - "tonic", -] - -[[package]] -name = "cas" -version = "0.0.0" -dependencies = [ - "ac_server", - "async-lock", - "axum", - "bytestream_server", - "capabilities_server", - "cas_server", - "clap", - "common", - "config", - "default_scheduler_factory", - "default_store_factory", - "env_logger", - "error", - "execution_server", - "futures", - "hyper", - "json5", - "local_worker", - "metrics_utils", - "parking_lot", - "prometheus-client", - "scopeguard", - "store", - "tokio", - "tonic", - "tower", - "worker_api_server", -] - -[[package]] -name = "cas_server" -version = "0.0.0" -dependencies = [ - "bytes", - "common", - "config", - "error", - "futures", - "grpc_store", - "proto", - "stdext", - "store", - "tokio", - "tonic", -] - -[[package]] -name = "cas_server_test" -version = "0.0.0" -dependencies = [ - "cas_server", - "common", - "config", - "default_store_factory", - "error", - "maplit", - "pretty_assertions", - "prometheus-client", - "proto", - "store", - "tokio", - "tonic", -] - [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -626,7 +324,7 @@ dependencies = [ "js-sys", "num-traits", "serde", - "time", + "time 0.1.45", "wasm-bindgen", "winapi", ] @@ -678,66 +376,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" -[[package]] -name = "common" -version = "0.0.0" -dependencies = [ - "bytes", - "error", - "fs", - "hex", - "log", - "prost", - "proto", - "serde", - "tokio", -] - -[[package]] -name = "compression_store" -version = "0.0.0" -dependencies = [ - "async-trait", - "bincode", - "buf_channel", - "byteorder", - "bytes", - "common", - "config", - "error", - "futures", - "lz4_flex", - "serde", - "tokio", - "traits", -] - -[[package]] -name = "compression_store_test" -version = "0.0.0" -dependencies = [ - "bincode", - "buf_channel", - "common", - "compression_store", - "config", - "error", - "futures", - "memory_store", - "pretty_assertions", - "rand", - "tokio", - "traits", -] - -[[package]] -name = "config" -version = "0.0.0" -dependencies = [ - "serde", - "serde_utils", -] - [[package]] name = "constant_time_eq" version = "0.3.0" @@ -809,78 +447,10 @@ dependencies = [ ] [[package]] -name = "dedup_store" -version = "0.0.0" -dependencies = [ - "async-trait", - "bincode", - "blake3", - "buf_channel", - "common", - "config", - "error", - "fastcdc", - "futures", - "serde", - "tokio", - "tokio-util", - "traits", -] - -[[package]] -name = "dedup_store_test" -version = "0.0.0" -dependencies = [ - "common", - "config", - "dedup_store", - "error", - "memory_store", - "pretty_assertions", - "rand", - "tokio", - "traits", -] - -[[package]] -name = "default_scheduler_factory" -version = "0.0.0" -dependencies = [ - "cache_lookup_scheduler", - "config", - "error", - "futures", - "grpc_scheduler", - "metrics_utils", - "property_modifier_scheduler", - "scheduler", - "simple_scheduler", - "store", - "tokio", -] - -[[package]] -name = "default_store_factory" -version = "0.0.0" -dependencies = [ - "compression_store", - "config", - "dedup_store", - "error", - "fast_slow_store", - "filesystem_store", - "futures", - "grpc_store", - "memory_store", - "metrics_utils", - "ref_store", - "s3_store", - "shard_store", - "size_partitioning_store", - "store", - "traits", - "verify_store", -] +name = "deranged" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f32d04922c60427da6f9fef14d042d9edddef64cb9d4ce0d64d0685fbeb1fd3" [[package]] name = "diff" @@ -908,6 +478,68 @@ dependencies = [ "subtle", ] +[[package]] +name = "direct-cargo-bazel-deps" +version = "0.0.1" +dependencies = [ + "async-lock", + "async-trait", + "axum", + "bincode", + "blake3", + "byteorder", + "bytes", + "clap", + "ctor", + "env_logger", + "filetime", + "fixed-buffer", + "futures", + "hashbrown 0.14.0", + "hex", + "http", + "hyper", + "json5", + "lazy_static", + "log", + "lru", + "lz4_flex", + "maplit", + "memory-stats", + "mock_instant", + "nix", + "parking_lot", + "pin-project-lite", + "pretty_assertions", + "prometheus-client", + "prost", + "prost-build", + "prost-types", + "rand", + "rcgen", + "relative-path", + "rusoto_core", + "rusoto_mock", + "rusoto_s3", + "rusoto_signature", + "rustls-pemfile", + "scopeguard", + "serde", + "sha2 0.10.7", + "shellexpand", + "shlex", + "stdext", + "tls-listener", + "tokio", + "tokio-rustls", + "tokio-stream", + "tokio-util", + "tonic", + "tonic-build", + "tower", + "uuid", +] + [[package]] name = "dirs" version = "5.0.1" @@ -970,152 +602,37 @@ checksum = "85cdab6a89accf66733ad5a1693a4dcced6aeff64602b634530dd73c1f3ee9f0" dependencies = [ "humantime", "is-terminal", - "log", - "regex", - "termcolor", -] - -[[package]] -name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - -[[package]] -name = "error" -version = "0.0.0" -dependencies = [ - "hex", - "prost", - "prost-types", - "proto", - "tokio", - "tonic", -] - -[[package]] -name = "event-listener" -version = "2.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" - -[[package]] -name = "evicting_map" -version = "0.0.0" -dependencies = [ - "async-lock", - "async-trait", - "common", - "config", - "futures", - "lru", - "metrics_utils", - "serde", -] - -[[package]] -name = "evicting_map_test" -version = "0.0.0" -dependencies = [ - "async-trait", - "bytes", - "common", - "config", - "error", - "evicting_map", - "hex", - "mock_instant", - "tokio", -] - -[[package]] -name = "execution_server" -version = "0.0.0" -dependencies = [ - "ac_utils", - "action_messages", - "common", - "config", - "error", - "futures", - "platform_property_manager", - "proto", - "rand", - "scheduler", - "stdext", - "store", - "tokio", - "tokio-stream", - "tonic", -] - -[[package]] -name = "fast_slow_store" -version = "0.0.0" -dependencies = [ - "async-trait", - "buf_channel", - "bytes", - "common", - "config", - "error", - "futures", - "metrics_utils", - "traits", + "log", + "regex", + "termcolor", ] [[package]] -name = "fast_slow_store_test" -version = "0.0.0" +name = "errno" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" dependencies = [ - "common", - "config", - "error", - "fast_slow_store", - "memory_store", - "pretty_assertions", - "rand", - "tokio", - "traits", + "errno-dragonfly", + "libc", + "windows-sys", ] [[package]] -name = "fastcdc" -version = "0.0.0" +name = "errno-dragonfly" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" dependencies = [ - "bytes", - "tokio-util", + "cc", + "libc", ] [[package]] -name = "fastcdc_test" -version = "0.0.0" -dependencies = [ - "bytes", - "fastcdc", - "futures", - "hex", - "pretty_assertions", - "rand", - "sha2 0.10.7", - "tokio", - "tokio-util", -] +name = "event-listener" +version = "2.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "fastrand" @@ -1123,51 +640,6 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6999dc1837253364c2ebb0704ba97994bd874e8f195d665c50b7548f6ea92764" -[[package]] -name = "filesystem_store" -version = "0.0.0" -dependencies = [ - "async-lock", - "async-trait", - "buf_channel", - "bytes", - "common", - "config", - "error", - "evicting_map", - "filetime", - "futures", - "metrics_utils", - "nix", - "prometheus-client", - "rand", - "tokio", - "tokio-stream", - "traits", -] - -[[package]] -name = "filesystem_store_test" -version = "0.0.0" -dependencies = [ - "async-lock", - "async-trait", - "buf_channel", - "common", - "config", - "error", - "evicting_map", - "filesystem_store", - "filetime", - "futures", - "lazy_static", - "pretty_assertions", - "rand", - "tokio", - "tokio-stream", - "traits", -] - [[package]] name = "filetime" version = "0.2.22" @@ -1232,26 +704,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fs" -version = "0.0.0" -dependencies = [ - "error", - "log", - "tokio", -] - -[[package]] -name = "fs_test" -version = "0.0.0" -dependencies = [ - "common", - "error", - "pretty_assertions", - "rand", - "tokio", -] - [[package]] name = "futures" version = "0.3.28" @@ -1341,15 +793,6 @@ dependencies = [ "slab", ] -[[package]] -name = "gen_protos_tool" -version = "0.0.0" -dependencies = [ - "clap", - "prost-build", - "tonic-build", -] - [[package]] name = "generic-array" version = "0.14.7" @@ -1377,48 +820,6 @@ version = "0.27.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" -[[package]] -name = "grpc_scheduler" -version = "0.0.0" -dependencies = [ - "action_messages", - "async-trait", - "common", - "config", - "error", - "parking_lot", - "platform_property_manager", - "proto", - "scheduler", - "tokio", - "tonic", -] - -[[package]] -name = "grpc_store" -version = "0.0.0" -dependencies = [ - "ac_utils", - "async-trait", - "buf_channel", - "bytes", - "common", - "config", - "error", - "futures", - "parking_lot", - "prost", - "proto", - "rand", - "retry", - "shellexpand", - "tokio", - "tonic", - "traits", - "uuid", - "write_request_stream_wrapper", -] - [[package]] name = "h2" version = "0.3.20" @@ -1667,9 +1068,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.147" +version = "0.2.149" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" +checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b" [[package]] name = "linux-raw-sys" @@ -1677,69 +1078,6 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57bcfdad1b858c2db7c38303a6d2ad4dfaf5eb53dfeb0910128b2c26d6158503" -[[package]] -name = "local_worker" -version = "0.0.0" -dependencies = [ - "action_messages", - "async-lock", - "common", - "config", - "error", - "fast_slow_store", - "futures", - "metrics_utils", - "proto", - "running_actions_manager", - "store", - "tokio", - "tokio-stream", - "tonic", - "worker_api_client_wrapper", - "worker_utils", -] - -[[package]] -name = "local_worker_test" -version = "0.0.0" -dependencies = [ - "action_messages", - "common", - "config", - "ctor", - "env_logger", - "error", - "fast_slow_store", - "filesystem_store", - "local_worker", - "local_worker_test_utils", - "memory_store", - "mock_running_actions_manager", - "platform_property_manager", - "pretty_assertions", - "prost", - "proto", - "rand", - "tokio", - "tonic", -] - -[[package]] -name = "local_worker_test_utils" -version = "0.0.0" -dependencies = [ - "common", - "config", - "error", - "hyper", - "local_worker", - "mock_running_actions_manager", - "mock_worker_api_client", - "proto", - "tokio", - "tonic", -] - [[package]] name = "lock_api" version = "0.4.10" @@ -1822,44 +1160,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "memory_store" -version = "0.0.0" -dependencies = [ - "async-trait", - "buf_channel", - "bytes", - "common", - "config", - "error", - "evicting_map", - "metrics_utils", - "traits", -] - -[[package]] -name = "memory_store_test" -version = "0.0.0" -dependencies = [ - "bytes", - "common", - "config", - "error", - "memory-stats", - "memory_store", - "pretty_assertions", - "tokio", - "traits", -] - -[[package]] -name = "metrics_utils" -version = "0.0.0" -dependencies = [ - "futures", - "prometheus-client", -] - [[package]] name = "mime" version = "0.3.17" @@ -1892,44 +1192,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6c1a54de846c4006b88b1516731cc1f6026eb5dc4bcb186aa071ef66d40524ec" -[[package]] -name = "mock_running_actions_manager" -version = "0.0.0" -dependencies = [ - "action_messages", - "async-lock", - "async-trait", - "common", - "error", - "proto", - "running_actions_manager", - "tokio", -] - -[[package]] -name = "mock_scheduler" -version = "0.0.0" -dependencies = [ - "action_messages", - "async-trait", - "error", - "platform_property_manager", - "scheduler", - "tokio", -] - -[[package]] -name = "mock_worker_api_client" -version = "0.0.0" -dependencies = [ - "async-lock", - "async-trait", - "proto", - "tokio", - "tonic", - "worker_api_client_wrapper", -] - [[package]] name = "multimap" version = "0.8.3" @@ -2081,6 +1343,16 @@ dependencies = [ "windows-targets", ] +[[package]] +name = "pem" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3163d2912b7c3b52d651a055f2c7eec9ba5cd22d26ef75b8dd3a59980b185923" +dependencies = [ + "base64 0.21.2", + "serde", +] + [[package]] name = "percent-encoding" version = "2.3.0" @@ -2179,15 +1451,6 @@ version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" -[[package]] -name = "platform_property_manager" -version = "0.0.0" -dependencies = [ - "config", - "error", - "proto", -] - [[package]] name = "ppv-lite86" version = "0.2.17" @@ -2246,37 +1509,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "property_modifier_scheduler" -version = "0.0.0" -dependencies = [ - "action_messages", - "async-trait", - "config", - "error", - "parking_lot", - "platform_property_manager", - "scheduler", - "tokio", -] - -[[package]] -name = "property_modifier_scheduler_test" -version = "0.0.0" -dependencies = [ - "action_messages", - "common", - "config", - "error", - "mock_scheduler", - "platform_property_manager", - "pretty_assertions", - "property_modifier_scheduler", - "scheduler", - "scheduler_utils", - "tokio", -] - [[package]] name = "prost" version = "0.11.9" @@ -2331,15 +1563,6 @@ dependencies = [ "prost", ] -[[package]] -name = "proto" -version = "0.0.0" -dependencies = [ - "prost", - "prost-types", - "tonic", -] - [[package]] name = "quote" version = "1.0.31" @@ -2379,6 +1602,18 @@ dependencies = [ "getrandom", ] +[[package]] +name = "rcgen" +version = "0.11.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "52c4f3084aa3bc7dfbba4eff4fab2a54db4324965d8872ab933565e6fbd83bc6" +dependencies = [ + "pem", + "ring 0.16.20", + "time 0.3.26", + "yasna", +] + [[package]] name = "redox_syscall" version = "0.2.16" @@ -2408,33 +1643,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "ref_store" -version = "0.0.0" -dependencies = [ - "async-trait", - "buf_channel", - "common", - "config", - "error", - "store", - "traits", -] - -[[package]] -name = "ref_store_test" -version = "0.0.0" -dependencies = [ - "common", - "config", - "error", - "memory_store", - "pretty_assertions", - "ref_store", - "store", - "tokio", -] - [[package]] name = "regex" version = "1.9.3" @@ -2471,92 +1679,32 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4bf2521270932c3c7bed1a59151222bd7643c79310f2916f01925e1e16255698" [[package]] -name = "resource_info" -version = "0.0.0" -dependencies = [ - "error", -] - -[[package]] -name = "resource_info_test" -version = "0.0.0" -dependencies = [ - "pretty_assertions", - "resource_info", - "tokio", -] - -[[package]] -name = "retry" -version = "0.0.0" -dependencies = [ - "error", - "futures", - "tokio", -] - -[[package]] -name = "retry_test" -version = "0.0.0" -dependencies = [ - "error", - "futures", - "pretty_assertions", - "retry", - "tokio", -] - -[[package]] -name = "running_actions_manager" -version = "0.0.0" +name = "ring" +version = "0.16.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3053cf52e236a3ed746dfc745aa9cacf1b791d846bdaf412f60a8d7d6e17c8fc" dependencies = [ - "ac_utils", - "action_messages", - "async-trait", - "bytes", - "common", - "config", - "error", - "fast_slow_store", - "filesystem_store", - "filetime", - "futures", - "grpc_store", - "hex", - "metrics_utils", - "parking_lot", - "prost", - "proto", - "relative-path", - "scopeguard", - "store", - "tokio", - "tokio-stream", - "tonic", + "cc", + "libc", + "once_cell", + "spin 0.5.2", + "untrusted 0.7.1", + "web-sys", + "winapi", ] [[package]] -name = "running_actions_manager_test" -version = "0.0.0" +name = "ring" +version = "0.17.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fb0205304757e5d899b9c2e448b867ffd03ae7f988002e47cd24954391394d0b" dependencies = [ - "ac_utils", - "action_messages", - "common", - "config", - "error", - "fast_slow_store", - "filesystem_store", - "futures", - "lazy_static", - "memory_store", - "pretty_assertions", - "prost", - "prost-types", - "proto", - "rand", - "running_actions_manager", - "store", - "tokio", + "cc", + "getrandom", + "libc", + "spin 0.9.8", + "untrusted 0.9.0", + "windows-sys", ] [[package]] @@ -2685,90 +1833,55 @@ dependencies = [ ] [[package]] -name = "rustversion" -version = "1.0.14" +name = "rustls" +version = "0.21.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" +checksum = "446e14c5cda4f3f30fe71863c34ec70f5ac79d6087097ad0bb433e1be5edf04c" +dependencies = [ + "log", + "ring 0.17.5", + "rustls-webpki", + "sct", +] [[package]] -name = "ryu" -version = "1.0.15" +name = "rustls-pemfile" +version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" - -[[package]] -name = "s3_store" -version = "0.0.0" +checksum = "2d3987094b1d07b653b7dfdc3f70ce9a1da9c51ac18c1b06b662e4f9a0e9f4b2" dependencies = [ - "async-trait", - "buf_channel", - "bytes", - "common", - "config", - "error", - "futures", - "http", - "lazy_static", - "rand", - "retry", - "rusoto_core", - "rusoto_s3", - "rusoto_signature", - "tokio", - "tokio-util", - "traits", + "base64 0.21.2", ] [[package]] -name = "s3_store_test" -version = "0.0.0" +name = "rustls-webpki" +version = "0.101.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b6275d1ee7a1cd780b64aca7726599a1dbc893b1e64144529e55c3c2f745765" dependencies = [ - "async_fixed_buffer", - "common", - "config", - "error", - "futures", - "http", - "pretty_assertions", - "rusoto_core", - "rusoto_mock", - "rusoto_s3", - "s3_store", - "tokio", - "tokio-util", - "traits", + "ring 0.17.5", + "untrusted 0.9.0", ] [[package]] -name = "schannel" -version = "0.1.22" +name = "rustversion" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" -dependencies = [ - "windows-sys", -] +checksum = "7ffc183a10b4478d04cbbbfc96d0873219d962dd5accaff2ffbd4ceb7df837f4" [[package]] -name = "scheduler" -version = "0.0.0" -dependencies = [ - "action_messages", - "async-trait", - "error", - "metrics_utils", - "platform_property_manager", - "tokio", - "worker", -] +name = "ryu" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ad4cc8da4ef723ed60bced201181d83791ad433213d8c24efffda1eec85d741" [[package]] -name = "scheduler_utils" -version = "0.0.0" +name = "schannel" +version = "0.1.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" dependencies = [ - "action_messages", - "async-trait", - "common", - "platform_property_manager", + "windows-sys", ] [[package]] @@ -2777,6 +1890,16 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sct" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" +dependencies = [ + "ring 0.17.5", + "untrusted 0.9.0", +] + [[package]] name = "security-framework" version = "2.9.2" @@ -2859,14 +1982,6 @@ dependencies = [ "serde", ] -[[package]] -name = "serde_utils" -version = "0.0.0" -dependencies = [ - "serde", - "shellexpand", -] - [[package]] name = "sha2" version = "0.9.9" @@ -2891,35 +2006,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "shard_store" -version = "0.0.0" -dependencies = [ - "async-trait", - "buf_channel", - "common", - "config", - "error", - "futures", - "metrics_utils", - "traits", -] - -[[package]] -name = "shard_store_test" -version = "0.0.0" -dependencies = [ - "common", - "config", - "error", - "memory_store", - "pretty_assertions", - "rand", - "shard_store", - "tokio", - "traits", -] - [[package]] name = "shellexpand" version = "3.1.0" @@ -2944,71 +2030,6 @@ dependencies = [ "libc", ] -[[package]] -name = "simple_scheduler" -version = "0.0.0" -dependencies = [ - "action_messages", - "async-trait", - "common", - "config", - "error", - "futures", - "hashbrown 0.14.0", - "lru", - "metrics_utils", - "parking_lot", - "platform_property_manager", - "scheduler", - "tokio", - "worker", -] - -[[package]] -name = "simple_scheduler_test" -version = "0.0.0" -dependencies = [ - "action_messages", - "common", - "config", - "error", - "platform_property_manager", - "pretty_assertions", - "proto", - "scheduler", - "scheduler_utils", - "simple_scheduler", - "tokio", - "worker", -] - -[[package]] -name = "size_partitioning_store" -version = "0.0.0" -dependencies = [ - "async-trait", - "buf_channel", - "common", - "config", - "error", - "tokio", - "traits", -] - -[[package]] -name = "size_partitioning_store_test" -version = "0.0.0" -dependencies = [ - "common", - "config", - "error", - "memory_store", - "pretty_assertions", - "size_partitioning_store", - "tokio", - "traits", -] - [[package]] name = "slab" version = "0.4.8" @@ -3034,6 +2055,18 @@ dependencies = [ "winapi", ] +[[package]] +name = "spin" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "static_assertions" version = "1.1.0" @@ -3046,15 +2079,6 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f3b6b32ae82412fb897ef134867d53a294f57ba5b758f06d71e865352c3e207" -[[package]] -name = "store" -version = "0.0.0" -dependencies = [ - "config", - "error", - "traits", -] - [[package]] name = "strsim" version = "0.10.0" @@ -3148,6 +2172,37 @@ dependencies = [ "winapi", ] +[[package]] +name = "time" +version = "0.3.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a79d09ac6b08c1ab3906a2f7cc2e81a0e27c7ae89c63812df75e52bef0751e07" +dependencies = [ + "deranged", + "serde", + "time-core", +] + +[[package]] +name = "time-core" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" + +[[package]] +name = "tls-listener" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "81294c017957a1a69794f506723519255879e15a870507faf45dfed288b763dd" +dependencies = [ + "futures-util", + "hyper", + "pin-project-lite", + "thiserror", + "tokio", + "tokio-rustls", +] + [[package]] name = "tokio" version = "1.29.1" @@ -3199,6 +2254,16 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.24.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081" +dependencies = [ + "rustls", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.14" @@ -3332,30 +2397,12 @@ dependencies = [ "once_cell", ] -[[package]] -name = "traits" -version = "0.0.0" -dependencies = [ - "async-trait", - "buf_channel", - "bytes", - "common", - "error", - "futures", - "metrics_utils", - "serde", -] - [[package]] name = "try-lock" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" -[[package]] -name = "turbo-cache" -version = "0.0.0" - [[package]] name = "twox-hash" version = "1.6.3" @@ -3384,6 +2431,18 @@ version = "1.0.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "301abaae475aa91687eb82514b328ab47a211a533026cb25fc3e519b86adfc3c" +[[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" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "utf8parse" version = "0.2.1" @@ -3405,38 +2464,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "verify_store" -version = "0.0.0" -dependencies = [ - "async-trait", - "buf_channel", - "common", - "config", - "error", - "hex", - "metrics_utils", - "sha2 0.10.7", - "tokio", - "traits", -] - -[[package]] -name = "verify_store_test" -version = "0.0.0" -dependencies = [ - "buf_channel", - "common", - "config", - "error", - "futures", - "memory_store", - "pretty_assertions", - "tokio", - "traits", - "verify_store", -] - [[package]] name = "version_check" version = "0.9.4" @@ -3518,6 +2545,16 @@ version = "0.2.87" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" +[[package]] +name = "web-sys" +version = "0.3.64" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + [[package]] name = "which" version = "4.4.0" @@ -3635,99 +2672,6 @@ version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" -[[package]] -name = "worker" -version = "0.0.0" -dependencies = [ - "action_messages", - "error", - "metrics_utils", - "platform_property_manager", - "proto", - "tokio", - "uuid", -] - -[[package]] -name = "worker_api_client_wrapper" -version = "0.0.0" -dependencies = [ - "async-trait", - "proto", - "tonic", -] - -[[package]] -name = "worker_api_server" -version = "0.0.0" -dependencies = [ - "action_messages", - "common", - "config", - "error", - "futures", - "platform_property_manager", - "proto", - "scheduler", - "tokio", - "tonic", - "uuid", - "worker", -] - -[[package]] -name = "worker_api_server_test" -version = "0.0.0" -dependencies = [ - "action_messages", - "common", - "config", - "error", - "platform_property_manager", - "pretty_assertions", - "prost-types", - "proto", - "scheduler", - "simple_scheduler", - "tokio", - "tokio-stream", - "tonic", - "worker", - "worker_api_server", -] - -[[package]] -name = "worker_utils" -version = "0.0.0" -dependencies = [ - "common", - "config", - "error", - "futures", - "proto", - "shlex", - "tokio", - "tonic", -] - -[[package]] -name = "write_counter" -version = "0.0.0" -dependencies = [ - "pin-project-lite", - "tokio", -] - -[[package]] -name = "write_request_stream_wrapper" -version = "0.0.0" -dependencies = [ - "error", - "futures", - "proto", - "resource_info", -] - [[package]] name = "xml-rs" version = "0.8.16" @@ -3740,6 +2684,15 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" +[[package]] +name = "yasna" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e17bb3549cc1321ae1296b9cdc2698e2b6cb1992adfa19a8c72e5b7a738f44cd" +dependencies = [ + "time 0.3.26", +] + [[package]] name = "zeroize" version = "1.6.0" diff --git a/Cargo.toml b/Cargo.toml index 97886fb67..ad3115556 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -131,18 +131,22 @@ prost = "0.11.9" prost-build = "0.11.9" prost-types = "0.11.9" rand = "0.8.5" +rcgen = "0.11.3" relative-path = "1.8.0" rusoto_core = "0.48.0" rusoto_mock = "=0.48.0" rusoto_s3 = "0.48.0" rusoto_signature = "0.48.0" +rustls-pemfile = "1.0.3" scopeguard = "1.2.0" serde = "1.0.167" sha2 = "0.10.7" shellexpand = "3.1.0" shlex = "1.1.0" stdext = "0.3.1" +tls-listener = { version = "0.7.0", features = ["hyper-h2", "rustls"] } tokio = { version = "1.29.1", features = ["macros", "io-util", "fs", "rt-multi-thread", "parking_lot"] } +tokio-rustls = "0.24.1" tokio-stream = { version = "0.1.14", features = ["fs", "sync"] } tokio-util = { version = "0.7.8", features = ["io", "io-util", "codec"] } tonic = { version = "0.9.2", features = ["gzip"] } diff --git a/cas/BUILD b/cas/BUILD index 3de6b7714..bda4060a0 100644 --- a/cas/BUILD +++ b/cas/BUILD @@ -28,8 +28,12 @@ rust_binary( "@crate_index//:parking_lot", "@crate_index//:prometheus-client", "@crate_index//:axum", + "@crate_index//:tls-listener", "@crate_index//:tower", "@crate_index//:tokio", "@crate_index//:tonic", + "@crate_index//:tokio-rustls", + "@crate_index//:rcgen", + "@crate_index//:rustls-pemfile", ], ) diff --git a/cas/cas_main.rs b/cas/cas_main.rs index 5e144a239..9e6b74017 100644 --- a/cas/cas_main.rs +++ b/cas/cas_main.rs @@ -22,12 +22,16 @@ use async_lock::Mutex as AsyncMutex; use axum::Router; use clap::Parser; use futures::future::{select_all, BoxFuture, OptionFuture, TryFutureExt}; +use futures::FutureExt; use hyper::server::conn::Http; use hyper::{Body, Response}; use parking_lot::Mutex; +use rustls_pemfile::{certs, pkcs8_private_keys}; use scopeguard::guard; use tokio::net::TcpListener; use tokio::task::spawn_blocking; +use tokio_rustls::rustls::{Certificate, PrivateKey, ServerConfig as TlsServerConfig}; +use tokio_rustls::TlsAcceptor; use tonic::codec::CompressionEncoding; use tonic::transport::Server as TonicServer; use tower::util::ServiceExt; @@ -386,13 +390,58 @@ async fn inner_main(cfg: CasConfig, server_start_timestamp: u64) -> Result<(), B ) } + // Configure our TLS acceptor if we have TLS configured. + let maybe_tls_acceptor = server_cfg.tls.map_or(Ok(None), |tls_config| { + let mut cert_reader = std::io::BufReader::new( + std::fs::File::open(&tls_config.cert_file) + .err_tip(|| format!("Could not open cert file {}", tls_config.cert_file))?, + ); + let certs = certs(&mut cert_reader) + .err_tip(|| format!("Could not extract certs from file {}", tls_config.cert_file))? + .into_iter() + .map(Certificate) + .collect(); + let mut key_reader = std::io::BufReader::new( + std::fs::File::open(&tls_config.key_file) + .err_tip(|| format!("Could not open key file {}", tls_config.key_file))?, + ); + let keys = pkcs8_private_keys(&mut key_reader) + .err_tip(|| format!("Could not extract key(s) from file {}", tls_config.key_file))?; + if keys.len() != 1 { + return Err(Box::new(make_err!( + Code::InvalidArgument, + "Expected 1 key in file {}, found {} keys", + tls_config.key_file, + keys.len() + ))); + } + let mut config = TlsServerConfig::builder() + .with_safe_defaults() + .with_no_client_auth() + .with_single_cert(certs, PrivateKey(keys.into_iter().next().unwrap().into())) + .map_err(|e| make_err!(Code::Internal, "Could not create TlsServerConfig : {:?}", e))?; + + config.alpn_protocols.push("h2".into()); + Ok(Some(TlsAcceptor::from(Arc::new(config)))) + })?; + let socket_addr = server_cfg.listen_address.parse::()?; let tcp_listener = TcpListener::bind(&socket_addr).await?; + let http = Http::new(); log::warn!("Ready, listening on {}", socket_addr); root_futures.push(Box::pin(async move { loop { // Wait for client to connect. - let (tcp_stream, remote_addr) = tcp_listener.accept().await?; + let (tcp_stream, remote_addr) = match tcp_listener.accept().await { + Ok(result) => result, + Err(e) => { + log::error!( + "{:?}", + Result::<(), _>::Err(e).err_tip(|| "Failed to accept tcp connection") + ); + continue; + } + }; connected_clients_mux.inner.lock().insert(remote_addr); connected_clients_mux.counter.inc(); @@ -401,7 +450,22 @@ async fn inner_main(cfg: CasConfig, server_start_timestamp: u64) -> Result<(), B let scope_guard = guard(connected_clients_mux.clone(), move |connected_clients_mux| { connected_clients_mux.inner.lock().remove(&remote_addr); }); - let fut = Http::new().serve_connection(tcp_stream, svc.clone()); + let (http, svc) = (http.clone(), svc.clone()); + let fut = if let Some(tls_acceptor) = &maybe_tls_acceptor { + let tls_stream = match tls_acceptor.accept(tcp_stream).await { + Ok(result) => result, + Err(e) => { + log::error!( + "{:?}", + Result::<(), _>::Err(e).err_tip(|| "Failed to accept tls stream") + ); + continue; + } + }; + http.serve_connection(tls_stream, svc).left_future() + } else { + http.serve_connection(tcp_stream, svc).right_future() + }; tokio::spawn(async move { // Move it into our spawn, so if our spawn dies the cleanup happens. let _guard = scope_guard; diff --git a/config/cas_server.rs b/config/cas_server.rs index 0d3c5dc83..c280996d2 100644 --- a/config/cas_server.rs +++ b/config/cas_server.rs @@ -189,6 +189,17 @@ pub struct ServicesConfig { pub prometheus: Option, } +#[derive(Deserialize, Debug)] +pub struct TlsConfig { + /// Path to the certificate file. + #[serde(deserialize_with = "convert_string_with_shellexpand")] + pub cert_file: String, + + /// Path to the private key file. + #[serde(deserialize_with = "convert_string_with_shellexpand")] + pub key_file: String, +} + #[derive(Deserialize, Debug)] pub struct ServerConfig { /// Name of the server. This is used to help identify the service @@ -209,6 +220,13 @@ pub struct ServerConfig { /// Services to attach to server. pub services: Option, + + /// Tls Configuration for this server. + /// If not set, the server will not use TLS. + /// + /// Default: None + #[serde(default)] + pub tls: Option, } #[allow(non_camel_case_types)] diff --git a/deployment-examples/docker-compose/docker-compose.yml b/deployment-examples/docker-compose/docker-compose.yml index 618c67c0d..97f550a94 100644 --- a/deployment-examples/docker-compose/docker-compose.yml +++ b/deployment-examples/docker-compose/docker-compose.yml @@ -30,7 +30,7 @@ services: target: /root environment: RUST_LOG: ${RUST_LOG:-warn} - ports: [ "50051:50051/tcp", "127.0.0.1:50061:50061" ] + ports: [ "50051:50051/tcp", "127.0.0.1:50061:50061", "50071:50071/tcp", ] command: | turbo-cache /root/local-storage-cas.json diff --git a/deployment-examples/docker-compose/example-do-not-use-in-prod-key.pem b/deployment-examples/docker-compose/example-do-not-use-in-prod-key.pem new file mode 100644 index 000000000..9ad6b97a0 --- /dev/null +++ b/deployment-examples/docker-compose/example-do-not-use-in-prod-key.pem @@ -0,0 +1,52 @@ +-----BEGIN PRIVATE KEY----- +MIIJQwIBADANBgkqhkiG9w0BAQEFAASCCS0wggkpAgEAAoICAQCWkpK9CeY3B1Q+ ++f5qTcavKEVPgJ4PqFdr9OJtOmboAcw9B9FcgM8QQ8FYkjwFYNE03ec0xCAUdPXG +gPXYxdU9ogwFYlTldV4Zhm9G7qbKLKWUE9rhXJHoiQZeLVHKUIn4UPSkMBr2UdQw +BVazG3RtJzRKTDfNpP6UAAmHlf/6MYWdQZwpK/Oelr4pCKofcavuiqmOyZmKEhpw +Nt0/6pFvLqERbaveuX2I+Ugvg0oY8voMueGAgT7qeE+ph+7BXQkaTBzYr+2p5TGy +aNXczXvkbL53KUxtLZ3bVlfLymGv8XpG8IVLroIOXbeQFSJpFiALilvZdtx2MnLk +hqiz193RNCVji9gL2l6JQDsL4L40XPY7iwmov+ar5fkjq3ysgIzpjRjZZUbt9DjJ +Ercmntfx3nDlXZni6/BnqQ9LxJC4Q1ZoONP6uXRJEC65vdRBusCXmRzLhijgdLLD +tSxk/1MQYztOq17X3HoOSUdlOrSMAyTiOysNTLCB3hWz53d0UAx2Chk+9Xd4LnVl +fOQH81OdK/QhAF6gGkhRM9UATe13v1nKLao+CS6U0xAjMNcA0mfd2/pVKXO8Ieuv +NEhI8UQOFvGX+DlJVXQtLAGrwGoNHzl2zbyI/8k1Lwp0bMzhrg7UfA9mb62rNVSH +3S9fu7XmeVuOi/Sb6iNFAGgMqXZm+QIDAQABAoICACMXC31kljMS0S5QAltxvrDJ +OMXbWnqZp63wBuifqKW+7YL3lHHzTs4ijCeBBN3X/0lLwXsJjdRWoYReP20CRby0 +TArhLJnA7WoTa1FjgpkxKHFG40aL1TEU5dgCxcHZXR3yd+DfmRj4XvPF+ruI1Wwu +q7/43TRelDmXfKENcvcynUnVpXfu1zqJNM3JSCRF0GSqCfPNxatopqKqFouztars +efrezSP9pGTMe2cfOKBx15Ypp4TUGf54hVAj7p8/eESZoktZTJDAagGC7vwjIxFL +ymNoy3fSHqykBZfnlTZ0lyN7IAVQKN0COCoq0rccweEOoHMggSZGgYICY8RttTKV +ZazKK0H+23oTj6zilgdHw0LNSV3+ByZF0zD0Ss2SZG7LHZJxJ8MS18i3U7XUG999 +LsWPacrIo5C1tK33WHWYLIIlJZyOqmJbvrRLleE3UImo26rwYVYP2I+KE6F3SH8b +lRCGYEqITXXKSBRDcAo63Ooohy9ftqeVRPzQtLzFVPODjnV3Ho3fCP+LdfjRCvED +9rk5f/zJR2SabW9OLKrvXoU0Z7+Oa7RvHiqH2Tdx1kUDuZnJgjcMF2pIeOPcAls7 +pEOrV5lIesLWSJQwRy2qsM1tr7/DFmpohGs8WnUbHwdLjWkFJXtkmTWcY7Yl3tm4 +aUD/8L4VNvsrGBtLHVmVAoIBAQDIjMe1umF/DgAWpuw0RYgELAyQ+MNc8GNalPV0 +FyAV2Sjzf08rfauJQ8PxJFAxkeI49uB2iGrcz1iuMC4l2sKdEHRbpYSArbmHcHsX +Hvq/n6TX2RH2GXv4k29c7dmj19phJMbTZCGvTpj+watJelwmK0cP/OmEWdLd3nud +dl6zrwsxxu88G330fg7KPBJIoVtMoczeOJ58lvlPXM+W729/lUhnItwIOU/AVu3u +xYe6skhVtX3YG0VWjNgFLK0KgaXJ2x+vNlrxOIOczpGiByfqpaCPoCG6vbVul/Bp +mpsp9iuFzHP8Ym938MMCsw/rrkQiZqcvgNrhHXT4XgUFN0qvAoIBAQDANFInrVOQ +LDs0G+s0nE+GSdjhSh2Qmf0rARs78XFxsRE/ZkHAzCfGAi9vggXqXtu3zzkC50KM +gAYgE2aQ6KoYJl5OU49o6nr7dWGguKZRVnfvnyVjq7h5ZYVHJQYry48+4SSkHzyY +NaGDNlnbKfehLxeQ3fzHrzajFCLsVMRiBb1wDEw+pbH1D7eSf6j7cOcgaUn0kfI9 +usPsjEZxxHAAuDYH8z6RHspucx3s+UxBIcyrljF+TNbEJ70ntow2172rAu/4O5d7 +NmTWBvX3YDsth52dHN199t+61cgz1/1gG15QEzvj8LHkGVPAu/8yQLskeJwMSSVJ +gOdHSvl9t7LXAoIBAQDIRkZ+BbWtcybFeEaz4Kf3OqIF+FborisZ313LY/inuOi7 +WeyPCv3Noz2+x7vJ9NyMdIYt+Qd2oR33PagoJ3Fn9nGsv/s1oceAKOTTbx2LVXsC +DwVv1X1G/L0eeWx5wWqUzmw72GgHMJ968Z8DTs1NVLSvk6sDf8wjwzWBRx9Fo02z +lO1+AhpjmatdbGX54CFTwtTbKoGi/AXWqmGoYk3fhA386QQAtnMdKfKMGvjziWzR +IuCceodg6mAjsrzPnC8bCNd4WviwofZVFri6rRjArExOgeSNHzxbSCJO45WGbw6B +nG5LoWWdynKEdJs2ih4CmK7msnBilM8l5IZw8gmDAoIBAQCte0wf9ejzu4igawas +EN4SlnsENdJjnyoMc84yF6ZOeQTZVaHJtDu+FGDeY9yVA5OL36VUwomlqTReJUSx +TN+iNpduWSubBfGFIBjDaYbs6YANr3ae9PLn18MpSPi99NjRZ4OcA3m85MNoXFlU +YRfay1eY8VTko3hMT7OJ3qT22Ll49hCnhwUN7WbC+yj58pka/w26izS7lOSckKxQ +qX5yl9Jk8J+resA6WvtK1mWGcEx9H26C0jYTDM9FlhYOtkHCpj8Uriz3EEyJhfTi +mGAxozOXCOO+e2LLD4TJjo1q/qjs27916N2XxWh8EPOxVw3TSG2JBUh7hLa7+ach +Wvo3AoIBAAM9Z9MOkAMECNwbSqsKt6/8j7RS+474cLPqXwRsmh1KPv5P4WkCTmxB +TDjqP/JkytL/0V3Zexc+2MUNwBwt1kUXRhi1rkbpi+fmZ/Sp8jh4fwriSRNj5BKz +0soGd/1dGF57EhpZHMQvts86y9A94tdKrVUb1Wosvsua22xAgeumbYGkc9gFKAkG +BiplOruOMkJhEQMR3gdrDUuyNL5HqBCGXP7v7+Lfgh99aZIh/ophex69T2QxTylw +sYDOH4+gMkJsYHU4H2UKm4JdGDZKRlxctwf//N1B+Ot7AULM/OPtHPgt/JcWxpjn +tLDdTkO8oICsLdyBDetlzNQ+h2hXfuM= +-----END PRIVATE KEY----- diff --git a/deployment-examples/docker-compose/example-do-not-use-in-prod-rootca.crt b/deployment-examples/docker-compose/example-do-not-use-in-prod-rootca.crt new file mode 100644 index 000000000..1e50c5e20 --- /dev/null +++ b/deployment-examples/docker-compose/example-do-not-use-in-prod-rootca.crt @@ -0,0 +1,29 @@ +-----BEGIN CERTIFICATE----- +MIIFCTCCAvGgAwIBAgIUBpZ3cJ8onptpeD/v2TVympU03sQwDQYJKoZIhvcNAQEL +BQAwFDESMBAGA1UEAwwJbG9jYWxob3N0MB4XDTIzMTAyMjA2MzMxNloXDTI0MTAy +MTA2MzMxNlowFDESMBAGA1UEAwwJbG9jYWxob3N0MIICIjANBgkqhkiG9w0BAQEF +AAOCAg8AMIICCgKCAgEAlpKSvQnmNwdUPvn+ak3GryhFT4CeD6hXa/TibTpm6AHM +PQfRXIDPEEPBWJI8BWDRNN3nNMQgFHT1xoD12MXVPaIMBWJU5XVeGYZvRu6myiyl +lBPa4VyR6IkGXi1RylCJ+FD0pDAa9lHUMAVWsxt0bSc0Skw3zaT+lAAJh5X/+jGF +nUGcKSvznpa+KQiqH3Gr7oqpjsmZihIacDbdP+qRby6hEW2r3rl9iPlIL4NKGPL6 +DLnhgIE+6nhPqYfuwV0JGkwc2K/tqeUxsmjV3M175Gy+dylMbS2d21ZXy8phr/F6 +RvCFS66CDl23kBUiaRYgC4pb2XbcdjJy5Iaos9fd0TQlY4vYC9peiUA7C+C+NFz2 +O4sJqL/mq+X5I6t8rICM6Y0Y2WVG7fQ4yRK3Jp7X8d5w5V2Z4uvwZ6kPS8SQuENW +aDjT+rl0SRAuub3UQbrAl5kcy4Yo4HSyw7UsZP9TEGM7Tqte19x6DklHZTq0jAMk +4jsrDUywgd4Vs+d3dFAMdgoZPvV3eC51ZXzkB/NTnSv0IQBeoBpIUTPVAE3td79Z +yi2qPgkulNMQIzDXANJn3dv6VSlzvCHrrzRISPFEDhbxl/g5SVV0LSwBq8BqDR85 +ds28iP/JNS8KdGzM4a4O1HwPZm+tqzVUh90vX7u15nlbjov0m+ojRQBoDKl2ZvkC +AwEAAaNTMFEwHQYDVR0OBBYEFL2SbUDfjD72r9B1/V2v33992AoWMB8GA1UdIwQY +MBaAFL2SbUDfjD72r9B1/V2v33992AoWMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZI +hvcNAQELBQADggIBAF6WiXP61VEfdclSpV24wZfg1bSDpHw9S6LG7fy+/0oizpFY +nQkc+M2x2i7LFE8BoJKop6l4VyJ0jgGf5wzRHfmHX4QVatHBmzfJKA6Vm471aRVx +NM4/VWFpVbflnqGjeYEZcStM+506lgKfJk2It7Kd6pCmVbNzYb8W5zlvuYeWtwaZ +mtSLrmgsXLBfIwZBJagOEdQiM0mrRMT5LkA+fjKs+mqjDQz/RaDLTsrWnCnQ354Z +SBycbrJoyfnfAf0YlOlX+s2sjOEeSUvcjyI6mcA0Osyzerw79bztyaF132rU0A6D +jQw22Yj8B4tdcuTjaThXjPrlvWNOfoWbIyiU8Fk7BEvy3YFeRJ9qW9nx2BOCn0/y +quvu4W5NreDeIGT6FSX836GJYkEdheUnVDiKsiZZmB8Xng2D52gkWv5LI2U7LB4D +sZqFkyYXBR2xwoWbV46j0WnbffloUvCTk9oKOJ7i4i3kCyoWccfVUp2kVCdRK3Ok +bq0cPkudq7srb8IsjJVaAISvmrPXQj1sByLVhTJZsNsMmACDV5+QK+4fQn5hpAhS +RIG803s/fdITWxTzE+j8IM6YOcEhmDQpzUxhNFKGdZATNv3FF/YZdg8dCs8hvdxq +y8nkIB354me8h7bchCTIpD7OlL4D+vwPmuVs7IHpiXZJXPzCP0gkMX8Ewt6W +-----END CERTIFICATE----- diff --git a/deployment-examples/docker-compose/local-storage-cas.json b/deployment-examples/docker-compose/local-storage-cas.json index ee88b27be..eb2011b13 100644 --- a/deployment-examples/docker-compose/local-storage-cas.json +++ b/deployment-examples/docker-compose/local-storage-cas.json @@ -69,5 +69,32 @@ "path": "/metrics" } } + }, + { + "listen_address": "0.0.0.0:50071", + "tls": { + "cert_file": "/root/example-do-not-use-in-prod-rootca.crt", + "key_file": "/root/example-do-not-use-in-prod-key.pem" + }, + "services": { + "cas": { + "main": { + "cas_store": "CAS_MAIN_STORE" + } + }, + "ac": { + "main": { + "ac_store": "AC_MAIN_STORE" + } + }, + "capabilities": {}, + "bytestream": { + "cas_stores": { + "main": "CAS_MAIN_STORE", + }, + // According to https://github.com/grpc/grpc.github.io/issues/371 16KiB - 64KiB is optimal. + "max_bytes_per_stream": 64000, // 64kb. + } + } }] } diff --git a/gencargo/cas/Cargo.toml b/gencargo/cas/Cargo.toml index ee40d92ae..1299dbeb2 100644 --- a/gencargo/cas/Cargo.toml +++ b/gencargo/cas/Cargo.toml @@ -28,8 +28,12 @@ hyper = { workspace = true } json5 = { workspace = true } parking_lot = { workspace = true } prometheus-client = { workspace = true } +rcgen = { workspace = true } +rustls-pemfile = { workspace = true } scopeguard = { workspace = true } +tls-listener = { workspace = true } tokio = { workspace = true } +tokio-rustls = { workspace = true } tonic = { workspace = true } tower = { workspace = true } diff --git a/integration_tests/simple_tls_test.sh b/integration_tests/simple_tls_test.sh new file mode 100755 index 000000000..bbc3ec47b --- /dev/null +++ b/integration_tests/simple_tls_test.sh @@ -0,0 +1,29 @@ +#!/bin/bash +# Copyright 2023 The Turbo Cache Authors. All rights reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +if [[ $UNDER_TEST_RUNNER -ne 1 ]]; then + echo "This script should be run under run_integration_tests.sh" + exit 1 +fi + +RESULTS=$(curl --retry 5 --insecure --cacert ./example-do-not-use-in-prod-rootca.crt --key ./example-do-not-use-in-prod-key1.pem https://127.0.0.1:50071/status 2>&1) + +echo "Results from curl: $RESULTS" + +if echo "$RESULTS" | grep -q "Ok"; then + echo "Curl returned 'Ok' status via TLS" +else + echo "Expected curl to be able to get 'Ok' status via TLS" + exit 1 +fi diff --git a/tools/cargo_shared.bzl b/tools/cargo_shared.bzl index 48c93a7cc..75b7ffea2 100644 --- a/tools/cargo_shared.bzl +++ b/tools/cargo_shared.bzl @@ -35,6 +35,19 @@ PACKAGES = { "version": "0.9.2", "features": ["gzip"], }, + "tls-listener": { + "version": "0.7.0", + "features": ["hyper-h2", "rustls"], + }, + "tokio-rustls": { + "version": "0.24.1", + }, + "rustls-pemfile": { + "version": "1.0.3", + }, + "rcgen": { + "version": "0.11.3", + }, "log": { "version": "0.4.19", },