From 3844aadf604045dd5fc42d3db629a3c3fcc2ac98 Mon Sep 17 00:00:00 2001 From: Firstyear Date: Sun, 10 Jan 2021 13:41:56 +1000 Subject: [PATCH] Tokio1.0 (#340) Upgrade dependencies, with the major highlight as the upgrade to tokio 1.0 --- Cargo.lock | 783 +++++++++------------- Makefile | 4 +- kanidm_client/Cargo.toml | 7 +- kanidm_client/tests/common.rs | 7 +- kanidm_proto/Cargo.toml | 2 +- kanidm_tools/Cargo.toml | 6 +- kanidm_unix_int/Cargo.toml | 14 +- kanidm_unix_int/nss_kanidm/Cargo.toml | 3 +- kanidm_unix_int/pam_kanidm/Cargo.toml | 3 +- kanidm_unix_int/pam_kanidm/src/lib.rs | 19 +- kanidm_unix_int/pam_tester/Cargo.lock | 2 +- kanidm_unix_int/src/client.rs | 5 +- kanidm_unix_int/src/daemon.rs | 11 +- kanidm_unix_int/tests/cache_layer_test.rs | 27 +- kanidmd/Cargo.toml | 22 +- kanidmd/Dockerfile | 22 +- kanidmd/src/lib/core/ldaps.rs | 26 +- kanidmd/src/lib/idm/authsession.rs | 14 +- kanidmd/src/lib/idm/server.rs | 30 +- kanidmd/src/lib/server.rs | 23 +- kanidmd/src/lib/utils.rs | 22 +- 21 files changed, 474 insertions(+), 578 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 442eb59a5..cc9555568 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -54,19 +54,21 @@ dependencies = [ "opaque-debug 0.3.0", ] -[[package]] -name = "ahash" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8fd72866655d1904d6b0997d0b07ba561047d070fbe29de039031c641b61217" - [[package]] name = "ahash" version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "739f4a8db6605981345c5654f3a85b056ce52f37a39d34da03f25bf2151ea16e" + +[[package]] +name = "ahash" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75b7e6a93ecd6dbd2c225154d0fa7f86205574ecaa6c87429fb5f66ee677c44" dependencies = [ - "const-random", + "getrandom 0.2.1", + "lazy_static", + "version_check 0.9.2", ] [[package]] @@ -80,9 +82,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.36" +version = "1.0.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68803225a7b13e47191bab76f2687382b60d259e8cf37f6e1893658b84bb9479" +checksum = "ee67c11feeac938fae061b232e38e0b6d94f97a9df10e6271319325ac4c56a86" [[package]] name = "arrayref" @@ -159,7 +161,7 @@ dependencies = [ "httparse", "lazy_static", "log", - "pin-project 1.0.2", + "pin-project 1.0.4", ] [[package]] @@ -179,7 +181,7 @@ dependencies = [ "polling", "vec-arena", "waker-fn", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -204,7 +206,7 @@ dependencies = [ "futures-lite", "once_cell", "signal-hook", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -222,7 +224,7 @@ dependencies = [ "chrono", "hmac 0.8.1", "kv-log-macro", - "rand", + "rand 0.7.3", "serde", "serde_json", "sha2 0.9.2", @@ -265,7 +267,7 @@ dependencies = [ "memchr", "num_cpus", "once_cell", - "pin-project-lite 0.2.0", + "pin-project-lite 0.2.3", "pin-utils", "slab", "wasm-bindgen-futures", @@ -315,7 +317,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -330,9 +332,9 @@ dependencies = [ "libc", "libudev", "log", - "rand", + "rand 0.7.3", "runloop", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -479,7 +481,7 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e38e98299d518ec351ca016363e0cbfc77059dcd08dfa9700d15e405536097a" dependencies = [ - "crossbeam-queue", + "crossbeam-queue 0.2.3", "stable_deref_trait", ] @@ -491,15 +493,15 @@ checksum = "e3b5ca7a04898ad4bcd41c90c5285445ff5b791899bb1b0abdd2a2aa791211d7" [[package]] name = "byteorder" -version = "1.3.4" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" +checksum = "ae44d1a3d5a19df61dd0c8beb138458ac2a53a7ac09eba97d55592540004306b" [[package]] name = "bytes" -version = "0.5.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" +checksum = "ad1f8e949d755f9d79112b5bb46938e0ef9d3804a0b16dfab13aafcaa5f0fa72" [[package]] name = "cache-padded" @@ -551,9 +553,9 @@ dependencies = [ "num-integer", "num-traits", "serde", - "time 0.1.44", + "time 0.1.43", "wasm-bindgen", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -578,17 +580,17 @@ dependencies = [ [[package]] name = "concread" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14fe52c39ed4e846fb3e6ad4bfe46224ef24db64ff7c5f496d2501c88c270b14" +checksum = "1eef33d95d263ebf9423049e76de365a2788e42c2ea48fd5a9fdb98596ae09cb" dependencies = [ - "ahash 0.4.7", + "ahash 0.6.2", "crossbeam", - "crossbeam-epoch 0.8.2", - "crossbeam-utils 0.7.2", + "crossbeam-epoch", + "crossbeam-utils 0.8.1", "num", "parking_lot", - "rand", + "rand 0.8.1", "smallvec", ] @@ -601,33 +603,11 @@ dependencies = [ "cache-padded", ] -[[package]] -name = "const-random" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f590d95d011aa80b063ffe3253422ed5aa462af4e9867d43ce8337562bac77c4" -dependencies = [ - "const-random-macro", - "proc-macro-hack", -] - -[[package]] -name = "const-random-macro" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "615f6e27d000a2bffbc7f2f6a8669179378fa27ee4d0a509e985dfc0a7defb40" -dependencies = [ - "getrandom 0.2.0", - "lazy_static", - "proc-macro-hack", - "tiny-keccak", -] - [[package]] name = "const_fn" -version = "0.4.4" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd51eab21ab4fd6a3bf889e2d0958c0a6e3a61ad04260325e919e652a2a62826" +checksum = "28b9d6de7f49e22cf97ad17fc4036ece69300032f45f78f30b4a4482cdc3f4a6" [[package]] name = "constant_time_eq" @@ -646,9 +626,9 @@ dependencies = [ "hkdf", "hmac 0.10.1", "percent-encoding", - "rand", + "rand 0.7.3", "sha2 0.9.2", - "time 0.2.23", + "time 0.2.24", "version_check 0.9.2", ] @@ -664,7 +644,7 @@ dependencies = [ "publicsuffix", "serde", "serde_json", - "time 0.2.23", + "time 0.2.24", "url", ] @@ -734,26 +714,16 @@ dependencies = [ [[package]] name = "crossbeam" -version = "0.7.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69323bff1fb41c635347b8ead484a5ca6c3f11914d784170b158d8449ab07f8e" +checksum = "fd01a6eb3daaafa260f6fc94c3a6c36390abc2080e38e3e34ced87393fb77d80" dependencies = [ - "cfg-if 0.1.10", - "crossbeam-channel 0.4.4", - "crossbeam-deque 0.7.3", - "crossbeam-epoch 0.8.2", - "crossbeam-queue", - "crossbeam-utils 0.7.2", -] - -[[package]] -name = "crossbeam-channel" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b153fe7cbef478c567df0f972e02e6d736db11affe43dfc9c56a9374d1adfb87" -dependencies = [ - "crossbeam-utils 0.7.2", - "maybe-uninit", + "cfg-if 1.0.0", + "crossbeam-channel", + "crossbeam-deque", + "crossbeam-epoch", + "crossbeam-queue 0.3.1", + "crossbeam-utils 0.8.1", ] [[package]] @@ -766,17 +736,6 @@ dependencies = [ "crossbeam-utils 0.8.1", ] -[[package]] -name = "crossbeam-deque" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" -dependencies = [ - "crossbeam-epoch 0.8.2", - "crossbeam-utils 0.7.2", - "maybe-uninit", -] - [[package]] name = "crossbeam-deque" version = "0.8.0" @@ -784,25 +743,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94af6efb46fef72616855b036a624cf27ba656ffc9be1b9a3c931cfc7749a9a9" dependencies = [ "cfg-if 1.0.0", - "crossbeam-epoch 0.9.1", + "crossbeam-epoch", "crossbeam-utils 0.8.1", ] -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -dependencies = [ - "autocfg", - "cfg-if 0.1.10", - "crossbeam-utils 0.7.2", - "lazy_static", - "maybe-uninit", - "memoffset 0.5.6", - "scopeguard", -] - [[package]] name = "crossbeam-epoch" version = "0.9.1" @@ -813,7 +757,7 @@ dependencies = [ "const_fn", "crossbeam-utils 0.8.1", "lazy_static", - "memoffset 0.6.1", + "memoffset", "scopeguard", ] @@ -828,6 +772,16 @@ dependencies = [ "maybe-uninit", ] +[[package]] +name = "crossbeam-queue" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0f6cb3c7f5b8e51bc3ebb73a2327ad4abdbd119dc13223f14f961d2f38486756" +dependencies = [ + "cfg-if 1.0.0", + "crossbeam-utils 0.8.1", +] + [[package]] name = "crossbeam-utils" version = "0.7.2" @@ -850,12 +804,6 @@ dependencies = [ "lazy_static", ] -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - [[package]] name = "crypto-mac" version = "0.8.0" @@ -1013,13 +961,13 @@ dependencies = [ [[package]] name = "dirs-sys-next" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99de365f605554ae33f115102a02057d4fc18b01f3284d6870be0938743cfe7d" +checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" dependencies = [ "libc", "redox_users", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -1045,9 +993,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.7.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +checksum = "f26ecb66b4bdca6c1409b40fb255eefc2bd4f6d135dab3c3124f80ffa2a9661e" dependencies = [ "atty", "humantime", @@ -1131,7 +1079,7 @@ source = "git+https://github.com/mozilla-services/fernet-rs.git#ec7f9091e0761c0d dependencies = [ "base64 0.12.3", "byteorder", - "getrandom 0.1.15", + "getrandom 0.1.16", "openssl", "zeroize", ] @@ -1167,27 +1115,11 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "fuchsia-zircon" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" -dependencies = [ - "bitflags", - "fuchsia-zircon-sys", -] - -[[package]] -name = "fuchsia-zircon-sys" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" - [[package]] name = "futures" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b3b0c040a1fe6529d30b3c5944b280c7f0dcb2930d2c3062bca967b602583d0" +checksum = "c70be434c505aee38639abccb918163b63158a4b4bb791b45b7023044bdc3c9c" dependencies = [ "futures-channel", "futures-core", @@ -1200,9 +1132,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b7109687aa4e177ef6fe84553af6280ef2778bdb7783ba44c9dc3399110fe64" +checksum = "f01c61843314e95f96cc9245702248733a3a3d744e43e2e755e3c7af8348a0a9" dependencies = [ "futures-core", "futures-sink", @@ -1210,15 +1142,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "847ce131b72ffb13b6109a221da9ad97a64cbe48feb1028356b836b47b8f1748" +checksum = "db8d3b0917ff63a2a96173133c02818fac4a746b0a57569d3baca9ec0e945e08" [[package]] name = "futures-executor" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4caa2b2b68b880003057c1dd49f1ed937e38f22fcf6c212188a121f08cf40a65" +checksum = "9ee9ca2f7eb4475772cf39dd1cd06208dce2670ad38f4d9c7262b3e15f127068" dependencies = [ "futures-core", "futures-task", @@ -1227,9 +1159,9 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "611834ce18aaa1bd13c4b374f5d653e1027cf99b6b502584ff8c9a64413b30bb" +checksum = "e37c1a51b037b80922864b8eed90692c5cd8abd4c71ce49b77146caa47f3253b" [[package]] name = "futures-lite" @@ -1242,15 +1174,15 @@ dependencies = [ "futures-io", "memchr", "parking", - "pin-project-lite 0.2.0", + "pin-project-lite 0.2.3", "waker-fn", ] [[package]] name = "futures-macro" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77408a692f1f97bcc61dc001d752e00643408fbc922e4d634c655df50d595556" +checksum = "0f8719ca0e1f3c5e34f3efe4570ef2c0610ca6da85ae7990d472e9cbfba13664" dependencies = [ "proc-macro-hack", "proc-macro2", @@ -1260,24 +1192,24 @@ dependencies = [ [[package]] name = "futures-sink" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f878195a49cee50e006b02b93cf7e0a95a38ac7b776b4c4d9cc1207cd20fcb3d" +checksum = "f6adabac1290109cfa089f79192fb6244ad2c3f1cc2281f3e1dd987592b71feb" [[package]] name = "futures-task" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c554eb5bf48b2426c4771ab68c6b14468b6e76cc90996f528c3338d761a4d0d" +checksum = "a92a0843a2ff66823a8f7c77bffe9a09be2b64e533562c412d63075643ec0038" dependencies = [ "once_cell", ] [[package]] name = "futures-util" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d304cff4a7b99cfb7986f7d43fbe93d175e72e704a8860787cc95e9ffd85cbd2" +checksum = "036a2107cdeb57f6d7322f1b6c363dad67cd63ca3b7d1b925bdf75bd5d96cda9" dependencies = [ "futures-channel", "futures-core", @@ -1286,7 +1218,7 @@ dependencies = [ "futures-sink", "futures-task", "memchr", - "pin-project 1.0.2", + "pin-project-lite 0.2.3", "pin-utils", "proc-macro-hack", "proc-macro-nested", @@ -1314,24 +1246,24 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.1.15" +version = "0.1.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", "wasi 0.9.0+wasi-snapshot-preview1", ] [[package]] name = "getrandom" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee8025cf36f917e6a52cce185b7c7177689b838b7ec138364e50cc2277a56cf4" +checksum = "4060f4657be78b8e766215b02b18a2e862d83745545de804638e2b545e81aee6" dependencies = [ - "cfg-if 0.1.10", + "cfg-if 1.0.0", "libc", - "wasi 0.9.0+wasi-snapshot-preview1", + "wasi 0.10.1+wasi-snapshot-preview1", ] [[package]] @@ -1359,9 +1291,9 @@ dependencies = [ [[package]] name = "h2" -version = "0.2.7" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e4728fd124914ad25e99e3d15a9361a879f6620f63cb56bbb08f95abb97a535" +checksum = "6b67e66362108efccd8ac053abafc8b7a8d86a37e6e48fc4f6f7485eb5e9e6a5" dependencies = [ "bytes", "fnv", @@ -1383,16 +1315,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d36fab90f82edc3c747f9d438e06cf0a491055896f2a279638bb5beed6c40177" -[[package]] -name = "hashbrown" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e91b62f79061a0bc2e046024cb7ba44b08419ed238ecbd9adbd787434b9e8c25" -dependencies = [ - "ahash 0.3.8", - "autocfg", -] - [[package]] name = "hashbrown" version = "0.9.1" @@ -1452,9 +1374,9 @@ dependencies = [ [[package]] name = "http" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84129d298a6d57d246960ff8eb831ca4af3f96d29e2e28848dae275408658e26" +checksum = "7245cd7449cc792608c3c8a9eaf69bd4eabbabf802713748fd739c98b82f0747" dependencies = [ "bytes", "fnv", @@ -1463,9 +1385,9 @@ dependencies = [ [[package]] name = "http-body" -version = "0.3.1" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +checksum = "2861bd27ee074e5ee891e8b539837a9430012e249d7f0ca2d795650f579c1994" dependencies = [ "bytes", "http", @@ -1496,7 +1418,7 @@ dependencies = [ "futures-lite", "infer", "pin-project-lite 0.1.11", - "rand", + "rand 0.7.3", "serde", "serde_json", "serde_qs", @@ -1518,18 +1440,15 @@ checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" [[package]] name = "humantime" -version = "1.3.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error 1.2.3", -] +checksum = "3c1ad908cc71012b7bea4d0c53ba96a8cba9962f048fa68d143376143d863b7a" [[package]] name = "hyper" -version = "0.13.9" +version = "0.14.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6ad767baac13b44d4529fcf58ba2cd0995e36e7b435bc5b039de6f47e880dbf" +checksum = "12219dc884514cb4a6a03737f4413c0e01c23a1b059b0156004b23f1e19dccbe" dependencies = [ "bytes", "futures-channel", @@ -1541,7 +1460,7 @@ dependencies = [ "httparse", "httpdate", "itoa", - "pin-project 1.0.2", + "pin-project 1.0.4", "socket2", "tokio", "tower-service", @@ -1551,15 +1470,15 @@ dependencies = [ [[package]] name = "hyper-tls" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d979acc56dcb5b8dddba3917601745e877576475aa046df3226eabdecef78eed" +checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", "hyper", "native-tls", "tokio", - "tokio-tls", + "tokio-native-tls", ] [[package]] @@ -1570,14 +1489,14 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idlset" -version = "0.1.10" +version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f71da0cbf98154c21e1e0fb334576bc715a64821f111c1bc723d83282b02e2" +checksum = "b39113f96923ff9f22c1d4cc4d5fb306d259b553be3bb8ef76d8c6a1ba4cabae" dependencies = [ "serde", "serde_derive", "smallvec", - "time 0.2.23", + "time 0.2.24", ] [[package]] @@ -1598,7 +1517,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4fb1fa934250de4de8aef298d81c729a7d33d8c239daa3a7575e6b92bfc7313b" dependencies = [ "autocfg", - "hashbrown 0.9.1", + "hashbrown", ] [[package]] @@ -1616,15 +1535,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "iovec" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" -dependencies = [ - "libc", -] - [[package]] name = "ipnet" version = "2.3.0" @@ -1662,7 +1572,7 @@ dependencies = [ "async-h1", "async-std", "async-trait", - "base64 0.12.3", + "base64 0.13.0", "cargo-husky", "chrono", "concread", @@ -1671,7 +1581,7 @@ dependencies = [ "fernet", "futures", "futures-util", - "hashbrown 0.8.2", + "hashbrown", "idlset", "kanidm_proto", "lazy_static", @@ -1683,7 +1593,7 @@ dependencies = [ "openssl", "r2d2", "r2d2_sqlite", - "rand", + "rand 0.8.1", "regex", "rpassword", "rusqlite", @@ -1696,7 +1606,7 @@ dependencies = [ "structopt", "tide", "tide-rustls", - "time 0.2.23", + "time 0.2.24", "tokio", "tokio-openssl", "tokio-util", @@ -1759,7 +1669,7 @@ dependencies = [ "serde_json", "shellexpand", "structopt", - "time 0.2.23", + "time 0.2.24", "webauthn-authenticator-rs", "zxcvbn", ] @@ -1794,16 +1704,6 @@ dependencies = [ "users", ] -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" -dependencies = [ - "winapi 0.2.8", - "winapi-build", -] - [[package]] name = "kv-log-macro" version = "1.0.7" @@ -1821,9 +1721,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "lber" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a749954d43fcfb8d4381aa0c6cf291065053e0590d622f4f830393a9bd8278a5" +checksum = "8a99b520993b21a6faab32643cf4726573dc18ca4cf2d48cbeb24d248c86c930" dependencies = [ "byteorder", "bytes", @@ -1832,9 +1732,9 @@ dependencies = [ [[package]] name = "ldap3_server" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cffae6c3d62a3100e04d4199d2df359298f5257e1d0ab64472f9f4991818f77c" +checksum = "0471d469a3d5e2c96fe43ca1608e64d829ec1ab8efaea7d0f55a753acd2b4a95" dependencies = [ "bytes", "lber", @@ -1843,9 +1743,9 @@ dependencies = [ [[package]] name = "libc" -version = "0.2.81" +version = "0.2.82" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1482821306169ec4d07f6aca392a4681f66c75c9918aa49641a2595db64053cb" +checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929" [[package]] name = "libnss" @@ -1854,7 +1754,7 @@ source = "git+https://github.com/csnewman/libnss-rs.git?rev=eab2d93d243865277369 dependencies = [ "lazy_static", "libc", - "paste", + "paste 0.1.18", ] [[package]] @@ -1889,9 +1789,9 @@ dependencies = [ [[package]] name = "linked-hash-map" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" +checksum = "7fb9b38af92608140b86b693604b9ffcc5824240a484d1ecd4795bacb2fe88f3" [[package]] name = "lock_api" @@ -1917,7 +1817,7 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3aae342b73d57ad0b8b364bd12584819f2c1fe9114285dfcf8b0722607671635" dependencies = [ - "hashbrown 0.9.1", + "hashbrown", ] [[package]] @@ -1947,15 +1847,6 @@ version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" -[[package]] -name = "memoffset" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" -dependencies = [ - "autocfg", -] - [[package]] name = "memoffset" version = "0.6.1" @@ -1971,68 +1862,17 @@ version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -[[package]] -name = "mime_guess" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2684d4c2e97d99848d30b324b00c8fcc7e5c897b7cbb5819b09e7c90e8baf212" -dependencies = [ - "mime", - "unicase", -] - [[package]] name = "mio" -version = "0.6.23" +version = "0.7.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4afd66f5b91bf2a3bc13fad0e21caedac168ca4c707504e75585648ae80e4cc4" +checksum = "e50ae3f04d169fcc9bde0b547d1c205219b7157e07ded9c5aff03e0637cb3ed7" dependencies = [ - "cfg-if 0.1.10", - "fuchsia-zircon", - "fuchsia-zircon-sys", - "iovec", - "kernel32-sys", "libc", "log", - "miow 0.2.2", - "net2", - "slab", - "winapi 0.2.8", -] - -[[package]] -name = "mio-named-pipes" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" -dependencies = [ - "log", - "mio", - "miow 0.3.6", - "winapi 0.3.9", -] - -[[package]] -name = "mio-uds" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" -dependencies = [ - "iovec", - "libc", - "mio", -] - -[[package]] -name = "miow" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebd808424166322d4a38da87083bfddd3ac4c131334ed55856112eb06d46944d" -dependencies = [ - "kernel32-sys", - "net2", - "winapi 0.2.8", - "ws2_32-sys", + "miow", + "ntapi", + "winapi", ] [[package]] @@ -2042,14 +1882,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" dependencies = [ "socket2", - "winapi 0.3.9", + "winapi", ] [[package]] name = "native-tls" -version = "0.2.6" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fcc7939b5edc4e4f86b1b4a04bb1498afaaf871b1a6691838ed06fcb48d3a3f" +checksum = "b8d96b2e1c8da3957d58100b09f102c6d9cfdfced01b7ec5a8974044bb09dbd4" dependencies = [ "lazy_static", "libc", @@ -2070,18 +1910,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8123a81538e457d44b933a02faf885d3fe8408806b23fa700e8f01c6c3a98998" dependencies = [ "libc", - "winapi 0.3.9", -] - -[[package]] -name = "net2" -version = "0.2.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "391630d12b68002ae1e25e8f974306474966550ad82dac6886fb8910c19568ae" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2118,7 +1947,16 @@ dependencies = [ "lazy_static", "libc", "libnss", - "paste", + "paste 1.0.4", +] + +[[package]] +name = "ntapi" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" +dependencies = [ + "winapi", ] [[package]] @@ -2268,10 +2106,9 @@ dependencies = [ name = "pam_kanidm" version = "1.1.0-alpha.3" dependencies = [ - "futures", + "async-std", "kanidm_unix_int", "libc", - "tokio", ] [[package]] @@ -2300,9 +2137,9 @@ dependencies = [ "cfg-if 1.0.0", "instant", "libc", - "redox_syscall", + "redox_syscall 0.1.57", "smallvec", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2315,6 +2152,12 @@ dependencies = [ "proc-macro-hack", ] +[[package]] +name = "paste" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c5d65c4d95931acda4498f675e332fcbdc9a06705cd07086c510e9b6009cd1c1" + [[package]] name = "paste-impl" version = "0.1.18" @@ -2341,11 +2184,11 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ccc2237c2c489783abd8c4c80e5450fc0e98644555b1364da68cc29aa151ca7" +checksum = "95b70b68509f17aa2857863b6fa00bf21fc93674c7a8893de2f469f6aa7ca2f2" dependencies = [ - "pin-project-internal 1.0.2", + "pin-project-internal 1.0.4", ] [[package]] @@ -2361,9 +2204,9 @@ dependencies = [ [[package]] name = "pin-project-internal" -version = "1.0.2" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8e8d2bf0b23038a4424865103a4df472855692821aab4e4f5c3312d461d9e5f" +checksum = "caa25a6393f22ce819b0f50e0be89287292fda8d425be38ee0ca14c4931d9e71" dependencies = [ "proc-macro2", "quote", @@ -2378,9 +2221,9 @@ checksum = "c917123afa01924fc84bb20c4c03f004d9c38e5127e3c039bbf7f4b9c76a2f6b" [[package]] name = "pin-project-lite" -version = "0.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b063f57ec186e6140e2b8b6921e5f1bd89c7356dda5b33acc5401203ca6131c" +checksum = "ba36e0a6cc5a4c645073f4984f1ed55d09f5857d4de7c14550baa81a39ef5a17" [[package]] name = "pin-utils" @@ -2416,7 +2259,7 @@ dependencies = [ "libc", "log", "wepoll-sys", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2494,12 +2337,6 @@ dependencies = [ "url", ] -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - [[package]] name = "quick-error" version = "2.0.0" @@ -2542,11 +2379,23 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom 0.1.15", + "getrandom 0.1.16", "libc", - "rand_chacha", - "rand_core", - "rand_hc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc 0.2.0", +] + +[[package]] +name = "rand" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c24fcd450d3fa2b592732565aa4f17a27a61c65ece4726353e000939b0edee34" +dependencies = [ + "libc", + "rand_chacha 0.3.0", + "rand_core 0.6.1", + "rand_hc 0.3.0", ] [[package]] @@ -2556,7 +2405,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_chacha" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.1", ] [[package]] @@ -2565,7 +2424,16 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom 0.1.15", + "getrandom 0.1.16", +] + +[[package]] +name = "rand_core" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" +dependencies = [ + "getrandom 0.2.1", ] [[package]] @@ -2574,7 +2442,16 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" dependencies = [ - "rand_core", + "rand_core 0.5.1", +] + +[[package]] +name = "rand_hc" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" +dependencies = [ + "rand_core 0.6.1", ] [[package]] @@ -2584,7 +2461,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b0d8e0819fadc20c74ea8373106ead0600e3a67ef1fe8da56e39b9ae7275674" dependencies = [ "autocfg", - "crossbeam-deque 0.8.0", + "crossbeam-deque", "either", "rayon-core", ] @@ -2595,8 +2472,8 @@ version = "1.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ab346ac5921dc62ffa9f89b7a773907511cdfa5490c572ae9be1be33e8afa4a" dependencies = [ - "crossbeam-channel 0.5.0", - "crossbeam-deque 0.8.0", + "crossbeam-channel", + "crossbeam-deque", "crossbeam-utils 0.8.1", "lazy_static", "num_cpus", @@ -2609,20 +2486,29 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" [[package]] -name = "redox_users" -version = "0.3.5" +name = "redox_syscall" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de0737333e7a9502c789a36d7c7fa6092a49895d4faa31ca5df163857ded2e9d" +checksum = "48b82c2a1e8eb6e1bfde608de2bcbebd4072aa32d056ea48a986990cd5ca0f5a" dependencies = [ - "getrandom 0.1.15", - "redox_syscall", + "bitflags", +] + +[[package]] +name = "redox_users" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "528532f3d801c87aec9def2add9ca802fe569e44a544afe633765267840abe64" +dependencies = [ + "getrandom 0.2.1", + "redox_syscall 0.2.1", ] [[package]] name = "regex" -version = "1.4.2" +version = "1.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38cf2c13ed4745de91a5eb834e11c00bcc3709e773173b2ce4c56c9fbde04b9c" +checksum = "d9251239e129e16308e70d853559389de218ac275b515068abc96829d05b948a" dependencies = [ "aho-corasick", "memchr", @@ -2641,9 +2527,9 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.6.21" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" +checksum = "b5eb417147ba9860a96cfe72a0b93bf88fee1744b5636ec99ab20c1aa9376581" [[package]] name = "remove_dir_all" @@ -2651,14 +2537,14 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] name = "reqwest" -version = "0.10.10" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0718f81a8e14c4dbb3b34cf23dc6aaf9ab8a0dfec160c534b3dbca1aaa21f47c" +checksum = "fd281b1030aa675fb90aa994d07187645bb3c8fc756ca766e7c3070b439de9de" dependencies = [ "base64 0.13.0", "bytes", @@ -2676,16 +2562,15 @@ dependencies = [ "lazy_static", "log", "mime", - "mime_guess", "native-tls", "percent-encoding", - "pin-project-lite 0.2.0", + "pin-project-lite 0.2.3", "serde", "serde_json", "serde_urlencoded", - "time 0.2.23", + "time 0.2.24", "tokio", - "tokio-tls", + "tokio-native-tls", "url", "wasm-bindgen", "wasm-bindgen-futures", @@ -2705,7 +2590,7 @@ dependencies = [ "spin", "untrusted", "web-sys", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2716,12 +2601,12 @@ checksum = "56770675ebc04927ded3e60633437841581c285dc6236109ea25fbf3beb7b59e" [[package]] name = "rpassword" -version = "4.0.5" +version = "5.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "99371657d3c8e4d816fb6221db98fa408242b0b53bac08f8676a41f8554fe99f" +checksum = "d755237fc0f99d98641540e66abac8bc46a0652f19148ac9e21de2da06b326c9" dependencies = [ "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2743,7 +2628,7 @@ dependencies = [ "lru-cache", "memchr", "smallvec", - "time 0.1.44", + "time 0.1.43", ] [[package]] @@ -2790,7 +2675,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" dependencies = [ "lazy_static", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -2897,9 +2782,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.60" +version = "1.0.61" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1500e84d27fe482ed1dc791a56eddc2f230046a040fa908c08bda1d9fb615779" +checksum = "4fceb2595057b6891a4ee808f70054bd2d12f0e97f1cbb78689b59f676df325a" dependencies = [ "itoa", "ryu", @@ -3006,9 +2891,9 @@ checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" [[package]] name = "smallvec" -version = "1.5.1" +version = "1.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae524f056d7d770e174287294f562e95044c68e88dec909a00d2094805db9d75" +checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" dependencies = [ "serde", ] @@ -3031,7 +2916,7 @@ checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" dependencies = [ "cfg-if 1.0.0", "libc", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3059,9 +2944,9 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" [[package]] name = "standback" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf906c8b8fc3f6ecd1046e01da1d8ddec83e48c8b08b84dcc02b585a6bedf5a8" +checksum = "c66a8cff4fa24853fdf6b51f75c6d7f8206d7c75cab4e467bcd7f25c2b1febe0" dependencies = [ "version_check 0.9.2", ] @@ -3159,9 +3044,9 @@ checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" [[package]] name = "syn" -version = "1.0.56" +version = "1.0.58" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9802ddde94170d186eeee5005b798d9c159fa970403f1be19976d0cfb939b72" +checksum = "cc60a3d73ea6594cd712d830cc1f0390fd71542d8c8cd24e70cc54cdfd5e05d5" dependencies = [ "proc-macro2", "quote", @@ -3188,10 +3073,10 @@ checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" dependencies = [ "cfg-if 0.1.10", "libc", - "rand", - "redox_syscall", + "rand 0.7.3", + "redox_syscall 0.1.57", "remove_dir_all", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3234,9 +3119,9 @@ dependencies = [ [[package]] name = "thread_local" -version = "1.0.1" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" +checksum = "bb9bc092d0d51e76b2b19d9d85534ffc9ec2db959a2523cdae0697e2972cd447" dependencies = [ "lazy_static", ] @@ -3280,20 +3165,19 @@ dependencies = [ [[package]] name = "time" -version = "0.1.44" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" +checksum = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" dependencies = [ "libc", - "wasi 0.10.0+wasi-snapshot-preview1", - "winapi 0.3.9", + "winapi", ] [[package]] name = "time" -version = "0.2.23" +version = "0.2.24" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcdaeea317915d59b2b4cd3b5efcd156c309108664277793f5351700c02ce98b" +checksum = "273d3ed44dca264b0d6b3665e8d48fb515042d42466fad93d2a45b90ec4058f7" dependencies = [ "const_fn", "libc", @@ -3302,7 +3186,7 @@ dependencies = [ "stdweb", "time-macros", "version_check 0.9.2", - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3328,20 +3212,11 @@ dependencies = [ "syn", ] -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - [[package]] name = "tinytemplate" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d3dc76004a03cec1c5932bca4cdc2e39aaa798e3f82363dd94f9adf6098c12f" +checksum = "a2ada8616fad06a2d0c455adc530de4ef57605a8120cc65da9653e0e9623ca74" dependencies = [ "serde", "serde_json", @@ -3364,33 +3239,29 @@ checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" [[package]] name = "tokio" -version = "0.2.24" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "099837d3464c16a808060bb3f02263b412f6fafcb5d01c533d309985fbeebe48" +checksum = "d258221f566b6c803c7b4714abadc080172b272090cdc5e244a6d4dd13c3a6bd" dependencies = [ + "autocfg", "bytes", - "fnv", - "futures-core", - "iovec", - "lazy_static", "libc", "memchr", "mio", - "mio-named-pipes", - "mio-uds", "num_cpus", - "pin-project-lite 0.1.11", + "once_cell", + "parking_lot", + "pin-project-lite 0.2.3", "signal-hook-registry", - "slab", "tokio-macros", - "winapi 0.3.9", + "winapi", ] [[package]] name = "tokio-macros" -version = "0.2.6" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a" +checksum = "42517d2975ca3114b22a16192634e8241dc5cc1f130be194645970cc1c371494" dependencies = [ "proc-macro2", "quote", @@ -3398,37 +3269,51 @@ dependencies = [ ] [[package]] -name = "tokio-openssl" -version = "0.4.0" +name = "tokio-native-tls" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c4b08c5f4208e699ede3df2520aca2e82401b2de33f45e96696a074480be594" -dependencies = [ - "openssl", - "tokio", -] - -[[package]] -name = "tokio-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a70f4fcd7b3b24fb194f837560168208f669ca8cb70d0c4b862944452396343" +checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" dependencies = [ "native-tls", "tokio", ] [[package]] -name = "tokio-util" -version = "0.3.1" +name = "tokio-openssl" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +checksum = "ac1bec5c0a4aa71e3459802c7a12e8912c2091ce2151004f9ce95cc5d1c6124e" +dependencies = [ + "futures", + "openssl", + "pin-project 1.0.4", + "tokio", +] + +[[package]] +name = "tokio-stream" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4cdeb73537e63f98adcd73138af75e3f368ccaecffaa29d7eb61b9f5a440457" +dependencies = [ + "futures-core", + "pin-project-lite 0.2.3", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36135b7e7da911f5f8b9331209f7fab4cc13498f3fff52f72a710c78187e3148" dependencies = [ "bytes", "futures-core", "futures-sink", "log", - "pin-project-lite 0.1.11", + "pin-project-lite 0.2.3", "tokio", + "tokio-stream", ] [[package]] @@ -3453,8 +3338,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9f47026cdc4080c07e49b37087de021820269d996f581aac150ef9e5583eefe3" dependencies = [ "cfg-if 1.0.0", - "log", - "pin-project-lite 0.2.0", + "pin-project-lite 0.2.3", "tracing-core", ] @@ -3489,15 +3373,6 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" -[[package]] -name = "unicase" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" -dependencies = [ - "version_check 0.9.2", -] - [[package]] name = "unicode-bidi" version = "0.3.4" @@ -3565,9 +3440,9 @@ dependencies = [ [[package]] name = "users" -version = "0.10.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa4227e95324a443c9fcb06e03d4d85e91aabe9a5a02aa818688b6918b6af486" +checksum = "24cc0f6d6f267b73e5a2cadf007ba8f9bc39c6a6f9666f8cf25ea809a153b032" dependencies = [ "libc", "log", @@ -3579,7 +3454,7 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9fde2f6a4bea1d6e007c4ad38c6839fa71cbb63b6dbf5b595aa38dc9b1093c11" dependencies = [ - "rand", + "rand 0.7.3", "serde", ] @@ -3620,7 +3495,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" dependencies = [ "same-file", - "winapi 0.3.9", + "winapi", "winapi-util", ] @@ -3642,9 +3517,9 @@ checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" [[package]] name = "wasi" -version = "0.10.0+wasi-snapshot-preview1" +version = "0.10.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" +checksum = "93c6c3420963c5c64bca373b25e77acb562081b9bb4dd5bb864187742186cea9" [[package]] name = "wasm-bindgen" @@ -3726,9 +3601,9 @@ dependencies = [ [[package]] name = "webauthn-authenticator-rs" -version = "0.3.0-alpha.1" +version = "0.3.0-alpha.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52b888769ddbb48a4c8886ab1c538b36d8f85299a16e18437a5a0083c3075311" +checksum = "57f2a998d035484b3a3e21fd839d5c56e014fdf7756077ffbe209b1f09e6d265" dependencies = [ "authenticator", "log", @@ -3742,15 +3617,15 @@ dependencies = [ [[package]] name = "webauthn-rs" -version = "0.3.0-alpha.1" +version = "0.3.0-alpha.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7df7c4e7be2638b04ec02465e79376f5df03ac681814b968faf1627fffd6ef20" +checksum = "1b4698b6e320b4c3a6d7ef77fe787c7f270cd8159eb1a87656e8e4eec8d62fa1" dependencies = [ - "base64 0.12.3", + "base64 0.13.0", "log", "nom 4.2.3", "openssl", - "rand", + "rand 0.8.1", "serde", "serde_bytes", "serde_cbor", @@ -3787,12 +3662,6 @@ dependencies = [ "cc", ] -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" - [[package]] name = "winapi" version = "0.3.9" @@ -3803,12 +3672,6 @@ dependencies = [ "winapi-x86_64-pc-windows-gnu", ] -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" - [[package]] name = "winapi-i686-pc-windows-gnu" version = "0.4.0" @@ -3821,7 +3684,7 @@ version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" dependencies = [ - "winapi 0.3.9", + "winapi", ] [[package]] @@ -3836,17 +3699,7 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" dependencies = [ - "winapi 0.3.9", -] - -[[package]] -name = "ws2_32-sys" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" -dependencies = [ - "winapi 0.2.8", - "winapi-build", + "winapi", ] [[package]] @@ -3881,7 +3734,7 @@ dependencies = [ "fancy-regex", "itertools", "lazy_static", - "quick-error 2.0.0", + "quick-error", "regex", "serde", "serde_derive", diff --git a/Makefile b/Makefile index f11d5bb4f..f0a0b171d 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,7 @@ IMAGE_BASE ?= kanidm IMAGE_VERSION ?= devel EXT_OPTS ?= IMAGE_ARCH ?= "linux/amd64,linux/arm64" +ARGS ?= --build-arg "SCCACHE_REDIS=redis://172.24.20.4:6379" .DEFAULT: help help: @@ -11,7 +12,8 @@ help: buildx/kanidmd: ## build multiarch server images buildx/kanidmd: - @docker buildx build --push --platform $(IMAGE_ARCH) -f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:$(IMAGE_VERSION) . + echo @docker buildx build --push --platform $(IMAGE_ARCH) -f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:$(IMAGE_VERSION) $(ARGS) . + @docker buildx build --push --platform $(IMAGE_ARCH) -f kanidmd/Dockerfile -t $(IMAGE_BASE)/server:$(IMAGE_VERSION) $(ARGS) . @docker buildx imagetools inspect $(IMAGE_BASE)/server:$(IMAGE_VERSION) buildx/radiusd: ## build multiarch radius images diff --git a/kanidm_client/Cargo.toml b/kanidm_client/Cargo.toml index 2e86d5cf4..fe0dddcf0 100644 --- a/kanidm_client/Cargo.toml +++ b/kanidm_client/Cargo.toml @@ -11,8 +11,8 @@ repository = "https://github.com/kanidm/kanidm/" [dependencies] log = "0.4" -env_logger = "0.7" -reqwest = { version = "0.10", features=["blocking", "cookies", "json", "native-tls"] } +env_logger = "0.8" +reqwest = { version = "0.11", features=["blocking", "cookies", "json", "native-tls"] } kanidm_proto = { path = "../kanidm_proto", version = "1.1.0-alpha" } serde = "1.0" serde_json = "1.0" @@ -28,7 +28,8 @@ webauthn-rs = "0.3.0-alpha.1" # webauthn-rs = { path = "../../webauthn-rs" } [dev-dependencies] -tokio = { version = "0.2", features = ["full"] } +# tokio = { version = "0.2", features = ["full"] } +tokio = { version = "1", features = ["rt", "net", "time", "macros", "sync", "signal"] } kanidm = { path = "../kanidmd" } futures = "0.3" async-std = "1.6" diff --git a/kanidm_client/tests/common.rs b/kanidm_client/tests/common.rs index 5c3f0c55a..8f70916d9 100644 --- a/kanidm_client/tests/common.rs +++ b/kanidm_client/tests/common.rs @@ -30,8 +30,8 @@ pub fn run_test(test_fn: fn(KanidmClient) -> ()) { .is_test(true) .try_init(); - let (mut ready_tx, mut ready_rx) = mpsc::channel(1); - let (mut finish_tx, mut finish_rx) = mpsc::channel(1); + let (ready_tx, mut ready_rx) = mpsc::channel(1); + let (finish_tx, mut finish_rx) = mpsc::channel(1); let mut counter = 0; let port = loop { @@ -63,8 +63,7 @@ pub fn run_test(test_fn: fn(KanidmClient) -> ()) { let t_handle = thread::spawn(move || { // Spawn a thread for the test runner, this should have a unique // port.... - let mut rt = tokio::runtime::Builder::new() - .basic_scheduler() + let rt = tokio::runtime::Builder::new_current_thread() .enable_all() .build() .expect("failed to start tokio"); diff --git a/kanidm_proto/Cargo.toml b/kanidm_proto/Cargo.toml index ac77e2c11..95610664b 100644 --- a/kanidm_proto/Cargo.toml +++ b/kanidm_proto/Cargo.toml @@ -16,7 +16,7 @@ uuid = { version = "0.8", features = ["serde", "v4"] } zxcvbn = { version = "2.0", features = ["ser"] } base32 = "0.4" thiserror = "1.0" -webauthn-rs = "0.3.0-alpha.1" +webauthn-rs = "0.3.0-alpha.5" # webauthn-rs = { path = "../../webauthn-rs" } [dev-dependencies] diff --git a/kanidm_tools/Cargo.toml b/kanidm_tools/Cargo.toml index 716ee7e49..e2e1d6093 100644 --- a/kanidm_tools/Cargo.toml +++ b/kanidm_tools/Cargo.toml @@ -29,10 +29,10 @@ path = "src/badlist_preprocess.rs" [dependencies] kanidm_client = { path = "../kanidm_client", version = "1.1.0-alpha.2" } kanidm_proto = { path = "../kanidm_proto", version = "1.1.0-alpha.2" } -rpassword = "4.0" +rpassword = "5.0" structopt = { version = "0.3", default-features = false } log = "0.4" -env_logger = "0.7" +env_logger = "0.8" serde = "1.0" serde_json = "1.0" shellexpand = "2.0" @@ -41,5 +41,5 @@ time = "0.2" zxcvbn = "2.0" -webauthn-authenticator-rs = "0.3.0-alpha.1" +webauthn-authenticator-rs = "0.3.0-alpha.5" # webauthn-authenticator-rs = { path = "../../webauthn-authenticator-rs" } diff --git a/kanidm_unix_int/Cargo.toml b/kanidm_unix_int/Cargo.toml index 0ad39f71d..a5ee8494f 100644 --- a/kanidm_unix_int/Cargo.toml +++ b/kanidm_unix_int/Cargo.toml @@ -44,15 +44,15 @@ kanidm_client = { path = "../kanidm_client", version = "1.1.0-alpha" } kanidm_proto = { path = "../kanidm_proto", version = "1.1.0-alpha" } kanidm = { path = "../kanidmd", version = "1.1.0-alpha" } toml = "0.5" -rpassword = "4.0" -tokio = { version = "0.2", features = ["rt-threaded", "macros", "rt-util", "sync", "time", "net", "io-util", "signal"] } -tokio-util = { version = "0.3", features = ["codec"] } +rpassword = "5.0" +tokio = { version = "1", features = ["rt", "macros", "sync", "time", "net", "io-util", "signal"] } +tokio-util = { version = "0.6", features = ["codec"] } futures = "0.3" -bytes = "0.5" +bytes = "1.0" libc = "0.2" log = "0.4" -env_logger = "0.7" +env_logger = "0.8" serde = "1.0" serde_derive = "1.0" serde_cbor = "0.11" @@ -63,9 +63,9 @@ rusqlite = { version = "0.23", features = ["backup"] } r2d2 = "0.8" r2d2_sqlite = "0.16" -reqwest = { version = "0.10" } +reqwest = { version = "0.11" } -users = "0.10" +users = "0.11" async-std = "1.6" lru = "0.6" diff --git a/kanidm_unix_int/nss_kanidm/Cargo.toml b/kanidm_unix_int/nss_kanidm/Cargo.toml index 0e612dcbb..a78004e47 100644 --- a/kanidm_unix_int/nss_kanidm/Cargo.toml +++ b/kanidm_unix_int/nss_kanidm/Cargo.toml @@ -14,7 +14,6 @@ kanidm_unix_int = { path = "../", version = "1.1.0-alpha" } # libnss = "0.2" libnss = { git = "https://github.com/csnewman/libnss-rs.git", rev = "eab2d93d2438652773699b0807d558ce75b1e748" } libc = "0.2.0" -paste = "0.1" +paste = "1.0" lazy_static = "1.3" - diff --git a/kanidm_unix_int/pam_kanidm/Cargo.toml b/kanidm_unix_int/pam_kanidm/Cargo.toml index 163958f84..4df465d62 100644 --- a/kanidm_unix_int/pam_kanidm/Cargo.toml +++ b/kanidm_unix_int/pam_kanidm/Cargo.toml @@ -11,6 +11,5 @@ path = "src/lib.rs" [dependencies] kanidm_unix_int = { path = "../", version = "1.1.0-alpha" } -futures = "0.3" -tokio = { version = "0.2", features=["full"] } +async-std = "1.6" libc = "0.2" diff --git a/kanidm_unix_int/pam_kanidm/src/lib.rs b/kanidm_unix_int/pam_kanidm/src/lib.rs index 2ac5ecace..4b3d3b197 100644 --- a/kanidm_unix_int/pam_kanidm/src/lib.rs +++ b/kanidm_unix_int/pam_kanidm/src/lib.rs @@ -20,10 +20,7 @@ use std::collections::BTreeSet; use std::convert::TryFrom; use std::ffi::CStr; // use std::os::raw::c_char; - -// use futures::executor::block_on; -use tokio::runtime::Runtime; - +use async_std::task; use kanidm_unix_common::client::call_daemon; use kanidm_unix_common::unix_config::KanidmUnixdConfig; use kanidm_unix_common::unix_proto::{ClientRequest, ClientResponse}; @@ -95,12 +92,7 @@ impl PamHooks for PamKanidm { let req = ClientRequest::PamAccountAllowed(account_id); // PamResultCode::PAM_IGNORE - let mut rt = match Runtime::new() { - Ok(rt) => rt, - Err(_) => return PamResultCode::PAM_SERVICE_ERR, - }; - - match rt.block_on(call_daemon(cfg.sock_path.as_str(), req)) { + match task::block_on(call_daemon(cfg.sock_path.as_str(), req)) { Ok(r) => match r { ClientResponse::PamStatus(Some(true)) => { // println!("PAM_SUCCESS"); @@ -209,12 +201,7 @@ impl PamHooks for PamKanidm { }; let req = ClientRequest::PamAuthenticate(account_id, authtok); - let mut rt = match Runtime::new() { - Ok(rt) => rt, - Err(_) => return PamResultCode::PAM_SERVICE_ERR, - }; - - match rt.block_on(call_daemon(cfg.sock_path.as_str(), req)) { + match task::block_on(call_daemon(cfg.sock_path.as_str(), req)) { Ok(r) => match r { ClientResponse::PamStatus(Some(true)) => { // println!("PAM_SUCCESS"); diff --git a/kanidm_unix_int/pam_tester/Cargo.lock b/kanidm_unix_int/pam_tester/Cargo.lock index 0401b18a8..8c384ddc5 100644 --- a/kanidm_unix_int/pam_tester/Cargo.lock +++ b/kanidm_unix_int/pam_tester/Cargo.lock @@ -25,7 +25,7 @@ dependencies = [ [[package]] name = "pam_tester" -version = "0.1.0" +version = "0.1.2" dependencies = [ "pam 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] diff --git a/kanidm_unix_int/src/client.rs b/kanidm_unix_int/src/client.rs index 7b3e8183a..7a75096e3 100644 --- a/kanidm_unix_int/src/client.rs +++ b/kanidm_unix_int/src/client.rs @@ -1,3 +1,4 @@ +use async_std::task; use bytes::{BufMut, BytesMut}; use futures::SinkExt; use futures::StreamExt; @@ -5,7 +6,6 @@ use std::error::Error; use std::io::Error as IoError; use std::io::ErrorKind; use tokio::net::UnixStream; -use tokio::runtime::Runtime; use tokio_util::codec::Framed; use tokio_util::codec::{Decoder, Encoder}; @@ -73,6 +73,5 @@ pub fn call_daemon_blocking( path: &str, req: ClientRequest, ) -> Result> { - let mut rt = Runtime::new()?; - rt.block_on(call_daemon(path, req)) + task::block_on(call_daemon(path, req)) } diff --git a/kanidm_unix_int/src/daemon.rs b/kanidm_unix_int/src/daemon.rs index 61dd68718..4f3a32037 100644 --- a/kanidm_unix_int/src/daemon.rs +++ b/kanidm_unix_int/src/daemon.rs @@ -218,7 +218,7 @@ async fn handle_client( Ok(()) } -#[tokio::main(core_threads = 1, max_threads = 1)] +#[tokio::main] async fn main() { let cuid = get_current_uid(); let ceuid = get_effective_uid(); @@ -398,7 +398,7 @@ async fn main() { // Set the umask while we open the path let before = unsafe { umask(0) }; - let mut listener = match UnixListener::bind(cfg.sock_path.as_str()) { + let listener = match UnixListener::bind(cfg.sock_path.as_str()) { Ok(l) => l, Err(_e) => { error!("Failed to bind unix socket."); @@ -411,10 +411,9 @@ async fn main() { // TODO: Setup a task that handles pre-fetching here. let server = async move { - let mut incoming = listener.incoming(); - while let Some(socket_res) = incoming.next().await { - match socket_res { - Ok(socket) => { + loop { + match listener.accept().await { + Ok((socket, _addr)) => { let cachelayer_ref = cachelayer.clone(); tokio::spawn(async move { if let Err(e) = handle_client(socket, cachelayer_ref.clone()).await { diff --git a/kanidm_unix_int/tests/cache_layer_test.rs b/kanidm_unix_int/tests/cache_layer_test.rs index 1bbbe85ca..f1bd80ec9 100644 --- a/kanidm_unix_int/tests/cache_layer_test.rs +++ b/kanidm_unix_int/tests/cache_layer_test.rs @@ -38,8 +38,8 @@ fn run_test(fix_fn: fn(&mut KanidmClient) -> (), test_fn: fn(CacheLayer, KanidmA // ::std::env::set_var("RUST_LOG", "kanidm=debug"); let _ = env_logger::builder().is_test(true).try_init(); - let (mut ready_tx, mut ready_rx) = mpsc::channel(1); - let (mut finish_tx, mut finish_rx) = mpsc::channel(1); + let (ready_tx, mut ready_rx) = mpsc::channel(1); + let (finish_tx, mut finish_rx) = mpsc::channel(1); let mut counter = 0; let port = loop { @@ -70,8 +70,7 @@ fn run_test(fix_fn: fn(&mut KanidmClient) -> (), test_fn: fn(CacheLayer, KanidmA let t_handle = thread::spawn(move || { // Spawn a thread for the test runner, this should have a unique // port.... - let mut rt = tokio::runtime::Builder::new() - .basic_scheduler() + let rt = tokio::runtime::Builder::new_current_thread() .enable_all() .build() .expect("failed to start tokio"); @@ -177,7 +176,7 @@ fn test_fixture(rsclient: &mut KanidmClient) -> () { #[test] fn test_cache_sshkey() { run_test(test_fixture, |cachelayer, _adminclient| { - let mut rt = Runtime::new().expect("Failed to start tokio"); + let rt = Runtime::new().expect("Failed to start tokio"); let fut = async move { // Force offline. Show we have no keys. cachelayer.mark_offline().await; @@ -213,7 +212,7 @@ fn test_cache_sshkey() { #[test] fn test_cache_account() { run_test(test_fixture, |cachelayer, _adminclient| { - let mut rt = Runtime::new().expect("Failed to start tokio"); + let rt = Runtime::new().expect("Failed to start tokio"); let fut = async move { // Force offline. Show we have no account cachelayer.mark_offline().await; @@ -259,7 +258,7 @@ fn test_cache_account() { #[test] fn test_cache_group() { run_test(test_fixture, |cachelayer, _adminclient| { - let mut rt = Runtime::new().expect("Failed to start tokio"); + let rt = Runtime::new().expect("Failed to start tokio"); let fut = async move { // Force offline. Show we have no groups. cachelayer.mark_offline().await; @@ -328,7 +327,7 @@ fn test_cache_group() { #[test] fn test_cache_group_delete() { run_test(test_fixture, |cachelayer, mut adminclient| { - let mut rt = Runtime::new().expect("Failed to start tokio"); + let rt = Runtime::new().expect("Failed to start tokio"); let fut = async move { // get the group cachelayer.attempt_online().await; @@ -367,7 +366,7 @@ fn test_cache_group_delete() { #[test] fn test_cache_account_delete() { run_test(test_fixture, |cachelayer, mut adminclient| { - let mut rt = Runtime::new().expect("Failed to start tokio"); + let rt = Runtime::new().expect("Failed to start tokio"); let fut = async move { // get the account cachelayer.attempt_online().await; @@ -413,7 +412,7 @@ fn test_cache_account_delete() { #[test] fn test_cache_account_password() { run_test(test_fixture, |cachelayer, mut adminclient| { - let mut rt = Runtime::new().expect("Failed to start tokio"); + let rt = Runtime::new().expect("Failed to start tokio"); let fut = async move { cachelayer.attempt_online().await; // Test authentication failure. @@ -510,7 +509,7 @@ fn test_cache_account_password() { #[test] fn test_cache_account_pam_allowed() { run_test(test_fixture, |cachelayer, mut adminclient| { - let mut rt = Runtime::new().expect("Failed to start tokio"); + let rt = Runtime::new().expect("Failed to start tokio"); let fut = async move { cachelayer.attempt_online().await; @@ -547,7 +546,7 @@ fn test_cache_account_pam_allowed() { #[test] fn test_cache_account_pam_nonexist() { run_test(test_fixture, |cachelayer, _adminclient| { - let mut rt = Runtime::new().expect("Failed to start tokio"); + let rt = Runtime::new().expect("Failed to start tokio"); let fut = async move { cachelayer.attempt_online().await; @@ -584,7 +583,7 @@ fn test_cache_account_pam_nonexist() { #[test] fn test_cache_account_expiry() { run_test(test_fixture, |cachelayer, mut adminclient| { - let mut rt = Runtime::new().expect("Failed to start tokio"); + let rt = Runtime::new().expect("Failed to start tokio"); let fut = async move { cachelayer.attempt_online().await; assert!(cachelayer.test_connection().await); @@ -659,7 +658,7 @@ fn test_cache_account_expiry() { #[test] fn test_cache_nxcache() { run_test(test_fixture, |cachelayer, mut _adminclient| { - let mut rt = Runtime::new().expect("Failed to start tokio"); + let rt = Runtime::new().expect("Failed to start tokio"); let fut = async move { cachelayer.attempt_online().await; assert!(cachelayer.test_connection().await); diff --git a/kanidmd/Cargo.toml b/kanidmd/Cargo.toml index 07410bdde..e56a4bde0 100644 --- a/kanidmd/Cargo.toml +++ b/kanidmd/Cargo.toml @@ -38,8 +38,8 @@ fernet = { git = "https://github.com/mozilla-services/fernet-rs.git" } async-std = "1.6" log = "0.4" -env_logger = "0.7" -rand = "0.7" +env_logger = "0.8" +rand = "0.8" toml = "0.5" chrono = "0.4" @@ -48,9 +48,9 @@ lazy_static = "1.2.0" futures = "0.3" futures-util = "0.3" -tokio = { version = "0.2", features = ["rt-threaded", "macros", "rt-util", "sync", "time", "net", "io-util", "signal"] } -tokio-util = { version = "0.3", features = ["codec"] } -tokio-openssl = "0.4" +tokio = { version = "1", features = ["full"] } +tokio-util = { version = "0.6", features = ["codec"] } +tokio-openssl = "0.6" openssl = "0.10" uuid = { version = "0.8", features = ["serde", "v4" ] } @@ -67,7 +67,7 @@ r2d2_sqlite = "0.16" structopt = { version = "0.3", default-features = false } time = { version = "0.2", features = ["serde", "std"] } -hashbrown = "0.8" +hashbrown = "0.9" concread = "^0.2.5" # concread = { version = "^0.2.5", features = ["simd_support"] } # concread = { path = "../../concread" } @@ -76,23 +76,23 @@ concread = "^0.2.5" sshkeys = "0.3" -rpassword = "4.0" +rpassword = "5.0" num_cpus = "1.10" idlset = { version = "0.1" , features = ["use_smallvec"] } # idlset = { path = "../../idlset", features = ["use_smallvec"] } zxcvbn = "2.0" -base64 = "0.12" +base64 = "0.13" ldap3_server = "0.1" # ldap3_server = { path = "../../ldap3_server" } -webauthn-rs = "0.3.0-alpha.1" +webauthn-rs = "0.3.0-alpha.5" # webauthn-rs = { path = "../../webauthn-rs" } libc = "0.2" -users = "0.10" +users = "0.11" smartstring = { version = "0.2", features = ["serde"] } @@ -102,7 +102,7 @@ smartstring = { version = "0.2", features = ["serde"] } [dev-dependencies] criterion = "0.3" # For testing webauthn -webauthn-authenticator-rs = "0.3.0-alpha.1" +webauthn-authenticator-rs = "0.3.0-alpha.5" # webauthn-authenticator-rs = { path = "../../webauthn-authenticator-rs" } [dev-dependencies.cargo-husky] diff --git a/kanidmd/Dockerfile b/kanidmd/Dockerfile index a870fc015..44b3ff03c 100644 --- a/kanidmd/Dockerfile +++ b/kanidmd/Dockerfile @@ -9,13 +9,15 @@ RUN zypper -vv ref && \ gcc \ clang lld \ make automake autoconf \ - libopenssl-devel pam-devel && \ + libopenssl-devel pam-devel \ + sccache && \ zypper clean -a - COPY . /usr/src/kanidm WORKDIR /usr/src/kanidm/kanidmd +ARG SCCACHE_REDIS + RUN ln -s -f /usr/bin/clang /usr/bin/cc && \ ln -s -f /usr/bin/ld.lld /usr/bin/ld @@ -25,10 +27,22 @@ RUN if [ "$(uname -m)" == "x86_64" ]; \ if [ "$(uname -m)" == "aarch64" ]; \ then export RUSTFLAGS=''; \ fi; \ + if [ "${SCCACHE_REDIS}" != "" ]; \ + then export CC="/usr/bin/sccache /usr/bin/clang"; export RUSTC_WRAPPER=sccache; sccache --start-server; \ + else export CC="/usr/bin/clang"; \ + fi; \ + echo $RUSTC_WRAPPER; \ echo $RUSTFLAGS; \ - CC=/usr/bin/clang RUSTC_BOOTSTRAP=1 \ + echo $CC; \ + RUSTC_BOOTSTRAP=1 \ cargo build --features=concread/simd_support,libsqlite3-sys/bundled \ - --release + --release; \ + if [ "${SCCACHE_REDIS}" != "" ]; \ + then sccache -s; \ + fi; \ + echo $RUSTFLAGS; \ + echo $CC; \ + echo $RUSTC_WRAPPER; FROM ${BASE_IMAGE} LABEL mantainer william@blackhats.net.au diff --git a/kanidmd/src/lib/core/ldaps.rs b/kanidmd/src/lib/core/ldaps.rs index 01d315109..edd9f8eab 100644 --- a/kanidmd/src/lib/core/ldaps.rs +++ b/kanidmd/src/lib/core/ldaps.rs @@ -1,10 +1,13 @@ use crate::actors::v1_read::{LdapRequestMessage, QueryServerReadV1}; use crate::ldap::{LdapBoundToken, LdapResponseState}; -use openssl::ssl::{SslAcceptor, SslAcceptorBuilder}; +use core::pin::Pin; +use openssl::ssl::{Ssl, SslAcceptor, SslAcceptorBuilder}; +use tokio_openssl::SslStream; use futures_util::sink::SinkExt; use futures_util::stream::StreamExt; // use ldap3_server::simple::*; +// use ldap3_server::proto::LdapMsg; use ldap3_server::LdapCodec; // use std::convert::TryFrom; use std::marker::Unpin; @@ -12,6 +15,7 @@ use std::net; use std::str::FromStr; use tokio::io::{AsyncRead, AsyncWrite}; use tokio::net::TcpListener; +// use tokio::sync::mpsc::{channel, Receiver, Sender}; use tokio_util::codec::{FramedRead, FramedWrite}; use uuid::Uuid; @@ -91,26 +95,30 @@ async fn client_process( } }; } - // We now are leaving, so any cleanup done here. } async fn tls_acceptor( - mut listener: TcpListener, + listener: TcpListener, tls_parms: SslAcceptor, qe_r_ref: &'static QueryServerReadV1, ) { - // Do we need to do the silly ssl leak? loop { match listener.accept().await { Ok((tcpstream, paddr)) => { - let res = tokio_openssl::accept(&tls_parms, tcpstream).await; - let tlsstream = match res { - Ok(ts) => ts, + // From the parms we need to create an SslContext. + let mut tlsstream = match Ssl::new(tls_parms.context()) + .and_then(|tls_obj| SslStream::new(tls_obj, tcpstream)) + { + Ok(ta) => ta, Err(e) => { - error!("tls handshake error, continuing -> {:?}", e); + error!("tls setup error, continuing -> {:?}", e); continue; } }; + if let Err(e) = SslStream::accept(Pin::new(&mut tlsstream)).await { + error!("tls accept error, continuing -> {:?}", e); + continue; + }; let (r, w) = tokio::io::split(tlsstream); let r = FramedRead::new(r, LdapCodec); let w = FramedWrite::new(w, LdapCodec); @@ -123,7 +131,7 @@ async fn tls_acceptor( } } -async fn acceptor(mut listener: TcpListener, qe_r_ref: &'static QueryServerReadV1) { +async fn acceptor(listener: TcpListener, qe_r_ref: &'static QueryServerReadV1) { loop { match listener.accept().await { Ok((tcpstream, paddr)) => { diff --git a/kanidmd/src/lib/idm/authsession.rs b/kanidmd/src/lib/idm/authsession.rs index bcd893d54..033f3908e 100644 --- a/kanidmd/src/lib/idm/authsession.rs +++ b/kanidmd/src/lib/idm/authsession.rs @@ -786,7 +786,9 @@ mod tests { Ok(AuthState::Success(_)) => {} _ => panic!(), }; - assert!(async_rx.try_recv().is_err()); + + drop(async_tx); + assert!(async_rx.blocking_recv().is_none()); audit.write_log(); } @@ -979,7 +981,8 @@ mod tests { }; } - assert!(async_rx.try_recv().is_err()); + drop(async_tx); + assert!(async_rx.blocking_recv().is_none()); audit.write_log(); } @@ -1104,8 +1107,8 @@ mod tests { } // Check the async counter update was sent. - match async_rx.try_recv() { - Ok(DelayedAction::WebauthnCounterIncrement(_)) => {} + match async_rx.blocking_recv() { + Some(DelayedAction::WebauthnCounterIncrement(_)) => {} _ => assert!(false), } @@ -1174,7 +1177,8 @@ mod tests { }; } - assert!(async_rx.try_recv().is_err()); + drop(async_tx); + assert!(async_rx.blocking_recv().is_none()); audit.write_log(); } } diff --git a/kanidmd/src/lib/idm/server.rs b/kanidmd/src/lib/idm/server.rs index 630752a58..262e4a07a 100644 --- a/kanidmd/src/lib/idm/server.rs +++ b/kanidmd/src/lib/idm/server.rs @@ -30,24 +30,22 @@ use crate::idm::delayed::{ use kanidm_proto::v1::OperationError; use kanidm_proto::v1::RadiusAuthToken; -// use kanidm_proto::v1::TOTPSecret as ProtoTOTPSecret; use kanidm_proto::v1::SetCredentialResponse; use kanidm_proto::v1::UnixGroupToken; use kanidm_proto::v1::UnixUserToken; -// use std::sync::Arc; - -// use crossbeam::channel::{unbounded, Sender, Receiver, TryRecvError}; -#[cfg(test)] -use tokio::sync::mpsc::error::TryRecvError; use tokio::sync::mpsc::{ unbounded_channel as unbounded, UnboundedReceiver as Receiver, UnboundedSender as Sender, }; use tokio::sync::Semaphore; -// SemaphorePermit use async_std::task; +#[cfg(test)] +use core::task::{Context, Poll}; +#[cfg(test)] +use futures::task as futures_task; + use concread::bptree::{BptreeMap, BptreeMapWriteTxn}; use concread::hashmap::HashMap; use rand::prelude::*; @@ -262,15 +260,23 @@ impl IdmServer { impl IdmServerDelayed { #[cfg(test)] pub fn is_empty_or_panic(&mut self) { - assert!(self.async_rx.try_recv().is_err()); + let waker = futures_task::noop_waker(); + let mut cx = Context::from_waker(&waker); + match self.async_rx.poll_recv(&mut cx) { + Poll::Pending | Poll::Ready(None) => {} + Poll::Ready(Some(_m)) => panic!("Task queue not empty"), + } } #[cfg(test)] pub(crate) fn try_recv(&mut self) -> Result { - self.async_rx.try_recv().map_err(|e| match e { - TryRecvError::Empty => OperationError::InvalidState, - TryRecvError::Closed => OperationError::QueueDisconnected, - }) + let waker = futures_task::noop_waker(); + let mut cx = Context::from_waker(&waker); + match self.async_rx.poll_recv(&mut cx) { + Poll::Pending => Err(OperationError::InvalidState), + Poll::Ready(None) => Err(OperationError::QueueDisconnected), + Poll::Ready(Some(m)) => Ok(m), + } } pub(crate) async fn process_all(&mut self, server: &'static QueryServerWriteV1) { diff --git a/kanidmd/src/lib/server.rs b/kanidmd/src/lib/server.rs index 3a75c5d95..b27269cb2 100644 --- a/kanidmd/src/lib/server.rs +++ b/kanidmd/src/lib/server.rs @@ -791,7 +791,12 @@ impl QueryServer { pub async fn read_async(&self) -> QueryServerReadTransaction<'_> { // We need to ensure a db conn will be available - let db_ticket = self.db_tickets.acquire().await; + #[allow(clippy::expect_used)] + let db_ticket = self + .db_tickets + .acquire() + .await + .expect("unable to aquire db_ticket for qsr"); QueryServerReadTransaction { be_txn: self.be.read(), @@ -808,10 +813,20 @@ impl QueryServer { } pub async fn write_async(&self, ts: Duration) -> QueryServerWriteTransaction<'_> { - // We need to ensure a db conn will be available - let db_ticket = self.db_tickets.acquire().await; // Guarantee we are the only writer on the thread pool - let write_ticket = self.write_ticket.acquire().await; + #[allow(clippy::expect_used)] + let write_ticket = self + .write_ticket + .acquire() + .await + .expect("unable to aquire writer_ticket for qsw"); + // We need to ensure a db conn will be available + #[allow(clippy::expect_used)] + let db_ticket = self + .db_tickets + .acquire() + .await + .expect("unable to aquire db_ticket for qsw"); // let schema_write = self.schema.write().await; let schema_write = self.schema.write(); diff --git a/kanidmd/src/lib/utils.rs b/kanidmd/src/lib/utils.rs index cc74fc6c0..1e22ee5d2 100644 --- a/kanidmd/src/lib/utils.rs +++ b/kanidmd/src/lib/utils.rs @@ -38,13 +38,25 @@ pub fn password_from_random() -> String { } pub fn readable_password_from_random() -> String { - let trng = thread_rng(); + let mut trng = thread_rng(); format!( "{}-{}-{}-{}", - trng.sample_iter(&DistinctAlpha).take(4).collect::(), - trng.sample_iter(&DistinctAlpha).take(4).collect::(), - trng.sample_iter(&DistinctAlpha).take(4).collect::(), - trng.sample_iter(&DistinctAlpha).take(4).collect::(), + (&mut trng) + .sample_iter(&DistinctAlpha) + .take(4) + .collect::(), + (&mut trng) + .sample_iter(&DistinctAlpha) + .take(4) + .collect::(), + (&mut trng) + .sample_iter(&DistinctAlpha) + .take(4) + .collect::(), + (&mut trng) + .sample_iter(&DistinctAlpha) + .take(4) + .collect::(), ) }