]> git.puffer.fish Git - matthieu/nova.git/commitdiff
tests, cleanup & rest base
authorMatthieu <matthieu@developershouse.xyz>
Tue, 12 Oct 2021 18:51:30 +0000 (22:51 +0400)
committerMatthieu <matthieu@developershouse.xyz>
Tue, 12 Oct 2021 18:51:30 +0000 (22:51 +0400)
89 files changed:
BUILD
Cargo.lock
Cargo.toml
Makefile
WORKSPACE
cargo/crates.bzl
cargo/remote/BUILD.anyhow-1.0.43.bazel [deleted file]
cargo/remote/BUILD.async-stream-0.3.2.bazel [deleted file]
cargo/remote/BUILD.async-stream-impl-0.3.2.bazel [deleted file]
cargo/remote/BUILD.crypto-mac-0.10.1.bazel [new file with mode: 0644]
cargo/remote/BUILD.either-1.6.1.bazel [deleted file]
cargo/remote/BUILD.fixedbitset-0.2.0.bazel [deleted file]
cargo/remote/BUILD.foreign-types-0.3.2.bazel [new file with mode: 0644]
cargo/remote/BUILD.foreign-types-shared-0.1.1.bazel [new file with mode: 0644]
cargo/remote/BUILD.heck-0.3.3.bazel [deleted file]
cargo/remote/BUILD.hmac-0.10.1.bazel [new file with mode: 0644]
cargo/remote/BUILD.hyper-timeout-0.4.1.bazel [deleted file]
cargo/remote/BUILD.hyper-tls-0.5.0.bazel [new file with mode: 0644]
cargo/remote/BUILD.itertools-0.10.1.bazel [deleted file]
cargo/remote/BUILD.multimap-0.8.3.bazel [deleted file]
cargo/remote/BUILD.native-tls-0.2.8.bazel [new file with mode: 0644]
cargo/remote/BUILD.openssl-0.10.36.bazel [new file with mode: 0644]
cargo/remote/BUILD.openssl-sys-0.9.67.bazel [new file with mode: 0644]
cargo/remote/BUILD.petgraph-0.5.1.bazel [deleted file]
cargo/remote/BUILD.prost-0.8.0.bazel [deleted file]
cargo/remote/BUILD.prost-build-0.8.0.bazel [deleted file]
cargo/remote/BUILD.prost-derive-0.8.0.bazel [deleted file]
cargo/remote/BUILD.prost-types-0.8.0.bazel [deleted file]
cargo/remote/BUILD.rand-0.8.4.bazel
cargo/remote/BUILD.security-framework-sys-2.4.2.bazel
cargo/remote/BUILD.sha2-0.9.6.bazel
cargo/remote/BUILD.testcontainers-0.12.0.bazel [new file with mode: 0644]
cargo/remote/BUILD.tokio-io-timeout-1.1.1.bazel [deleted file]
cargo/remote/BUILD.tokio-native-tls-0.3.0.bazel [new file with mode: 0644]
cargo/remote/BUILD.tokio-stream-0.1.7.bazel [deleted file]
cargo/remote/BUILD.tonic-0.5.2.bazel [deleted file]
cargo/remote/BUILD.tonic-build-0.5.2.bazel [deleted file]
cargo/remote/BUILD.tower-0.4.8.bazel [deleted file]
cargo/remote/BUILD.tower-layer-0.3.1.bazel [deleted file]
cargo/remote/BUILD.tracing-0.1.26.bazel
cargo/remote/BUILD.tracing-attributes-0.1.15.bazel [deleted file]
cargo/remote/BUILD.tracing-futures-0.2.5.bazel [deleted file]
cargo/remote/BUILD.unicode-segmentation-1.8.0.bazel [deleted file]
cargo/remote/BUILD.vcpkg-0.2.15.bazel [new file with mode: 0644]
cargo/remote/BUILD.which-4.2.2.bazel [deleted file]
common/rust/Cargo.toml
common/rust/cargo/BUILD.bazel
common/rust/src/config.rs
common/rust/src/lib.rs
common/rust/src/monitoring.rs
common/rust/src/nats.rs
common/rust/src/payloads.rs
common/version.go.in
config/default.json [new file with mode: 0644]
docker-compose.yaml
docs/docusaurus.config.js
gateway/Cargo.toml
gateway/README.md [deleted file]
gateway/cargo/BUILD.bazel
gateway/config/default.toml [deleted file]
gateway/src/connection/stream.rs
gateway/src/connection/utils.rs
gateway/src/management/mod.rs [deleted file]
gateway/src/payloads/events/resume.rs [deleted file]
gateway/src/shard/actions.rs
gateway/src/shard/connection.rs
novactl/README.md [deleted file]
ratelimiter/BUILD [deleted file]
ratelimiter/Cargo.toml [deleted file]
ratelimiter/README.md [deleted file]
ratelimiter/build.rs [deleted file]
ratelimiter/proto/BUILD.bazel [deleted file]
ratelimiter/proto/nova.ratelimit.v1alpha.proto [deleted file]
ratelimiter/src/main.rs [deleted file]
rest/BUILD [new file with mode: 0644]
rest/Cargo.toml [new file with mode: 0644]
rest/cargo/BUILD.bazel [new file with mode: 0644]
rest/src/config.rs [new file with mode: 0644]
rest/src/main.rs [new file with mode: 0644]
rest/src/proxy/mod.rs [new file with mode: 0644]
webhook/Cargo.toml
webhook/README.md [deleted file]
webhook/cargo/BUILD.bazel
webhook/src/handler/handler.rs
webhook/src/handler/make_service.rs
webhook/src/handler/mod.rs
webhook/src/handler/tests/handler.rs [new file with mode: 0644]
webhook/src/handler/tests/mod.rs [new file with mode: 0644]
webhook/src/main.rs

diff --git a/BUILD b/BUILD
index ec32785948ae660e4ca50a0e7a216e407781168b..c486575bd8f5dea3d58442ece9185eea99b60fc8 100644 (file)
--- a/BUILD
+++ b/BUILD
@@ -14,7 +14,7 @@ filegroup(
         "//cache",
         "//gateway",
         "//novactl",
-        "//ratelimiter",
+        "//rest",
         "//webhook",
     ],
 )
@@ -24,7 +24,7 @@ container_bundle(
     images = {
         "ghcr.io/discordnova/nova/novactl:$(docker_tag)": "//novactl:image",
         "ghcr.io/discordnova/nova/gateway:$(docker_tag)": "//gateway:image",
-        "ghcr.io/discordnova/nova/ratelimiter:$(docker_tag)": "//ratelimiter:image",
+        "ghcr.io/discordnova/nova/rest:$(docker_tag)": "//rest:image",
         "ghcr.io/discordnova/nova/webhook:$(docker_tag)": "//webhook:image",
         "ghcr.io/discordnova/nova/cache:$(docker_tag)": "//cache:image",
     },
@@ -41,7 +41,7 @@ test_suite(
     tests = [
         "//gateway:tests",
         "//novactl:tests",
-        "//ratelimiter:tests",
+        "//rest:tests",
         "//webhook:tests",
     ],
 )
index 0696dd6d71b24b9847612a261b54b3737e4d5ecd..df69d5aa81c26d24b3f5242e5799d4ef1fed91ad 100644 (file)
@@ -11,12 +11,6 @@ dependencies = [
  "memchr",
 ]
 
-[[package]]
-name = "anyhow"
-version = "1.0.43"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf"
-
 [[package]]
 name = "arrayvec"
 version = "0.5.2"
@@ -34,27 +28,6 @@ dependencies = [
  "futures-core",
 ]
 
-[[package]]
-name = "async-stream"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "171374e7e3b2504e0e5236e3b59260560f9fe94bfe9ac39ba5e4e929c5590625"
-dependencies = [
- "async-stream-impl",
- "futures-core",
-]
-
-[[package]]
-name = "async-stream-impl"
-version = "0.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
 [[package]]
 name = "async-task"
 version = "4.0.3"
@@ -222,6 +195,7 @@ dependencies = [
  "pretty_env_logger",
  "prometheus",
  "serde 1.0.130",
+ "testcontainers",
  "tokio",
 ]
 
@@ -295,6 +269,16 @@ dependencies = [
  "lazy_static",
 ]
 
+[[package]]
+name = "crypto-mac"
+version = "0.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a"
+dependencies = [
+ "generic-array",
+ "subtle",
+]
+
 [[package]]
 name = "curve25519-dalek"
 version = "3.2.0"
@@ -350,12 +334,6 @@ dependencies = [
  "zeroize",
 ]
 
-[[package]]
-name = "either"
-version = "1.6.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
-
 [[package]]
 name = "enumflags2"
 version = "0.7.1"
@@ -405,18 +383,27 @@ dependencies = [
  "instant",
 ]
 
-[[package]]
-name = "fixedbitset"
-version = "0.2.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
-
 [[package]]
 name = "fnv"
 version = "1.0.7"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1"
 
+[[package]]
+name = "foreign-types"
+version = "0.3.2"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1"
+dependencies = [
+ "foreign-types-shared",
+]
+
+[[package]]
+name = "foreign-types-shared"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b"
+
 [[package]]
 name = "form_urlencoded"
 version = "1.0.1"
@@ -544,7 +531,6 @@ dependencies = [
  "enumflags2",
  "futures",
  "futures-util",
- "log",
  "num",
  "num-derive",
  "num-traits 0.2.14",
@@ -613,15 +599,6 @@ version = "0.11.2"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
 
-[[package]]
-name = "heck"
-version = "0.3.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c"
-dependencies = [
- "unicode-segmentation",
-]
-
 [[package]]
 name = "hermit-abi"
 version = "0.1.19"
@@ -637,6 +614,16 @@ version = "0.4.3"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70"
 
+[[package]]
+name = "hmac"
+version = "0.10.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15"
+dependencies = [
+ "crypto-mac",
+ "digest",
+]
+
 [[package]]
 name = "http"
 version = "0.2.4"
@@ -705,15 +692,16 @@ dependencies = [
 ]
 
 [[package]]
-name = "hyper-timeout"
-version = "0.4.1"
+name = "hyper-tls"
+version = "0.5.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1"
+checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
 dependencies = [
+ "bytes",
  "hyper",
- "pin-project-lite",
+ "native-tls",
  "tokio",
- "tokio-io-timeout",
+ "tokio-native-tls",
 ]
 
 [[package]]
@@ -746,15 +734,6 @@ dependencies = [
  "cfg-if",
 ]
 
-[[package]]
-name = "itertools"
-version = "0.10.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf"
-dependencies = [
- "either",
-]
-
 [[package]]
 name = "itoa"
 version = "0.4.8"
@@ -872,10 +851,22 @@ dependencies = [
 ]
 
 [[package]]
-name = "multimap"
-version = "0.8.3"
+name = "native-tls"
+version = "0.2.8"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a"
+checksum = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d"
+dependencies = [
+ "lazy_static",
+ "libc",
+ "log",
+ "openssl",
+ "openssl-probe",
+ "openssl-sys",
+ "schannel",
+ "security-framework",
+ "security-framework-sys",
+ "tempfile",
+]
 
 [[package]]
 name = "nats"
@@ -1076,12 +1067,39 @@ version = "0.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5"
 
+[[package]]
+name = "openssl"
+version = "0.10.36"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a"
+dependencies = [
+ "bitflags",
+ "cfg-if",
+ "foreign-types",
+ "libc",
+ "once_cell",
+ "openssl-sys",
+]
+
 [[package]]
 name = "openssl-probe"
 version = "0.1.4"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a"
 
+[[package]]
+name = "openssl-sys"
+version = "0.9.67"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "69df2d8dfc6ce3aaf44b40dec6f487d5a886516cf6879c49e98e0710f310a058"
+dependencies = [
+ "autocfg",
+ "cc",
+ "libc",
+ "pkg-config",
+ "vcpkg",
+]
+
 [[package]]
 name = "parking"
 version = "2.0.0"
@@ -1119,16 +1137,6 @@ version = "2.1.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e"
 
-[[package]]
-name = "petgraph"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7"
-dependencies = [
- "fixedbitset",
- "indexmap",
-]
-
 [[package]]
 name = "pin-project"
 version = "1.0.8"
@@ -1219,57 +1227,6 @@ dependencies = [
  "thiserror",
 ]
 
-[[package]]
-name = "prost"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020"
-dependencies = [
- "bytes",
- "prost-derive",
-]
-
-[[package]]
-name = "prost-build"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603"
-dependencies = [
- "bytes",
- "heck",
- "itertools",
- "log",
- "multimap",
- "petgraph",
- "prost",
- "prost-types",
- "tempfile",
- "which",
-]
-
-[[package]]
-name = "prost-derive"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba"
-dependencies = [
- "anyhow",
- "itertools",
- "proc-macro2",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "prost-types"
-version = "0.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b"
-dependencies = [
- "bytes",
- "prost",
-]
-
 [[package]]
 name = "protobuf"
 version = "2.25.1"
@@ -1423,13 +1380,15 @@ dependencies = [
 ]
 
 [[package]]
-name = "rest-ratelimiter"
+name = "rest"
 version = "0.1.0"
 dependencies = [
- "prost",
+ "common",
+ "futures-util",
+ "hyper",
+ "hyper-tls",
+ "serde 1.0.130",
  "tokio",
- "tonic",
- "tonic-build",
 ]
 
 [[package]]
@@ -1756,6 +1715,21 @@ dependencies = [
  "winapi-util",
 ]
 
+[[package]]
+name = "testcontainers"
+version = "0.12.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d5e3ed6e3598dbf32cba8cb356b881c085e0adea57597f387723430dd94b4084"
+dependencies = [
+ "hex",
+ "hmac",
+ "log",
+ "rand 0.8.4",
+ "serde 1.0.130",
+ "serde_json",
+ "sha2",
+]
+
 [[package]]
 name = "thiserror"
 version = "1.0.29"
@@ -1822,16 +1796,6 @@ dependencies = [
  "winapi",
 ]
 
-[[package]]
-name = "tokio-io-timeout"
-version = "1.1.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "90c49f106be240de154571dd31fbe48acb10ba6c6dd6f6517ad603abffa42de9"
-dependencies = [
- "pin-project-lite",
- "tokio",
-]
-
 [[package]]
 name = "tokio-macros"
 version = "1.3.0"
@@ -1844,25 +1808,24 @@ dependencies = [
 ]
 
 [[package]]
-name = "tokio-rustls"
-version = "0.22.0"
+name = "tokio-native-tls"
+version = "0.3.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6"
+checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b"
 dependencies = [
- "rustls",
+ "native-tls",
  "tokio",
- "webpki",
 ]
 
 [[package]]
-name = "tokio-stream"
-version = "0.1.7"
+name = "tokio-rustls"
+version = "0.22.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f"
+checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6"
 dependencies = [
- "futures-core",
- "pin-project-lite",
+ "rustls",
  "tokio",
+ "webpki",
 ]
 
 [[package]]
@@ -1905,75 +1868,6 @@ dependencies = [
  "serde 1.0.130",
 ]
 
-[[package]]
-name = "tonic"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "796c5e1cd49905e65dd8e700d4cb1dffcbfdb4fc9d017de08c1a537afd83627c"
-dependencies = [
- "async-stream",
- "async-trait",
- "base64",
- "bytes",
- "futures-core",
- "futures-util",
- "h2",
- "http",
- "http-body",
- "hyper",
- "hyper-timeout",
- "percent-encoding",
- "pin-project",
- "prost",
- "prost-derive",
- "tokio",
- "tokio-stream",
- "tokio-util",
- "tower",
- "tower-layer",
- "tower-service",
- "tracing",
- "tracing-futures",
-]
-
-[[package]]
-name = "tonic-build"
-version = "0.5.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "12b52d07035516c2b74337d2ac7746075e7dcae7643816c1b12c5ff8a7484c08"
-dependencies = [
- "proc-macro2",
- "prost-build",
- "quote",
- "syn",
-]
-
-[[package]]
-name = "tower"
-version = "0.4.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f60422bc7fefa2f3ec70359b8ff1caff59d785877eb70595904605bcc412470f"
-dependencies = [
- "futures-core",
- "futures-util",
- "indexmap",
- "pin-project",
- "rand 0.8.4",
- "slab",
- "tokio",
- "tokio-stream",
- "tokio-util",
- "tower-layer",
- "tower-service",
- "tracing",
-]
-
-[[package]]
-name = "tower-layer"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62"
-
 [[package]]
 name = "tower-service"
 version = "0.3.1"
@@ -1987,23 +1881,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d"
 dependencies = [
  "cfg-if",
- "log",
  "pin-project-lite",
- "tracing-attributes",
  "tracing-core",
 ]
 
-[[package]]
-name = "tracing-attributes"
-version = "0.1.15"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2"
-dependencies = [
- "proc-macro2",
- "quote",
- "syn",
-]
-
 [[package]]
 name = "tracing-core"
 version = "0.1.19"
@@ -2013,16 +1894,6 @@ dependencies = [
  "lazy_static",
 ]
 
-[[package]]
-name = "tracing-futures"
-version = "0.2.5"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2"
-dependencies = [
- "pin-project",
- "tracing",
-]
-
 [[package]]
 name = "try-lock"
 version = "0.2.3"
@@ -2072,12 +1943,6 @@ dependencies = [
  "tinyvec",
 ]
 
-[[package]]
-name = "unicode-segmentation"
-version = "1.8.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b"
-
 [[package]]
 name = "unicode-xid"
 version = "0.2.2"
@@ -2108,6 +1973,12 @@ version = "0.7.6"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
 
+[[package]]
+name = "vcpkg"
+version = "0.2.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
+
 [[package]]
 name = "version_check"
 version = "0.9.3"
@@ -2222,12 +2093,10 @@ name = "webhook"
 version = "0.1.0"
 dependencies = [
  "common",
- "config",
  "hex",
  "hyper",
+ "libc",
  "libsodium-sys",
- "log",
- "nats",
  "serde 1.0.130",
  "serde_json",
  "tokio",
@@ -2252,17 +2121,6 @@ dependencies = [
  "webpki",
 ]
 
-[[package]]
-name = "which"
-version = "4.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9"
-dependencies = [
- "either",
- "lazy_static",
- "libc",
-]
-
 [[package]]
 name = "winapi"
 version = "0.3.9"
index 8bee6e488f43da1d14a2cb08088a16fa44d98759..87ebe395785134449f027c6efc82cfb0bf91eaff 100644 (file)
@@ -2,10 +2,10 @@
 \r
 members = [\r
     "webhook",\r
-    "ratelimiter",\r
     "gateway",\r
     "cache",\r
-    "common/rust"\r
+    "common/rust",\r
+    "rest"\r
 ]\r
 \r
 [package]\r
@@ -50,4 +50,8 @@ buildrs_additional_environment_variables = { PATH = "/usr/sbin:/usr/bin:/sbin:/b
 compile_data_attr = "glob([\"*/**\"])"\r
 additional_build_file = "bazel/patch/BUILD_script_patch"\r
 gen_buildrs = false\r
-additional_deps = [":libsodium_sys_build_script"]
\ No newline at end of file
+additional_deps = [":libsodium_sys_build_script"]\r
+\r
+\r
+[package.metadata.raze.crates.value-bag.'*']\r
+gen_buildrs = false
\ No newline at end of file
index 663502f343b3eebe5e3207b75e803403b9ed0926..d938a866ab43d287ec171a4e39cab73f4b5cdb94 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,3 @@
 .PHONY: gazelle
 gazelle:
        bazel run //:gazelle -- update-repos -build_file_name BUILD.bazel -from_file=go.mod -to_macro=deps.bzl%go_dependencies
-
-.PHONY: docs
-docs:
index bdc8b177a352095270c9921cbc9033c860badd07..d4aab8c26d099739444c37dd9475bc54060e01a2 100644 (file)
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -1,6 +1,4 @@
 workspace(name = "nova")
-
-#@unused
 load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
 
 http_archive(
index 6bfcdb65f9584d5a9e43a0ae6a635d59d07fc8d3..2d934cc4a792c7d482b6ab365158a87ef0938625 100644 (file)
@@ -12,12 +12,10 @@ load("@bazel_tools//tools/build_defs/repo:utils.bzl", "maybe")  # buildifier: di
 # EXPERIMENTAL -- MAY CHANGE AT ANY TIME: A mapping of package names to a set of normal dependencies for the Rust targets of that package.
 _DEPENDENCIES = {
     "webhook": {
-        "config": "@raze__config__0_11_0//:config",
         "hex": "@raze__hex__0_4_3//:hex",
         "hyper": "@raze__hyper__0_14_12//:hyper",
+        "libc": "@raze__libc__0_2_101//:libc",
         "libsodium-sys": "@raze__libsodium_sys__0_2_7//:libsodium_sys",
-        "log": "@raze__log__0_4_14//:log",
-        "nats": "@raze__nats__0_15_2//:nats",
         "serde": "@raze__serde__1_0_130//:serde",
         "serde_json": "@raze__serde_json__1_0_67//:serde_json",
         "tokio": "@raze__tokio__1_11_0//:tokio",
@@ -30,18 +28,13 @@ _DEPENDENCIES = {
         "pretty_env_logger": "@raze__pretty_env_logger__0_4_0//:pretty_env_logger",
         "prometheus": "@raze__prometheus__0_12_0//:prometheus",
         "serde": "@raze__serde__1_0_130//:serde",
+        "testcontainers": "@raze__testcontainers__0_12_0//:testcontainers",
         "tokio": "@raze__tokio__1_11_0//:tokio",
     },
-    "ratelimiter": {
-        "prost": "@raze__prost__0_8_0//:prost",
-        "tokio": "@raze__tokio__1_11_0//:tokio",
-        "tonic": "@raze__tonic__0_5_2//:tonic",
-    },
     "gateway": {
         "enumflags2": "@raze__enumflags2__0_7_1//:enumflags2",
         "futures": "@raze__futures__0_3_17//:futures",
         "futures-util": "@raze__futures_util__0_3_17//:futures_util",
-        "log": "@raze__log__0_4_14//:log",
         "num": "@raze__num__0_4_0//:num",
         "num-traits": "@raze__num_traits__0_2_14//:num_traits",
         "serde": "@raze__serde__1_0_130//:serde",
@@ -57,6 +50,13 @@ _DEPENDENCIES = {
         "serde": "@raze__serde__1_0_130//:serde",
         "serde_json": "@raze__serde_json__1_0_67//:serde_json",
     },
+    "rest": {
+        "futures-util": "@raze__futures_util__0_3_17//:futures_util",
+        "hyper": "@raze__hyper__0_14_12//:hyper",
+        "hyper-tls": "@raze__hyper_tls__0_5_0//:hyper_tls",
+        "serde": "@raze__serde__1_0_130//:serde",
+        "tokio": "@raze__tokio__1_11_0//:tokio",
+    },
     "": {
         "libc": "@raze__libc__0_2_101//:libc",
     },
@@ -68,14 +68,14 @@ _PROC_MACRO_DEPENDENCIES = {
     },
     "common/rust": {
     },
-    "ratelimiter": {
-    },
     "gateway": {
         "num-derive": "@raze__num_derive__0_3_3//:num_derive",
         "serde_repr": "@raze__serde_repr__0_1_7//:serde_repr",
     },
     "cache": {
     },
+    "rest": {
+    },
     "": {
     },
 }
@@ -86,13 +86,12 @@ _DEV_DEPENDENCIES = {
     },
     "common/rust": {
     },
-    "ratelimiter": {
-        "tonic-build": "@raze__tonic_build__0_5_2//:tonic_build",
-    },
     "gateway": {
     },
     "cache": {
     },
+    "rest": {
+    },
     "": {
     },
 }
@@ -103,12 +102,12 @@ _DEV_PROC_MACRO_DEPENDENCIES = {
     },
     "common/rust": {
     },
-    "ratelimiter": {
-    },
     "gateway": {
     },
     "cache": {
     },
+    "rest": {
+    },
     "": {
     },
 }
@@ -258,16 +257,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.aho-corasick-0.7.18.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__anyhow__1_0_43",
-        url = "https://crates.io/api/v1/crates/anyhow/1.0.43/download",
-        type = "tar.gz",
-        sha256 = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf",
-        strip_prefix = "anyhow-1.0.43",
-        build_file = Label("//cargo/remote:BUILD.anyhow-1.0.43.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__arrayvec__0_5_2",
@@ -288,26 +277,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.async-channel-1.6.1.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__async_stream__0_3_2",
-        url = "https://crates.io/api/v1/crates/async-stream/0.3.2/download",
-        type = "tar.gz",
-        sha256 = "171374e7e3b2504e0e5236e3b59260560f9fe94bfe9ac39ba5e4e929c5590625",
-        strip_prefix = "async-stream-0.3.2",
-        build_file = Label("//cargo/remote:BUILD.async-stream-0.3.2.bazel"),
-    )
-
-    maybe(
-        http_archive,
-        name = "raze__async_stream_impl__0_3_2",
-        url = "https://crates.io/api/v1/crates/async-stream-impl/0.3.2/download",
-        type = "tar.gz",
-        sha256 = "648ed8c8d2ce5409ccd57453d9d1b214b342a0d69376a6feda1fd6cae3299308",
-        strip_prefix = "async-stream-impl-0.3.2",
-        build_file = Label("//cargo/remote:BUILD.async-stream-impl-0.3.2.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__async_task__4_0_3",
@@ -558,6 +527,16 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.crossbeam-utils-0.8.5.bazel"),
     )
 
+    maybe(
+        http_archive,
+        name = "raze__crypto_mac__0_10_1",
+        url = "https://crates.io/api/v1/crates/crypto-mac/0.10.1/download",
+        type = "tar.gz",
+        sha256 = "bff07008ec701e8028e2ceb8f83f0e4274ee62bd2dbdc4fefff2e9a91824081a",
+        strip_prefix = "crypto-mac-0.10.1",
+        build_file = Label("//cargo/remote:BUILD.crypto-mac-0.10.1.bazel"),
+    )
+
     maybe(
         http_archive,
         name = "raze__curve25519_dalek__3_2_0",
@@ -618,16 +597,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.ed25519-dalek-1.0.1.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__either__1_6_1",
-        url = "https://crates.io/api/v1/crates/either/1.6.1/download",
-        type = "tar.gz",
-        sha256 = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457",
-        strip_prefix = "either-1.6.1",
-        build_file = Label("//cargo/remote:BUILD.either-1.6.1.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__enumflags2__0_7_1",
@@ -678,16 +647,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.fastrand-1.5.0.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__fixedbitset__0_2_0",
-        url = "https://crates.io/api/v1/crates/fixedbitset/0.2.0/download",
-        type = "tar.gz",
-        sha256 = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d",
-        strip_prefix = "fixedbitset-0.2.0",
-        build_file = Label("//cargo/remote:BUILD.fixedbitset-0.2.0.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__fnv__1_0_7",
@@ -698,6 +657,26 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.fnv-1.0.7.bazel"),
     )
 
+    maybe(
+        http_archive,
+        name = "raze__foreign_types__0_3_2",
+        url = "https://crates.io/api/v1/crates/foreign-types/0.3.2/download",
+        type = "tar.gz",
+        sha256 = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1",
+        strip_prefix = "foreign-types-0.3.2",
+        build_file = Label("//cargo/remote:BUILD.foreign-types-0.3.2.bazel"),
+    )
+
+    maybe(
+        http_archive,
+        name = "raze__foreign_types_shared__0_1_1",
+        url = "https://crates.io/api/v1/crates/foreign-types-shared/0.1.1/download",
+        type = "tar.gz",
+        sha256 = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b",
+        strip_prefix = "foreign-types-shared-0.1.1",
+        build_file = Label("//cargo/remote:BUILD.foreign-types-shared-0.1.1.bazel"),
+    )
+
     maybe(
         http_archive,
         name = "raze__form_urlencoded__1_0_1",
@@ -858,16 +837,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.hashbrown-0.11.2.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__heck__0_3_3",
-        url = "https://crates.io/api/v1/crates/heck/0.3.3/download",
-        type = "tar.gz",
-        sha256 = "6d621efb26863f0e9924c6ac577e8275e5e6b77455db64ffa6c65c904e9e132c",
-        strip_prefix = "heck-0.3.3",
-        build_file = Label("//cargo/remote:BUILD.heck-0.3.3.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__hermit_abi__0_1_19",
@@ -888,6 +857,16 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.hex-0.4.3.bazel"),
     )
 
+    maybe(
+        http_archive,
+        name = "raze__hmac__0_10_1",
+        url = "https://crates.io/api/v1/crates/hmac/0.10.1/download",
+        type = "tar.gz",
+        sha256 = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15",
+        strip_prefix = "hmac-0.10.1",
+        build_file = Label("//cargo/remote:BUILD.hmac-0.10.1.bazel"),
+    )
+
     maybe(
         http_archive,
         name = "raze__http__0_2_4",
@@ -950,12 +929,12 @@ def raze_fetch_remote_crates():
 
     maybe(
         http_archive,
-        name = "raze__hyper_timeout__0_4_1",
-        url = "https://crates.io/api/v1/crates/hyper-timeout/0.4.1/download",
+        name = "raze__hyper_tls__0_5_0",
+        url = "https://crates.io/api/v1/crates/hyper-tls/0.5.0/download",
         type = "tar.gz",
-        sha256 = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1",
-        strip_prefix = "hyper-timeout-0.4.1",
-        build_file = Label("//cargo/remote:BUILD.hyper-timeout-0.4.1.bazel"),
+        sha256 = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905",
+        strip_prefix = "hyper-tls-0.5.0",
+        build_file = Label("//cargo/remote:BUILD.hyper-tls-0.5.0.bazel"),
     )
 
     maybe(
@@ -988,16 +967,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.instant-0.1.10.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__itertools__0_10_1",
-        url = "https://crates.io/api/v1/crates/itertools/0.10.1/download",
-        type = "tar.gz",
-        sha256 = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf",
-        strip_prefix = "itertools-0.10.1",
-        build_file = Label("//cargo/remote:BUILD.itertools-0.10.1.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__itoa__0_4_8",
@@ -1140,12 +1109,12 @@ def raze_fetch_remote_crates():
 
     maybe(
         http_archive,
-        name = "raze__multimap__0_8_3",
-        url = "https://crates.io/api/v1/crates/multimap/0.8.3/download",
+        name = "raze__native_tls__0_2_8",
+        url = "https://crates.io/api/v1/crates/native-tls/0.2.8/download",
         type = "tar.gz",
-        sha256 = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a",
-        strip_prefix = "multimap-0.8.3",
-        build_file = Label("//cargo/remote:BUILD.multimap-0.8.3.bazel"),
+        sha256 = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d",
+        strip_prefix = "native-tls-0.2.8",
+        build_file = Label("//cargo/remote:BUILD.native-tls-0.2.8.bazel"),
     )
 
     maybe(
@@ -1318,6 +1287,16 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.opaque-debug-0.3.0.bazel"),
     )
 
+    maybe(
+        http_archive,
+        name = "raze__openssl__0_10_36",
+        url = "https://crates.io/api/v1/crates/openssl/0.10.36/download",
+        type = "tar.gz",
+        sha256 = "8d9facdb76fec0b73c406f125d44d86fdad818d66fef0531eec9233ca425ff4a",
+        strip_prefix = "openssl-0.10.36",
+        build_file = Label("//cargo/remote:BUILD.openssl-0.10.36.bazel"),
+    )
+
     maybe(
         http_archive,
         name = "raze__openssl_probe__0_1_4",
@@ -1328,6 +1307,16 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.openssl-probe-0.1.4.bazel"),
     )
 
+    maybe(
+        http_archive,
+        name = "raze__openssl_sys__0_9_67",
+        url = "https://crates.io/api/v1/crates/openssl-sys/0.9.67/download",
+        type = "tar.gz",
+        sha256 = "69df2d8dfc6ce3aaf44b40dec6f487d5a886516cf6879c49e98e0710f310a058",
+        strip_prefix = "openssl-sys-0.9.67",
+        build_file = Label("//cargo/remote:BUILD.openssl-sys-0.9.67.bazel"),
+    )
+
     maybe(
         http_archive,
         name = "raze__parking__2_0_0",
@@ -1368,16 +1357,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.percent-encoding-2.1.0.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__petgraph__0_5_1",
-        url = "https://crates.io/api/v1/crates/petgraph/0.5.1/download",
-        type = "tar.gz",
-        sha256 = "467d164a6de56270bd7c4d070df81d07beace25012d5103ced4e9ff08d6afdb7",
-        strip_prefix = "petgraph-0.5.1",
-        build_file = Label("//cargo/remote:BUILD.petgraph-0.5.1.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__pin_project__1_0_8",
@@ -1488,46 +1467,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.prometheus-0.12.0.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__prost__0_8_0",
-        url = "https://crates.io/api/v1/crates/prost/0.8.0/download",
-        type = "tar.gz",
-        sha256 = "de5e2533f59d08fcf364fd374ebda0692a70bd6d7e66ef97f306f45c6c5d8020",
-        strip_prefix = "prost-0.8.0",
-        build_file = Label("//cargo/remote:BUILD.prost-0.8.0.bazel"),
-    )
-
-    maybe(
-        http_archive,
-        name = "raze__prost_build__0_8_0",
-        url = "https://crates.io/api/v1/crates/prost-build/0.8.0/download",
-        type = "tar.gz",
-        sha256 = "355f634b43cdd80724ee7848f95770e7e70eefa6dcf14fea676216573b8fd603",
-        strip_prefix = "prost-build-0.8.0",
-        build_file = Label("//cargo/remote:BUILD.prost-build-0.8.0.bazel"),
-    )
-
-    maybe(
-        http_archive,
-        name = "raze__prost_derive__0_8_0",
-        url = "https://crates.io/api/v1/crates/prost-derive/0.8.0/download",
-        type = "tar.gz",
-        sha256 = "600d2f334aa05acb02a755e217ef1ab6dea4d51b58b7846588b747edec04efba",
-        strip_prefix = "prost-derive-0.8.0",
-        build_file = Label("//cargo/remote:BUILD.prost-derive-0.8.0.bazel"),
-    )
-
-    maybe(
-        http_archive,
-        name = "raze__prost_types__0_8_0",
-        url = "https://crates.io/api/v1/crates/prost-types/0.8.0/download",
-        type = "tar.gz",
-        sha256 = "603bbd6394701d13f3f25aada59c7de9d35a6a5887cfc156181234a44002771b",
-        strip_prefix = "prost-types-0.8.0",
-        build_file = Label("//cargo/remote:BUILD.prost-types-0.8.0.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__protobuf__2_25_1",
@@ -2028,6 +1967,16 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.termcolor-1.1.2.bazel"),
     )
 
+    maybe(
+        http_archive,
+        name = "raze__testcontainers__0_12_0",
+        url = "https://crates.io/api/v1/crates/testcontainers/0.12.0/download",
+        type = "tar.gz",
+        sha256 = "d5e3ed6e3598dbf32cba8cb356b881c085e0adea57597f387723430dd94b4084",
+        strip_prefix = "testcontainers-0.12.0",
+        build_file = Label("//cargo/remote:BUILD.testcontainers-0.12.0.bazel"),
+    )
+
     maybe(
         http_archive,
         name = "raze__thiserror__1_0_29",
@@ -2088,16 +2037,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.tokio-1.11.0.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__tokio_io_timeout__1_1_1",
-        url = "https://crates.io/api/v1/crates/tokio-io-timeout/1.1.1/download",
-        type = "tar.gz",
-        sha256 = "90c49f106be240de154571dd31fbe48acb10ba6c6dd6f6517ad603abffa42de9",
-        strip_prefix = "tokio-io-timeout-1.1.1",
-        build_file = Label("//cargo/remote:BUILD.tokio-io-timeout-1.1.1.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__tokio_macros__1_3_0",
@@ -2110,22 +2049,22 @@ def raze_fetch_remote_crates():
 
     maybe(
         http_archive,
-        name = "raze__tokio_rustls__0_22_0",
-        url = "https://crates.io/api/v1/crates/tokio-rustls/0.22.0/download",
+        name = "raze__tokio_native_tls__0_3_0",
+        url = "https://crates.io/api/v1/crates/tokio-native-tls/0.3.0/download",
         type = "tar.gz",
-        sha256 = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6",
-        strip_prefix = "tokio-rustls-0.22.0",
-        build_file = Label("//cargo/remote:BUILD.tokio-rustls-0.22.0.bazel"),
+        sha256 = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b",
+        strip_prefix = "tokio-native-tls-0.3.0",
+        build_file = Label("//cargo/remote:BUILD.tokio-native-tls-0.3.0.bazel"),
     )
 
     maybe(
         http_archive,
-        name = "raze__tokio_stream__0_1_7",
-        url = "https://crates.io/api/v1/crates/tokio-stream/0.1.7/download",
+        name = "raze__tokio_rustls__0_22_0",
+        url = "https://crates.io/api/v1/crates/tokio-rustls/0.22.0/download",
         type = "tar.gz",
-        sha256 = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f",
-        strip_prefix = "tokio-stream-0.1.7",
-        build_file = Label("//cargo/remote:BUILD.tokio-stream-0.1.7.bazel"),
+        sha256 = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6",
+        strip_prefix = "tokio-rustls-0.22.0",
+        build_file = Label("//cargo/remote:BUILD.tokio-rustls-0.22.0.bazel"),
     )
 
     maybe(
@@ -2158,46 +2097,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.toml-0.5.8.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__tonic__0_5_2",
-        url = "https://crates.io/api/v1/crates/tonic/0.5.2/download",
-        type = "tar.gz",
-        sha256 = "796c5e1cd49905e65dd8e700d4cb1dffcbfdb4fc9d017de08c1a537afd83627c",
-        strip_prefix = "tonic-0.5.2",
-        build_file = Label("//cargo/remote:BUILD.tonic-0.5.2.bazel"),
-    )
-
-    maybe(
-        http_archive,
-        name = "raze__tonic_build__0_5_2",
-        url = "https://crates.io/api/v1/crates/tonic-build/0.5.2/download",
-        type = "tar.gz",
-        sha256 = "12b52d07035516c2b74337d2ac7746075e7dcae7643816c1b12c5ff8a7484c08",
-        strip_prefix = "tonic-build-0.5.2",
-        build_file = Label("//cargo/remote:BUILD.tonic-build-0.5.2.bazel"),
-    )
-
-    maybe(
-        http_archive,
-        name = "raze__tower__0_4_8",
-        url = "https://crates.io/api/v1/crates/tower/0.4.8/download",
-        type = "tar.gz",
-        sha256 = "f60422bc7fefa2f3ec70359b8ff1caff59d785877eb70595904605bcc412470f",
-        strip_prefix = "tower-0.4.8",
-        build_file = Label("//cargo/remote:BUILD.tower-0.4.8.bazel"),
-    )
-
-    maybe(
-        http_archive,
-        name = "raze__tower_layer__0_3_1",
-        url = "https://crates.io/api/v1/crates/tower-layer/0.3.1/download",
-        type = "tar.gz",
-        sha256 = "343bc9466d3fe6b0f960ef45960509f84480bf4fd96f92901afe7ff3df9d3a62",
-        strip_prefix = "tower-layer-0.3.1",
-        build_file = Label("//cargo/remote:BUILD.tower-layer-0.3.1.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__tower_service__0_3_1",
@@ -2218,16 +2117,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.tracing-0.1.26.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__tracing_attributes__0_1_15",
-        url = "https://crates.io/api/v1/crates/tracing-attributes/0.1.15/download",
-        type = "tar.gz",
-        sha256 = "c42e6fa53307c8a17e4ccd4dc81cf5ec38db9209f59b222210375b54ee40d1e2",
-        strip_prefix = "tracing-attributes-0.1.15",
-        build_file = Label("//cargo/remote:BUILD.tracing-attributes-0.1.15.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__tracing_core__0_1_19",
@@ -2238,16 +2127,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.tracing-core-0.1.19.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__tracing_futures__0_2_5",
-        url = "https://crates.io/api/v1/crates/tracing-futures/0.2.5/download",
-        type = "tar.gz",
-        sha256 = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2",
-        strip_prefix = "tracing-futures-0.2.5",
-        build_file = Label("//cargo/remote:BUILD.tracing-futures-0.2.5.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__try_lock__0_2_3",
@@ -2298,16 +2177,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.unicode-normalization-0.1.19.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__unicode_segmentation__1_8_0",
-        url = "https://crates.io/api/v1/crates/unicode-segmentation/1.8.0/download",
-        type = "tar.gz",
-        sha256 = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b",
-        strip_prefix = "unicode-segmentation-1.8.0",
-        build_file = Label("//cargo/remote:BUILD.unicode-segmentation-1.8.0.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__unicode_xid__0_2_2",
@@ -2348,6 +2217,16 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.utf-8-0.7.6.bazel"),
     )
 
+    maybe(
+        http_archive,
+        name = "raze__vcpkg__0_2_15",
+        url = "https://crates.io/api/v1/crates/vcpkg/0.2.15/download",
+        type = "tar.gz",
+        sha256 = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426",
+        strip_prefix = "vcpkg-0.2.15",
+        build_file = Label("//cargo/remote:BUILD.vcpkg-0.2.15.bazel"),
+    )
+
     maybe(
         http_archive,
         name = "raze__version_check__0_9_3",
@@ -2488,16 +2367,6 @@ def raze_fetch_remote_crates():
         build_file = Label("//cargo/remote:BUILD.webpki-roots-0.21.1.bazel"),
     )
 
-    maybe(
-        http_archive,
-        name = "raze__which__4_2_2",
-        url = "https://crates.io/api/v1/crates/which/4.2.2/download",
-        type = "tar.gz",
-        sha256 = "ea187a8ef279bc014ec368c27a920da2024d2a711109bfbe3440585d5cf27ad9",
-        strip_prefix = "which-4.2.2",
-        build_file = Label("//cargo/remote:BUILD.which-4.2.2.bazel"),
-    )
-
     maybe(
         http_archive,
         name = "raze__winapi__0_3_9",
diff --git a/cargo/remote/BUILD.anyhow-1.0.43.bazel b/cargo/remote/BUILD.anyhow-1.0.43.bazel
deleted file mode 100644 (file)
index 65e94d6..0000000
+++ /dev/null
@@ -1,113 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT OR Apache-2.0"
-])
-
-# Generated Targets
-# buildifier: disable=out-of-order-load
-# buildifier: disable=load-on-top
-load(
-    "@rules_rust//cargo:cargo_build_script.bzl",
-    "cargo_build_script",
-)
-
-cargo_build_script(
-    name = "anyhow_build_script",
-    srcs = glob(["**/*.rs"]),
-    build_script_env = {
-    },
-    crate_features = [
-        "default",
-        "std",
-    ],
-    crate_root = "build.rs",
-    data = glob(["**"]),
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "1.0.43",
-    visibility = ["//visibility:private"],
-    deps = [
-    ],
-)
-
-rust_library(
-    name = "anyhow",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-        "default",
-        "std",
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "1.0.43",
-    # buildifier: leave-alone
-    deps = [
-        ":anyhow_build_script",
-    ],
-)
-
-# Unsupported target "compiletest" with type "test" omitted
-
-# Unsupported target "test_autotrait" with type "test" omitted
-
-# Unsupported target "test_backtrace" with type "test" omitted
-
-# Unsupported target "test_boxed" with type "test" omitted
-
-# Unsupported target "test_chain" with type "test" omitted
-
-# Unsupported target "test_context" with type "test" omitted
-
-# Unsupported target "test_convert" with type "test" omitted
-
-# Unsupported target "test_downcast" with type "test" omitted
-
-# Unsupported target "test_ffi" with type "test" omitted
-
-# Unsupported target "test_fmt" with type "test" omitted
-
-# Unsupported target "test_macros" with type "test" omitted
-
-# Unsupported target "test_repr" with type "test" omitted
-
-# Unsupported target "test_source" with type "test" omitted
diff --git a/cargo/remote/BUILD.async-stream-0.3.2.bazel b/cargo/remote/BUILD.async-stream-0.3.2.bazel
deleted file mode 100644 (file)
index bfffc1a..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT"
-])
-
-# Generated Targets
-
-# Unsupported target "tcp_accept" with type "example" omitted
-
-rust_library(
-    name = "async_stream",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    proc_macro_deps = [
-        "@raze__async_stream_impl__0_3_2//:async_stream_impl",
-    ],
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.3.2",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__futures_core__0_3_17//:futures_core",
-    ],
-)
-
-# Unsupported target "for_await" with type "test" omitted
-
-# Unsupported target "stream" with type "test" omitted
-
-# Unsupported target "try_stream" with type "test" omitted
diff --git a/cargo/remote/BUILD.async-stream-impl-0.3.2.bazel b/cargo/remote/BUILD.async-stream-impl-0.3.2.bazel
deleted file mode 100644 (file)
index 1db7cf6..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "async_stream_impl",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "proc-macro",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.3.2",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__proc_macro2__1_0_29//:proc_macro2",
-        "@raze__quote__1_0_9//:quote",
-        "@raze__syn__1_0_76//:syn",
-    ],
-)
diff --git a/cargo/remote/BUILD.crypto-mac-0.10.1.bazel b/cargo/remote/BUILD.crypto-mac-0.10.1.bazel
new file mode 100644 (file)
index 0000000..5d4c629
--- /dev/null
@@ -0,0 +1,55 @@
+"""
+@generated
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+
+# buildifier: disable=load
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+# buildifier: disable=load
+load(
+    "@rules_rust//rust:rust.bzl",
+    "rust_binary",
+    "rust_library",
+    "rust_test",
+)
+
+package(default_visibility = [
+    # Public for visibility by "@raze__crate__version//" targets.
+    #
+    # Prefer access through "//cargo", which limits external
+    # visibility to explicit Cargo.toml dependencies.
+    "//visibility:public",
+])
+
+licenses([
+    "notice",  # MIT from expression "MIT OR Apache-2.0"
+])
+
+# Generated Targets
+
+rust_library(
+    name = "crypto_mac",
+    srcs = glob(["**/*.rs"]),
+    crate_features = [
+    ],
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    data = [],
+    edition = "2018",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.10.1",
+    # buildifier: leave-alone
+    deps = [
+        "@raze__generic_array__0_14_4//:generic_array",
+        "@raze__subtle__2_4_1//:subtle",
+    ],
+)
diff --git a/cargo/remote/BUILD.either-1.6.1.bazel b/cargo/remote/BUILD.either-1.6.1.bazel
deleted file mode 100644 (file)
index 29a576b..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT OR Apache-2.0"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "either",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-        "default",
-        "use_std",
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2015",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "1.6.1",
-    # buildifier: leave-alone
-    deps = [
-    ],
-)
diff --git a/cargo/remote/BUILD.fixedbitset-0.2.0.bazel b/cargo/remote/BUILD.fixedbitset-0.2.0.bazel
deleted file mode 100644 (file)
index 260256f..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT OR Apache-2.0"
-])
-
-# Generated Targets
-
-# Unsupported target "benches" with type "bench" omitted
-
-rust_library(
-    name = "fixedbitset",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2015",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.2.0",
-    # buildifier: leave-alone
-    deps = [
-    ],
-)
diff --git a/cargo/remote/BUILD.foreign-types-0.3.2.bazel b/cargo/remote/BUILD.foreign-types-0.3.2.bazel
new file mode 100644 (file)
index 0000000..6ef7960
--- /dev/null
@@ -0,0 +1,54 @@
+"""
+@generated
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+
+# buildifier: disable=load
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+# buildifier: disable=load
+load(
+    "@rules_rust//rust:rust.bzl",
+    "rust_binary",
+    "rust_library",
+    "rust_test",
+)
+
+package(default_visibility = [
+    # Public for visibility by "@raze__crate__version//" targets.
+    #
+    # Prefer access through "//cargo", which limits external
+    # visibility to explicit Cargo.toml dependencies.
+    "//visibility:public",
+])
+
+licenses([
+    "notice",  # MIT from expression "MIT OR Apache-2.0"
+])
+
+# Generated Targets
+
+rust_library(
+    name = "foreign_types",
+    srcs = glob(["**/*.rs"]),
+    crate_features = [
+    ],
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    data = [],
+    edition = "2015",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.3.2",
+    # buildifier: leave-alone
+    deps = [
+        "@raze__foreign_types_shared__0_1_1//:foreign_types_shared",
+    ],
+)
diff --git a/cargo/remote/BUILD.foreign-types-shared-0.1.1.bazel b/cargo/remote/BUILD.foreign-types-shared-0.1.1.bazel
new file mode 100644 (file)
index 0000000..c003ce7
--- /dev/null
@@ -0,0 +1,53 @@
+"""
+@generated
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+
+# buildifier: disable=load
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+# buildifier: disable=load
+load(
+    "@rules_rust//rust:rust.bzl",
+    "rust_binary",
+    "rust_library",
+    "rust_test",
+)
+
+package(default_visibility = [
+    # Public for visibility by "@raze__crate__version//" targets.
+    #
+    # Prefer access through "//cargo", which limits external
+    # visibility to explicit Cargo.toml dependencies.
+    "//visibility:public",
+])
+
+licenses([
+    "notice",  # MIT from expression "MIT OR Apache-2.0"
+])
+
+# Generated Targets
+
+rust_library(
+    name = "foreign_types_shared",
+    srcs = glob(["**/*.rs"]),
+    crate_features = [
+    ],
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    data = [],
+    edition = "2015",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.1.1",
+    # buildifier: leave-alone
+    deps = [
+    ],
+)
diff --git a/cargo/remote/BUILD.heck-0.3.3.bazel b/cargo/remote/BUILD.heck-0.3.3.bazel
deleted file mode 100644 (file)
index 45ff7e4..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT OR Apache-2.0"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "heck",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.3.3",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__unicode_segmentation__1_8_0//:unicode_segmentation",
-    ],
-)
diff --git a/cargo/remote/BUILD.hmac-0.10.1.bazel b/cargo/remote/BUILD.hmac-0.10.1.bazel
new file mode 100644 (file)
index 0000000..e129998
--- /dev/null
@@ -0,0 +1,57 @@
+"""
+@generated
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+
+# buildifier: disable=load
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+# buildifier: disable=load
+load(
+    "@rules_rust//rust:rust.bzl",
+    "rust_binary",
+    "rust_library",
+    "rust_test",
+)
+
+package(default_visibility = [
+    # Public for visibility by "@raze__crate__version//" targets.
+    #
+    # Prefer access through "//cargo", which limits external
+    # visibility to explicit Cargo.toml dependencies.
+    "//visibility:public",
+])
+
+licenses([
+    "notice",  # MIT from expression "MIT OR Apache-2.0"
+])
+
+# Generated Targets
+
+rust_library(
+    name = "hmac",
+    srcs = glob(["**/*.rs"]),
+    crate_features = [
+    ],
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    data = [],
+    edition = "2018",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.10.1",
+    # buildifier: leave-alone
+    deps = [
+        "@raze__crypto_mac__0_10_1//:crypto_mac",
+        "@raze__digest__0_9_0//:digest",
+    ],
+)
+
+# Unsupported target "lib" with type "test" omitted
diff --git a/cargo/remote/BUILD.hyper-timeout-0.4.1.bazel b/cargo/remote/BUILD.hyper-timeout-0.4.1.bazel
deleted file mode 100644 (file)
index 9fc071f..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT OR Apache-2.0"
-])
-
-# Generated Targets
-
-# Unsupported target "client" with type "example" omitted
-
-rust_library(
-    name = "hyper_timeout",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.4.1",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__hyper__0_14_12//:hyper",
-        "@raze__pin_project_lite__0_2_7//:pin_project_lite",
-        "@raze__tokio__1_11_0//:tokio",
-        "@raze__tokio_io_timeout__1_1_1//:tokio_io_timeout",
-    ],
-)
diff --git a/cargo/remote/BUILD.hyper-tls-0.5.0.bazel b/cargo/remote/BUILD.hyper-tls-0.5.0.bazel
new file mode 100644 (file)
index 0000000..5cfb670
--- /dev/null
@@ -0,0 +1,60 @@
+"""
+@generated
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+
+# buildifier: disable=load
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+# buildifier: disable=load
+load(
+    "@rules_rust//rust:rust.bzl",
+    "rust_binary",
+    "rust_library",
+    "rust_test",
+)
+
+package(default_visibility = [
+    # Public for visibility by "@raze__crate__version//" targets.
+    #
+    # Prefer access through "//cargo", which limits external
+    # visibility to explicit Cargo.toml dependencies.
+    "//visibility:public",
+])
+
+licenses([
+    "notice",  # MIT from expression "MIT OR Apache-2.0"
+])
+
+# Generated Targets
+
+# Unsupported target "client" with type "example" omitted
+
+rust_library(
+    name = "hyper_tls",
+    srcs = glob(["**/*.rs"]),
+    crate_features = [
+    ],
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    data = [],
+    edition = "2018",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.5.0",
+    # buildifier: leave-alone
+    deps = [
+        "@raze__bytes__1_1_0//:bytes",
+        "@raze__hyper__0_14_12//:hyper",
+        "@raze__native_tls__0_2_8//:native_tls",
+        "@raze__tokio__1_11_0//:tokio",
+        "@raze__tokio_native_tls__0_3_0//:tokio_native_tls",
+    ],
+)
diff --git a/cargo/remote/BUILD.itertools-0.10.1.bazel b/cargo/remote/BUILD.itertools-0.10.1.bazel
deleted file mode 100644 (file)
index 4b5e5db..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT OR Apache-2.0"
-])
-
-# Generated Targets
-
-# Unsupported target "bench1" with type "bench" omitted
-
-# Unsupported target "combinations" with type "bench" omitted
-
-# Unsupported target "combinations_with_replacement" with type "bench" omitted
-
-# Unsupported target "fold_specialization" with type "bench" omitted
-
-# Unsupported target "powerset" with type "bench" omitted
-
-# Unsupported target "tree_fold1" with type "bench" omitted
-
-# Unsupported target "tuple_combinations" with type "bench" omitted
-
-# Unsupported target "tuples" with type "bench" omitted
-
-# Unsupported target "iris" with type "example" omitted
-
-rust_library(
-    name = "itertools",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-        "default",
-        "use_alloc",
-        "use_std",
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.10.1",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__either__1_6_1//:either",
-    ],
-)
-
-# Unsupported target "adaptors_no_collect" with type "test" omitted
-
-# Unsupported target "flatten_ok" with type "test" omitted
-
-# Unsupported target "fold_specialization" with type "test" omitted
-
-# Unsupported target "macros_hygiene" with type "test" omitted
-
-# Unsupported target "merge_join" with type "test" omitted
-
-# Unsupported target "peeking_take_while" with type "test" omitted
-
-# Unsupported target "quick" with type "test" omitted
-
-# Unsupported target "specializations" with type "test" omitted
-
-# Unsupported target "test_core" with type "test" omitted
-
-# Unsupported target "test_std" with type "test" omitted
-
-# Unsupported target "tuples" with type "test" omitted
-
-# Unsupported target "zip" with type "test" omitted
diff --git a/cargo/remote/BUILD.multimap-0.8.3.bazel b/cargo/remote/BUILD.multimap-0.8.3.bazel
deleted file mode 100644 (file)
index b720afa..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT OR Apache-2.0"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "multimap",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2015",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.8.3",
-    # buildifier: leave-alone
-    deps = [
-    ],
-)
diff --git a/cargo/remote/BUILD.native-tls-0.2.8.bazel b/cargo/remote/BUILD.native-tls-0.2.8.bazel
new file mode 100644 (file)
index 0000000..cf4a6a5
--- /dev/null
@@ -0,0 +1,177 @@
+"""
+@generated
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+
+# buildifier: disable=load
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+# buildifier: disable=load
+load(
+    "@rules_rust//rust:rust.bzl",
+    "rust_binary",
+    "rust_library",
+    "rust_test",
+)
+
+package(default_visibility = [
+    # Public for visibility by "@raze__crate__version//" targets.
+    #
+    # Prefer access through "//cargo", which limits external
+    # visibility to explicit Cargo.toml dependencies.
+    "//visibility:public",
+])
+
+licenses([
+    "notice",  # MIT from expression "MIT OR Apache-2.0"
+])
+
+# Generated Targets
+# buildifier: disable=out-of-order-load
+# buildifier: disable=load-on-top
+load(
+    "@rules_rust//cargo:cargo_build_script.bzl",
+    "cargo_build_script",
+)
+
+cargo_build_script(
+    name = "native_tls_build_script",
+    srcs = glob(["**/*.rs"]),
+    build_script_env = {
+    },
+    crate_features = [
+    ],
+    crate_root = "build.rs",
+    data = glob(["**"]),
+    edition = "2015",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.2.8",
+    visibility = ["//visibility:private"],
+    deps = [
+    ] + selects.with_or({
+        # cfg(any(target_os = "macos", target_os = "ios"))
+        (
+            "@rules_rust//rust/platform:aarch64-apple-darwin",
+            "@rules_rust//rust/platform:aarch64-apple-ios",
+            "@rules_rust//rust/platform:i686-apple-darwin",
+            "@rules_rust//rust/platform:x86_64-apple-darwin",
+            "@rules_rust//rust/platform:x86_64-apple-ios",
+        ): [
+            "@raze__security_framework_sys__2_4_2//:security_framework_sys",
+        ],
+        "//conditions:default": [],
+    }) + selects.with_or({
+        # cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))
+        (
+            "@rules_rust//rust/platform:aarch64-linux-android",
+            "@rules_rust//rust/platform:aarch64-unknown-linux-gnu",
+            "@rules_rust//rust/platform:arm-unknown-linux-gnueabi",
+            "@rules_rust//rust/platform:i686-linux-android",
+            "@rules_rust//rust/platform:i686-unknown-freebsd",
+            "@rules_rust//rust/platform:i686-unknown-linux-gnu",
+            "@rules_rust//rust/platform:powerpc-unknown-linux-gnu",
+            "@rules_rust//rust/platform:s390x-unknown-linux-gnu",
+            "@rules_rust//rust/platform:wasm32-unknown-unknown",
+            "@rules_rust//rust/platform:wasm32-wasi",
+            "@rules_rust//rust/platform:x86_64-linux-android",
+            "@rules_rust//rust/platform:x86_64-unknown-freebsd",
+            "@rules_rust//rust/platform:x86_64-unknown-linux-gnu",
+        ): [
+            "@raze__openssl_sys__0_9_67//:openssl_sys",
+        ],
+        "//conditions:default": [],
+    }) + selects.with_or({
+        # cfg(target_os = "windows")
+        (
+            "@rules_rust//rust/platform:i686-pc-windows-msvc",
+            "@rules_rust//rust/platform:x86_64-pc-windows-msvc",
+        ): [
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+# Unsupported target "google-connect" with type "example" omitted
+
+# Unsupported target "simple-server" with type "example" omitted
+
+rust_library(
+    name = "native_tls",
+    srcs = glob(["**/*.rs"]),
+    aliases = {
+    },
+    crate_features = [
+    ],
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    data = [],
+    edition = "2015",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.2.8",
+    # buildifier: leave-alone
+    deps = [
+        ":native_tls_build_script",
+    ] + selects.with_or({
+        # cfg(any(target_os = "macos", target_os = "ios"))
+        (
+            "@rules_rust//rust/platform:aarch64-apple-darwin",
+            "@rules_rust//rust/platform:aarch64-apple-ios",
+            "@rules_rust//rust/platform:i686-apple-darwin",
+            "@rules_rust//rust/platform:x86_64-apple-darwin",
+            "@rules_rust//rust/platform:x86_64-apple-ios",
+        ): [
+            "@raze__lazy_static__1_4_0//:lazy_static",
+            "@raze__libc__0_2_101//:libc",
+            "@raze__security_framework__2_4_2//:security_framework",
+            "@raze__security_framework_sys__2_4_2//:security_framework_sys",
+            "@raze__tempfile__3_2_0//:tempfile",
+        ],
+        "//conditions:default": [],
+    }) + selects.with_or({
+        # cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))
+        (
+            "@rules_rust//rust/platform:aarch64-linux-android",
+            "@rules_rust//rust/platform:aarch64-unknown-linux-gnu",
+            "@rules_rust//rust/platform:arm-unknown-linux-gnueabi",
+            "@rules_rust//rust/platform:i686-linux-android",
+            "@rules_rust//rust/platform:i686-unknown-freebsd",
+            "@rules_rust//rust/platform:i686-unknown-linux-gnu",
+            "@rules_rust//rust/platform:powerpc-unknown-linux-gnu",
+            "@rules_rust//rust/platform:s390x-unknown-linux-gnu",
+            "@rules_rust//rust/platform:wasm32-unknown-unknown",
+            "@rules_rust//rust/platform:wasm32-wasi",
+            "@rules_rust//rust/platform:x86_64-linux-android",
+            "@rules_rust//rust/platform:x86_64-unknown-freebsd",
+            "@rules_rust//rust/platform:x86_64-unknown-linux-gnu",
+        ): [
+            "@raze__log__0_4_14//:log",
+            "@raze__openssl__0_10_36//:openssl",
+            "@raze__openssl_probe__0_1_4//:openssl_probe",
+            "@raze__openssl_sys__0_9_67//:openssl_sys",
+        ],
+        "//conditions:default": [],
+    }) + selects.with_or({
+        # cfg(target_os = "windows")
+        (
+            "@rules_rust//rust/platform:i686-pc-windows-msvc",
+            "@rules_rust//rust/platform:x86_64-pc-windows-msvc",
+        ): [
+            "@raze__schannel__0_1_19//:schannel",
+        ],
+        "//conditions:default": [],
+    }),
+)
diff --git a/cargo/remote/BUILD.openssl-0.10.36.bazel b/cargo/remote/BUILD.openssl-0.10.36.bazel
new file mode 100644 (file)
index 0000000..e70a454
--- /dev/null
@@ -0,0 +1,95 @@
+"""
+@generated
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+
+# buildifier: disable=load
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+# buildifier: disable=load
+load(
+    "@rules_rust//rust:rust.bzl",
+    "rust_binary",
+    "rust_library",
+    "rust_test",
+)
+
+package(default_visibility = [
+    # Public for visibility by "@raze__crate__version//" targets.
+    #
+    # Prefer access through "//cargo", which limits external
+    # visibility to explicit Cargo.toml dependencies.
+    "//visibility:public",
+])
+
+licenses([
+    "notice",  # Apache-2.0 from expression "Apache-2.0"
+])
+
+# Generated Targets
+# buildifier: disable=out-of-order-load
+# buildifier: disable=load-on-top
+load(
+    "@rules_rust//cargo:cargo_build_script.bzl",
+    "cargo_build_script",
+)
+
+cargo_build_script(
+    name = "openssl_build_script",
+    srcs = glob(["**/*.rs"]),
+    build_script_env = {
+    },
+    crate_features = [
+    ],
+    crate_root = "build.rs",
+    data = glob(["**"]),
+    edition = "2018",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.10.36",
+    visibility = ["//visibility:private"],
+    deps = [
+        "@raze__openssl_sys__0_9_67//:openssl_sys",
+    ],
+)
+
+# Unsupported target "mk_certs" with type "example" omitted
+
+rust_library(
+    name = "openssl",
+    srcs = glob(["**/*.rs"]),
+    aliases = {
+        "@raze__openssl_sys__0_9_67//:openssl_sys": "ffi",
+    },
+    crate_features = [
+    ],
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    data = [],
+    edition = "2018",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.10.36",
+    # buildifier: leave-alone
+    deps = [
+        ":openssl_build_script",
+        "@raze__bitflags__1_3_2//:bitflags",
+        "@raze__cfg_if__1_0_0//:cfg_if",
+        "@raze__foreign_types__0_3_2//:foreign_types",
+        "@raze__libc__0_2_101//:libc",
+        "@raze__once_cell__1_8_0//:once_cell",
+        "@raze__openssl_sys__0_9_67//:openssl_sys",
+    ],
+)
diff --git a/cargo/remote/BUILD.openssl-sys-0.9.67.bazel b/cargo/remote/BUILD.openssl-sys-0.9.67.bazel
new file mode 100644 (file)
index 0000000..a97fdb8
--- /dev/null
@@ -0,0 +1,107 @@
+"""
+@generated
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+
+# buildifier: disable=load
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+# buildifier: disable=load
+load(
+    "@rules_rust//rust:rust.bzl",
+    "rust_binary",
+    "rust_library",
+    "rust_test",
+)
+
+package(default_visibility = [
+    # Public for visibility by "@raze__crate__version//" targets.
+    #
+    # Prefer access through "//cargo", which limits external
+    # visibility to explicit Cargo.toml dependencies.
+    "//visibility:public",
+])
+
+licenses([
+    "notice",  # MIT from expression "MIT"
+])
+
+# Generated Targets
+# buildifier: disable=out-of-order-load
+# buildifier: disable=load-on-top
+load(
+    "@rules_rust//cargo:cargo_build_script.bzl",
+    "cargo_build_script",
+)
+
+cargo_build_script(
+    name = "openssl_sys_build_script",
+    srcs = glob(["**/*.rs"]),
+    build_script_env = {
+    },
+    crate_features = [
+    ],
+    crate_root = "build/main.rs",
+    data = glob(["**"]),
+    edition = "2015",
+    links = "openssl",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.9.67",
+    visibility = ["//visibility:private"],
+    deps = [
+        "@raze__autocfg__1_0_1//:autocfg",
+        "@raze__cc__1_0_70//:cc",
+        "@raze__pkg_config__0_3_19//:pkg_config",
+    ] + selects.with_or({
+        # cfg(target_env = "msvc")
+        (
+            "@rules_rust//rust/platform:i686-pc-windows-msvc",
+            "@rules_rust//rust/platform:x86_64-pc-windows-msvc",
+        ): [
+            "@raze__vcpkg__0_2_15//:vcpkg",
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+rust_library(
+    name = "openssl_sys",
+    srcs = glob(["**/*.rs"]),
+    aliases = {
+    },
+    crate_features = [
+    ],
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    data = [],
+    edition = "2015",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.9.67",
+    # buildifier: leave-alone
+    deps = [
+        ":openssl_sys_build_script",
+        "@raze__libc__0_2_101//:libc",
+    ] + selects.with_or({
+        # cfg(target_env = "msvc")
+        (
+            "@rules_rust//rust/platform:i686-pc-windows-msvc",
+            "@rules_rust//rust/platform:x86_64-pc-windows-msvc",
+        ): [
+        ],
+        "//conditions:default": [],
+    }),
+)
diff --git a/cargo/remote/BUILD.petgraph-0.5.1.bazel b/cargo/remote/BUILD.petgraph-0.5.1.bazel
deleted file mode 100644 (file)
index 0be98f7..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT OR Apache-2.0"
-])
-
-# Generated Targets
-
-# Unsupported target "dijkstra" with type "bench" omitted
-
-# Unsupported target "iso" with type "bench" omitted
-
-# Unsupported target "matrix_graph" with type "bench" omitted
-
-# Unsupported target "ograph" with type "bench" omitted
-
-# Unsupported target "stable_graph" with type "bench" omitted
-
-# Unsupported target "unionfind" with type "bench" omitted
-
-rust_library(
-    name = "petgraph",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.5.1",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__fixedbitset__0_2_0//:fixedbitset",
-        "@raze__indexmap__1_7_0//:indexmap",
-    ],
-)
-
-# Unsupported target "graph" with type "test" omitted
-
-# Unsupported target "graphmap" with type "test" omitted
-
-# Unsupported target "iso" with type "test" omitted
-
-# Unsupported target "quickcheck" with type "test" omitted
-
-# Unsupported target "stable_graph" with type "test" omitted
-
-# Unsupported target "unionfind" with type "test" omitted
diff --git a/cargo/remote/BUILD.prost-0.8.0.bazel b/cargo/remote/BUILD.prost-0.8.0.bazel
deleted file mode 100644 (file)
index 6d99ea1..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # Apache-2.0 from expression "Apache-2.0"
-])
-
-# Generated Targets
-
-# Unsupported target "varint" with type "bench" omitted
-
-rust_library(
-    name = "prost",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-        "default",
-        "prost-derive",
-        "std",
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    proc_macro_deps = [
-        "@raze__prost_derive__0_8_0//:prost_derive",
-    ],
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.8.0",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__bytes__1_1_0//:bytes",
-    ],
-)
diff --git a/cargo/remote/BUILD.prost-build-0.8.0.bazel b/cargo/remote/BUILD.prost-build-0.8.0.bazel
deleted file mode 100644 (file)
index 998d95e..0000000
+++ /dev/null
@@ -1,93 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # Apache-2.0 from expression "Apache-2.0"
-])
-
-# Generated Targets
-# buildifier: disable=out-of-order-load
-# buildifier: disable=load-on-top
-load(
-    "@rules_rust//cargo:cargo_build_script.bzl",
-    "cargo_build_script",
-)
-
-cargo_build_script(
-    name = "prost_build_build_script",
-    srcs = glob(["**/*.rs"]),
-    build_script_env = {
-    },
-    crate_features = [
-    ],
-    crate_root = "build.rs",
-    data = glob(["**"]),
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.8.0",
-    visibility = ["//visibility:private"],
-    deps = [
-        "@raze__which__4_2_2//:which",
-    ],
-)
-
-rust_library(
-    name = "prost_build",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.8.0",
-    # buildifier: leave-alone
-    deps = [
-        ":prost_build_build_script",
-        "@raze__bytes__1_1_0//:bytes",
-        "@raze__heck__0_3_3//:heck",
-        "@raze__itertools__0_10_1//:itertools",
-        "@raze__log__0_4_14//:log",
-        "@raze__multimap__0_8_3//:multimap",
-        "@raze__petgraph__0_5_1//:petgraph",
-        "@raze__prost__0_8_0//:prost",
-        "@raze__prost_types__0_8_0//:prost_types",
-        "@raze__tempfile__3_2_0//:tempfile",
-    ],
-)
diff --git a/cargo/remote/BUILD.prost-derive-0.8.0.bazel b/cargo/remote/BUILD.prost-derive-0.8.0.bazel
deleted file mode 100644 (file)
index e573303..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # Apache-2.0 from expression "Apache-2.0"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "prost_derive",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "proc-macro",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.8.0",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__anyhow__1_0_43//:anyhow",
-        "@raze__itertools__0_10_1//:itertools",
-        "@raze__proc_macro2__1_0_29//:proc_macro2",
-        "@raze__quote__1_0_9//:quote",
-        "@raze__syn__1_0_76//:syn",
-    ],
-)
diff --git a/cargo/remote/BUILD.prost-types-0.8.0.bazel b/cargo/remote/BUILD.prost-types-0.8.0.bazel
deleted file mode 100644 (file)
index 97de85a..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # Apache-2.0 from expression "Apache-2.0"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "prost_types",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.8.0",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__bytes__1_1_0//:bytes",
-        "@raze__prost__0_8_0//:prost",
-    ],
-)
index 412444322d288f291d03b7d5dfacccbef899714a..4d0f4d68aab9e7e57477f916a0f6921792e8a769 100644 (file)
@@ -42,7 +42,6 @@ rust_library(
         "libc",
         "rand_chacha",
         "rand_hc",
-        "small_rng",
         "std",
         "std_rng",
     ],
index 329b304363788f93013ddd263846fd127f4da271..6d2a2306d5d96bd20c1fbc04d8425745160a77d9 100644 (file)
@@ -35,6 +35,7 @@ rust_library(
     srcs = glob(["**/*.rs"]),
     crate_features = [
         "OSX_10_9",
+        "default",
     ],
     crate_root = "src/lib.rs",
     crate_type = "lib",
index 9ebd0ed5cfdbc71ef1018c7e2988b7172c350797..dff9109d7b8682cd6c743e13f18eb67197441b53 100644 (file)
@@ -44,6 +44,8 @@ rust_library(
     aliases = {
     },
     crate_features = [
+        "default",
+        "std",
     ],
     crate_root = "src/lib.rs",
     crate_type = "lib",
diff --git a/cargo/remote/BUILD.testcontainers-0.12.0.bazel b/cargo/remote/BUILD.testcontainers-0.12.0.bazel
new file mode 100644 (file)
index 0000000..e35b1e5
--- /dev/null
@@ -0,0 +1,64 @@
+"""
+@generated
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+
+# buildifier: disable=load
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+# buildifier: disable=load
+load(
+    "@rules_rust//rust:rust.bzl",
+    "rust_binary",
+    "rust_library",
+    "rust_test",
+)
+
+package(default_visibility = [
+    # Public for visibility by "@raze__crate__version//" targets.
+    #
+    # Prefer access through "//cargo", which limits external
+    # visibility to explicit Cargo.toml dependencies.
+    "//visibility:public",
+])
+
+licenses([
+    "notice",  # MIT from expression "MIT OR Apache-2.0"
+])
+
+# Generated Targets
+
+rust_library(
+    name = "testcontainers",
+    srcs = glob(["**/*.rs"]),
+    crate_features = [
+    ],
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    data = [],
+    edition = "2018",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.12.0",
+    # buildifier: leave-alone
+    deps = [
+        "@raze__hex__0_4_3//:hex",
+        "@raze__hmac__0_10_1//:hmac",
+        "@raze__log__0_4_14//:log",
+        "@raze__rand__0_8_4//:rand",
+        "@raze__serde__1_0_130//:serde",
+        "@raze__serde_json__1_0_67//:serde_json",
+        "@raze__sha2__0_9_6//:sha2",
+    ],
+)
+
+# Unsupported target "cli_client" with type "test" omitted
+
+# Unsupported target "images" with type "test" omitted
diff --git a/cargo/remote/BUILD.tokio-io-timeout-1.1.1.bazel b/cargo/remote/BUILD.tokio-io-timeout-1.1.1.bazel
deleted file mode 100644 (file)
index 33a8951..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT OR Apache-2.0"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "tokio_io_timeout",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "1.1.1",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__pin_project_lite__0_2_7//:pin_project_lite",
-        "@raze__tokio__1_11_0//:tokio",
-    ],
-)
diff --git a/cargo/remote/BUILD.tokio-native-tls-0.3.0.bazel b/cargo/remote/BUILD.tokio-native-tls-0.3.0.bazel
new file mode 100644 (file)
index 0000000..9f83be1
--- /dev/null
@@ -0,0 +1,105 @@
+"""
+@generated
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+
+# buildifier: disable=load
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+# buildifier: disable=load
+load(
+    "@rules_rust//rust:rust.bzl",
+    "rust_binary",
+    "rust_library",
+    "rust_test",
+)
+
+package(default_visibility = [
+    # Public for visibility by "@raze__crate__version//" targets.
+    #
+    # Prefer access through "//cargo", which limits external
+    # visibility to explicit Cargo.toml dependencies.
+    "//visibility:public",
+])
+
+licenses([
+    "notice",  # MIT from expression "MIT"
+])
+
+# Generated Targets
+
+# Unsupported target "download-rust-lang" with type "example" omitted
+
+# Unsupported target "echo" with type "example" omitted
+
+rust_library(
+    name = "tokio_native_tls",
+    srcs = glob(["**/*.rs"]),
+    aliases = {
+    },
+    crate_features = [
+    ],
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    data = [],
+    edition = "2018",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.3.0",
+    # buildifier: leave-alone
+    deps = [
+        "@raze__native_tls__0_2_8//:native_tls",
+        "@raze__tokio__1_11_0//:tokio",
+    ] + selects.with_or({
+        # cfg(all(not(target_os = "macos"), not(windows), not(target_os = "ios")))
+        (
+            "@rules_rust//rust/platform:aarch64-linux-android",
+            "@rules_rust//rust/platform:aarch64-unknown-linux-gnu",
+            "@rules_rust//rust/platform:arm-unknown-linux-gnueabi",
+            "@rules_rust//rust/platform:i686-linux-android",
+            "@rules_rust//rust/platform:i686-unknown-freebsd",
+            "@rules_rust//rust/platform:i686-unknown-linux-gnu",
+            "@rules_rust//rust/platform:powerpc-unknown-linux-gnu",
+            "@rules_rust//rust/platform:s390x-unknown-linux-gnu",
+            "@rules_rust//rust/platform:wasm32-unknown-unknown",
+            "@rules_rust//rust/platform:wasm32-wasi",
+            "@rules_rust//rust/platform:x86_64-linux-android",
+            "@rules_rust//rust/platform:x86_64-unknown-freebsd",
+            "@rules_rust//rust/platform:x86_64-unknown-linux-gnu",
+        ): [
+        ],
+        "//conditions:default": [],
+    }) + selects.with_or({
+        # cfg(any(target_os = "macos", target_os = "ios"))
+        (
+            "@rules_rust//rust/platform:aarch64-apple-darwin",
+            "@rules_rust//rust/platform:aarch64-apple-ios",
+            "@rules_rust//rust/platform:i686-apple-darwin",
+            "@rules_rust//rust/platform:x86_64-apple-darwin",
+            "@rules_rust//rust/platform:x86_64-apple-ios",
+        ): [
+        ],
+        "//conditions:default": [],
+    }) + selects.with_or({
+        # cfg(windows)
+        (
+            "@rules_rust//rust/platform:i686-pc-windows-msvc",
+            "@rules_rust//rust/platform:x86_64-pc-windows-msvc",
+        ): [
+        ],
+        "//conditions:default": [],
+    }),
+)
+
+# Unsupported target "bad" with type "test" omitted
+
+# Unsupported target "google" with type "test" omitted
+
+# Unsupported target "smoke" with type "test" omitted
diff --git a/cargo/remote/BUILD.tokio-stream-0.1.7.bazel b/cargo/remote/BUILD.tokio-stream-0.1.7.bazel
deleted file mode 100644 (file)
index 5b08034..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "tokio_stream",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-        "default",
-        "time",
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.1.7",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__futures_core__0_3_17//:futures_core",
-        "@raze__pin_project_lite__0_2_7//:pin_project_lite",
-        "@raze__tokio__1_11_0//:tokio",
-    ],
-)
-
-# Unsupported target "async_send_sync" with type "test" omitted
-
-# Unsupported target "stream_chain" with type "test" omitted
-
-# Unsupported target "stream_collect" with type "test" omitted
-
-# Unsupported target "stream_empty" with type "test" omitted
-
-# Unsupported target "stream_fuse" with type "test" omitted
-
-# Unsupported target "stream_iter" with type "test" omitted
-
-# Unsupported target "stream_merge" with type "test" omitted
-
-# Unsupported target "stream_once" with type "test" omitted
-
-# Unsupported target "stream_pending" with type "test" omitted
-
-# Unsupported target "stream_stream_map" with type "test" omitted
-
-# Unsupported target "stream_timeout" with type "test" omitted
-
-# Unsupported target "time_throttle" with type "test" omitted
-
-# Unsupported target "watch" with type "test" omitted
diff --git a/cargo/remote/BUILD.tonic-0.5.2.bazel b/cargo/remote/BUILD.tonic-0.5.2.bazel
deleted file mode 100644 (file)
index 9d3e41f..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT"
-])
-
-# Generated Targets
-
-# Unsupported target "decode" with type "bench" omitted
-
-rust_library(
-    name = "tonic",
-    srcs = glob(["**/*.rs"]),
-    aliases = {
-        "@raze__prost__0_8_0//:prost": "prost1",
-    },
-    crate_features = [
-        "async-trait",
-        "codegen",
-        "default",
-        "h2",
-        "hyper",
-        "hyper-timeout",
-        "prost",
-        "prost-derive",
-        "prost1",
-        "tokio",
-        "tower",
-        "tracing-futures",
-        "transport",
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    proc_macro_deps = [
-        "@raze__async_trait__0_1_51//:async_trait",
-        "@raze__prost_derive__0_8_0//:prost_derive",
-    ],
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.5.2",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__async_stream__0_3_2//:async_stream",
-        "@raze__base64__0_13_0//:base64",
-        "@raze__bytes__1_1_0//:bytes",
-        "@raze__futures_core__0_3_17//:futures_core",
-        "@raze__futures_util__0_3_17//:futures_util",
-        "@raze__h2__0_3_4//:h2",
-        "@raze__http__0_2_4//:http",
-        "@raze__http_body__0_4_3//:http_body",
-        "@raze__hyper__0_14_12//:hyper",
-        "@raze__hyper_timeout__0_4_1//:hyper_timeout",
-        "@raze__percent_encoding__2_1_0//:percent_encoding",
-        "@raze__pin_project__1_0_8//:pin_project",
-        "@raze__prost__0_8_0//:prost",
-        "@raze__tokio__1_11_0//:tokio",
-        "@raze__tokio_stream__0_1_7//:tokio_stream",
-        "@raze__tokio_util__0_6_8//:tokio_util",
-        "@raze__tower__0_4_8//:tower",
-        "@raze__tower_layer__0_3_1//:tower_layer",
-        "@raze__tower_service__0_3_1//:tower_service",
-        "@raze__tracing__0_1_26//:tracing",
-        "@raze__tracing_futures__0_2_5//:tracing_futures",
-    ],
-)
diff --git a/cargo/remote/BUILD.tonic-build-0.5.2.bazel b/cargo/remote/BUILD.tonic-build-0.5.2.bazel
deleted file mode 100644 (file)
index d2e17b0..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "tonic_build",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-        "prost",
-        "prost-build",
-        "transport",
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.5.2",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__proc_macro2__1_0_29//:proc_macro2",
-        "@raze__prost_build__0_8_0//:prost_build",
-        "@raze__quote__1_0_9//:quote",
-        "@raze__syn__1_0_76//:syn",
-    ],
-)
diff --git a/cargo/remote/BUILD.tower-0.4.8.bazel b/cargo/remote/BUILD.tower-0.4.8.bazel
deleted file mode 100644 (file)
index 2fa5af3..0000000
+++ /dev/null
@@ -1,110 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT"
-])
-
-# Generated Targets
-
-# Unsupported target "tower-balance" with type "example" omitted
-
-rust_library(
-    name = "tower",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-        "balance",
-        "buffer",
-        "default",
-        "discover",
-        "futures-util",
-        "indexmap",
-        "limit",
-        "load",
-        "log",
-        "make",
-        "rand",
-        "ready-cache",
-        "slab",
-        "timeout",
-        "tokio",
-        "tokio-stream",
-        "tokio-util",
-        "tracing",
-        "util",
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.4.8",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__futures_core__0_3_17//:futures_core",
-        "@raze__futures_util__0_3_17//:futures_util",
-        "@raze__indexmap__1_7_0//:indexmap",
-        "@raze__pin_project__1_0_8//:pin_project",
-        "@raze__rand__0_8_4//:rand",
-        "@raze__slab__0_4_4//:slab",
-        "@raze__tokio__1_11_0//:tokio",
-        "@raze__tokio_stream__0_1_7//:tokio_stream",
-        "@raze__tokio_util__0_6_8//:tokio_util",
-        "@raze__tower_layer__0_3_1//:tower_layer",
-        "@raze__tower_service__0_3_1//:tower_service",
-        "@raze__tracing__0_1_26//:tracing",
-    ],
-)
-
-# Unsupported target "balance" with type "test" omitted
-
-# Unsupported target "buffer" with type "test" omitted
-
-# Unsupported target "builder" with type "test" omitted
-
-# Unsupported target "hedge" with type "test" omitted
-
-# Unsupported target "limit" with type "test" omitted
-
-# Unsupported target "load_shed" with type "test" omitted
-
-# Unsupported target "ready_cache" with type "test" omitted
-
-# Unsupported target "retry" with type "test" omitted
-
-# Unsupported target "spawn_ready" with type "test" omitted
-
-# Unsupported target "steer" with type "test" omitted
-
-# Unsupported target "support" with type "test" omitted
-
-# Unsupported target "util" with type "test" omitted
diff --git a/cargo/remote/BUILD.tower-layer-0.3.1.bazel b/cargo/remote/BUILD.tower-layer-0.3.1.bazel
deleted file mode 100644 (file)
index f1204c6..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "tower_layer",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.3.1",
-    # buildifier: leave-alone
-    deps = [
-    ],
-)
index c66b5dc808b092805aeec5acba911e53ece42afc..b9b15f37e7777d76f4f2710f52314ee0db2e3c90 100644 (file)
@@ -40,19 +40,12 @@ rust_library(
     aliases = {
     },
     crate_features = [
-        "attributes",
-        "default",
-        "log",
         "std",
-        "tracing-attributes",
     ],
     crate_root = "src/lib.rs",
     crate_type = "lib",
     data = [],
     edition = "2018",
-    proc_macro_deps = [
-        "@raze__tracing_attributes__0_1_15//:tracing_attributes",
-    ],
     rustc_flags = [
         "--cap-lints=allow",
     ],
@@ -64,7 +57,6 @@ rust_library(
     # buildifier: leave-alone
     deps = [
         "@raze__cfg_if__1_0_0//:cfg_if",
-        "@raze__log__0_4_14//:log",
         "@raze__pin_project_lite__0_2_7//:pin_project_lite",
         "@raze__tracing_core__0_1_19//:tracing_core",
     ] + selects.with_or({
diff --git a/cargo/remote/BUILD.tracing-attributes-0.1.15.bazel b/cargo/remote/BUILD.tracing-attributes-0.1.15.bazel
deleted file mode 100644 (file)
index d0d79ee..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "tracing_attributes",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "proc-macro",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.1.15",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__proc_macro2__1_0_29//:proc_macro2",
-        "@raze__quote__1_0_9//:quote",
-        "@raze__syn__1_0_76//:syn",
-    ],
-)
-
-# Unsupported target "async_fn" with type "test" omitted
-
-# Unsupported target "destructuring" with type "test" omitted
-
-# Unsupported target "err" with type "test" omitted
-
-# Unsupported target "fields" with type "test" omitted
-
-# Unsupported target "instrument" with type "test" omitted
-
-# Unsupported target "levels" with type "test" omitted
-
-# Unsupported target "names" with type "test" omitted
-
-# Unsupported target "support" with type "test" omitted
-
-# Unsupported target "targets" with type "test" omitted
diff --git a/cargo/remote/BUILD.tracing-futures-0.2.5.bazel b/cargo/remote/BUILD.tracing-futures-0.2.5.bazel
deleted file mode 100644 (file)
index 066b633..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "tracing_futures",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-        "default",
-        "pin-project",
-        "std",
-        "std-future",
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "0.2.5",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__pin_project__1_0_8//:pin_project",
-        "@raze__tracing__0_1_26//:tracing",
-    ],
-)
-
-# Unsupported target "std_future" with type "test" omitted
-
-# Unsupported target "support" with type "test" omitted
diff --git a/cargo/remote/BUILD.unicode-segmentation-1.8.0.bazel b/cargo/remote/BUILD.unicode-segmentation-1.8.0.bazel
deleted file mode 100644 (file)
index dec202b..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT OR Apache-2.0"
-])
-
-# Generated Targets
-
-# Unsupported target "graphemes" with type "bench" omitted
-
-# Unsupported target "unicode_words" with type "bench" omitted
-
-# Unsupported target "word_bounds" with type "bench" omitted
-
-rust_library(
-    name = "unicode_segmentation",
-    srcs = glob(["**/*.rs"]),
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "1.8.0",
-    # buildifier: leave-alone
-    deps = [
-    ],
-)
diff --git a/cargo/remote/BUILD.vcpkg-0.2.15.bazel b/cargo/remote/BUILD.vcpkg-0.2.15.bazel
new file mode 100644 (file)
index 0000000..fd21e4d
--- /dev/null
@@ -0,0 +1,53 @@
+"""
+@generated
+cargo-raze crate build file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+
+# buildifier: disable=load
+load("@bazel_skylib//lib:selects.bzl", "selects")
+
+# buildifier: disable=load
+load(
+    "@rules_rust//rust:rust.bzl",
+    "rust_binary",
+    "rust_library",
+    "rust_test",
+)
+
+package(default_visibility = [
+    # Public for visibility by "@raze__crate__version//" targets.
+    #
+    # Prefer access through "//cargo", which limits external
+    # visibility to explicit Cargo.toml dependencies.
+    "//visibility:public",
+])
+
+licenses([
+    "notice",  # MIT from expression "MIT OR Apache-2.0"
+])
+
+# Generated Targets
+
+rust_library(
+    name = "vcpkg",
+    srcs = glob(["**/*.rs"]),
+    crate_features = [
+    ],
+    crate_root = "src/lib.rs",
+    crate_type = "lib",
+    data = [],
+    edition = "2015",
+    rustc_flags = [
+        "--cap-lints=allow",
+    ],
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+    version = "0.2.15",
+    # buildifier: leave-alone
+    deps = [
+    ],
+)
diff --git a/cargo/remote/BUILD.which-4.2.2.bazel b/cargo/remote/BUILD.which-4.2.2.bazel
deleted file mode 100644 (file)
index ad77755..0000000
+++ /dev/null
@@ -1,68 +0,0 @@
-"""
-@generated
-cargo-raze crate build file.
-
-DO NOT EDIT! Replaced on runs of cargo-raze
-"""
-
-# buildifier: disable=load
-load("@bazel_skylib//lib:selects.bzl", "selects")
-
-# buildifier: disable=load
-load(
-    "@rules_rust//rust:rust.bzl",
-    "rust_binary",
-    "rust_library",
-    "rust_test",
-)
-
-package(default_visibility = [
-    # Public for visibility by "@raze__crate__version//" targets.
-    #
-    # Prefer access through "//cargo", which limits external
-    # visibility to explicit Cargo.toml dependencies.
-    "//visibility:public",
-])
-
-licenses([
-    "notice",  # MIT from expression "MIT"
-])
-
-# Generated Targets
-
-rust_library(
-    name = "which",
-    srcs = glob(["**/*.rs"]),
-    aliases = {
-    },
-    crate_features = [
-    ],
-    crate_root = "src/lib.rs",
-    crate_type = "lib",
-    data = [],
-    edition = "2018",
-    rustc_flags = [
-        "--cap-lints=allow",
-    ],
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-    version = "4.2.2",
-    # buildifier: leave-alone
-    deps = [
-        "@raze__either__1_6_1//:either",
-        "@raze__libc__0_2_101//:libc",
-    ] + selects.with_or({
-        # cfg(windows)
-        (
-            "@rules_rust//rust/platform:i686-pc-windows-msvc",
-            "@rules_rust//rust/platform:x86_64-pc-windows-msvc",
-        ): [
-            "@raze__lazy_static__1_4_0//:lazy_static",
-        ],
-        "//conditions:default": [],
-    }),
-)
-
-# Unsupported target "basic" with type "test" omitted
index ec81c4b30718c90d685b80124bf09bc75e83d059..a373caa7e9c7c0e9a8dc4255d2847fa267d9e5b7 100644 (file)
@@ -11,4 +11,5 @@ config = "0.11"
 hyper = { version = "0.14", features = ["full"] }
 tokio = { version = "1", features = ["full"] }
 prometheus = "0.12.0"
-nats = "0.15.2"
\ No newline at end of file
+nats = "0.15.2"
+testcontainers = "0.12.0"
\ No newline at end of file
index f92a2e9085ab32f10a8e4c6849ac5ba5f229ffc3..88b84fadefe8be28e323d0a5ef79781aa4fe69b0 100644 (file)
@@ -75,6 +75,15 @@ alias(
     ],
 )
 
+alias(
+    name = "testcontainers",
+    actual = "@raze__testcontainers__0_12_0//:testcontainers",
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+)
+
 alias(
     name = "tokio",
     actual = "@raze__tokio__1_11_0//:tokio",
index 3dcd72c0e9ac8e5c250283a1f58842599c3887e6..c4ad7b042ec29898205198e9dce2c543b9b149c0 100644 (file)
@@ -1,5 +1,5 @@
 use std::env;
-use config::{Config, ConfigError, Environment, File, Source};
+use config::{Config, ConfigError, Environment, File};
 use log::info;
 use serde::Deserialize;
 
@@ -24,6 +24,8 @@ where
     /// Initializes a new configuration like the other components of nova
     /// And starts the prometheus metrics server if needed.
     pub fn new(service_name: &str) -> Result<Settings<T>, ConfigError> {
+        pretty_env_logger::init();
+
         let mut default = Config::default();
         // this file my be shared with all the components
         default.merge(File::with_name("config/default"))?;
@@ -34,17 +36,19 @@ where
         default.merge(File::with_name("config/local").required(false))?;
 
         let env = Environment::with_prefix("NOVA").separator("__");
-        println!("{:?}", env.collect());
         // we can configure each component using environment variables
         default.merge(env)?;
         let mut config: Settings<T> = default.clone().try_into().unwrap();
 
         //  try to load the config
         config.config = default.get::<T>(&service_name).unwrap();
-        pretty_env_logger::init();
 
         // start the monitoring system if needed
         crate::monitoring::start_monitoring(&config.monitoring);
         Ok(config)
     }
 }
+
+pub fn test_init() {
+    pretty_env_logger::init();
+}
index 1125f5a294da7d5391816cbd7169e6cdf170be18..be3c913d30ac3ef85a5961e3891413fa23af2cf7 100644 (file)
@@ -5,3 +5,10 @@ pub mod monitoring;
 pub mod nats;
 pub mod payloads;
 pub mod error;
+
+pub use log as log;
+pub use serde as serde;
+pub use ::config as config_crate;
+pub use prometheus as prometheus;
+pub use ::nats as nats_crate;
+pub use testcontainers as testcontainers;
\ No newline at end of file
index ded1d95b450e9fd5532fd3a88d516a500bd3d720..4bff04352bc3c5718f6a37597120ce17e356f052 100644 (file)
@@ -1,19 +1,19 @@
 use hyper::{
-    Response, Body, Request, Server,
-    header::{CONTENT_TYPE},
+    header::CONTENT_TYPE,
     service::{make_service_fn, service_fn},
+    Body, Request, Response, Server,
 };
-use std::net::ToSocketAddrs;
+use log::{error, info};
 use prometheus::{Encoder, TextEncoder};
-use log::{info,error};
 use serde::Deserialize;
+use std::net::ToSocketAddrs;
 
 #[derive(Clone, Debug, Deserialize)]
 /// Options for the monitoring service
 pub struct MonitoringConfiguration {
-    enabled: bool,
-    address: Option<String>,
-    port: Option<i32>,
+    pub enabled: bool,
+    pub address: Option<String>,
+    pub port: Option<i32>,
 }
 
 /// Handler for the hyper http server
@@ -37,17 +37,18 @@ pub fn start_monitoring(configuration: &MonitoringConfiguration) {
     let config = configuration.clone();
     tokio::task::spawn(async move {
         if config.enabled {
-            let address = format!("{}:{}",
-                config.address.expect("a listening address must be specified for the metrics server"),
-                config.port.expect("a listening port must be specified for the metrics server")
+            let address = format!(
+                "{}:{}",
+                config
+                    .address
+                    .expect("a listening address must be specified for the metrics server"),
+                config
+                    .port
+                    .expect("a listening port must be specified for the metrics server")
             );
             info!("Starting monitoring server on {}", address);
-            
-            let listen_address = address
-                .to_socket_addrs()
-                .unwrap()
-                .next()
-                .unwrap();
+
+            let listen_address = address.to_socket_addrs().unwrap().next().unwrap();
             let server = Server::bind(&listen_address).serve(make_service_fn(|_| async {
                 Ok::<_, hyper::Error>(service_fn(serve_metrics))
             }));
@@ -57,4 +58,4 @@ pub fn start_monitoring(configuration: &MonitoringConfiguration) {
             }
         }
     });
-}
\ No newline at end of file
+}
index 437a857c34e5b76fe459a7e59ffec9e1fc5b16af..c61aa4c789f4d764aab9144d79d3c26dd359cab5 100644 (file)
@@ -1,33 +1,34 @@
-use nats::{Options, Connection};
+use nats::{Connection, Options};
 use serde::Deserialize;
 
 #[derive(Clone, Debug, Deserialize)]
-struct NatsConfigurationClientCert {
-    cert: String,
-    key: String
+pub struct NatsConfigurationClientCert {
+    pub cert: String,
+    pub key: String,
 }
 #[derive(Clone, Debug, Deserialize)]
-struct NatsConfigurationTls {
-    mtu: Option<usize>,
+pub struct NatsConfigurationTls {
+    pub mtu: Option<usize>,
 }
 
 #[derive(Clone, Debug, Deserialize)]
 pub struct NatsConfiguration {
-    client_cert: Option<NatsConfigurationClientCert>,
-    root_cert: Option<Vec<String>>,
-    jetstream_api_prefix: Option<String>,
-    max_reconnects: Option<usize>,
-    reconnect_buffer_size: Option<usize>,
-    tls: Option<NatsConfigurationTls>,
-    client_name: Option<String>,
-    tls_required: Option<bool>,
-    host: String,
+    pub client_cert: Option<NatsConfigurationClientCert>,
+    pub root_cert: Option<Vec<String>>,
+    pub jetstream_api_prefix: Option<String>,
+    pub max_reconnects: Option<usize>,
+    pub reconnect_buffer_size: Option<usize>,
+    pub tls: Option<NatsConfigurationTls>,
+    pub client_name: Option<String>,
+    pub tls_required: Option<bool>,
+    pub host: String,
 }
 
+// Allows the configuration to directly create a nats connection
 impl Into<Connection> for NatsConfiguration {
     fn into(self) -> Connection {
         let mut options = Options::new();
-        
+
         if let Some(client_cert) = self.client_cert {
             options = options.client_cert(client_cert.cert, client_cert.key);
         }
@@ -48,7 +49,6 @@ impl Into<Connection> for NatsConfiguration {
         options = options.tls_required(self.tls_required.unwrap_or(false));
         options = options.with_name(&self.client_name.unwrap_or("Nova".to_string()));
 
-
         if let Some(tls) = self.tls {
             let mut config = nats::rustls::ClientConfig::new();
             config.set_mtu(&tls.mtu);
index 2da70e398800c99f0c4bc15894bed44f4bc872f1..c97ac1db5cb9414d42f2fadf0abbc2d0f8303cc7 100644 (file)
@@ -1,8 +1,6 @@
 use serde::{Deserialize, Serialize};
 use std::fmt::Debug;
 
-
-
 /// Data structure sent to the cache component
 /// by the gateway & webhook.
 #[derive(Serialize, Deserialize, Debug)]
index aacaad5c1aaec15ea3a189f1e06a4b346fe3cdb7..c182605c3fcb28d9b001dd45f97ca592dc06a273 100644 (file)
@@ -1,5 +1,8 @@
 package common
 
+// This is a file that will be replaced
+// by the `version_template` target in bazel
+
 const (
        VERSION = "$VERSION"
 )
diff --git a/config/default.json b/config/default.json
new file mode 100644 (file)
index 0000000..d30823d
--- /dev/null
@@ -0,0 +1,17 @@
+{
+    "monitoring": {
+        "enabled": false
+    },
+    "nats": {
+        "host": "localhost"
+    },
+    "rest": {
+        "server": {
+            "port": 8000,
+            "address": "0.0.0.0"
+        },
+        "discord": {
+            "token": "<your token>"
+        }
+    }
+}
\ No newline at end of file
index 3fe92e0e31f0aacdbb5cc527ebea3e27022c33e9..3e8f9246b391dfce96098563fe90f8783cfdf04d 100644 (file)
@@ -2,9 +2,12 @@ version: "3.3"
 services:
   nats:
       image: 'nats'
-      expose:
-        - "4222:422"
       ports:
         - "8222:8222"
         - "4222:4222"
       hostname: nats-server
+  redis:
+      image: 'redis'
+      ports:
+        - "6379:6379"
+      hostname: redis
index 472536766ccac2b8d4c5c65f1606f30f7bbe8cf5..7bdcc0b27ca87346b60c1e3ae79d2c22ffbe1c8b 100644 (file)
@@ -22,7 +22,7 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
         docs: {
           sidebarPath: require.resolve('./sidebars.js'),
           // Please change this to your repo.
-          editUrl: 'https://github.com/facebook/docusaurus/edit/main/website/docs/',
+          editUrl: 'https://github.com/discordnova/nova/edit/main/docs/docs/',
         },
         theme: {
           customCss: require.resolve('./src/css/custom.css'),
index 1b8e9eac9929e031e6bbcab757ea9b5f1ca1020c..4afdbc23961cea2c684a97f19dfda15ec2ef46e8 100644 (file)
@@ -5,12 +5,12 @@ edition = "2018"
 
 [dependencies]
 common = { path = "../common/rust" }
-tokio = { version = "1", features = ["full"] }
 tokio-tungstenite = { version = "*", features = ["rustls-tls"] }
+tokio = { version = "1", features = ["full"] }
+
 url = "2.2.2"
 futures-util = "0.3.17"
 futures = "0.3.17"
-log = { version = "0.4", features = ["std"] }
 
 serde_json = { version = "1.0" }
 serde = { version = "1.0", features = ["derive"] }
@@ -19,4 +19,4 @@ enumflags2 = { version = "0.7.1", features = ["serde"] }
 
 num-traits = "0.2"
 num-derive = "0.3"
-num = "0.4"
\ No newline at end of file
+num = "0.4"
diff --git a/gateway/README.md b/gateway/README.md
deleted file mode 100644 (file)
index 0f8b76c..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# Gateway\r
-\r
-The gateway component managed the connexion with the Discord event gateway using a websocket connexion.
\ No newline at end of file
index e85683f00e65fecbd2125ef4b8902d03180a8c8e..211b09607f3e197b257c29cdc1c33ba57eebb840 100644 (file)
@@ -39,15 +39,6 @@ alias(
     ],
 )
 
-alias(
-    name = "log",
-    actual = "@raze__log__0_4_14//:log",
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-)
-
 alias(
     name = "num",
     actual = "@raze__num__0_4_0//:num",
diff --git a/gateway/config/default.toml b/gateway/config/default.toml
deleted file mode 100644 (file)
index 4bfac9d..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-[monitoring]
-enabled = false
-
-[nats]
-host = "localhost"
-
-[gateway]
-max_reconnects = 5
-reconnect_delay_growth_factor = 1.25
-reconnect_delay_minimum = 5000
-reconnect_delay_maximum = 60000
-intents = 32767
index 767feec41adff177f1798f6ec752e28664f4b4bd..5a12daf3ce619b86cfb1b9a16a32e4c9eaef8900 100644 (file)
@@ -2,7 +2,7 @@ use crate::{error::GatewayError, payloads::gateway::BaseMessage};
 
 use super::Connection;
 use futures::{FutureExt, Sink, SinkExt, Stream, StreamExt};
-use log::info;
+use common::log::info;
 use serde::Serialize;
 use std::{
     pin::Pin,
index fb07229f601e2b005bfc2fa0c1b53e81e8da6b24..bb425dab7738c9f8efc42b087a39a88d931bc3d8 100644 (file)
@@ -1,6 +1,6 @@
 use std::str::from_utf8;
 use tokio_tungstenite::tungstenite::Message;
-use log::info;
+use common::log::info;
 
 use crate::error::GatewayError;
 
diff --git a/gateway/src/management/mod.rs b/gateway/src/management/mod.rs
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/gateway/src/payloads/events/resume.rs b/gateway/src/payloads/events/resume.rs
deleted file mode 100644 (file)
index e69de29..0000000
index 86e5f9897555f3f94be8d00c9b013b0ea7f273fc..b6ef03826bf5decb68b8c29c511d9cebebb873d6 100644 (file)
@@ -1,7 +1,7 @@
 use std::env;
 
 use futures::SinkExt;
-use log::{debug, error, info};
+use common::log::{debug, error, info};
 use serde::Serialize;
 use serde_json::Value;
 use std::fmt::Debug;
index f31a89b3a088895574bd909655db2bf989e62870..2f7f2d5a6e3846923729165dfcc796752db1f0d1 100644 (file)
@@ -7,8 +7,8 @@ use crate::{connection::Connection, error::GatewayError, payloads::{
 
 use super::{state::ConnectionState, ConnectionWithState, Shard};
 use futures::StreamExt;
-use log::{error, info};
-use tokio::{select, time::{Instant, sleep}};
+use common::{log::{error, info}};
+use tokio::{select, time::{Instant, interval_at, sleep}};
 
 impl Shard {
     pub async fn start(self: &mut Self) {
@@ -159,7 +159,7 @@ impl Shard {
                 info!("Server hello received");
                 self._util_set_seq(msg.sequence);
                 if let Some(conn) = &mut self.connection {
-                    conn.state.interval = Some(tokio::time::interval_at(
+                    conn.state.interval = Some(interval_at(
                         Instant::now() + Duration::from_millis(msg.data.heartbeat_interval),
                         Duration::from_millis(msg.data.heartbeat_interval),
                     ));
diff --git a/novactl/README.md b/novactl/README.md
deleted file mode 100644 (file)
index 480524a..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-# Novactl\r
-\r
-Novactl is a simple command-line utility used to interact with your nova projects, and the nova infrastructure.
\ No newline at end of file
diff --git a/ratelimiter/BUILD b/ratelimiter/BUILD
deleted file mode 100644 (file)
index eeb957a..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-load("@rules_rust//rust:rust.bzl", "rust_binary")
-load("@rules_rust//cargo:cargo_build_script.bzl", "cargo_build_script")
-load("//cargo:crates.bzl", "all_crate_deps", "crate_deps")
-load("@io_bazel_rules_docker//rust:image.bzl", "rust_image")
-
-test_suite(name = "tests")
-
-cargo_build_script(
-    name = "build_script",
-    srcs = ["build.rs"],
-    build_script_env = {
-        "PROTOC": "$(location @com_google_protobuf//:protoc)",
-    },
-    data = [
-        "//ratelimiter/proto:nova.ratelimit.v1alpha.proto",
-    ] + [
-        "@com_google_protobuf//:protoc",
-        "@com_google_protobuf//:protobuf_headers",
-    ],
-    deps = all_crate_deps() + crate_deps(["tonic-build"]),
-)
-
-rust_binary(
-    name = "ratelimiter",
-    srcs = ["src/main.rs"],
-    visibility = ["//visibility:public"],
-    deps = all_crate_deps() + [":build_script"],
-)
-
-rust_image(
-    name = "image",
-    srcs = ["src/main.rs"],
-    base = "//bazel:base",
-    visibility = ["//visibility:public"],
-    deps = all_crate_deps() + [":build_script"],
-)
diff --git a/ratelimiter/Cargo.toml b/ratelimiter/Cargo.toml
deleted file mode 100644 (file)
index 873017c..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-[package]\r
-name = "rest-ratelimiter"\r
-version = "0.1.0"\r
-edition = "2018"\r
-\r
-[dependencies]\r
-tonic = "0.5"\r
-prost = "0.8"\r
-tokio = { version = "1", features = ["full"] }\r
-\r
-[[bin]]\r
-name = "rest-ratelimiter"\r
-path = "src/main.rs"\r
-\r
-[build-dependencies]\r
-tonic-build = { version = "0.5", features = ["transport", "prost"], default-features = false }\r
-\r
-[dev-dependencies]\r
-tonic-build = { version = "0.5", features = ["transport", "prost"], default-features = false }\r
-\r
diff --git a/ratelimiter/README.md b/ratelimiter/README.md
deleted file mode 100644 (file)
index a6e400e..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-# Ratelimiter\r
-\r
-This is an implementation of the ratelimiting service described in the `proto/nova.ratelimit.v1.proto`.\r
-The library is divied in two part, a Rust library, built as a static library, and a rust executable that implements\r
-the rate limiting algorithm. A  FFI interface is exposed by the Rust static library for use in the nova-lite component.
\ No newline at end of file
diff --git a/ratelimiter/build.rs b/ratelimiter/build.rs
deleted file mode 100644 (file)
index dad6fbe..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-fn main() -> Result<(), Box<dyn std::error::Error>> {\r
-    tonic_build::compile_protos("proto/nova.ratelimit.v1alpha.proto").unwrap();\r
-    Ok(())\r
-}\r
diff --git a/ratelimiter/proto/BUILD.bazel b/ratelimiter/proto/BUILD.bazel
deleted file mode 100644 (file)
index 364df7e..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-load("@rules_proto//proto:defs.bzl", "proto_library")
-load("@io_bazel_rules_go//go:def.bzl", "go_library")
-load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
-
-exports_files(["nova.ratelimit.v1alpha.proto"])
-
-proto_library(
-    name = "nova_ratelimit_v1_proto",
-    srcs = ["nova.ratelimit.v1alpha.proto"],
-    visibility = ["//visibility:public"],
-)
-
-go_proto_library(
-    name = "nova_ratelimit_v1_go_proto",
-    compilers = ["@io_bazel_rules_go//proto:go_grpc"],
-    importpath = "github.com/discordnova/nova/ratelimiter/proto",
-    proto = ":nova_ratelimit_v1_proto",
-    visibility = ["//visibility:public"],
-)
-
-go_library(
-    name = "proto",
-    embed = [":nova_ratelimit_v1_go_proto"],
-    importpath = "github.com/discordnova/nova/ratelimiter/proto",
-    visibility = ["//visibility:public"],
-)
diff --git a/ratelimiter/proto/nova.ratelimit.v1alpha.proto b/ratelimiter/proto/nova.ratelimit.v1alpha.proto
deleted file mode 100644 (file)
index 8ef606f..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// How does this works ?
-// Every request, the proxy (envoy) requests the rate-limiting service if
-// the requested route bucket or global rate-limit is hit.
-
-syntax = "proto3";
-package nova.ratelimit.v1alpha;
-
-// The reponse of a RatelimitRequest, it includes the status of the reponse and
-// the bucket informations.
-message RatelimitResponse {
-    enum Status {
-        OK                  = 0;
-        RATELIMITED         = 1;
-        GLOBAL_RATELIMITED  = 2;
-    }
-    Status status = 1;
-    bool   updateAsked = 2;
-}
-
-// Requests the ratelimit status of a route request, it also takes the 
-// indentifiables of the request in question.
-message RatelimitRequest {
-    string          routeName       = 1;
-    repeated string indentifiables  = 2;
-}
-
-// Used when "updateAsked" is sed to true
-// this means the bucket is unknown to the ratelimit server.
-message CreateBucketData {
-    RatelimitRequest request    = 1;
-    int32 limit                 = 2;
-    int32 remaining             = 3;
-    int32 reset                 = 4;
-}
-
-service RatelimitService {
-    rpc GetRatelimitStatus (RatelimitRequest)   returns (RatelimitResponse);
-    rpc CreateBucket       (CreateBucketData)   returns (CreateBucketData);
-}
\ No newline at end of file
diff --git a/ratelimiter/src/main.rs b/ratelimiter/src/main.rs
deleted file mode 100644 (file)
index 706077f..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-// Some implementation of the gRPC service using the shared library.\r
-\r
-pub mod ratelimit_pb {\r
-    tonic::include_proto!("nova.ratelimit.v1alpha");\r
-}\r
-\r
-use ratelimit_pb::ratelimit_service_server::{RatelimitService, RatelimitServiceServer};\r
-use ratelimit_pb::{CreateBucketData, RatelimitRequest, RatelimitResponse};\r
-use std::error::Error;\r
-use tonic::transport::Server;\r
-use tonic::{Request, Response, Status};\r
-\r
-#[derive(Default)]\r
-pub struct MyRatelimitService {}\r
-\r
-#[tonic::async_trait]\r
-impl RatelimitService for MyRatelimitService {\r
-    async fn get_ratelimit_status(\r
-        &self,\r
-        _request: Request<RatelimitRequest>,\r
-    ) -> Result<Response<RatelimitResponse>, Status> {\r
-        return Err(Status::not_found("Not implmented"));\r
-    }\r
-    async fn create_bucket(\r
-        &self,\r
-        _request: Request<CreateBucketData>,\r
-    ) -> Result<Response<CreateBucketData>, Status> {\r
-        return Err(tonic::Status::not_found("Not implmented"));\r
-    }\r
-}\r
-\r
-#[tokio::main]\r
-async fn main() -> Result<(), Box<dyn Error>> {\r
-    let addr = "[::1]:50051".parse().unwrap();\r
-    let service = MyRatelimitService::default();\r
-\r
-    println!("GreeterServer listening on {}", addr);\r
-\r
-    Server::builder()\r
-        .add_service(RatelimitServiceServer::new(service))\r
-        .serve(addr)\r
-        .await?;\r
-\r
-    Ok(())\r
-}\r
diff --git a/rest/BUILD b/rest/BUILD
new file mode 100644 (file)
index 0000000..2487187
--- /dev/null
@@ -0,0 +1,24 @@
+load("@rules_rust//rust:rust.bzl", "rust_binary", "rust_test")
+load("//cargo:crates.bzl", "all_crate_deps")
+load("@io_bazel_rules_docker//rust:image.bzl", "rust_image")
+
+test_suite(name = "tests")
+
+rust_binary(
+    name = "rest",
+    srcs = glob(["src/**"]),
+    visibility = ["//visibility:public"],
+    deps = all_crate_deps() + ["//common/rust:common"],
+)
+
+rust_test(
+    name = "rest_test",
+    crate = ":rest",
+)
+
+rust_image(
+    name = "image",
+    base = "//bazel:base",
+    binary = ":rest",
+    visibility = ["//visibility:public"],
+)
diff --git a/rest/Cargo.toml b/rest/Cargo.toml
new file mode 100644 (file)
index 0000000..08e7911
--- /dev/null
@@ -0,0 +1,14 @@
+[package]
+name = "rest"
+version = "0.1.0"
+edition = "2018"
+
+# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
+
+[dependencies]
+common = { path = "../common/rust" }
+hyper = { version = "0.14", features = ["full"] }
+tokio = { version = "1", features = ["full"] }
+serde = { version = "1.0.8", features = ["derive"] }
+futures-util = "0.3.17"
+hyper-tls = "0.5.0"
diff --git a/rest/cargo/BUILD.bazel b/rest/cargo/BUILD.bazel
new file mode 100644 (file)
index 0000000..d664b3c
--- /dev/null
@@ -0,0 +1,58 @@
+"""
+@generated
+cargo-raze generated Bazel file.
+
+DO NOT EDIT! Replaced on runs of cargo-raze
+"""
+
+package(default_visibility = ["//visibility:public"])
+
+licenses([
+    "notice",  # See individual crates for specific licenses
+])
+
+# Aliased targets
+alias(
+    name = "futures_util",
+    actual = "@raze__futures_util__0_3_17//:futures_util",
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+)
+
+alias(
+    name = "hyper",
+    actual = "@raze__hyper__0_14_12//:hyper",
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+)
+
+alias(
+    name = "hyper_tls",
+    actual = "@raze__hyper_tls__0_5_0//:hyper_tls",
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+)
+
+alias(
+    name = "serde",
+    actual = "@raze__serde__1_0_130//:serde",
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+)
+
+alias(
+    name = "tokio",
+    actual = "@raze__tokio__1_11_0//:tokio",
+    tags = [
+        "cargo-raze",
+        "manual",
+    ],
+)
diff --git a/rest/src/config.rs b/rest/src/config.rs
new file mode 100644 (file)
index 0000000..559929f
--- /dev/null
@@ -0,0 +1,18 @@
+use serde::Deserialize;
+
+#[derive(Debug, Deserialize, Clone, Default)]
+pub struct ServerSettings {
+    pub port: u16,
+    pub address: String,
+}
+
+#[derive(Debug, Deserialize, Clone, Default)]
+pub struct Discord {
+    pub token: String
+}
+
+#[derive(Debug, Deserialize, Clone, Default)]
+pub struct Config {
+    pub server: ServerSettings,
+    pub discord: Discord,
+}
diff --git a/rest/src/main.rs b/rest/src/main.rs
new file mode 100644 (file)
index 0000000..703c9f4
--- /dev/null
@@ -0,0 +1,35 @@
+use std::{convert::Infallible, sync::Arc};
+
+use crate::config::Config;
+use common::{config::Settings, log::{error, info}};
+use hyper::{server::conn::AddrStream, service::make_service_fn, Server};
+use std::net::ToSocketAddrs;
+
+use crate::proxy::ServiceProxy;
+
+mod config;
+mod proxy;
+
+#[tokio::main]
+async fn main() {
+    let settings: Settings<Config> = Settings::new("rest").unwrap();
+    let config = Arc::new(settings.config);
+
+    let addr = format!("{}:{}", config.server.address, config.server.port)
+        .to_socket_addrs()
+        .unwrap()
+        .next()
+        .unwrap();
+
+    let service_fn = make_service_fn(move |_: &AddrStream| {
+        let service_proxy = ServiceProxy::new(config.clone());
+        async move { Ok::<_, Infallible>(service_proxy) }
+    });
+
+    let server = Server::bind(&addr).serve(service_fn);
+
+    info!("starting ratelimit server");
+    if let Err(e) = server.await {
+        error!("server error: {}", e);
+    }
+}
diff --git a/rest/src/proxy/mod.rs b/rest/src/proxy/mod.rs
new file mode 100644 (file)
index 0000000..fafbf9a
--- /dev/null
@@ -0,0 +1,74 @@
+use crate::config::Config;
+use futures_util::future::TryFutureExt;
+use hyper::{
+    client::HttpConnector, header::HeaderValue, http::uri::Parts, service::Service, Body, Client,
+    HeaderMap, Request, Response, Uri,
+};
+use hyper_tls::HttpsConnector;
+use std::{future::Future, pin::Pin, sync::Arc, task::Poll};
+
+#[derive(Clone)]
+pub struct ServiceProxy {
+    client: Client<HttpsConnector<HttpConnector>>,
+    config: Arc<Config>,
+}
+
+impl Service<Request<Body>> for ServiceProxy {
+    type Response = Response<Body>;
+    type Error = hyper::Error;
+    type Future = Pin<Box<dyn Future<Output = Result<Self::Response, Self::Error>> + Send>>;
+
+    fn poll_ready(
+        &mut self,
+        cx: &mut std::task::Context<'_>,
+    ) -> std::task::Poll<Result<(), Self::Error>> {
+        match self.client.poll_ready(cx) {
+            Poll::Ready(Ok(())) => Poll::Ready(Ok(())),
+            Poll::Ready(Err(e)) => Poll::Ready(Err(e)),
+            Poll::Pending => Poll::Pending,
+        }
+    }
+
+    fn call(&mut self, mut req: Request<hyper::Body>) -> Self::Future {
+        let host = "discord.com";
+        let mut new_parts = Parts::default();
+
+        let path = req.uri().path().to_string();
+
+        new_parts.scheme = Some("https".parse().unwrap());
+        new_parts.authority = Some(host.parse().unwrap());
+        new_parts.path_and_query = Some(path.parse().unwrap());
+
+        *req.uri_mut() = Uri::from_parts(new_parts).unwrap();
+
+        let mut headers = HeaderMap::default();
+
+        headers.insert("Host", HeaderValue::from_str("discord.com").unwrap());
+        headers.insert(
+            "Authorization",
+            HeaderValue::from_str(&format!("Bot {}", self.config.discord.token)).unwrap(),
+        );
+
+        *req.headers_mut() = headers;
+        let res = self.client
+            .request(req)
+            .map_ok(move |res| {
+                if let Some(bucket) = res.headers().get("x-ratelimit-bucket") {
+                    
+                    println!("bucket ratelimit! {:?} : {:?}", path, bucket);
+                }
+
+                res
+            });
+        
+        return Box::pin(res);
+    }
+}
+
+impl ServiceProxy {
+    pub fn new(config: Arc<Config>) -> Self {
+        let https = HttpsConnector::new();
+        let client = Client::builder().build::<_, hyper::Body>(https);
+        ServiceProxy { client, config }
+    }
+}
index 045c71076b7c2a39c83e7c005a176b1037201b0b..ba0b2f88bf0fa90153d9de23c91f177de238c5bd 100644 (file)
@@ -6,14 +6,12 @@ edition = "2018"
 [dependencies]
 hyper = { version = "0.14", features = ["full"] }
 tokio = { version = "1", features = ["full"] }
-log = { version = "0.4", features = ["std"] }
-config = "0.11"
+common = { path = "../common/rust" }
 serde = { version = "1.0.8", features = ["derive"] }
 libsodium-sys = "0.2.7"
 hex = "0.4.3"
 serde_json = { version = "1.0" }
-common = { path = "../common/rust" }
-nats = "0.15.2"
+libc = "0.2.101"
 
 [[bin]]
 name = "webhook"
diff --git a/webhook/README.md b/webhook/README.md
deleted file mode 100644 (file)
index e69de29..0000000
index e035ab6c1d28379ccaf1719406bee7d150f1ecee..8eb8336a975a991ffa41998a8d7316ca6584f9bb 100644 (file)
@@ -12,15 +12,6 @@ licenses([
 ])
 
 # Aliased targets
-alias(
-    name = "config",
-    actual = "@raze__config__0_11_0//:config",
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-)
-
 alias(
     name = "hex",
     actual = "@raze__hex__0_4_3//:hex",
@@ -40,17 +31,8 @@ alias(
 )
 
 alias(
-    name = "libsodium_sys",
-    actual = "@raze__libsodium_sys__0_2_7//:libsodium_sys",
-    tags = [
-        "cargo-raze",
-        "manual",
-    ],
-)
-
-alias(
-    name = "log",
-    actual = "@raze__log__0_4_14//:log",
+    name = "libc",
+    actual = "@raze__libc__0_2_101//:libc",
     tags = [
         "cargo-raze",
         "manual",
@@ -58,8 +40,8 @@ alias(
 )
 
 alias(
-    name = "nats",
-    actual = "@raze__nats__0_15_2//:nats",
+    name = "libsodium_sys",
+    actual = "@raze__libsodium_sys__0_2_7//:libsodium_sys",
     tags = [
         "cargo-raze",
         "manual",
index 9545becba02ab0c65ccb92c32185fdabc101156f..b3dc8a6b808f8fc1ea549ba907dd4e00ea010dda 100644 (file)
@@ -5,17 +5,10 @@ use hyper::{
     service::Service,
     Body, Method, Request, Response, StatusCode,
 };
-use log::{error, info, trace};
-use nats::Connection;
+use common::log::{error, info, trace};
+use common::nats_crate::Connection;
 use serde::{Deserialize, Serialize};
-use std::{
-    future::Future,
-    io::{Error, ErrorKind},
-    pin::Pin,
-    str::from_utf8,
-    sync::Arc,
-    task::{Context, Poll},
-};
+use std::{future::Future, io::{Error, ErrorKind}, pin::Pin, str::from_utf8, sync::Arc, task::{Context, Poll}, time::Duration};
 
 /// Hyper service used to handle the discord webhooks
 #[derive(Clone)]
@@ -105,13 +98,14 @@ impl Service<Request<Body>> for HandlerService {
                                     node_id: "".to_string(),
                                     span: None,
                                 },
+                                operation: "".to_string(),
                                 data: value,
                             })
                             .unwrap();
 
                             match self_clone
                                 .nats
-                                .request("nova.cache.dispatch.interaction", payload)
+                                .request_timeout("nova.cache.dispatch.interaction", payload, Duration::from_secs(2))
                             {
                                 Ok(response) => Ok(Response::builder()
                                     .header("Content-Type", "application/json")
index 0778ad0017af66f64d6d92e60343d71c92bd8cf8..deeb2fe6a0451bffd85fad321b965400087327df 100644 (file)
@@ -1,7 +1,7 @@
 use super::handler::HandlerService;
 use crate::config::Config;
 use hyper::service::Service;
-use nats::Connection;
+use common::nats_crate::Connection;
 use std::{
     future::{ready, Ready},
     sync::Arc,
index 490c580a1ab3340f306a60ad1f47d197f21d6889..598906bad4ae61ab10eb68efa9099af93d03d9c1 100644 (file)
@@ -1,4 +1,5 @@
 pub mod make_service;
 mod signature;
 mod handler;
-mod types;
\ No newline at end of file
+mod types;
+pub mod tests;
\ No newline at end of file
diff --git a/webhook/src/handler/tests/handler.rs b/webhook/src/handler/tests/handler.rs
new file mode 100644 (file)
index 0000000..3e5ccd0
--- /dev/null
@@ -0,0 +1,174 @@
+fn generate_keypair() -> (
+    String,
+    [u8; libsodium_sys::crypto_sign_ed25519_SECRETKEYBYTES as usize],
+) {
+    use libsodium_sys::crypto_sign_ed25519_keypair;
+    let pk_s: String;
+
+    let mut pk = [0; libsodium_sys::crypto_sign_ed25519_PUBLICKEYBYTES as usize];
+    let mut sk = [0; libsodium_sys::crypto_sign_ed25519_SECRETKEYBYTES as usize];
+
+    let pk_p = pk.as_mut_ptr();
+    let sk_p = sk.as_mut_ptr();
+
+    // generate keypair
+    unsafe {
+        if crypto_sign_ed25519_keypair(pk_p, sk_p) < 0 {
+            panic!("keypair generation failed!");
+        }
+    };
+
+    pk_s = hex::encode(pk);
+    return (pk_s, sk);
+}
+
+fn sign_message(
+    msg: Vec<u8>,
+    sk: [u8; libsodium_sys::crypto_sign_ed25519_SECRETKEYBYTES as usize],
+) -> String {
+    use libc::c_ulonglong;
+    use libsodium_sys::crypto_sign_ed25519_detached;
+
+    let len = msg.len();
+    let mut signature_len: c_ulonglong = 0;
+    let mut str = [0; 64];
+    unsafe {
+        crypto_sign_ed25519_detached(
+            str.as_mut_ptr(),
+            &mut signature_len,
+            msg.as_ptr(),
+            len as u64,
+            sk.as_ptr(),
+        );
+    };
+
+    return hex::encode(str);
+}
+
+#[tokio::test]
+async fn respond_to_pings_and_deny_invalid() {
+    use crate::start;
+    use common::config::test_init;
+    use common::config::Settings;
+    use common::log::info;
+    use common::testcontainers::images::generic::GenericImage;
+    use common::testcontainers::Docker;
+    use hyper::{Body, Method, Request};
+    use libsodium_sys::sodium_init;
+    use serde_json::json;
+    use std::time::Duration;
+
+    test_init();
+
+    unsafe {
+        if sodium_init() < 0 {
+            panic!("libsodium init error!");
+        }
+    }
+
+    let (private_key, secret_key) = generate_keypair();
+    let ping = json!({ "type": 1 }).to_string();
+    let timestamp = "my datetime :)";
+    let signature_data = [timestamp.as_bytes().to_vec(), ping.as_bytes().to_vec()].concat();
+    let signature = sign_message(signature_data, secret_key);
+
+    // start nats
+    let docker = common::testcontainers::clients::Cli::default();
+    let image = GenericImage::new("nats");
+    let node = docker.run(image);
+    node.start();
+    let port = node.get_host_port(4222).unwrap();
+
+    let settings: Settings<crate::config::Config> = common::config::Settings {
+        config: crate::config::Config {
+            server: crate::config::ServerSettings {
+                port: 5003,
+                address: "0.0.0.0".to_string(),
+            },
+            discord: crate::config::Discord {
+                public_key: private_key,
+                client_id: 0,
+            },
+        },
+        monitoring: common::monitoring::MonitoringConfiguration {
+            enabled: false,
+            address: None,
+            port: None,
+        },
+        nats: common::nats::NatsConfiguration {
+            client_cert: None,
+            root_cert: None,
+            jetstream_api_prefix: None,
+            max_reconnects: None,
+            reconnect_buffer_size: None,
+            tls: None,
+            client_name: None,
+            tls_required: None,
+            host: format!("localhost:{}", port),
+        },
+    };
+
+    let nats: common::nats_crate::Connection = settings.nats.clone().into();
+    // start the server
+    tokio::task::spawn(start(settings));
+    tokio::time::sleep(Duration::from_secs(1)).await;
+
+    let req = Request::builder()
+        .method(Method::POST)
+        .uri("http://localhost:5003/")
+        .header("X-Signature-Ed25519", signature)
+        .header("X-Signature-Timestamp", timestamp)
+        .body(Body::from(ping.clone()))
+        .expect("request builder");
+    let client = hyper::client::Client::new();
+    let result = client.request(req).await.unwrap();
+    assert!(result.status() == 200);
+
+    let req = Request::builder()
+        .method(Method::POST)
+        .uri("http://localhost:5003/")
+        .header("X-Signature-Ed25519", "inva&lid signature :)")
+        .header("X-Signature-Timestamp", timestamp)
+        .body(Body::from(ping.clone()))
+        .expect("request builder");
+    let client = hyper::client::Client::new();
+    let result = client.request(req).await.unwrap();
+    assert!(result.status() == 401);
+
+    // setup nats mock listener
+    let sub = nats.subscribe("nova.cache.dispatch.interaction").unwrap();
+
+    let ping = json!({ "type": 0 }).to_string();
+    let timestamp = "my datetime :)";
+    let signature_data = [timestamp.as_bytes().to_vec(), ping.as_bytes().to_vec()].concat();
+    let signature = sign_message(signature_data, secret_key);
+
+    // we must timeout
+    let req = Request::builder()
+        .method(Method::POST)
+        .uri("http://localhost:5003/")
+        .header("X-Signature-Ed25519", signature.clone())
+        .header("X-Signature-Timestamp", timestamp)
+        .body(Body::from(ping.clone()))
+        .expect("request builder");
+    let client = hyper::client::Client::new();
+    let result = client.request(req).await.unwrap();
+    assert!(result.status() == 500);
+
+     sub.with_handler(move |msg| {
+        info!("Received {}", &msg);
+        msg.respond("ok :)").unwrap();
+        Ok(())
+    });
+
+    let req = Request::builder()
+        .method(Method::POST)
+        .uri("http://localhost:5003/")
+        .header("X-Signature-Ed25519", signature.clone())
+        .header("X-Signature-Timestamp", timestamp)
+        .body(Body::from(ping.clone()))
+        .expect("request builder");
+    let client = hyper::client::Client::new();
+    let result = client.request(req).await.unwrap();
+    assert!(result.status() == 200);
+}
diff --git a/webhook/src/handler/tests/mod.rs b/webhook/src/handler/tests/mod.rs
new file mode 100644 (file)
index 0000000..ef7d850
--- /dev/null
@@ -0,0 +1 @@
+pub mod handler;
\ No newline at end of file
index 6ea22fc703e6a71fcc8b4de5dc7cbeb354201e54..b213e9d724f08a0d801f80707814f7f823dd4096 100644 (file)
@@ -5,14 +5,16 @@ use crate::handler::make_service::MakeSvc;
 \r
 use crate::config::Config;\r
 use common::config::Settings;\r
+use common::log::{error, info};\r
 use hyper::Server;\r
-use log::{error, info};\r
 \r
 #[tokio::main]\r
 async fn main() {\r
     let settings: Settings<Config> = Settings::new("webhook").unwrap();\r
-    println!("{:?}", settings);\r
+    start(settings).await;\r
+}\r
 \r
+async fn start(settings: Settings<Config>) {\r
     let addr = format!(\r
         "{}:{}",\r
         settings.config.server.address, settings.config.server.port\r
@@ -27,12 +29,13 @@ async fn main() {
         settings.config.server.address, settings.config.server.port\r
     );\r
 \r
+    let config = Arc::new(settings.config);\r
     let server = Server::bind(&addr).serve(MakeSvc {\r
-        settings: settings.config.clone(),\r
+        settings: config,\r
         nats: Arc::new(settings.nats.into()),\r
     });\r
 \r
     if let Err(e) = server.await {\r
-        error!("server error: {}", e);\r
+        panic!("server error: {}", e);\r
     }\r
 }\r