tests, cleanup & rest base

This commit is contained in:
Matthieu 2021-10-12 22:51:30 +04:00
parent a02b25f235
commit 005dadb342
80 changed files with 1138 additions and 1999 deletions

6
BUILD
View file

@ -14,7 +14,7 @@ filegroup(
"//cache", "//cache",
"//gateway", "//gateway",
"//novactl", "//novactl",
"//ratelimiter", "//rest",
"//webhook", "//webhook",
], ],
) )
@ -24,7 +24,7 @@ container_bundle(
images = { images = {
"ghcr.io/discordnova/nova/novactl:$(docker_tag)": "//novactl:image", "ghcr.io/discordnova/nova/novactl:$(docker_tag)": "//novactl:image",
"ghcr.io/discordnova/nova/gateway:$(docker_tag)": "//gateway: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/webhook:$(docker_tag)": "//webhook:image",
"ghcr.io/discordnova/nova/cache:$(docker_tag)": "//cache:image", "ghcr.io/discordnova/nova/cache:$(docker_tag)": "//cache:image",
}, },
@ -41,7 +41,7 @@ test_suite(
tests = [ tests = [
"//gateway:tests", "//gateway:tests",
"//novactl:tests", "//novactl:tests",
"//ratelimiter:tests", "//rest:tests",
"//webhook:tests", "//webhook:tests",
], ],
) )

386
Cargo.lock generated
View file

@ -11,12 +11,6 @@ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "anyhow"
version = "1.0.43"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28ae2b3dec75a406790005a200b1bd89785afc02517a00ca99ecfe093ee9e6cf"
[[package]] [[package]]
name = "arrayvec" name = "arrayvec"
version = "0.5.2" version = "0.5.2"
@ -34,27 +28,6 @@ dependencies = [
"futures-core", "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]] [[package]]
name = "async-task" name = "async-task"
version = "4.0.3" version = "4.0.3"
@ -222,6 +195,7 @@ dependencies = [
"pretty_env_logger", "pretty_env_logger",
"prometheus", "prometheus",
"serde 1.0.130", "serde 1.0.130",
"testcontainers",
"tokio", "tokio",
] ]
@ -295,6 +269,16 @@ dependencies = [
"lazy_static", "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]] [[package]]
name = "curve25519-dalek" name = "curve25519-dalek"
version = "3.2.0" version = "3.2.0"
@ -350,12 +334,6 @@ dependencies = [
"zeroize", "zeroize",
] ]
[[package]]
name = "either"
version = "1.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457"
[[package]] [[package]]
name = "enumflags2" name = "enumflags2"
version = "0.7.1" version = "0.7.1"
@ -405,18 +383,27 @@ dependencies = [
"instant", "instant",
] ]
[[package]]
name = "fixedbitset"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d"
[[package]] [[package]]
name = "fnv" name = "fnv"
version = "1.0.7" version = "1.0.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 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]] [[package]]
name = "form_urlencoded" name = "form_urlencoded"
version = "1.0.1" version = "1.0.1"
@ -544,7 +531,6 @@ dependencies = [
"enumflags2", "enumflags2",
"futures", "futures",
"futures-util", "futures-util",
"log",
"num", "num",
"num-derive", "num-derive",
"num-traits 0.2.14", "num-traits 0.2.14",
@ -613,15 +599,6 @@ version = "0.11.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e" 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]] [[package]]
name = "hermit-abi" name = "hermit-abi"
version = "0.1.19" version = "0.1.19"
@ -637,6 +614,16 @@ version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" 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]] [[package]]
name = "http" name = "http"
version = "0.2.4" version = "0.2.4"
@ -705,15 +692,16 @@ dependencies = [
] ]
[[package]] [[package]]
name = "hyper-timeout" name = "hyper-tls"
version = "0.4.1" version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905"
dependencies = [ dependencies = [
"bytes",
"hyper", "hyper",
"pin-project-lite", "native-tls",
"tokio", "tokio",
"tokio-io-timeout", "tokio-native-tls",
] ]
[[package]] [[package]]
@ -746,15 +734,6 @@ dependencies = [
"cfg-if", "cfg-if",
] ]
[[package]]
name = "itertools"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69ddb889f9d0d08a67338271fa9b62996bc788c7796a5c18cf057420aaed5eaf"
dependencies = [
"either",
]
[[package]] [[package]]
name = "itoa" name = "itoa"
version = "0.4.8" version = "0.4.8"
@ -872,10 +851,22 @@ dependencies = [
] ]
[[package]] [[package]]
name = "multimap" name = "native-tls"
version = "0.8.3" version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index" 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]] [[package]]
name = "nats" name = "nats"
@ -1076,12 +1067,39 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" 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]] [[package]]
name = "openssl-probe" name = "openssl-probe"
version = "0.1.4" version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28988d872ab76095a6e6ac88d99b54fd267702734fd7ffe610ca27f533ddb95a" 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]] [[package]]
name = "parking" name = "parking"
version = "2.0.0" version = "2.0.0"
@ -1119,16 +1137,6 @@ version = "2.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 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]] [[package]]
name = "pin-project" name = "pin-project"
version = "1.0.8" version = "1.0.8"
@ -1219,57 +1227,6 @@ dependencies = [
"thiserror", "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]] [[package]]
name = "protobuf" name = "protobuf"
version = "2.25.1" version = "2.25.1"
@ -1423,13 +1380,15 @@ dependencies = [
] ]
[[package]] [[package]]
name = "rest-ratelimiter" name = "rest"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"prost", "common",
"futures-util",
"hyper",
"hyper-tls",
"serde 1.0.130",
"tokio", "tokio",
"tonic",
"tonic-build",
] ]
[[package]] [[package]]
@ -1756,6 +1715,21 @@ dependencies = [
"winapi-util", "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]] [[package]]
name = "thiserror" name = "thiserror"
version = "1.0.29" version = "1.0.29"
@ -1822,16 +1796,6 @@ dependencies = [
"winapi", "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]] [[package]]
name = "tokio-macros" name = "tokio-macros"
version = "1.3.0" version = "1.3.0"
@ -1843,6 +1807,16 @@ dependencies = [
"syn", "syn",
] ]
[[package]]
name = "tokio-native-tls"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b"
dependencies = [
"native-tls",
"tokio",
]
[[package]] [[package]]
name = "tokio-rustls" name = "tokio-rustls"
version = "0.22.0" version = "0.22.0"
@ -1854,17 +1828,6 @@ dependencies = [
"webpki", "webpki",
] ]
[[package]]
name = "tokio-stream"
version = "0.1.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f"
dependencies = [
"futures-core",
"pin-project-lite",
"tokio",
]
[[package]] [[package]]
name = "tokio-tungstenite" name = "tokio-tungstenite"
version = "0.15.0" version = "0.15.0"
@ -1905,75 +1868,6 @@ dependencies = [
"serde 1.0.130", "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]] [[package]]
name = "tower-service" name = "tower-service"
version = "0.3.1" version = "0.3.1"
@ -1987,23 +1881,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d" checksum = "09adeb8c97449311ccd28a427f96fb563e7fd31aabf994189879d9da2394b89d"
dependencies = [ dependencies = [
"cfg-if", "cfg-if",
"log",
"pin-project-lite", "pin-project-lite",
"tracing-attributes",
"tracing-core", "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]] [[package]]
name = "tracing-core" name = "tracing-core"
version = "0.1.19" version = "0.1.19"
@ -2013,16 +1894,6 @@ dependencies = [
"lazy_static", "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]] [[package]]
name = "try-lock" name = "try-lock"
version = "0.2.3" version = "0.2.3"
@ -2072,12 +1943,6 @@ dependencies = [
"tinyvec", "tinyvec",
] ]
[[package]]
name = "unicode-segmentation"
version = "1.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8895849a949e7845e06bd6dc1aa51731a103c42707010a5b591c0038fb73385b"
[[package]] [[package]]
name = "unicode-xid" name = "unicode-xid"
version = "0.2.2" version = "0.2.2"
@ -2108,6 +1973,12 @@ version = "0.7.6"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9"
[[package]]
name = "vcpkg"
version = "0.2.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426"
[[package]] [[package]]
name = "version_check" name = "version_check"
version = "0.9.3" version = "0.9.3"
@ -2222,12 +2093,10 @@ name = "webhook"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"common", "common",
"config",
"hex", "hex",
"hyper", "hyper",
"libc",
"libsodium-sys", "libsodium-sys",
"log",
"nats",
"serde 1.0.130", "serde 1.0.130",
"serde_json", "serde_json",
"tokio", "tokio",
@ -2252,17 +2121,6 @@ dependencies = [
"webpki", "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]] [[package]]
name = "winapi" name = "winapi"
version = "0.3.9" version = "0.3.9"

View file

@ -2,10 +2,10 @@
members = [ members = [
"webhook", "webhook",
"ratelimiter",
"gateway", "gateway",
"cache", "cache",
"common/rust" "common/rust",
"rest"
] ]
[package] [package]
@ -50,4 +50,8 @@ buildrs_additional_environment_variables = { PATH = "/usr/sbin:/usr/bin:/sbin:/b
compile_data_attr = "glob([\"*/**\"])" compile_data_attr = "glob([\"*/**\"])"
additional_build_file = "bazel/patch/BUILD_script_patch" additional_build_file = "bazel/patch/BUILD_script_patch"
gen_buildrs = false gen_buildrs = false
additional_deps = [":libsodium_sys_build_script"] additional_deps = [":libsodium_sys_build_script"]
[package.metadata.raze.crates.value-bag.'*']
gen_buildrs = false

View file

@ -1,6 +1,3 @@
.PHONY: gazelle .PHONY: gazelle
gazelle: gazelle:
bazel run //:gazelle -- update-repos -build_file_name BUILD.bazel -from_file=go.mod -to_macro=deps.bzl%go_dependencies bazel run //:gazelle -- update-repos -build_file_name BUILD.bazel -from_file=go.mod -to_macro=deps.bzl%go_dependencies
.PHONY: docs
docs:

View file

@ -1,6 +1,4 @@
workspace(name = "nova") workspace(name = "nova")
#@unused
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
http_archive( http_archive(

View 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. # 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 = { _DEPENDENCIES = {
"webhook": { "webhook": {
"config": "@raze__config__0_11_0//:config",
"hex": "@raze__hex__0_4_3//:hex", "hex": "@raze__hex__0_4_3//:hex",
"hyper": "@raze__hyper__0_14_12//:hyper", "hyper": "@raze__hyper__0_14_12//:hyper",
"libc": "@raze__libc__0_2_101//:libc",
"libsodium-sys": "@raze__libsodium_sys__0_2_7//:libsodium_sys", "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": "@raze__serde__1_0_130//:serde",
"serde_json": "@raze__serde_json__1_0_67//:serde_json", "serde_json": "@raze__serde_json__1_0_67//:serde_json",
"tokio": "@raze__tokio__1_11_0//:tokio", "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", "pretty_env_logger": "@raze__pretty_env_logger__0_4_0//:pretty_env_logger",
"prometheus": "@raze__prometheus__0_12_0//:prometheus", "prometheus": "@raze__prometheus__0_12_0//:prometheus",
"serde": "@raze__serde__1_0_130//:serde", "serde": "@raze__serde__1_0_130//:serde",
"testcontainers": "@raze__testcontainers__0_12_0//:testcontainers",
"tokio": "@raze__tokio__1_11_0//:tokio", "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": { "gateway": {
"enumflags2": "@raze__enumflags2__0_7_1//:enumflags2", "enumflags2": "@raze__enumflags2__0_7_1//:enumflags2",
"futures": "@raze__futures__0_3_17//:futures", "futures": "@raze__futures__0_3_17//:futures",
"futures-util": "@raze__futures_util__0_3_17//:futures_util", "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": "@raze__num__0_4_0//:num",
"num-traits": "@raze__num_traits__0_2_14//:num_traits", "num-traits": "@raze__num_traits__0_2_14//:num_traits",
"serde": "@raze__serde__1_0_130//:serde", "serde": "@raze__serde__1_0_130//:serde",
@ -57,6 +50,13 @@ _DEPENDENCIES = {
"serde": "@raze__serde__1_0_130//:serde", "serde": "@raze__serde__1_0_130//:serde",
"serde_json": "@raze__serde_json__1_0_67//:serde_json", "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", "libc": "@raze__libc__0_2_101//:libc",
}, },
@ -68,14 +68,14 @@ _PROC_MACRO_DEPENDENCIES = {
}, },
"common/rust": { "common/rust": {
}, },
"ratelimiter": {
},
"gateway": { "gateway": {
"num-derive": "@raze__num_derive__0_3_3//:num_derive", "num-derive": "@raze__num_derive__0_3_3//:num_derive",
"serde_repr": "@raze__serde_repr__0_1_7//:serde_repr", "serde_repr": "@raze__serde_repr__0_1_7//:serde_repr",
}, },
"cache": { "cache": {
}, },
"rest": {
},
"": { "": {
}, },
} }
@ -86,13 +86,12 @@ _DEV_DEPENDENCIES = {
}, },
"common/rust": { "common/rust": {
}, },
"ratelimiter": {
"tonic-build": "@raze__tonic_build__0_5_2//:tonic_build",
},
"gateway": { "gateway": {
}, },
"cache": { "cache": {
}, },
"rest": {
},
"": { "": {
}, },
} }
@ -103,12 +102,12 @@ _DEV_PROC_MACRO_DEPENDENCIES = {
}, },
"common/rust": { "common/rust": {
}, },
"ratelimiter": {
},
"gateway": { "gateway": {
}, },
"cache": { "cache": {
}, },
"rest": {
},
"": { "": {
}, },
} }
@ -258,16 +257,6 @@ def raze_fetch_remote_crates():
build_file = Label("//cargo/remote:BUILD.aho-corasick-0.7.18.bazel"), 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( maybe(
http_archive, http_archive,
name = "raze__arrayvec__0_5_2", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__async_task__4_0_3", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__curve25519_dalek__3_2_0", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__enumflags2__0_7_1", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__fnv__1_0_7", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__form_urlencoded__1_0_1", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__hermit_abi__0_1_19", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__http__0_2_4", name = "raze__http__0_2_4",
@ -950,12 +929,12 @@ def raze_fetch_remote_crates():
maybe( maybe(
http_archive, http_archive,
name = "raze__hyper_timeout__0_4_1", name = "raze__hyper_tls__0_5_0",
url = "https://crates.io/api/v1/crates/hyper-timeout/0.4.1/download", url = "https://crates.io/api/v1/crates/hyper-tls/0.5.0/download",
type = "tar.gz", type = "tar.gz",
sha256 = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1", sha256 = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905",
strip_prefix = "hyper-timeout-0.4.1", strip_prefix = "hyper-tls-0.5.0",
build_file = Label("//cargo/remote:BUILD.hyper-timeout-0.4.1.bazel"), build_file = Label("//cargo/remote:BUILD.hyper-tls-0.5.0.bazel"),
) )
maybe( maybe(
@ -988,16 +967,6 @@ def raze_fetch_remote_crates():
build_file = Label("//cargo/remote:BUILD.instant-0.1.10.bazel"), 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( maybe(
http_archive, http_archive,
name = "raze__itoa__0_4_8", name = "raze__itoa__0_4_8",
@ -1140,12 +1109,12 @@ def raze_fetch_remote_crates():
maybe( maybe(
http_archive, http_archive,
name = "raze__multimap__0_8_3", name = "raze__native_tls__0_2_8",
url = "https://crates.io/api/v1/crates/multimap/0.8.3/download", url = "https://crates.io/api/v1/crates/native-tls/0.2.8/download",
type = "tar.gz", type = "tar.gz",
sha256 = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a", sha256 = "48ba9f7719b5a0f42f338907614285fb5fd70e53858141f69898a1fb7203b24d",
strip_prefix = "multimap-0.8.3", strip_prefix = "native-tls-0.2.8",
build_file = Label("//cargo/remote:BUILD.multimap-0.8.3.bazel"), build_file = Label("//cargo/remote:BUILD.native-tls-0.2.8.bazel"),
) )
maybe( maybe(
@ -1318,6 +1287,16 @@ def raze_fetch_remote_crates():
build_file = Label("//cargo/remote:BUILD.opaque-debug-0.3.0.bazel"), 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( maybe(
http_archive, http_archive,
name = "raze__openssl_probe__0_1_4", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__parking__2_0_0", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__pin_project__1_0_8", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__protobuf__2_25_1", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__thiserror__1_0_29", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__tokio_macros__1_3_0", name = "raze__tokio_macros__1_3_0",
@ -2108,6 +2047,16 @@ def raze_fetch_remote_crates():
build_file = Label("//cargo/remote:BUILD.tokio-macros-1.3.0.bazel"), build_file = Label("//cargo/remote:BUILD.tokio-macros-1.3.0.bazel"),
) )
maybe(
http_archive,
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 = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b",
strip_prefix = "tokio-native-tls-0.3.0",
build_file = Label("//cargo/remote:BUILD.tokio-native-tls-0.3.0.bazel"),
)
maybe( maybe(
http_archive, http_archive,
name = "raze__tokio_rustls__0_22_0", name = "raze__tokio_rustls__0_22_0",
@ -2118,16 +2067,6 @@ def raze_fetch_remote_crates():
build_file = Label("//cargo/remote:BUILD.tokio-rustls-0.22.0.bazel"), build_file = Label("//cargo/remote:BUILD.tokio-rustls-0.22.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",
type = "tar.gz",
sha256 = "7b2f3f698253f03119ac0102beaa64f67a67e08074d03a22d18784104543727f",
strip_prefix = "tokio-stream-0.1.7",
build_file = Label("//cargo/remote:BUILD.tokio-stream-0.1.7.bazel"),
)
maybe( maybe(
http_archive, http_archive,
name = "raze__tokio_tungstenite__0_15_0", name = "raze__tokio_tungstenite__0_15_0",
@ -2158,46 +2097,6 @@ def raze_fetch_remote_crates():
build_file = Label("//cargo/remote:BUILD.toml-0.5.8.bazel"), 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( maybe(
http_archive, http_archive,
name = "raze__tower_service__0_3_1", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__tracing_core__0_1_19", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__try_lock__0_2_3", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__unicode_xid__0_2_2", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__version_check__0_9_3", 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"), 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( maybe(
http_archive, http_archive,
name = "raze__winapi__0_3_9", name = "raze__winapi__0_3_9",

View file

@ -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

View file

@ -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",
],
)

View file

@ -31,7 +31,7 @@ licenses([
# Generated Targets # Generated Targets
rust_library( rust_library(
name = "heck", name = "crypto_mac",
srcs = glob(["**/*.rs"]), srcs = glob(["**/*.rs"]),
crate_features = [ crate_features = [
], ],
@ -46,9 +46,10 @@ rust_library(
"cargo-raze", "cargo-raze",
"manual", "manual",
], ],
version = "0.3.3", version = "0.10.1",
# buildifier: leave-alone # buildifier: leave-alone
deps = [ deps = [
"@raze__unicode_segmentation__1_8_0//:unicode_segmentation", "@raze__generic_array__0_14_4//:generic_array",
"@raze__subtle__2_4_1//:subtle",
], ],
) )

View file

@ -30,10 +30,8 @@ licenses([
# Generated Targets # Generated Targets
# Unsupported target "benches" with type "bench" omitted
rust_library( rust_library(
name = "fixedbitset", name = "foreign_types",
srcs = glob(["**/*.rs"]), srcs = glob(["**/*.rs"]),
crate_features = [ crate_features = [
], ],
@ -48,8 +46,9 @@ rust_library(
"cargo-raze", "cargo-raze",
"manual", "manual",
], ],
version = "0.2.0", version = "0.3.2",
# buildifier: leave-alone # buildifier: leave-alone
deps = [ deps = [
"@raze__foreign_types_shared__0_1_1//:foreign_types_shared",
], ],
) )

View file

@ -31,11 +31,9 @@ licenses([
# Generated Targets # Generated Targets
rust_library( rust_library(
name = "either", name = "foreign_types_shared",
srcs = glob(["**/*.rs"]), srcs = glob(["**/*.rs"]),
crate_features = [ crate_features = [
"default",
"use_std",
], ],
crate_root = "src/lib.rs", crate_root = "src/lib.rs",
crate_type = "lib", crate_type = "lib",
@ -48,7 +46,7 @@ rust_library(
"cargo-raze", "cargo-raze",
"manual", "manual",
], ],
version = "1.6.1", version = "0.1.1",
# buildifier: leave-alone # buildifier: leave-alone
deps = [ deps = [
], ],

View file

@ -31,7 +31,7 @@ licenses([
# Generated Targets # Generated Targets
rust_library( rust_library(
name = "tokio_io_timeout", name = "hmac",
srcs = glob(["**/*.rs"]), srcs = glob(["**/*.rs"]),
crate_features = [ crate_features = [
], ],
@ -46,10 +46,12 @@ rust_library(
"cargo-raze", "cargo-raze",
"manual", "manual",
], ],
version = "1.1.1", version = "0.10.1",
# buildifier: leave-alone # buildifier: leave-alone
deps = [ deps = [
"@raze__pin_project_lite__0_2_7//:pin_project_lite", "@raze__crypto_mac__0_10_1//:crypto_mac",
"@raze__tokio__1_11_0//:tokio", "@raze__digest__0_9_0//:digest",
], ],
) )
# Unsupported target "lib" with type "test" omitted

View file

@ -33,7 +33,7 @@ licenses([
# Unsupported target "client" with type "example" omitted # Unsupported target "client" with type "example" omitted
rust_library( rust_library(
name = "hyper_timeout", name = "hyper_tls",
srcs = glob(["**/*.rs"]), srcs = glob(["**/*.rs"]),
crate_features = [ crate_features = [
], ],
@ -48,12 +48,13 @@ rust_library(
"cargo-raze", "cargo-raze",
"manual", "manual",
], ],
version = "0.4.1", version = "0.5.0",
# buildifier: leave-alone # buildifier: leave-alone
deps = [ deps = [
"@raze__bytes__1_1_0//:bytes",
"@raze__hyper__0_14_12//:hyper", "@raze__hyper__0_14_12//:hyper",
"@raze__pin_project_lite__0_2_7//:pin_project_lite", "@raze__native_tls__0_2_8//:native_tls",
"@raze__tokio__1_11_0//:tokio", "@raze__tokio__1_11_0//:tokio",
"@raze__tokio_io_timeout__1_1_1//:tokio_io_timeout", "@raze__tokio_native_tls__0_3_0//:tokio_native_tls",
], ],
) )

View file

@ -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

View file

@ -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": [],
}),
)

View file

@ -37,7 +37,7 @@ load(
) )
cargo_build_script( cargo_build_script(
name = "prost_build_build_script", name = "openssl_build_script",
srcs = glob(["**/*.rs"]), srcs = glob(["**/*.rs"]),
build_script_env = { build_script_env = {
}, },
@ -53,16 +53,21 @@ cargo_build_script(
"cargo-raze", "cargo-raze",
"manual", "manual",
], ],
version = "0.8.0", version = "0.10.36",
visibility = ["//visibility:private"], visibility = ["//visibility:private"],
deps = [ deps = [
"@raze__which__4_2_2//:which", "@raze__openssl_sys__0_9_67//:openssl_sys",
], ],
) )
# Unsupported target "mk_certs" with type "example" omitted
rust_library( rust_library(
name = "prost_build", name = "openssl",
srcs = glob(["**/*.rs"]), srcs = glob(["**/*.rs"]),
aliases = {
"@raze__openssl_sys__0_9_67//:openssl_sys": "ffi",
},
crate_features = [ crate_features = [
], ],
crate_root = "src/lib.rs", crate_root = "src/lib.rs",
@ -76,18 +81,15 @@ rust_library(
"cargo-raze", "cargo-raze",
"manual", "manual",
], ],
version = "0.8.0", version = "0.10.36",
# buildifier: leave-alone # buildifier: leave-alone
deps = [ deps = [
":prost_build_build_script", ":openssl_build_script",
"@raze__bytes__1_1_0//:bytes", "@raze__bitflags__1_3_2//:bitflags",
"@raze__heck__0_3_3//:heck", "@raze__cfg_if__1_0_0//:cfg_if",
"@raze__itertools__0_10_1//:itertools", "@raze__foreign_types__0_3_2//:foreign_types",
"@raze__log__0_4_14//:log", "@raze__libc__0_2_101//:libc",
"@raze__multimap__0_8_3//:multimap", "@raze__once_cell__1_8_0//:once_cell",
"@raze__petgraph__0_5_1//:petgraph", "@raze__openssl_sys__0_9_67//:openssl_sys",
"@raze__prost__0_8_0//:prost",
"@raze__prost_types__0_8_0//:prost_types",
"@raze__tempfile__3_2_0//:tempfile",
], ],
) )

View file

@ -25,7 +25,7 @@ package(default_visibility = [
]) ])
licenses([ licenses([
"notice", # MIT from expression "MIT OR Apache-2.0" "notice", # MIT from expression "MIT"
]) ])
# Generated Targets # Generated Targets
@ -37,17 +37,16 @@ load(
) )
cargo_build_script( cargo_build_script(
name = "anyhow_build_script", name = "openssl_sys_build_script",
srcs = glob(["**/*.rs"]), srcs = glob(["**/*.rs"]),
build_script_env = { build_script_env = {
}, },
crate_features = [ crate_features = [
"default",
"std",
], ],
crate_root = "build.rs", crate_root = "build/main.rs",
data = glob(["**"]), data = glob(["**"]),
edition = "2018", edition = "2015",
links = "openssl",
rustc_flags = [ rustc_flags = [
"--cap-lints=allow", "--cap-lints=allow",
], ],
@ -55,23 +54,35 @@ cargo_build_script(
"cargo-raze", "cargo-raze",
"manual", "manual",
], ],
version = "1.0.43", version = "0.9.67",
visibility = ["//visibility:private"], visibility = ["//visibility:private"],
deps = [ 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( rust_library(
name = "anyhow", name = "openssl_sys",
srcs = glob(["**/*.rs"]), srcs = glob(["**/*.rs"]),
aliases = {
},
crate_features = [ crate_features = [
"default",
"std",
], ],
crate_root = "src/lib.rs", crate_root = "src/lib.rs",
crate_type = "lib", crate_type = "lib",
data = [], data = [],
edition = "2018", edition = "2015",
rustc_flags = [ rustc_flags = [
"--cap-lints=allow", "--cap-lints=allow",
], ],
@ -79,35 +90,18 @@ rust_library(
"cargo-raze", "cargo-raze",
"manual", "manual",
], ],
version = "1.0.43", version = "0.9.67",
# buildifier: leave-alone # buildifier: leave-alone
deps = [ deps = [
":anyhow_build_script", ":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": [],
}),
) )
# 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

View file

@ -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

View file

@ -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",
],
)

View file

@ -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",
],
)

View file

@ -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",
],
)

View file

@ -42,7 +42,6 @@ rust_library(
"libc", "libc",
"rand_chacha", "rand_chacha",
"rand_hc", "rand_hc",
"small_rng",
"std", "std",
"std_rng", "std_rng",
], ],

View file

@ -35,6 +35,7 @@ rust_library(
srcs = glob(["**/*.rs"]), srcs = glob(["**/*.rs"]),
crate_features = [ crate_features = [
"OSX_10_9", "OSX_10_9",
"default",
], ],
crate_root = "src/lib.rs", crate_root = "src/lib.rs",
crate_type = "lib", crate_type = "lib",

View file

@ -44,6 +44,8 @@ rust_library(
aliases = { aliases = {
}, },
crate_features = [ crate_features = [
"default",
"std",
], ],
crate_root = "src/lib.rs", crate_root = "src/lib.rs",
crate_type = "lib", crate_type = "lib",

View file

@ -30,14 +30,8 @@ licenses([
# Generated Targets # 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( rust_library(
name = "unicode_segmentation", name = "testcontainers",
srcs = glob(["**/*.rs"]), srcs = glob(["**/*.rs"]),
crate_features = [ crate_features = [
], ],
@ -52,8 +46,19 @@ rust_library(
"cargo-raze", "cargo-raze",
"manual", "manual",
], ],
version = "1.8.0", version = "0.12.0",
# buildifier: leave-alone # buildifier: leave-alone
deps = [ 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

View file

@ -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

View file

@ -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

View file

@ -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",
],
)

View file

@ -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",
],
)

View file

@ -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

View file

@ -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 = [
],
)

View file

@ -40,19 +40,12 @@ rust_library(
aliases = { aliases = {
}, },
crate_features = [ crate_features = [
"attributes",
"default",
"log",
"std", "std",
"tracing-attributes",
], ],
crate_root = "src/lib.rs", crate_root = "src/lib.rs",
crate_type = "lib", crate_type = "lib",
data = [], data = [],
edition = "2018", edition = "2018",
proc_macro_deps = [
"@raze__tracing_attributes__0_1_15//:tracing_attributes",
],
rustc_flags = [ rustc_flags = [
"--cap-lints=allow", "--cap-lints=allow",
], ],
@ -64,7 +57,6 @@ rust_library(
# buildifier: leave-alone # buildifier: leave-alone
deps = [ deps = [
"@raze__cfg_if__1_0_0//:cfg_if", "@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__pin_project_lite__0_2_7//:pin_project_lite",
"@raze__tracing_core__0_1_19//:tracing_core", "@raze__tracing_core__0_1_19//:tracing_core",
] + selects.with_or({ ] + selects.with_or({

View file

@ -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

View file

@ -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

View file

@ -31,7 +31,7 @@ licenses([
# Generated Targets # Generated Targets
rust_library( rust_library(
name = "multimap", name = "vcpkg",
srcs = glob(["**/*.rs"]), srcs = glob(["**/*.rs"]),
crate_features = [ crate_features = [
], ],
@ -46,7 +46,7 @@ rust_library(
"cargo-raze", "cargo-raze",
"manual", "manual",
], ],
version = "0.8.3", version = "0.2.15",
# buildifier: leave-alone # buildifier: leave-alone
deps = [ deps = [
], ],

View file

@ -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

View file

@ -11,4 +11,5 @@ config = "0.11"
hyper = { version = "0.14", features = ["full"] } hyper = { version = "0.14", features = ["full"] }
tokio = { version = "1", features = ["full"] } tokio = { version = "1", features = ["full"] }
prometheus = "0.12.0" prometheus = "0.12.0"
nats = "0.15.2" nats = "0.15.2"
testcontainers = "0.12.0"

View file

@ -75,6 +75,15 @@ alias(
], ],
) )
alias(
name = "testcontainers",
actual = "@raze__testcontainers__0_12_0//:testcontainers",
tags = [
"cargo-raze",
"manual",
],
)
alias( alias(
name = "tokio", name = "tokio",
actual = "@raze__tokio__1_11_0//:tokio", actual = "@raze__tokio__1_11_0//:tokio",

View file

@ -1,5 +1,5 @@
use std::env; use std::env;
use config::{Config, ConfigError, Environment, File, Source}; use config::{Config, ConfigError, Environment, File};
use log::info; use log::info;
use serde::Deserialize; use serde::Deserialize;
@ -24,6 +24,8 @@ where
/// Initializes a new configuration like the other components of nova /// Initializes a new configuration like the other components of nova
/// And starts the prometheus metrics server if needed. /// And starts the prometheus metrics server if needed.
pub fn new(service_name: &str) -> Result<Settings<T>, ConfigError> { pub fn new(service_name: &str) -> Result<Settings<T>, ConfigError> {
pretty_env_logger::init();
let mut default = Config::default(); let mut default = Config::default();
// this file my be shared with all the components // this file my be shared with all the components
default.merge(File::with_name("config/default"))?; default.merge(File::with_name("config/default"))?;
@ -34,17 +36,19 @@ where
default.merge(File::with_name("config/local").required(false))?; default.merge(File::with_name("config/local").required(false))?;
let env = Environment::with_prefix("NOVA").separator("__"); let env = Environment::with_prefix("NOVA").separator("__");
println!("{:?}", env.collect());
// we can configure each component using environment variables // we can configure each component using environment variables
default.merge(env)?; default.merge(env)?;
let mut config: Settings<T> = default.clone().try_into().unwrap(); let mut config: Settings<T> = default.clone().try_into().unwrap();
// try to load the config // try to load the config
config.config = default.get::<T>(&service_name).unwrap(); config.config = default.get::<T>(&service_name).unwrap();
pretty_env_logger::init();
// start the monitoring system if needed // start the monitoring system if needed
crate::monitoring::start_monitoring(&config.monitoring); crate::monitoring::start_monitoring(&config.monitoring);
Ok(config) Ok(config)
} }
} }
pub fn test_init() {
pretty_env_logger::init();
}

View file

@ -5,3 +5,10 @@ pub mod monitoring;
pub mod nats; pub mod nats;
pub mod payloads; pub mod payloads;
pub mod error; 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;

View file

@ -1,19 +1,19 @@
use hyper::{ use hyper::{
Response, Body, Request, Server, header::CONTENT_TYPE,
header::{CONTENT_TYPE},
service::{make_service_fn, service_fn}, service::{make_service_fn, service_fn},
Body, Request, Response, Server,
}; };
use std::net::ToSocketAddrs; use log::{error, info};
use prometheus::{Encoder, TextEncoder}; use prometheus::{Encoder, TextEncoder};
use log::{info,error};
use serde::Deserialize; use serde::Deserialize;
use std::net::ToSocketAddrs;
#[derive(Clone, Debug, Deserialize)] #[derive(Clone, Debug, Deserialize)]
/// Options for the monitoring service /// Options for the monitoring service
pub struct MonitoringConfiguration { pub struct MonitoringConfiguration {
enabled: bool, pub enabled: bool,
address: Option<String>, pub address: Option<String>,
port: Option<i32>, pub port: Option<i32>,
} }
/// Handler for the hyper http server /// Handler for the hyper http server
@ -37,17 +37,18 @@ pub fn start_monitoring(configuration: &MonitoringConfiguration) {
let config = configuration.clone(); let config = configuration.clone();
tokio::task::spawn(async move { tokio::task::spawn(async move {
if config.enabled { if config.enabled {
let address = format!("{}:{}", 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") 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); info!("Starting monitoring server on {}", address);
let listen_address = address let listen_address = address.to_socket_addrs().unwrap().next().unwrap();
.to_socket_addrs()
.unwrap()
.next()
.unwrap();
let server = Server::bind(&listen_address).serve(make_service_fn(|_| async { let server = Server::bind(&listen_address).serve(make_service_fn(|_| async {
Ok::<_, hyper::Error>(service_fn(serve_metrics)) Ok::<_, hyper::Error>(service_fn(serve_metrics))
})); }));
@ -57,4 +58,4 @@ pub fn start_monitoring(configuration: &MonitoringConfiguration) {
} }
} }
}); });
} }

View file

@ -1,33 +1,34 @@
use nats::{Options, Connection}; use nats::{Connection, Options};
use serde::Deserialize; use serde::Deserialize;
#[derive(Clone, Debug, Deserialize)] #[derive(Clone, Debug, Deserialize)]
struct NatsConfigurationClientCert { pub struct NatsConfigurationClientCert {
cert: String, pub cert: String,
key: String pub key: String,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Clone, Debug, Deserialize)]
struct NatsConfigurationTls { pub struct NatsConfigurationTls {
mtu: Option<usize>, pub mtu: Option<usize>,
} }
#[derive(Clone, Debug, Deserialize)] #[derive(Clone, Debug, Deserialize)]
pub struct NatsConfiguration { pub struct NatsConfiguration {
client_cert: Option<NatsConfigurationClientCert>, pub client_cert: Option<NatsConfigurationClientCert>,
root_cert: Option<Vec<String>>, pub root_cert: Option<Vec<String>>,
jetstream_api_prefix: Option<String>, pub jetstream_api_prefix: Option<String>,
max_reconnects: Option<usize>, pub max_reconnects: Option<usize>,
reconnect_buffer_size: Option<usize>, pub reconnect_buffer_size: Option<usize>,
tls: Option<NatsConfigurationTls>, pub tls: Option<NatsConfigurationTls>,
client_name: Option<String>, pub client_name: Option<String>,
tls_required: Option<bool>, pub tls_required: Option<bool>,
host: String, pub host: String,
} }
// Allows the configuration to directly create a nats connection
impl Into<Connection> for NatsConfiguration { impl Into<Connection> for NatsConfiguration {
fn into(self) -> Connection { fn into(self) -> Connection {
let mut options = Options::new(); let mut options = Options::new();
if let Some(client_cert) = self.client_cert { if let Some(client_cert) = self.client_cert {
options = options.client_cert(client_cert.cert, client_cert.key); 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.tls_required(self.tls_required.unwrap_or(false));
options = options.with_name(&self.client_name.unwrap_or("Nova".to_string())); options = options.with_name(&self.client_name.unwrap_or("Nova".to_string()));
if let Some(tls) = self.tls { if let Some(tls) = self.tls {
let mut config = nats::rustls::ClientConfig::new(); let mut config = nats::rustls::ClientConfig::new();
config.set_mtu(&tls.mtu); config.set_mtu(&tls.mtu);

View file

@ -1,8 +1,6 @@
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::fmt::Debug; use std::fmt::Debug;
/// Data structure sent to the cache component /// Data structure sent to the cache component
/// by the gateway & webhook. /// by the gateway & webhook.
#[derive(Serialize, Deserialize, Debug)] #[derive(Serialize, Deserialize, Debug)]

View file

@ -1,5 +1,8 @@
package common package common
// This is a file that will be replaced
// by the `version_template` target in bazel
const ( const (
VERSION = "$VERSION" VERSION = "$VERSION"
) )

17
config/default.json Normal file
View file

@ -0,0 +1,17 @@
{
"monitoring": {
"enabled": false
},
"nats": {
"host": "localhost"
},
"rest": {
"server": {
"port": 8000,
"address": "0.0.0.0"
},
"discord": {
"token": "<your token>"
}
}
}

View file

@ -2,9 +2,12 @@ version: "3.3"
services: services:
nats: nats:
image: 'nats' image: 'nats'
expose:
- "4222:422"
ports: ports:
- "8222:8222" - "8222:8222"
- "4222:4222" - "4222:4222"
hostname: nats-server hostname: nats-server
redis:
image: 'redis'
ports:
- "6379:6379"
hostname: redis

View file

@ -22,7 +22,7 @@ const darkCodeTheme = require('prism-react-renderer/themes/dracula');
docs: { docs: {
sidebarPath: require.resolve('./sidebars.js'), sidebarPath: require.resolve('./sidebars.js'),
// Please change this to your repo. // 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: { theme: {
customCss: require.resolve('./src/css/custom.css'), customCss: require.resolve('./src/css/custom.css'),

View file

@ -5,12 +5,12 @@ edition = "2018"
[dependencies] [dependencies]
common = { path = "../common/rust" } common = { path = "../common/rust" }
tokio = { version = "1", features = ["full"] }
tokio-tungstenite = { version = "*", features = ["rustls-tls"] } tokio-tungstenite = { version = "*", features = ["rustls-tls"] }
tokio = { version = "1", features = ["full"] }
url = "2.2.2" url = "2.2.2"
futures-util = "0.3.17" futures-util = "0.3.17"
futures = "0.3.17" futures = "0.3.17"
log = { version = "0.4", features = ["std"] }
serde_json = { version = "1.0" } serde_json = { version = "1.0" }
serde = { version = "1.0", features = ["derive"] } serde = { version = "1.0", features = ["derive"] }
@ -19,4 +19,4 @@ enumflags2 = { version = "0.7.1", features = ["serde"] }
num-traits = "0.2" num-traits = "0.2"
num-derive = "0.3" num-derive = "0.3"
num = "0.4" num = "0.4"

View file

@ -1,3 +0,0 @@
# Gateway
The gateway component managed the connexion with the Discord event gateway using a websocket connexion.

View file

@ -39,15 +39,6 @@ alias(
], ],
) )
alias(
name = "log",
actual = "@raze__log__0_4_14//:log",
tags = [
"cargo-raze",
"manual",
],
)
alias( alias(
name = "num", name = "num",
actual = "@raze__num__0_4_0//:num", actual = "@raze__num__0_4_0//:num",

View file

@ -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

View file

@ -2,7 +2,7 @@ use crate::{error::GatewayError, payloads::gateway::BaseMessage};
use super::Connection; use super::Connection;
use futures::{FutureExt, Sink, SinkExt, Stream, StreamExt}; use futures::{FutureExt, Sink, SinkExt, Stream, StreamExt};
use log::info; use common::log::info;
use serde::Serialize; use serde::Serialize;
use std::{ use std::{
pin::Pin, pin::Pin,

View file

@ -1,6 +1,6 @@
use std::str::from_utf8; use std::str::from_utf8;
use tokio_tungstenite::tungstenite::Message; use tokio_tungstenite::tungstenite::Message;
use log::info; use common::log::info;
use crate::error::GatewayError; use crate::error::GatewayError;

View file

@ -1,7 +1,7 @@
use std::env; use std::env;
use futures::SinkExt; use futures::SinkExt;
use log::{debug, error, info}; use common::log::{debug, error, info};
use serde::Serialize; use serde::Serialize;
use serde_json::Value; use serde_json::Value;
use std::fmt::Debug; use std::fmt::Debug;

View file

@ -7,8 +7,8 @@ use crate::{connection::Connection, error::GatewayError, payloads::{
use super::{state::ConnectionState, ConnectionWithState, Shard}; use super::{state::ConnectionState, ConnectionWithState, Shard};
use futures::StreamExt; use futures::StreamExt;
use log::{error, info}; use common::{log::{error, info}};
use tokio::{select, time::{Instant, sleep}}; use tokio::{select, time::{Instant, interval_at, sleep}};
impl Shard { impl Shard {
pub async fn start(self: &mut Self) { pub async fn start(self: &mut Self) {
@ -159,7 +159,7 @@ impl Shard {
info!("Server hello received"); info!("Server hello received");
self._util_set_seq(msg.sequence); self._util_set_seq(msg.sequence);
if let Some(conn) = &mut self.connection { 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), Instant::now() + Duration::from_millis(msg.data.heartbeat_interval),
Duration::from_millis(msg.data.heartbeat_interval), Duration::from_millis(msg.data.heartbeat_interval),
)); ));

View file

@ -1,3 +0,0 @@
# Novactl
Novactl is a simple command-line utility used to interact with your nova projects, and the nova infrastructure.

View file

@ -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"],
)

View file

@ -1,20 +0,0 @@
[package]
name = "rest-ratelimiter"
version = "0.1.0"
edition = "2018"
[dependencies]
tonic = "0.5"
prost = "0.8"
tokio = { version = "1", features = ["full"] }
[[bin]]
name = "rest-ratelimiter"
path = "src/main.rs"
[build-dependencies]
tonic-build = { version = "0.5", features = ["transport", "prost"], default-features = false }
[dev-dependencies]
tonic-build = { version = "0.5", features = ["transport", "prost"], default-features = false }

View file

@ -1,5 +0,0 @@
# Ratelimiter
This is an implementation of the ratelimiting service described in the `proto/nova.ratelimit.v1.proto`.
The library is divied in two part, a Rust library, built as a static library, and a rust executable that implements
the rate limiting algorithm. A FFI interface is exposed by the Rust static library for use in the nova-lite component.

View file

@ -1,4 +0,0 @@
fn main() -> Result<(), Box<dyn std::error::Error>> {
tonic_build::compile_protos("proto/nova.ratelimit.v1alpha.proto").unwrap();
Ok(())
}

View file

@ -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"],
)

View file

@ -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);
}

View file

@ -1,45 +0,0 @@
// Some implementation of the gRPC service using the shared library.
pub mod ratelimit_pb {
tonic::include_proto!("nova.ratelimit.v1alpha");
}
use ratelimit_pb::ratelimit_service_server::{RatelimitService, RatelimitServiceServer};
use ratelimit_pb::{CreateBucketData, RatelimitRequest, RatelimitResponse};
use std::error::Error;
use tonic::transport::Server;
use tonic::{Request, Response, Status};
#[derive(Default)]
pub struct MyRatelimitService {}
#[tonic::async_trait]
impl RatelimitService for MyRatelimitService {
async fn get_ratelimit_status(
&self,
_request: Request<RatelimitRequest>,
) -> Result<Response<RatelimitResponse>, Status> {
return Err(Status::not_found("Not implmented"));
}
async fn create_bucket(
&self,
_request: Request<CreateBucketData>,
) -> Result<Response<CreateBucketData>, Status> {
return Err(tonic::Status::not_found("Not implmented"));
}
}
#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
let addr = "[::1]:50051".parse().unwrap();
let service = MyRatelimitService::default();
println!("GreeterServer listening on {}", addr);
Server::builder()
.add_service(RatelimitServiceServer::new(service))
.serve(addr)
.await?;
Ok(())
}

24
rest/BUILD Normal file
View file

@ -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"],
)

14
rest/Cargo.toml Normal file
View file

@ -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"

58
rest/cargo/BUILD.bazel Normal file
View file

@ -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",
],
)

18
rest/src/config.rs Normal file
View file

@ -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,
}

35
rest/src/main.rs Normal file
View file

@ -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);
}
}

74
rest/src/proxy/mod.rs Normal file
View file

@ -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 }
}
}

View file

@ -6,14 +6,12 @@ edition = "2018"
[dependencies] [dependencies]
hyper = { version = "0.14", features = ["full"] } hyper = { version = "0.14", features = ["full"] }
tokio = { version = "1", features = ["full"] } tokio = { version = "1", features = ["full"] }
log = { version = "0.4", features = ["std"] } common = { path = "../common/rust" }
config = "0.11"
serde = { version = "1.0.8", features = ["derive"] } serde = { version = "1.0.8", features = ["derive"] }
libsodium-sys = "0.2.7" libsodium-sys = "0.2.7"
hex = "0.4.3" hex = "0.4.3"
serde_json = { version = "1.0" } serde_json = { version = "1.0" }
common = { path = "../common/rust" } libc = "0.2.101"
nats = "0.15.2"
[[bin]] [[bin]]
name = "webhook" name = "webhook"

View file

View file

@ -12,15 +12,6 @@ licenses([
]) ])
# Aliased targets # Aliased targets
alias(
name = "config",
actual = "@raze__config__0_11_0//:config",
tags = [
"cargo-raze",
"manual",
],
)
alias( alias(
name = "hex", name = "hex",
actual = "@raze__hex__0_4_3//:hex", actual = "@raze__hex__0_4_3//:hex",
@ -39,6 +30,15 @@ alias(
], ],
) )
alias(
name = "libc",
actual = "@raze__libc__0_2_101//:libc",
tags = [
"cargo-raze",
"manual",
],
)
alias( alias(
name = "libsodium_sys", name = "libsodium_sys",
actual = "@raze__libsodium_sys__0_2_7//:libsodium_sys", actual = "@raze__libsodium_sys__0_2_7//:libsodium_sys",
@ -48,24 +48,6 @@ alias(
], ],
) )
alias(
name = "log",
actual = "@raze__log__0_4_14//:log",
tags = [
"cargo-raze",
"manual",
],
)
alias(
name = "nats",
actual = "@raze__nats__0_15_2//:nats",
tags = [
"cargo-raze",
"manual",
],
)
alias( alias(
name = "serde", name = "serde",
actual = "@raze__serde__1_0_130//:serde", actual = "@raze__serde__1_0_130//:serde",

View file

@ -5,17 +5,10 @@ use hyper::{
service::Service, service::Service,
Body, Method, Request, Response, StatusCode, Body, Method, Request, Response, StatusCode,
}; };
use log::{error, info, trace}; use common::log::{error, info, trace};
use nats::Connection; use common::nats_crate::Connection;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use std::{ use std::{future::Future, io::{Error, ErrorKind}, pin::Pin, str::from_utf8, sync::Arc, task::{Context, Poll}, time::Duration};
future::Future,
io::{Error, ErrorKind},
pin::Pin,
str::from_utf8,
sync::Arc,
task::{Context, Poll},
};
/// Hyper service used to handle the discord webhooks /// Hyper service used to handle the discord webhooks
#[derive(Clone)] #[derive(Clone)]
@ -105,13 +98,14 @@ impl Service<Request<Body>> for HandlerService {
node_id: "".to_string(), node_id: "".to_string(),
span: None, span: None,
}, },
operation: "".to_string(),
data: value, data: value,
}) })
.unwrap(); .unwrap();
match self_clone match self_clone
.nats .nats
.request("nova.cache.dispatch.interaction", payload) .request_timeout("nova.cache.dispatch.interaction", payload, Duration::from_secs(2))
{ {
Ok(response) => Ok(Response::builder() Ok(response) => Ok(Response::builder()
.header("Content-Type", "application/json") .header("Content-Type", "application/json")

View file

@ -1,7 +1,7 @@
use super::handler::HandlerService; use super::handler::HandlerService;
use crate::config::Config; use crate::config::Config;
use hyper::service::Service; use hyper::service::Service;
use nats::Connection; use common::nats_crate::Connection;
use std::{ use std::{
future::{ready, Ready}, future::{ready, Ready},
sync::Arc, sync::Arc,

View file

@ -1,4 +1,5 @@
pub mod make_service; pub mod make_service;
mod signature; mod signature;
mod handler; mod handler;
mod types; mod types;
pub mod tests;

View file

@ -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);
}

View file

@ -0,0 +1 @@
pub mod handler;

View file

@ -5,14 +5,16 @@ use crate::handler::make_service::MakeSvc;
use crate::config::Config; use crate::config::Config;
use common::config::Settings; use common::config::Settings;
use common::log::{error, info};
use hyper::Server; use hyper::Server;
use log::{error, info};
#[tokio::main] #[tokio::main]
async fn main() { async fn main() {
let settings: Settings<Config> = Settings::new("webhook").unwrap(); let settings: Settings<Config> = Settings::new("webhook").unwrap();
println!("{:?}", settings); start(settings).await;
}
async fn start(settings: Settings<Config>) {
let addr = format!( let addr = format!(
"{}:{}", "{}:{}",
settings.config.server.address, settings.config.server.port settings.config.server.address, settings.config.server.port
@ -27,12 +29,13 @@ async fn main() {
settings.config.server.address, settings.config.server.port settings.config.server.address, settings.config.server.port
); );
let config = Arc::new(settings.config);
let server = Server::bind(&addr).serve(MakeSvc { let server = Server::bind(&addr).serve(MakeSvc {
settings: settings.config.clone(), settings: config,
nats: Arc::new(settings.nats.into()), nats: Arc::new(settings.nats.into()),
}); });
if let Err(e) = server.await { if let Err(e) = server.await {
error!("server error: {}", e); panic!("server error: {}", e);
} }
} }