From bb188949dfe3d28d91b9a8d499f11058c45603a8 Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Mon, 26 Sep 2022 12:58:01 +0100 Subject: [PATCH] Update dependencies + fix clippy warnings. --- Cargo.lock | 462 +++++++----------- Dockerfile | 3 +- Dockerfile-devel | 5 +- api/Dockerfile-rust | 4 +- api/rust/Cargo.lock | 140 +++--- api/rust/Cargo.toml | 16 +- chirpstack/Cargo.toml | 67 ++- chirpstack/src/adr/mod.rs | 2 +- chirpstack/src/api/auth/claims.rs | 2 +- chirpstack/src/api/auth/mod.rs | 2 +- chirpstack/src/api/error.rs | 2 +- chirpstack/src/downlink/classb.rs | 3 +- chirpstack/src/downlink/data.rs | 2 +- chirpstack/src/downlink/tx_ack.rs | 4 +- chirpstack/src/gpstime.rs | 2 +- chirpstack/src/maccommand/dev_status.rs | 4 +- chirpstack/src/maccommand/device_mode_ind.rs | 2 +- chirpstack/src/maccommand/device_time.rs | 2 +- chirpstack/src/maccommand/link_check.rs | 2 +- chirpstack/src/maccommand/ping_slot_info.rs | 2 +- .../src/maccommand/rejoin_param_setup.rs | 4 +- chirpstack/src/maccommand/rekey.rs | 2 +- chirpstack/src/maccommand/reset.rs | 2 +- chirpstack/src/maccommand/rx_param_setup.rs | 4 +- chirpstack/src/maccommand/rx_timing_setup.rs | 2 +- chirpstack/src/maccommand/tx_param_setup.rs | 2 +- chirpstack/src/main.rs | 4 +- chirpstack/src/storage/api_key.rs | 2 +- chirpstack/src/storage/application.rs | 30 +- chirpstack/src/storage/device.rs | 6 +- chirpstack/src/storage/device_profile.rs | 4 +- .../src/storage/device_profile_template.rs | 4 +- chirpstack/src/storage/device_queue.rs | 2 +- chirpstack/src/storage/fields.rs | 8 +- chirpstack/src/storage/gateway.rs | 2 +- chirpstack/src/storage/metrics.rs | 2 +- chirpstack/src/storage/multicast.rs | 22 +- chirpstack/src/storage/tenant.rs | 6 +- chirpstack/src/storage/user.rs | 5 +- chirpstack/src/uplink/data.rs | 4 +- chirpstack/src/uplink/join.rs | 2 +- chirpstack/src/uplink/join_sns.rs | 2 +- lrwn/Cargo.toml | 6 +- lrwn/src/keys.rs | 2 +- lrwn/src/phy_payload.rs | 12 +- ui/yarn.lock | 2 +- 46 files changed, 398 insertions(+), 473 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c8f64d0..ad11fa07 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,18 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "aes" -version = "0.7.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" -dependencies = [ - "cfg-if", - "cipher 0.3.0", - "cpufeatures", - "opaque-debug 0.3.0", -] - [[package]] name = "aes" version = "0.8.1" @@ -21,7 +9,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfe0133578c0986e1fe3dfcd4af1cc5b2dd6c3dbf534d69916ce16a2701d40ba" dependencies = [ "cfg-if", - "cipher 0.4.3", + "cipher", "cpufeatures", ] @@ -31,7 +19,7 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69fa2b352dcefb5f7f3a5fb840e02665d311d878955380515e4fd50095dd3d8c" dependencies = [ - "aes 0.8.1", + "aes", ] [[package]] @@ -91,6 +79,15 @@ dependencies = [ "url", ] +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "ansi_term" version = "0.12.1" @@ -344,11 +341,12 @@ checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "aws-config" -version = "0.3.0" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46634223c537ac88e5500cbb992afb0012b4533d8cbdfe337643bf512f3126b9" +checksum = "b309b2154d224728d845a958c580834f24213037ed61b195da80c0b0fc7469fa" dependencies = [ "aws-http", + "aws-sdk-sso", "aws-sdk-sts", "aws-smithy-async", "aws-smithy-client", @@ -358,19 +356,25 @@ dependencies = [ "aws-smithy-types", "aws-types", "bytes", + "hex", "http", + "hyper", + "ring", + "time 0.3.11", "tokio", "tower", "tracing", + "zeroize", ] [[package]] name = "aws-endpoint" -version = "0.3.0" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30594dc47241751ecd8bf15b3440a7ff27c0e947a0f3152863fd4c6a0e82ac90" +checksum = "76f35c8f5877ad60db4f0d9dcdfbcb2233a8cc539f9e568df39ee0581ec62e89" dependencies = [ "aws-smithy-http", + "aws-smithy-types", "aws-types", "http", "regex", @@ -379,23 +383,27 @@ dependencies = [ [[package]] name = "aws-http" -version = "0.3.0" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c6f0268ebab22b6ed41ae78b3e04c35e2bf524cce555e4ce2b78c45f2048066" +checksum = "2f5422c9632d887968ccb66e2871a6d190d6104e276034912bee72ef58a5d890" dependencies = [ "aws-smithy-http", "aws-smithy-types", "aws-types", + "bytes", "http", + "http-body", "lazy_static", + "percent-encoding", + "pin-project-lite", "tracing", ] [[package]] name = "aws-sdk-sns" -version = "0.3.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee6c2350e9f7bb7630fc93bc2074e2e108acf884eaddf159275ba911fee37c0" +checksum = "bfdba3a74bd5b4d0bc4708f6670d05ed1fd8d1e7c96e099dc783a52f7edfa273" dependencies = [ "aws-endpoint", "aws-http", @@ -410,14 +418,37 @@ dependencies = [ "aws-types", "bytes", "http", + "tokio-stream", + "tower", +] + +[[package]] +name = "aws-sdk-sso" +version = "0.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2cc8b50281e1350d0b5c7207c2ce53c6721186ad196472caff4f20fa4b42e96" +dependencies = [ + "aws-endpoint", + "aws-http", + "aws-sig-auth", + "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", + "aws-smithy-http-tower", + "aws-smithy-json", + "aws-smithy-types", + "aws-types", + "bytes", + "http", + "tokio-stream", "tower", ] [[package]] name = "aws-sdk-sts" -version = "0.3.0" +version = "0.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80da5ff48de4b884a7d31138a05a5adf2db2a4b53b2457324c22019984e775d9" +checksum = "d6179f13c9fbab3226860f377354dece860e34ff129b69c7c1b0fa828d1e9c76" dependencies = [ "aws-endpoint", "aws-http", @@ -437,23 +468,22 @@ dependencies = [ [[package]] name = "aws-sig-auth" -version = "0.3.0" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a9dffed5192181706d6702c2ddc569341b12b1011f6ce36dbd560a846fb55ac" +checksum = "b16f4d70c9c865af392eb40cacfe2bec3fa18f651fbdf49919cfc1dda13b189e" dependencies = [ "aws-sigv4", "aws-smithy-http", "aws-types", "http", - "thiserror", "tracing", ] [[package]] name = "aws-sigv4" -version = "0.3.0" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "066def5814ac312f4f4c0a3aa09af45b1fca19317247b0ffa06d4b1d1f0d815a" +checksum = "8d33790cecae42b999d197074c8a19e9b96b9e346284a6f93989e7489c9fa0f5" dependencies = [ "aws-smithy-http", "form_urlencoded", @@ -469,19 +499,21 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "0.33.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "907295d2d53d55ae31228647e3382be0f2f4706d6c43a7e8b23f5cfdbe224fb2" +checksum = "bc604f278bae64bbd15854baa9c46ed69a56dfb0669d04aab80974749f2d6599" dependencies = [ + "futures-util", "pin-project-lite", "tokio", + "tokio-stream", ] [[package]] name = "aws-smithy-client" -version = "0.33.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "484dfc5febf1290e305479288a703120fd35e996182105e4cd97afe69e0d11a0" +checksum = "ec39585f8274fa543ad5c63cc09cbd435666be16b2cf99e4e07be5cf798bc050" dependencies = [ "aws-smithy-async", "aws-smithy-http", @@ -494,7 +526,6 @@ dependencies = [ "hyper", "hyper-rustls 0.22.1", "lazy_static", - "pin-project", "pin-project-lite", "tokio", "tower", @@ -503,9 +534,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.33.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a4b8e568f284def4d1edfb0705e7058928f355ae264c44359b80f021e24d419" +checksum = "014a0ef5c4508fc2f6a9d3925c214725af19f020ea388db48e20196cc4cc9d6d" dependencies = [ "aws-smithy-types", "bytes", @@ -514,54 +545,55 @@ dependencies = [ "http", "http-body", "hyper", + "once_cell", "percent-encoding", - "pin-project", + "pin-project-lite", "tokio", - "tokio-util 0.6.10", + "tokio-util 0.7.3", "tracing", ] [[package]] name = "aws-smithy-http-tower" -version = "0.33.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db222d9dbca42fa0d19ea803826f88153c14144c38915d5121e981b45c5f2cee" +checksum = "deecb478dc3cc40203e0e97ac0fb92947e0719754bbafd0026bdc49318e2fd03" dependencies = [ "aws-smithy-http", "bytes", "http", "http-body", - "pin-project", + "pin-project-lite", "tower", "tracing", ] [[package]] name = "aws-smithy-json" -version = "0.33.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acdb867f28532243d923fd2ef8b5a1d44e461b841e75a78c2c276b1918b5e842" +checksum = "6593456af93c4a39724f7dc9d239833102ab96c1d1e94c35ea79f0e55f9fd54c" dependencies = [ "aws-smithy-types", ] [[package]] name = "aws-smithy-query" -version = "0.33.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00d2169a63763651b835912aae357cfea9ad889468aa8828117b10c2329c6231" +checksum = "b803460b71645dfa9f6be47c4f00f91632f01e5bb01f9dc43890cd6cba983f08" dependencies = [ "aws-smithy-types", - "urlencoding 1.3.3", + "urlencoding", ] [[package]] name = "aws-smithy-types" -version = "0.33.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "420eb4743434a99ce9ba270bec3ef242884d407bff0bca7d16b5b0457a7d3782" +checksum = "e93b0c93a3b963da946a0b8ef3853a7252298eb75cdbfb21dad60f5ed0ded861" dependencies = [ - "itoa 0.4.8", + "itoa 1.0.2", "num-integer", "ryu", "time 0.3.11", @@ -569,22 +601,24 @@ dependencies = [ [[package]] name = "aws-smithy-xml" -version = "0.33.1" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25466637a7f68d24df5f25f69037179588419fa81991c6e198fd8f6e72ebfb07" +checksum = "36b9efb4855b4acb29961a776d45680f3cbdd7c4783cbbae078da54c342575dd" dependencies = [ - "thiserror", "xmlparser", ] [[package]] name = "aws-types" -version = "0.3.0" +version = "0.49.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2d8e1b6fd4081f367682b260f55eddc4c90ac4e93ee09517f373c093366fb96" +checksum = "93f3f349b39781849261db1c727369923bb97007cf7bd0deb3a6e9e461c8d38f" dependencies = [ "aws-smithy-async", + "aws-smithy-client", + "aws-smithy-http", "aws-smithy-types", + "http", "rustc_version", "tracing", "zeroize", @@ -614,7 +648,7 @@ dependencies = [ "sync_wrapper", "tokio", "tower", - "tower-http 0.3.4", + "tower-http", "tower-layer", "tower-service", ] @@ -694,7 +728,7 @@ dependencies = [ "bitflags", "cexpr", "clang-sys", - "clap 3.2.12", + "clap", "env_logger", "lazy_static", "lazycell", @@ -853,7 +887,7 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26b52a9543ae338f279b96b0b9fed9c8093744685043739079ce85cd58f289a6" dependencies = [ - "cipher 0.4.3", + "cipher", ] [[package]] @@ -881,7 +915,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" name = "chirpstack" version = "4.0.0" dependencies = [ - "aes 0.7.5", + "aes", "anyhow", "async-recursion", "async-trait", @@ -894,7 +928,7 @@ dependencies = [ "bytes", "chirpstack_api", "chrono", - "clap 2.34.0", + "clap", "diesel", "diesel_migrations", "futures", @@ -902,7 +936,7 @@ dependencies = [ "geohash", "handlebars", "hex", - "hmac 0.12.1", + "hmac", "http", "http-body", "httpmock", @@ -947,10 +981,10 @@ dependencies = [ "tonic-reflection", "tonic-web", "tower", - "tower-http 0.1.3", + "tower-http", "tracing", "tracing-subscriber", - "urlencoding 2.1.0", + "urlencoding", "uuid", "validator", "warp", @@ -975,27 +1009,20 @@ dependencies = [ [[package]] name = "chrono" -version = "0.4.19" +version = "0.4.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" +checksum = "bfd4d1b31faaa3a89d7934dbded3111da0d2ef28e3ebccdb4f0179f5929d1ef1" dependencies = [ - "libc", + "iana-time-zone", + "js-sys", "num-integer", "num-traits", "serde", "time 0.1.44", + "wasm-bindgen", "winapi", ] -[[package]] -name = "cipher" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" -dependencies = [ - "generic-array 0.14.5", -] - [[package]] name = "cipher" version = "0.4.3" @@ -1017,21 +1044,6 @@ dependencies = [ "libloading", ] -[[package]] -name = "clap" -version = "2.34.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0610544180c38b88101fecf2dd634b174a62eef6946f84dfc6a7127512b381c" -dependencies = [ - "ansi_term", - "atty", - "bitflags", - "strsim 0.8.0", - "textwrap 0.11.0", - "unicode-width", - "vec_map", -] - [[package]] name = "clap" version = "3.2.12" @@ -1042,9 +1054,9 @@ dependencies = [ "bitflags", "clap_lex", "indexmap", - "strsim 0.10.0", + "strsim", "termcolor", - "textwrap 0.15.0", + "textwrap", ] [[package]] @@ -1058,12 +1070,13 @@ dependencies = [ [[package]] name = "cmac" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b70e37282d9624283878ffda1d1e53883bcf868cf441bddda44127620b39572d" +checksum = "606383658416244b8dc4b36f864ec1f86cb922b95c41a908fd07aeb01cad06fa" dependencies = [ - "crypto-mac", + "cipher", "dbl", + "digest 0.10.3", ] [[package]] @@ -1167,17 +1180,6 @@ dependencies = [ "typenum", ] -[[package]] -name = "crypto-mac" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" -dependencies = [ - "cipher 0.3.0", - "generic-array 0.14.5", - "subtle", -] - [[package]] name = "ct-logs" version = "0.8.0" @@ -1243,14 +1245,14 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffdd80ce8ce993de27e9f063a444a4d53ce8e8db4c1f00cc03af5ad5a9867a1e" dependencies = [ - "cipher 0.4.3", + "cipher", ] [[package]] name = "diesel" -version = "2.0.0-rc.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "876a12f2d98c35d1dfaf74083664be5bb71606b72f4756f3792cdb1ddb192b46" +checksum = "01e2adfd0a7a81070ed7beec0c62636458926326c16fedb77796d41e447b282d" dependencies = [ "bigdecimal", "bitflags", @@ -1269,9 +1271,9 @@ dependencies = [ [[package]] name = "diesel_derives" -version = "2.0.0-rc.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2497d9cefebedc40492310f3c94493e1d0bd5b11b5e1bfc0a7f4b106012203ea" +checksum = "22a7ab9d7967e6a1a247ea38aedf88ab808b4ac0c159576bc71866ab8f9f9250" dependencies = [ "proc-macro-error", "proc-macro2", @@ -1281,9 +1283,9 @@ dependencies = [ [[package]] name = "diesel_migrations" -version = "2.0.0-rc.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af3e284b00439e362c3f55849a103f38b4c5a9918ae3cf34fca2268b6eb52fef" +checksum = "e9ae22beef5e9d6fab9225ddb073c1c6c1a7a6ded5019d5da11d1e5c5adc34e2" dependencies = [ "diesel", "migrations_internals", @@ -1769,16 +1771,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hmac" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" -dependencies = [ - "crypto-mac", - "digest 0.9.0", -] - [[package]] name = "hmac" version = "0.12.1" @@ -1952,6 +1944,19 @@ dependencies = [ "tokio-native-tls", ] +[[package]] +name = "iana-time-zone" +version = "0.1.50" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd911b35d940d2bd0bea0f9100068e5b97b51a1cbe13d13382f132e0365257a0" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "js-sys", + "wasm-bindgen", + "winapi", +] + [[package]] name = "idna" version = "0.2.3" @@ -2194,12 +2199,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "linked-hash-map" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" - [[package]] name = "lock_api" version = "0.4.7" @@ -2224,7 +2223,7 @@ dependencies = [ name = "lrwn" version = "4.0.0" dependencies = [ - "aes 0.7.5", + "aes", "anyhow", "cmac", "diesel", @@ -2240,15 +2239,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" -[[package]] -name = "matchers" -version = "0.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f099785f7595cc4b4553a174ce30dd7589ef93391ff414dbb67f62392b9e0ce1" -dependencies = [ - "regex-automata", -] - [[package]] name = "matches" version = "0.1.9" @@ -2269,9 +2259,9 @@ checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "migrations_internals" -version = "2.0.0-rc.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e03913f1a1c044aa53b37c8f34011599bbf98914092a0444081555e9ca35022c" +checksum = "c493c09323068c01e54c685f7da41a9ccf9219735c3766fbfd6099806ea08fbc" dependencies = [ "serde", "toml", @@ -2279,9 +2269,9 @@ dependencies = [ [[package]] name = "migrations_macros" -version = "2.0.0-rc.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccfa634200e9de9fe6497f568d54951e933e9e0ddf61058e52e24bda896de48" +checksum = "8a8ff27a350511de30cdabb77147501c36ef02e0451d957abea2f30caffb2b58" dependencies = [ "migrations_internals", "proc-macro2", @@ -2589,10 +2579,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d4873306de53fe82e7e484df31e1e947d61514b6ea2ed6cd7b45d63006fd9224" dependencies = [ "cbc", - "cipher 0.4.3", + "cipher", "des", "getrandom", - "hmac 0.12.1", + "hmac", "lazy_static", "rc2", "sha1 0.10.1", @@ -2656,9 +2646,9 @@ dependencies = [ [[package]] name = "password-hash" -version = "0.2.3" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77e0b28ace46c5a396546bcf443bf422b57049617433d8854227352a4a9b24e7" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" dependencies = [ "base64ct", "rand_core", @@ -2667,9 +2657,9 @@ dependencies = [ [[package]] name = "pbjson" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15ab5b51d009f452712c4f77601f2a5a432d9a2b02b51a3686fa149510336640" +checksum = "2f06d6c64fa91b40a9321e174ad4e9702038c90210f87b295b4f723c7ad2155a" dependencies = [ "base64", "serde", @@ -2677,9 +2667,9 @@ dependencies = [ [[package]] name = "pbjson-build" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cbaa173e82708b343eb70343feb0ab63734509dd5aefed11d44d3bb3f4b3cff" +checksum = "780b05debc7ed9a64c4ba63309c39a329368aa54a6894686c3a91608a18f9bb2" dependencies = [ "heck", "itertools", @@ -2689,9 +2679,9 @@ dependencies = [ [[package]] name = "pbjson-types" -version = "0.3.2" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef17abc1cc106b935f8d2a6a11a246e0bfc163d96a26301ef95c6f15224cc1d" +checksum = "2aa68b479d28fc76e96b1973cb307c177607bbd975e7cd9101605d56cf09f22d" dependencies = [ "bytes", "chrono", @@ -2704,15 +2694,14 @@ dependencies = [ [[package]] name = "pbkdf2" -version = "0.8.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d95f5254224e617595d2cc3cc73ff0a5eaf2637519e25f03388154e9378b6ffa" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" dependencies = [ - "base64ct", - "crypto-mac", - "hmac 0.11.0", + "digest 0.10.3", + "hmac", "password-hash", - "sha2 0.9.9", + "sha2 0.10.2", ] [[package]] @@ -2967,9 +2956,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.10.4" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71adf41db68aa0daaefc69bb30bcd68ded9b9abaad5d1fbb6304c4fb390e083e" +checksum = "399c3c31cdec40583bb68f0b18403400d01ec4289c383aa047560439952c4dd7" dependencies = [ "bytes", "prost-derive", @@ -2977,13 +2966,11 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.10.4" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ae5a4388762d5815a9fc0dea33c56b021cdc8dde0c55e0c9ca57197254b0cab" +checksum = "7f835c582e6bd972ba8347313300219fed5bfa52caf175298d860b61ff6069bb" dependencies = [ "bytes", - "cfg-if", - "cmake", "heck", "itertools", "lazy_static", @@ -2999,9 +2986,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" +checksum = "7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364" dependencies = [ "anyhow", "itertools", @@ -3012,9 +2999,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" +checksum = "4dfaa718ad76a44b3415e6c4d53b17c8f99160dcb3a99b10470fce8ad43f6e3e" dependencies = [ "bytes", "prost", @@ -3082,7 +3069,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62c64daa8e9438b84aaae55010a93f396f8e60e3911590fcba770d04643fc1dd" dependencies = [ - "cipher 0.4.3", + "cipher", ] [[package]] @@ -3175,15 +3162,6 @@ dependencies = [ "regex-syntax", ] -[[package]] -name = "regex-automata" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c230d73fb8d8c1b9c0b3135c5142a8acee3a0558fb8db5cf1cb65f8d7862132" -dependencies = [ - "regex-syntax", -] - [[package]] name = "regex-syntax" version = "0.6.27" @@ -3592,14 +3570,15 @@ dependencies = [ [[package]] name = "serde_yaml" -version = "0.8.26" +version = "0.9.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578a7433b776b56a35785ed5ce9a7e777ac0598aac5a6dd1b4b18a307c7fc71b" +checksum = "8613d593412a0deb7bbd8de9d908efff5a0cb9ccd8f62c641e7b2ed2f57291d1" dependencies = [ "indexmap", + "itoa 1.0.2", "ryu", "serde", - "yaml-rust", + "unsafe-libyaml", ] [[package]] @@ -3807,12 +3786,6 @@ dependencies = [ "precomputed-hash", ] -[[package]] -name = "strsim" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" - [[package]] name = "strsim" version = "0.10.0" @@ -3888,15 +3861,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" -dependencies = [ - "unicode-width", -] - [[package]] name = "textwrap" version = "0.15.0" @@ -3988,9 +3952,9 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "1.20.0" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57aec3cfa4c296db7255446efb4928a6be304b431a806216105542a67b6ca82e" +checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" dependencies = [ "autocfg", "bytes", @@ -4147,9 +4111,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.7.2" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5be9d60db39854b30b835107500cf0aca0b0d14d6e1c3de124217c23a29c2ddb" +checksum = "11cd56bdb54ef93935a6a79dbd1d91f1ebd4c64150fd61654031fd6b8b775c91" dependencies = [ "async-stream", "async-trait", @@ -4179,9 +4143,9 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9263bf4c9bfaae7317c1c2faf7f18491d2fe476f70c414b73bf5d445b00ffa1" +checksum = "2fbcd2800e34e743b9ae795867d5f77b535d3a3be69fd731e39145719752df8c" dependencies = [ "prettyplease", "proc-macro2", @@ -4192,9 +4156,9 @@ dependencies = [ [[package]] name = "tonic-reflection" -version = "0.4.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1d786fcf313b48f1aac280142eae249f3c03495355c7906aa49872a41955015" +checksum = "0455f730d540a1484bffc3c55c94100b18a662597b982c2e9073f2c55c602616" dependencies = [ "bytes", "prost", @@ -4207,9 +4171,9 @@ dependencies = [ [[package]] name = "tonic-web" -version = "0.3.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3864b1194b9b39ba01fc8f6640dc5554ded967ccaebdd8033341987f6c776431" +checksum = "e392f7556972523aa87ddb0fc7f2d2ce530559956706aa081bb0bd8fed158559" dependencies = [ "base64", "bytes", @@ -4243,30 +4207,13 @@ dependencies = [ "tracing", ] -[[package]] -name = "tower-http" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81eca72647e58054bbfa41e6f297c23436f1c60aff6e5eb38455a0f9ca420bb5" -dependencies = [ - "base64", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "pin-project", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tower-http" version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c530c8675c1dbf98facee631536fa116b5fb6382d7dd6dc1b118d970eafe3ba" dependencies = [ + "base64", "bitflags", "bytes", "futures-core", @@ -4278,6 +4225,7 @@ dependencies = [ "tower", "tower-layer", "tower-service", + "tracing", ] [[package]] @@ -4347,36 +4295,18 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-serde" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6b213177105856957181934e4920de57730fc69bf42c37ee5bb664d406d9e1" -dependencies = [ - "serde", - "tracing-core", -] - [[package]] name = "tracing-subscriber" -version = "0.2.25" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e0d2eaa99c3c2e41547cfa109e910a68ea03823cccad4a0525dcbc9b01e8c71" +checksum = "60db860322da191b40952ad9affe65ea23e7dd6a5c442c2c42865810c6ab8e6b" dependencies = [ "ansi_term", - "chrono", - "lazy_static", - "matchers", - "regex", - "serde", - "serde_json", "sharded-slab", "smallvec", "thread_local", - "tracing", "tracing-core", "tracing-log", - "tracing-serde", ] [[package]] @@ -4455,18 +4385,18 @@ dependencies = [ "tinyvec", ] -[[package]] -name = "unicode-width" -version = "0.1.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed742d4ea2bd1176e236172c8429aaf54486e7ac098db29ffe6529e0ce50973" - [[package]] name = "unicode-xid" version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "957e51f3646910546462e67d5f7599b9e4fb8acdd304b087a6494730f9eebf04" +[[package]] +name = "unsafe-libyaml" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1e5fa573d8ac5f1a856f8d7be41d390ee973daf97c806b2c1a465e4e1406e68" + [[package]] name = "untrusted" version = "0.7.1" @@ -4486,12 +4416,6 @@ dependencies = [ "serde", ] -[[package]] -name = "urlencoding" -version = "1.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a1f0175e03a0973cf4afd476bef05c26e228520400eb1fd473ad417b1c00ffb" - [[package]] name = "urlencoding" version = "2.1.0" @@ -4516,9 +4440,9 @@ dependencies = [ [[package]] name = "validator" -version = "0.13.0" +version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be110dc66fa015b8b1d2c4eae40c495a27fae55f82b9cae3efb8178241ed20eb" +checksum = "32ad5bf234c7d3ad1042e5252b7eddb2c4669ee23f32c7dd0e9b7705f07ef591" dependencies = [ "idna", "lazy_static", @@ -4527,15 +4451,8 @@ dependencies = [ "serde_derive", "serde_json", "url", - "validator_types", ] -[[package]] -name = "validator_types" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad9680608df133af2c1ddd5eaf1ddce91d60d61b6bc51494ef326458365a470a" - [[package]] name = "valuable" version = "0.1.0" @@ -4558,12 +4475,6 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" -[[package]] -name = "vec_map" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" - [[package]] name = "version_check" version = "0.9.4" @@ -4854,15 +4765,6 @@ version = "0.13.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "114ba2b24d2167ef6d67d7d04c8cc86522b87f490025f39f0303b7db5bf5e3d8" -[[package]] -name = "yaml-rust" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56c1936c4cc7a1c9ab21a1ebb602eb942ba868cbd44a99cb7cdc5892335e1c85" -dependencies = [ - "linked-hash-map", -] - [[package]] name = "yasna" version = "0.5.0" diff --git a/Dockerfile b/Dockerfile index 548c88cb..e0f157db 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,7 @@ RUN cd $PROJECT_PATH/ui && \ # ChirpStack build stage -FROM --platform=$BUILDPLATFORM rust:1.62.0-buster AS rust-build +FROM --platform=$BUILDPLATFORM rust:1.64.0-buster AS rust-build ENV PROJECT_PATH=/chirpstack RUN mkdir -p $PROJECT_PATH @@ -32,6 +32,7 @@ RUN apt-get update && \ clang \ libclang-dev \ jq \ + protobuf-compiler \ gcc-arm-linux-gnueabihf \ g++-arm-linux-gnueabihf \ gcc-aarch64-linux-gnu \ diff --git a/Dockerfile-devel b/Dockerfile-devel index 90ebdc14..96db9c11 100644 --- a/Dockerfile-devel +++ b/Dockerfile-devel @@ -1,4 +1,4 @@ -FROM rust:1.62.0-buster +FROM rust:1.64.0-buster ENV PROJECT_PATH=/chirpstack RUN mkdir -p $PROJECT_PATH @@ -22,6 +22,7 @@ RUN apt-get update && \ libclang-dev \ golang-cfssl \ jq \ + protobuf-compiler \ gcc-arm-linux-gnueabihf \ g++-arm-linux-gnueabihf \ gcc-aarch64-linux-gnu \ @@ -33,7 +34,7 @@ RUN rustup component add rustfmt clippy RUN rustup target add armv7-unknown-linux-gnueabihf RUN rustup target add aarch64-unknown-linux-gnu -RUN cargo install diesel_cli --version 2.0.0-rc.1 --no-default-features --features postgres +RUN cargo install diesel_cli --version 2.0.0 --no-default-features --features postgres RUN cargo install cargo-deb RUN cargo install cargo-rpm RUN cargo install cargo-bitbake diff --git a/api/Dockerfile-rust b/api/Dockerfile-rust index 50361bce..a46282eb 100644 --- a/api/Dockerfile-rust +++ b/api/Dockerfile-rust @@ -1,8 +1,8 @@ -FROM rust:1.56 +FROM rust:1.64 ENV PROJECT_PATH=/chirpstack/api RUN apt-get update && \ - apt-get install -y make cmake git bash && \ + apt-get install -y make cmake git bash protobuf-compiler && \ apt-get clean RUN git clone https://github.com/googleapis/googleapis.git /googleapis diff --git a/api/rust/Cargo.lock b/api/rust/Cargo.lock index 7ca17ad7..ed1c0ebd 100644 --- a/api/rust/Cargo.lock +++ b/api/rust/Cargo.lock @@ -42,9 +42,9 @@ dependencies = [ [[package]] name = "autocfg" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "axum" @@ -107,12 +107,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4872d67bab6358e59559027aa3b9157c53d9358c51423c17554809a8858e0f8" -[[package]] -name = "cc" -version = "1.0.73" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fff2a6927b3bb87f9595d67196a70493f627687a71d87a0d692242c33f58c11" - [[package]] name = "cfg-if" version = "1.0.0" @@ -146,15 +140,6 @@ dependencies = [ "num-traits", ] -[[package]] -name = "cmake" -version = "0.1.48" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8ad8cef104ac57b68b89df3208164d228503abbdce70f6880ffa3d970e7443a" -dependencies = [ - "cc", -] - [[package]] name = "either" version = "1.6.1" @@ -409,25 +394,14 @@ checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" [[package]] name = "mio" -version = "0.8.2" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52da4364ffb0e4fe33a9841a98a3f3014fb964045ce4f7a45a398243c8d6b0c9" +checksum = "57ee1c23c7c63b0c9250c339ffdc69255f110b298b901b9f6c82547b7b87caaf" dependencies = [ "libc", "log", - "miow", - "ntapi", "wasi 0.11.0+wasi-snapshot-preview1", - "winapi", -] - -[[package]] -name = "miow" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21" -dependencies = [ - "winapi", + "windows-sys", ] [[package]] @@ -436,15 +410,6 @@ version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" -[[package]] -name = "ntapi" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" -dependencies = [ - "winapi", -] - [[package]] name = "num-integer" version = "0.1.44" @@ -465,10 +430,16 @@ dependencies = [ ] [[package]] -name = "pbjson" -version = "0.3.0" +name = "once_cell" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86c0a61b93c50f35af5d8a4f134790f47cbebf8803a7219dd1e7238cd1af022" +checksum = "e82dad04139b71a90c080c8463fe0dc7902db5192d939bd0950f074d014339e1" + +[[package]] +name = "pbjson" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f06d6c64fa91b40a9321e174ad4e9702038c90210f87b295b4f723c7ad2155a" dependencies = [ "base64", "serde", @@ -476,9 +447,9 @@ dependencies = [ [[package]] name = "pbjson-build" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "956a449e8a85fc040e9f8cd8fd4dd2e68059d179092401f0d8570ba059f76dae" +checksum = "780b05debc7ed9a64c4ba63309c39a329368aa54a6894686c3a91608a18f9bb2" dependencies = [ "heck", "itertools", @@ -488,9 +459,9 @@ dependencies = [ [[package]] name = "pbjson-types" -version = "0.3.0" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c20bd6ec3b4ba0073e7e5a1a770abd95723b431bf0e1941d2dd8aace9ffb97f" +checksum = "2aa68b479d28fc76e96b1973cb307c177607bbd975e7cd9101605d56cf09f22d" dependencies = [ "bytes", "chrono", @@ -576,9 +547,9 @@ dependencies = [ [[package]] name = "prost" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a07b0857a71a8cb765763950499cae2413c3f9cede1133478c43600d9e146890" +checksum = "399c3c31cdec40583bb68f0b18403400d01ec4289c383aa047560439952c4dd7" dependencies = [ "bytes", "prost-derive", @@ -586,13 +557,11 @@ dependencies = [ [[package]] name = "prost-build" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120fbe7988713f39d780a58cf1a7ef0d7ef66c6d87e5aa3438940c05357929f4" +checksum = "7f835c582e6bd972ba8347313300219fed5bfa52caf175298d860b61ff6069bb" dependencies = [ "bytes", - "cfg-if", - "cmake", "heck", "itertools", "lazy_static", @@ -608,9 +577,9 @@ dependencies = [ [[package]] name = "prost-derive" -version = "0.10.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b670f45da57fb8542ebdbb6105a925fe571b67f9e7ed9f47a06a84e72b4e7cc" +checksum = "7345d5f0e08c0536d7ac7229952590239e77abf0a0100a1b1d890add6ea96364" dependencies = [ "anyhow", "itertools", @@ -621,9 +590,9 @@ dependencies = [ [[package]] name = "prost-types" -version = "0.10.1" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d0a014229361011dc8e69c8a1ec6c2e8d0f2af7c91e3ea3f5b2170298461e68" +checksum = "4dfaa718ad76a44b3415e6c4d53b17c8f99160dcb3a99b10470fce8ad43f6e3e" dependencies = [ "bytes", "prost", @@ -780,14 +749,16 @@ dependencies = [ [[package]] name = "tokio" -version = "1.17.0" +version = "1.21.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2af73ac49756f3f7c01172e34a23e5d0216f6c32333757c2c61feb2bbff5a5ee" +checksum = "0020c875007ad96677dcc890298f4b942882c5d4eb7cc8f439fc3bf813dc9c95" dependencies = [ + "autocfg", "bytes", "libc", "memchr", "mio", + "once_cell", "pin-project-lite", "socket2", "tokio-macros", @@ -856,9 +827,9 @@ dependencies = [ [[package]] name = "tonic" -version = "0.7.1" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30fb54bf1e446f44d870d260d99957e7d11fb9d0a0f5bd1a662ad1411cc103f9" +checksum = "11cd56bdb54ef93935a6a79dbd1d91f1ebd4c64150fd61654031fd6b8b775c91" dependencies = [ "async-stream", "async-trait", @@ -888,9 +859,9 @@ dependencies = [ [[package]] name = "tonic-build" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d17087af5c80e5d5fc8ba9878e60258065a0a757e35efe7a05b7904bece1943" +checksum = "2fbcd2800e34e743b9ae795867d5f77b535d3a3be69fd731e39145719752df8c" dependencies = [ "prettyplease", "proc-macro2", @@ -1059,3 +1030,46 @@ name = "winapi-x86_64-pc-windows-gnu" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-sys" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ea04155a16a59f9eab786fe12a4a450e75cdb175f9e0d80da1e17db09f55b8d2" +dependencies = [ + "windows_aarch64_msvc", + "windows_i686_gnu", + "windows_i686_msvc", + "windows_x86_64_gnu", + "windows_x86_64_msvc", +] + +[[package]] +name = "windows_aarch64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9bb8c3fd39ade2d67e9874ac4f3db21f0d710bee00fe7cab16949ec184eeaa47" + +[[package]] +name = "windows_i686_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "180e6ccf01daf4c426b846dfc66db1fc518f074baa793aa7d9b9aaeffad6a3b6" + +[[package]] +name = "windows_i686_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2e7917148b2812d1eeafaeb22a97e4813dfa60a3f8f78ebe204bcc88f12f024" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dcd171b8776c41b97521e5da127a2d86ad280114807d0b2ab1e462bc764d9e1" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.36.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680" diff --git a/api/rust/Cargo.toml b/api/rust/Cargo.toml index 403b6816..cfd5c259 100644 --- a/api/rust/Cargo.toml +++ b/api/rust/Cargo.toml @@ -14,17 +14,17 @@ api = ["tonic/transport", "tonic-build/transport", "tokio"] internal = [] [dependencies] -prost = "0.10" -prost-types = "0.10" -pbjson = "0.3" -pbjson-types = "0.3" +prost = "0.11" +prost-types = "0.11" +pbjson = "0.5" +pbjson-types = "0.5" hex = "0.4" rand = "0.8" -tonic = { version = "0.7", features = ["codegen", "prost"], default-features = false } -tokio = { version = "1.17", features = ["macros"], optional = true } +tonic = { version = "0.8", features = ["codegen", "prost"], default-features = false } +tokio = { version = "1.21", features = ["macros"], optional = true } serde = { version = "1.0" } [build-dependencies] -tonic-build = { version = "0.7", features = ["prost"], default-features = false } -pbjson-build = "0.3" +tonic-build = { version = "0.8", features = ["prost"], default-features = false } +pbjson-build = "0.5" diff --git a/chirpstack/Cargo.toml b/chirpstack/Cargo.toml index 9044b518..263b0f4b 100644 --- a/chirpstack/Cargo.toml +++ b/chirpstack/Cargo.toml @@ -11,28 +11,28 @@ license = "MIT" [dependencies] # CLI interface -clap = "2.33" +clap = "3.2" # Configuration serde = { version = "1.0", features = ["derive", "rc"] } -serde_yaml = "0.8" +serde_yaml = "0.9" serde_json = "1.0" -humantime-serde = "1.0" +humantime-serde = "1.1" toml = "0.5" -handlebars = "4.1" +handlebars = "4.3" # Database -validator = "0.13" -diesel = { version = "2.0.0-rc.1", features = [ "chrono", "postgres", "r2d2", "uuid", "serde_json", "numeric" ] } -diesel_migrations = { version = "2.0.0-rc.1" } +validator = "0.16" +diesel = { version = "2.0.0", features = [ "chrono", "postgres", "r2d2", "uuid", "serde_json", "numeric" ] } +diesel_migrations = { version = "2.0.0" } r2d2 = "0.8" bigdecimal = "0.3" redis = { version = "0.21", features = ["r2d2", "cluster"] } -pq-sys = { version = "0.4.6", features = ["pkg-config"] } +pq-sys = { version = "0.4.7", features = ["pkg-config"] } # Logging tracing = "0.1" -tracing-subscriber = { version = "0.2", features = ["fmt", "ansi"], default-features = true } +tracing-subscriber = { version = "0.3", features = ["fmt", "ansi"], default-features = true } # ChirpStack API definitions chirpstack_api = { path = "../api/rust", features = ["default", "internal"] } @@ -43,28 +43,28 @@ backend = { path = "../backend" } reqwest = { version = "0.11", features = ["json"] } # Integrations -aws-types = "0.3.0" -aws-config = "0.3.0" -aws-sdk-sns = "0.3.0" +aws-types = "0.49" +aws-config = "0.49" +aws-sdk-sns = "0.19" hmac = "0.12" sha2 = "0.10" urlencoding = "2.1" geohash = "0.12" -gcp_auth = "0.7.2" -lapin = "2.1.1" -tokio-executor-trait = "2.1.0" -tokio-reactor-trait = "1.1.0" -rdkafka = { version = "0.28.0", features = ["cmake-build"]} +gcp_auth = "0.7" +lapin = "2.1" +tokio-executor-trait = "2.1" +tokio-reactor-trait = "1.1" +rdkafka = { version = "0.28", features = ["cmake-build"]} # gRPC and Protobuf -tonic = "0.7" -tonic-web = "0.3" -tonic-reflection = "0.4" -tokio = { version = "1.17", features = ["macros", "rt-multi-thread"] } -tokio-stream = "0.1.8" -prost-types = "0.10" -prost = "0.10" -pbjson-types = "0.3" +tonic = "0.8" +tonic-web = "0.4" +tonic-reflection = "0.5" +tokio = { version = "1.21", features = ["macros", "rt-multi-thread"] } +tokio-stream = "0.1" +prost-types = "0.11" +prost = "0.11" +pbjson-types = "0.5" # gRPC and HTTP multiplexing warp = { version = "0.3", features = ["tls"] } @@ -75,37 +75,36 @@ http = "0.2" http-body = "0.4" rust-embed = "6.4" mime_guess = "2.0" -tower-http = { version = "0.1", features = ["trace", "auth"] } +tower-http = { version = "0.3", features = ["trace", "auth"] } # Error handling thiserror = "1.0" anyhow = "1.0" # Authentication -pbkdf2 = "0.8" +pbkdf2 = "0.11" rand_core = { version = "0.6", features = ["std"] } -# jsonwebtoken = "8.0" -jsonwebtoken = "8.1.0" +jsonwebtoken = "8.1" openssl = { version = "0.10", features = ["vendored"] } -openidconnect = { version = "2.3.1", features = ["accept-rfc3339-timestamps"] } +openidconnect = { version = "2.3", features = ["accept-rfc3339-timestamps"] } # MQTT paho-mqtt = { version = "0.11", features = ["vendored-ssl"] } hex = "0.4" # Codecs -rquickjs = { version = "0.1.6", features = ["bindgen", "loader", "array-buffer", "chrono"] } +rquickjs = { version = "0.1", features = ["bindgen", "loader", "array-buffer", "chrono"] } # Misc lazy_static = "1.4" uuid = { version = "1.1", features = [ "v4", "serde" ] } chrono = "0.4" async-trait = "0.1" -aes = "0.7" +aes = "0.8" rand = "0.8" base64 = "0.13" async-recursion = "1.0" -regex = "1" +regex = "1.6" petgraph = "0.6" prometheus-client = "0.18" pin-project = "1.0" @@ -113,7 +112,7 @@ pin-project = "1.0" # Development and testing [dev-dependencies] httpmock = "0.6" -bytes = "1.1" +bytes = "1.2" # Debian packaging. [package.metadata.deb] diff --git a/chirpstack/src/adr/mod.rs b/chirpstack/src/adr/mod.rs index 54d07044..46c8fcd8 100644 --- a/chirpstack/src/adr/mod.rs +++ b/chirpstack/src/adr/mod.rs @@ -110,7 +110,7 @@ pub struct Request { pub uplink_history: Vec, } -#[derive(Debug, PartialEq)] +#[derive(Debug, PartialEq, Eq)] pub struct Response { pub dr: u8, pub tx_power_index: u8, diff --git a/chirpstack/src/api/auth/claims.rs b/chirpstack/src/api/auth/claims.rs index e0b8bfac..d508bcf9 100644 --- a/chirpstack/src/api/auth/claims.rs +++ b/chirpstack/src/api/auth/claims.rs @@ -7,7 +7,7 @@ use jsonwebtoken::{decode, encode, Algorithm, DecodingKey, EncodingKey, Header, use serde::{Deserialize, Serialize}; use uuid::Uuid; -#[derive(Serialize, Deserialize, PartialEq, Debug)] +#[derive(Serialize, Deserialize, PartialEq, Eq, Debug)] pub struct AuthClaim { pub aud: String, #[serde(default, skip_serializing_if = "is_default")] diff --git a/chirpstack/src/api/auth/mod.rs b/chirpstack/src/api/auth/mod.rs index eaf29a4c..e19df1ed 100644 --- a/chirpstack/src/api/auth/mod.rs +++ b/chirpstack/src/api/auth/mod.rs @@ -6,7 +6,7 @@ pub mod claims; pub mod error; pub mod validator; -#[derive(PartialEq, Debug)] +#[derive(PartialEq, Eq, Debug)] pub enum AuthID { None, User(Uuid), diff --git a/chirpstack/src/api/error.rs b/chirpstack/src/api/error.rs index ffff9715..b09a1995 100644 --- a/chirpstack/src/api/error.rs +++ b/chirpstack/src/api/error.rs @@ -85,7 +85,7 @@ impl ToStatus for tokio::task::JoinError { } } -impl ToStatus for prost_types::TimestampOutOfSystemRangeError { +impl ToStatus for prost_types::TimestampError { fn status(&self) -> Status { Status::new(Code::Internal, format!("{}", self)) } diff --git a/chirpstack/src/downlink/classb.rs b/chirpstack/src/downlink/classb.rs index 8a9b7d06..8f8169c9 100644 --- a/chirpstack/src/downlink/classb.rs +++ b/chirpstack/src/downlink/classb.rs @@ -1,5 +1,6 @@ use aes::cipher::generic_array::GenericArray; -use aes::{Aes128, Block, BlockEncrypt, NewBlockCipher}; +use aes::cipher::{BlockEncrypt, KeyInit}; +use aes::{Aes128, Block}; use anyhow::Result; use chrono::{DateTime, Duration, Utc}; use tracing::info; diff --git a/chirpstack/src/downlink/data.rs b/chirpstack/src/downlink/data.rs index ad17b345..13db2555 100644 --- a/chirpstack/src/downlink/data.rs +++ b/chirpstack/src/downlink/data.rs @@ -304,7 +304,7 @@ impl Data { device_name: self.device.name.clone(), dev_eui: self.device.dev_eui.to_string(), tags: { - let mut tags = (&*self.device_profile.tags).clone(); + let mut tags = (*self.device_profile.tags).clone(); tags.extend((*self.device.tags).clone()); tags }, diff --git a/chirpstack/src/downlink/tx_ack.rs b/chirpstack/src/downlink/tx_ack.rs index 50e3569a..f15c681b 100644 --- a/chirpstack/src/downlink/tx_ack.rs +++ b/chirpstack/src/downlink/tx_ack.rs @@ -294,7 +294,7 @@ impl TxAck { let dp = self.device_profile.as_ref().unwrap(); let dev = self.device.as_ref().unwrap(); - let mut tags = (&*dp.tags).clone(); + let mut tags = (*dp.tags).clone(); tags.extend((*dev.tags).clone()); let pl = integration_pb::LogEvent { @@ -330,7 +330,7 @@ impl TxAck { let dev = self.device.as_ref().unwrap(); let qi = self.device_queue_item.as_ref().unwrap(); - let mut tags = (&*dp.tags).clone(); + let mut tags = (*dp.tags).clone(); tags.extend((*dev.tags).clone()); let downlink_id = self.downlink_frame.as_ref().unwrap().downlink_id; diff --git a/chirpstack/src/gpstime.rs b/chirpstack/src/gpstime.rs index 30b09e7d..9078d134 100644 --- a/chirpstack/src/gpstime.rs +++ b/chirpstack/src/gpstime.rs @@ -104,7 +104,7 @@ impl ToDateTime for Duration { let mut t = *GPS_EPOCH_TIME + *self; for ls in LEAP_SECONDS_TABLE.iter() { if ls.0 < t { - t = t - ls.1; + t -= ls.1; } } t diff --git a/chirpstack/src/maccommand/dev_status.rs b/chirpstack/src/maccommand/dev_status.rs index 90f861fa..b6ac3628 100644 --- a/chirpstack/src/maccommand/dev_status.rs +++ b/chirpstack/src/maccommand/dev_status.rs @@ -23,7 +23,7 @@ pub async fn handle( dev: &device::Device, block: &lrwn::MACCommandSet, ) -> Result> { - let mac = (&**block) + let mac = (**block) .first() .ok_or_else(|| anyhow!("Expected DevStatusAns"))?; if let lrwn::MACCommand::DevStatusAns(pl) = mac { @@ -42,7 +42,7 @@ pub async fn handle( ) .await?; - let mut tags = (&*dp.tags).clone(); + let mut tags = (*dp.tags).clone(); tags.clone_from(&*dev.tags); let rx_time: DateTime = diff --git a/chirpstack/src/maccommand/device_mode_ind.rs b/chirpstack/src/maccommand/device_mode_ind.rs index 2001b85b..9fa57d81 100644 --- a/chirpstack/src/maccommand/device_mode_ind.rs +++ b/chirpstack/src/maccommand/device_mode_ind.rs @@ -6,7 +6,7 @@ pub async fn handle( dev: &device::Device, block: &lrwn::MACCommandSet, ) -> Result> { - let mac = (&**block) + let mac = (**block) .first() .ok_or_else(|| anyhow!("Expected DeviceModeInd"))?; if let lrwn::MACCommand::DeviceModeInd(pl) = mac { diff --git a/chirpstack/src/maccommand/device_time.rs b/chirpstack/src/maccommand/device_time.rs index 6aa1768f..578ef8d9 100644 --- a/chirpstack/src/maccommand/device_time.rs +++ b/chirpstack/src/maccommand/device_time.rs @@ -13,7 +13,7 @@ pub fn handle( dev: &device::Device, block: &lrwn::MACCommandSet, ) -> Result> { - let _ = (&**block) + let _ = (**block) .first() .ok_or_else(|| anyhow!("Expected DeviceTimeReq"))?; diff --git a/chirpstack/src/maccommand/link_check.rs b/chirpstack/src/maccommand/link_check.rs index f6f61041..3267dfba 100644 --- a/chirpstack/src/maccommand/link_check.rs +++ b/chirpstack/src/maccommand/link_check.rs @@ -11,7 +11,7 @@ pub fn handle( dev: &device::Device, block: &lrwn::MACCommandSet, ) -> Result> { - let _ = (&**block) + let _ = (**block) .first() .ok_or_else(|| anyhow!("Expected LinkCheckReq")); diff --git a/chirpstack/src/maccommand/ping_slot_info.rs b/chirpstack/src/maccommand/ping_slot_info.rs index a498b01e..c376f43a 100644 --- a/chirpstack/src/maccommand/ping_slot_info.rs +++ b/chirpstack/src/maccommand/ping_slot_info.rs @@ -9,7 +9,7 @@ pub fn handle( ds: &mut internal::DeviceSession, block: &lrwn::MACCommandSet, ) -> Result> { - let mac = (&**block) + let mac = (**block) .first() .ok_or_else(|| anyhow!("MACCommandSet is empty"))?; diff --git a/chirpstack/src/maccommand/rejoin_param_setup.rs b/chirpstack/src/maccommand/rejoin_param_setup.rs index 5561528f..6eb29f91 100644 --- a/chirpstack/src/maccommand/rejoin_param_setup.rs +++ b/chirpstack/src/maccommand/rejoin_param_setup.rs @@ -23,10 +23,10 @@ pub fn handle( return Err(anyhow!("Pending RejoinParamSetupReq expected")); } - let ans_mac = (&**block) + let ans_mac = (**block) .first() .ok_or_else(|| anyhow!("MACCommandSet is empty"))?; - let req_mac = (&**pending.unwrap()) + let req_mac = (**pending.unwrap()) .first() .ok_or_else(|| anyhow!("MACCommandSet is empty"))?; diff --git a/chirpstack/src/maccommand/rekey.rs b/chirpstack/src/maccommand/rekey.rs index 001428fc..68c1154c 100644 --- a/chirpstack/src/maccommand/rekey.rs +++ b/chirpstack/src/maccommand/rekey.rs @@ -9,7 +9,7 @@ pub fn handle( dev: &device::Device, block: &lrwn::MACCommandSet, ) -> Result> { - let block_mac = (&**block) + let block_mac = (**block) .first() .ok_or_else(|| anyhow!("MACCommandSet is empty"))?; diff --git a/chirpstack/src/maccommand/reset.rs b/chirpstack/src/maccommand/reset.rs index efac40dc..f3a97bcf 100644 --- a/chirpstack/src/maccommand/reset.rs +++ b/chirpstack/src/maccommand/reset.rs @@ -12,7 +12,7 @@ pub fn handle( ds: &mut internal::DeviceSession, block: &lrwn::MACCommandSet, ) -> Result> { - let block_mac = (&**block) + let block_mac = (**block) .first() .ok_or_else(|| anyhow!("MACCommandSet is empty"))?; let block_pl = if let lrwn::MACCommand::ResetInd(pl) = block_mac { diff --git a/chirpstack/src/maccommand/rx_param_setup.rs b/chirpstack/src/maccommand/rx_param_setup.rs index 79cbab2b..56cd25d2 100644 --- a/chirpstack/src/maccommand/rx_param_setup.rs +++ b/chirpstack/src/maccommand/rx_param_setup.rs @@ -27,10 +27,10 @@ pub fn handle( return Err(anyhow!("Expected pending RxParamSetupReq")); } - let req_mac = (&**pending.unwrap()) + let req_mac = (**pending.unwrap()) .first() .ok_or_else(|| anyhow!("MACCommandSet is empty"))?; - let ans_mac = (&**block) + let ans_mac = (**block) .first() .ok_or_else(|| anyhow!("MACCommandSet is empty"))?; diff --git a/chirpstack/src/maccommand/rx_timing_setup.rs b/chirpstack/src/maccommand/rx_timing_setup.rs index 928b1eb3..cab67814 100644 --- a/chirpstack/src/maccommand/rx_timing_setup.rs +++ b/chirpstack/src/maccommand/rx_timing_setup.rs @@ -20,7 +20,7 @@ pub fn handle( return Err(anyhow!("Pending RxTimingSetupReq expected")); } - let req_mac = (&**pending.unwrap()) + let req_mac = (**pending.unwrap()) .first() .ok_or_else(|| anyhow!("MACCommandSet is empty"))?; diff --git a/chirpstack/src/maccommand/tx_param_setup.rs b/chirpstack/src/maccommand/tx_param_setup.rs index 92b5ea2d..3c453b22 100644 --- a/chirpstack/src/maccommand/tx_param_setup.rs +++ b/chirpstack/src/maccommand/tx_param_setup.rs @@ -38,7 +38,7 @@ pub fn handle( return Err(anyhow!("Expected pending TxParamSetupReq")); } - let req_mac = (&**pending.unwrap()) + let req_mac = (**pending.unwrap()) .first() .ok_or_else(|| anyhow!("MACCommandSet is empty"))?; diff --git a/chirpstack/src/main.rs b/chirpstack/src/main.rs index aa50ce62..d8f8328f 100644 --- a/chirpstack/src/main.rs +++ b/chirpstack/src/main.rs @@ -51,7 +51,7 @@ async fn main() -> Result<()> { .arg( Arg::with_name("config-dir") .required(true) - .short("c") + .short('c') .long("config-dir") .value_name("DIR") .multiple(false) @@ -79,7 +79,7 @@ async fn main() -> Result<()> { .arg( Arg::with_name("dir") .required(true) - .short("d") + .short('d') .long("dir") .value_name("DIR") .multiple(false) diff --git a/chirpstack/src/storage/api_key.rs b/chirpstack/src/storage/api_key.rs index 818d30b8..2d39fba5 100644 --- a/chirpstack/src/storage/api_key.rs +++ b/chirpstack/src/storage/api_key.rs @@ -10,7 +10,7 @@ use super::error::Error; use super::schema::api_key; use super::{error, get_db_conn}; -#[derive(Queryable, Insertable, PartialEq, Debug)] +#[derive(Queryable, Insertable, PartialEq, Eq, Debug)] #[diesel(table_name = api_key)] pub struct ApiKey { pub id: Uuid, diff --git a/chirpstack/src/storage/application.rs b/chirpstack/src/storage/application.rs index c663fec2..c2ee2d84 100644 --- a/chirpstack/src/storage/application.rs +++ b/chirpstack/src/storage/application.rs @@ -19,7 +19,7 @@ use super::error::Error; use super::get_db_conn; use super::schema::{application, application_integration}; -#[derive(Clone, Queryable, Insertable, PartialEq, Debug)] +#[derive(Clone, Queryable, Insertable, PartialEq, Eq, Debug)] #[diesel(table_name = application)] pub struct Application { pub id: Uuid, @@ -62,7 +62,7 @@ pub struct Filters { pub search: Option, } -#[derive(Queryable, PartialEq, Debug)] +#[derive(Queryable, PartialEq, Eq, Debug)] pub struct ApplicationListItem { pub id: Uuid, pub created_at: DateTime, @@ -134,7 +134,7 @@ where } } -#[derive(Debug, Clone, PartialEq, AsExpression, FromSqlRow, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, AsExpression, FromSqlRow, Serialize, Deserialize)] #[diesel(sql_type = Jsonb)] pub enum IntegrationConfiguration { None, @@ -164,14 +164,14 @@ impl serialize::ToSql for IntegrationConfiguration { } } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct HttpConfiguration { pub headers: HashMap, pub json: bool, pub event_endpoint_url: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct InfluxDbConfiguration { pub endpoint: String, pub db: String, @@ -185,22 +185,22 @@ pub struct InfluxDbConfiguration { pub bucket: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct ThingsBoardConfiguration { pub server: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct MyDevicesConfiguration { pub endpoint: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct LoraCloudConfiguration { pub modem_geolocation_services: LoraCloudModemGeolocationServices, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct LoraCloudModemGeolocationServices { pub token: String, pub modem_enabled: bool, @@ -219,7 +219,7 @@ pub struct LoraCloudModemGeolocationServices { pub geolocation_wifi_payload_field: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct GcpPubSubConfiguration { pub encoding: i32, pub credentials_file: String, @@ -227,7 +227,7 @@ pub struct GcpPubSubConfiguration { pub topic_name: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct AwsSnsConfiguration { pub encoding: i32, pub region: String, @@ -236,26 +236,26 @@ pub struct AwsSnsConfiguration { pub topic_arn: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct AzureServiceBusConfiguration { pub encoding: i32, pub connection_string: String, pub publish_name: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct PilotThingsConfiguration { pub server: String, pub token: String, } -#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct IftttConfiguration { pub key: String, pub uplink_values: [String; 2], // The first value is reserved for the DevEUI } -#[derive(Clone, Queryable, Insertable, PartialEq, Debug)] +#[derive(Clone, Queryable, Insertable, PartialEq, Eq, Debug)] #[diesel(table_name = application_integration)] pub struct Integration { pub application_id: Uuid, diff --git a/chirpstack/src/storage/device.rs b/chirpstack/src/storage/device.rs index 5676e9b9..3174b67a 100644 --- a/chirpstack/src/storage/device.rs +++ b/chirpstack/src/storage/device.rs @@ -82,7 +82,7 @@ impl Default for Device { } } -#[derive(Queryable, PartialEq, Debug)] +#[derive(Queryable, PartialEq, Eq, Debug)] pub struct DeviceListItem { pub dev_eui: EUI64, pub name: String, @@ -104,7 +104,7 @@ pub struct Filters { pub search: Option, } -#[derive(QueryableByName, PartialEq, Debug)] +#[derive(QueryableByName, PartialEq, Eq, Debug)] pub struct DevicesActiveInactive { #[diesel(sql_type = diesel::sql_types::BigInt)] pub never_seen_count: i64, @@ -114,7 +114,7 @@ pub struct DevicesActiveInactive { pub inactive_count: i64, } -#[derive(Queryable, PartialEq, Debug)] +#[derive(Queryable, PartialEq, Eq, Debug)] pub struct DevicesDataRate { pub dr: Option, // as the column is nullable pub count: i64, diff --git a/chirpstack/src/storage/device_profile.rs b/chirpstack/src/storage/device_profile.rs index 57eb726e..19f5a31a 100644 --- a/chirpstack/src/storage/device_profile.rs +++ b/chirpstack/src/storage/device_profile.rs @@ -16,7 +16,7 @@ use super::{error, fields, get_db_conn}; use crate::codec::Codec; use chirpstack_api::internal; -#[derive(Clone, Queryable, Insertable, Debug, PartialEq)] +#[derive(Clone, Queryable, Insertable, Debug, PartialEq, Eq)] #[diesel(table_name = device_profile)] pub struct DeviceProfile { pub id: Uuid, @@ -122,7 +122,7 @@ impl DeviceProfile { } } -#[derive(Queryable, PartialEq, Debug)] +#[derive(Queryable, PartialEq, Eq, Debug)] pub struct DeviceProfileListItem { pub id: Uuid, pub created_at: DateTime, diff --git a/chirpstack/src/storage/device_profile_template.rs b/chirpstack/src/storage/device_profile_template.rs index 0495de9f..2aaa7fd5 100644 --- a/chirpstack/src/storage/device_profile_template.rs +++ b/chirpstack/src/storage/device_profile_template.rs @@ -15,7 +15,7 @@ use super::schema::device_profile_template; use super::{error, fields, get_db_conn}; use crate::codec::Codec; -#[derive(Clone, Queryable, Insertable, Debug, PartialEq)] +#[derive(Clone, Queryable, Insertable, Debug, PartialEq, Eq)] #[diesel(table_name = device_profile_template)] pub struct DeviceProfileTemplate { pub id: String, @@ -114,7 +114,7 @@ impl Default for DeviceProfileTemplate { } } -#[derive(Queryable, PartialEq, Debug)] +#[derive(Queryable, PartialEq, Eq, Debug)] pub struct DeviceProfileTemplateListItem { pub id: String, pub created_at: DateTime, diff --git a/chirpstack/src/storage/device_queue.rs b/chirpstack/src/storage/device_queue.rs index 0c50d066..95176fb0 100644 --- a/chirpstack/src/storage/device_queue.rs +++ b/chirpstack/src/storage/device_queue.rs @@ -10,7 +10,7 @@ use super::get_db_conn; use super::schema::device_queue_item; use lrwn::EUI64; -#[derive(Queryable, Insertable, PartialEq, Debug, Clone)] +#[derive(Queryable, Insertable, PartialEq, Eq, Debug, Clone)] #[diesel(table_name = device_queue_item)] pub struct DeviceQueueItem { pub id: Uuid, diff --git a/chirpstack/src/storage/fields.rs b/chirpstack/src/storage/fields.rs index c42572e3..8faaa755 100644 --- a/chirpstack/src/storage/fields.rs +++ b/chirpstack/src/storage/fields.rs @@ -7,7 +7,7 @@ use diesel::sql_types::Jsonb; use diesel::{deserialize, serialize}; use serde::{Deserialize, Serialize}; -#[derive(Debug, Clone, PartialEq, AsExpression, FromSqlRow)] +#[derive(Debug, Clone, PartialEq, Eq, AsExpression, FromSqlRow)] #[diesel(sql_type = Jsonb)] pub struct KeyValue(HashMap); @@ -51,7 +51,7 @@ impl serialize::ToSql for KeyValue { } } -#[derive(Debug, Clone, AsExpression, FromSqlRow, PartialEq)] +#[derive(Debug, Clone, AsExpression, FromSqlRow, PartialEq, Eq)] #[diesel(sql_type = Jsonb)] pub struct Measurements(HashMap); @@ -95,7 +95,7 @@ impl serialize::ToSql for Measurements { } } -#[derive(Debug, Serialize, Deserialize, Clone, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq)] pub struct Measurement { pub name: String, pub kind: MeasurementKind, @@ -103,7 +103,7 @@ pub struct Measurement { #[allow(clippy::upper_case_acronyms)] #[allow(non_camel_case_types)] -#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq)] +#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq)] pub enum MeasurementKind { // Unknown. UNKNOWN, diff --git a/chirpstack/src/storage/gateway.rs b/chirpstack/src/storage/gateway.rs index cec88415..ee6c9acf 100644 --- a/chirpstack/src/storage/gateway.rs +++ b/chirpstack/src/storage/gateway.rs @@ -72,7 +72,7 @@ pub struct Filters { pub search: Option, } -#[derive(QueryableByName, PartialEq, Debug)] +#[derive(QueryableByName, PartialEq, Eq, Debug)] pub struct GatewaysActiveInactive { #[diesel(sql_type = diesel::sql_types::BigInt)] pub never_seen_count: i64, diff --git a/chirpstack/src/storage/metrics.rs b/chirpstack/src/storage/metrics.rs index 664b7375..e0255177 100644 --- a/chirpstack/src/storage/metrics.rs +++ b/chirpstack/src/storage/metrics.rs @@ -200,7 +200,7 @@ pub async fn get( while ts.le(&end) { timestamps.push(ts); keys.push(get_key(name, a, ts)); - ts = ts + ChronoDuration::hours(1); + ts += ChronoDuration::hours(1); } } Aggregation::DAY => { diff --git a/chirpstack/src/storage/multicast.rs b/chirpstack/src/storage/multicast.rs index 76834563..bd09fca2 100644 --- a/chirpstack/src/storage/multicast.rs +++ b/chirpstack/src/storage/multicast.rs @@ -66,7 +66,7 @@ impl Default for MulticastGroup { } } -#[derive(Queryable, PartialEq, Debug)] +#[derive(Queryable, PartialEq, Eq, Debug)] pub struct MulticastGroupListItem { pub id: Uuid, pub created_at: DateTime, @@ -82,7 +82,7 @@ pub struct Filters { pub search: Option, } -#[derive(Clone, Queryable, QueryableByName, Insertable, AsChangeset, Debug, PartialEq)] +#[derive(Clone, Queryable, QueryableByName, Insertable, AsChangeset, Debug, PartialEq, Eq)] #[diesel(table_name = multicast_group_queue_item)] pub struct MulticastGroupQueueItem { pub id: Uuid, @@ -448,11 +448,10 @@ pub async fn enqueue( true => { // Increment with margin as requesting the gateway to send the // downlink 'now' will result in a too late error from the gateway. - scheduler_run_after_ts = scheduler_run_after_ts - + Duration::from_std( - conf.network.scheduler.multicast_class_c_margin, - ) - .unwrap(); + scheduler_run_after_ts += Duration::from_std( + conf.network.scheduler.multicast_class_c_margin, + ) + .unwrap(); Some(scheduler_run_after_ts.to_gps_time().num_milliseconds()) } }; @@ -478,11 +477,10 @@ pub async fn enqueue( if !conf.network.scheduler.multicast_class_c_use_gps_time { // Increment timing for each gateway to avoid colissions. - scheduler_run_after_ts = scheduler_run_after_ts - + Duration::from_std( - conf.network.scheduler.multicast_class_c_margin, - ) - .unwrap(); + scheduler_run_after_ts += Duration::from_std( + conf.network.scheduler.multicast_class_c_margin, + ) + .unwrap(); } } } diff --git a/chirpstack/src/storage/tenant.rs b/chirpstack/src/storage/tenant.rs index 1d211e23..7847a359 100644 --- a/chirpstack/src/storage/tenant.rs +++ b/chirpstack/src/storage/tenant.rs @@ -10,7 +10,7 @@ use super::error::Error; use super::get_db_conn; use super::schema::{tenant, tenant_user, user}; -#[derive(Queryable, Insertable, PartialEq, Debug, Clone)] +#[derive(Queryable, Insertable, PartialEq, Eq, Debug, Clone)] #[diesel(table_name = tenant)] pub struct Tenant { pub id: Uuid, @@ -51,7 +51,7 @@ impl Default for Tenant { } } -#[derive(Queryable, Insertable, AsChangeset, PartialEq, Debug)] +#[derive(Queryable, Insertable, AsChangeset, PartialEq, Eq, Debug)] #[diesel(table_name = tenant_user)] pub struct TenantUser { pub tenant_id: Uuid, @@ -79,7 +79,7 @@ impl Default for TenantUser { } } -#[derive(Queryable, PartialEq, Debug)] +#[derive(Queryable, PartialEq, Eq, Debug)] pub struct TenantUserListItem { pub tenant_id: Uuid, pub user_id: Uuid, diff --git a/chirpstack/src/storage/user.rs b/chirpstack/src/storage/user.rs index ad7c8223..f06cbb44 100644 --- a/chirpstack/src/storage/user.rs +++ b/chirpstack/src/storage/user.rs @@ -16,7 +16,7 @@ use super::error::Error; use super::get_db_conn; use super::schema::user; -#[derive(Queryable, Insertable, PartialEq, Debug, Clone)] +#[derive(Queryable, Insertable, PartialEq, Eq, Debug, Clone)] #[diesel(table_name = user)] pub struct User { pub id: Uuid, @@ -248,9 +248,10 @@ pub async fn list(limit: i64, offset: i64) -> Result, Error> { // https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md#specification fn hash_password(pw: &str, rounds: u32) -> Result { let salt = SaltString::generate(&mut OsRng); - let hash_resp = Pbkdf2.hash_password( + let hash_resp = Pbkdf2.hash_password_customized( pw.as_bytes(), Some(Algorithm::Pbkdf2Sha512.ident()), + None, pbkdf2::Params { rounds, ..Default::default() diff --git a/chirpstack/src/uplink/data.rs b/chirpstack/src/uplink/data.rs index 1700b61e..e1ff9efe 100644 --- a/chirpstack/src/uplink/data.rs +++ b/chirpstack/src/uplink/data.rs @@ -218,7 +218,7 @@ impl Data { let dp = self.device_profile.as_ref().unwrap(); let dev = self.device.as_ref().unwrap(); - let mut tags = (&*dp.tags).clone(); + let mut tags = (*dp.tags).clone(); tags.extend((*dev.tags).clone()); self.device_info = Some(integration_pb::DeviceInfo { @@ -807,7 +807,7 @@ impl Data { device_queue::delete_item(&qi.id).await?; - let mut tags = (&*dp.tags).clone(); + let mut tags = (*dp.tags).clone(); tags.extend((*dev.tags).clone()); integration::ack_event( diff --git a/chirpstack/src/uplink/join.rs b/chirpstack/src/uplink/join.rs index eff3bff9..4907aec6 100644 --- a/chirpstack/src/uplink/join.rs +++ b/chirpstack/src/uplink/join.rs @@ -193,7 +193,7 @@ impl JoinRequest { let dp = self.device_profile.as_ref().unwrap(); let dev = self.device.as_ref().unwrap(); - let mut tags = (&*dp.tags).clone(); + let mut tags = (*dp.tags).clone(); tags.extend((*dev.tags).clone()); self.device_info = Some(integration_pb::DeviceInfo { diff --git a/chirpstack/src/uplink/join_sns.rs b/chirpstack/src/uplink/join_sns.rs index e9c822ba..20ca4e32 100644 --- a/chirpstack/src/uplink/join_sns.rs +++ b/chirpstack/src/uplink/join_sns.rs @@ -171,7 +171,7 @@ impl JoinRequest { let dp = self.device_profile.as_ref().unwrap(); let dev = self.device.as_ref().unwrap(); - let mut tags = (&*dp.tags).clone(); + let mut tags = (*dp.tags).clone(); tags.extend((*dev.tags).clone()); self.device_info = Some(integration_pb::DeviceInfo { diff --git a/lrwn/Cargo.toml b/lrwn/Cargo.toml index d49feca0..45351169 100644 --- a/lrwn/Cargo.toml +++ b/lrwn/Cargo.toml @@ -10,10 +10,10 @@ repository = "https://github.com/chirpstack/chirpstack" [dependencies] hex = "0.4" -cmac = "0.6" -aes = "0.7" +cmac = "0.7" +aes = "0.8" serde = { version = "1.0", features = ["derive"] } -diesel = { version = "2.0.0-rc.1", features = [ "postgres" ] } +diesel = { version = "2.0.0", features = [ "postgres" ] } # Error handling thiserror = "1.0" diff --git a/lrwn/src/keys.rs b/lrwn/src/keys.rs index 255c56de..a70e57da 100644 --- a/lrwn/src/keys.rs +++ b/lrwn/src/keys.rs @@ -1,4 +1,4 @@ -use aes::cipher::{generic_array::GenericArray, BlockEncrypt, NewBlockCipher}; +use aes::cipher::{generic_array::GenericArray, BlockEncrypt, KeyInit}; use aes::{Aes128, Block}; use anyhow::Result; diff --git a/lrwn/src/phy_payload.rs b/lrwn/src/phy_payload.rs index e1e88468..3a2f0a60 100644 --- a/lrwn/src/phy_payload.rs +++ b/lrwn/src/phy_payload.rs @@ -1,7 +1,7 @@ -use aes::cipher::{generic_array::GenericArray, BlockDecrypt, BlockEncrypt, NewBlockCipher}; +use aes::cipher::{generic_array::GenericArray, BlockDecrypt, BlockEncrypt}; use aes::{Aes128, Block}; use anyhow::Result; -use cmac::{Cmac, Mac, NewMac}; +use cmac::{Cmac, Mac}; use serde::Serialize; use super::aes128::AES128Key; @@ -523,6 +523,8 @@ impl PhyPayload { /// For encrypting a join-request response, use the nwk_key, for rejoin-request 0, 1 and 3 /// response, use the js_enc_key. pub fn encrypt_join_accept_payload(&mut self, key: &AES128Key) -> Result<()> { + use aes::cipher::KeyInit; + if self.mic.is_none() { return Err(anyhow!("mic must be set first")); } @@ -565,6 +567,8 @@ impl PhyPayload { /// For decrypting a join-request response, use the nwk_key, for rejoin-request 0, 1 and 3 /// response, use the js_enc_key. pub fn decrypt_join_accept_payload(&mut self, key: &AES128Key) -> Result<()> { + use aes::cipher::KeyInit; + if self.mic.is_none() { return Err(anyhow!("mic must be set first")); } @@ -901,6 +905,8 @@ pub fn encrypt_f_opts( f_cnt: u32, data: &[u8], ) -> Result> { + use aes::cipher::KeyInit; + if data.len() > 15 { return Err(anyhow!("max size of f_opts is 15 bytes")); } @@ -945,6 +951,8 @@ pub fn encrypt_frm_payload( f_cnt: u32, data: &[u8], ) -> Result> { + use aes::cipher::KeyInit; + let mut data = data.to_vec(); let data_len = data.len(); diff --git a/ui/yarn.lock b/ui/yarn.lock index 8534d8b2..3084d7cb 100644 --- a/ui/yarn.lock +++ b/ui/yarn.lock @@ -1881,7 +1881,7 @@ integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw== "@chirpstack/chirpstack-api-grpc-web@file:../api/grpc-web": - version "4.0.0-rc.4" + version "4.0.0" dependencies: "@types/google-protobuf" "^3.15.2" google-protobuf "^3.17.3"