diff --git a/Cargo.lock b/Cargo.lock index 63e42da7316..93efba8b51b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,3 +1,16 @@ +[[package]] +name = "aho-corasick" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "ansi_term" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "ansi_term" version = "0.10.2" @@ -10,7 +23,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -21,8 +34,8 @@ dependencies = [ "backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-demangle 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -43,6 +56,11 @@ dependencies = [ "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bitflags" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "bitflags" version = "1.0.1" @@ -59,7 +77,7 @@ version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -77,30 +95,59 @@ name = "chrono" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "clap" -version = "2.29.2" +version = "2.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", "atty 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", "vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "core-foundation" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "core-foundation-sys" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "dtoa" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "env_logger" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "atty 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "termcolor 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "failure" version = "0.1.1" @@ -120,6 +167,19 @@ dependencies = [ "synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "foreign-types" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "foreign-types-shared" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "fuchsia-zircon" version = "0.3.3" @@ -136,7 +196,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "futures" -version = "0.1.17" +version = "0.1.18" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -144,38 +204,53 @@ name = "futures-cpupool" version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "httparse" -version = "1.2.3" +version = "1.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "hyper" -version = "0.11.14" +version = "0.11.18" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "base64 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "mime 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", "percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "relay 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "hyper-tls" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.11.18 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "idna" version = "0.1.4" @@ -188,7 +263,7 @@ dependencies = [ [[package]] name = "iovec" -version = "0.1.1" +version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", @@ -214,6 +289,16 @@ name = "language-tags" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "lazy_static" +version = "0.2.11" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "lazy_static" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "lazycell" version = "0.6.0" @@ -235,7 +320,7 @@ dependencies = [ [[package]] name = "linked-hash-map" -version = "0.5.0" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -252,6 +337,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -259,6 +345,14 @@ name = "matches" version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "memchr" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "mime" version = "0.3.5" @@ -269,12 +363,12 @@ dependencies = [ [[package]] name = "mio" -version = "0.6.12" +version = "0.6.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", @@ -296,6 +390,20 @@ dependencies = [ "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "native-tls" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)", + "schannel 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tempdir 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "net2" version = "0.2.31" @@ -310,34 +418,42 @@ dependencies = [ [[package]] name = "num" -version = "0.1.41" +version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "num-iter 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-integer" -version = "0.1.35" +version = "0.1.36" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-iter" -version = "0.1.34" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "num-traits" +version = "0.1.43" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "num-traits" -version = "0.1.41" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -348,6 +464,29 @@ dependencies = [ "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "openssl" +version = "0.9.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)", + "foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "openssl-sys 0.9.26 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "openssl-sys" +version = "0.9.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "owning_ref" version = "0.3.3" @@ -362,18 +501,18 @@ version = "0.5.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "parking_lot_core" -version = "0.2.10" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -386,6 +525,17 @@ name = "pkg-config" version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "pretty_env_logger" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)", + "ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", + "env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "quote" version = "0.3.15" @@ -393,11 +543,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "rand" -version = "0.3.20" +version = "0.3.22" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -407,7 +558,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -423,17 +574,43 @@ dependencies = [ "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "regex" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "regex-syntax 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "regex-syntax" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "relay" -version = "0.1.0" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "remove_dir_all" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "rustc-demangle" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -441,17 +618,47 @@ name = "safemem" version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "schannel" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "scoped-tls" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "security-framework" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", + "security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "security-framework-sys" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sentry-agent" version = "0.1.0" dependencies = [ - "clap 2.29.2 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.30.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "pretty_env_logger 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "smith-aorta 0.1.0", "smith-common 0.1.0", "smith-config 0.1.0", @@ -490,7 +697,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -499,8 +706,8 @@ name = "serde_yaml" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "linked-hash-map 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)", + "linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", + "num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "yaml-rust 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -533,6 +740,9 @@ dependencies = [ "chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.11.18 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", @@ -540,7 +750,8 @@ dependencies = [ "serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "smith-common 0.1.0", "sodiumoxide 0.0.16 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "uuid 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -553,21 +764,23 @@ dependencies = [ "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "smith-config" version = "0.1.0" dependencies = [ + "chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", "serde_yaml 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", "smith-aorta 0.1.0", "smith-common 0.1.0", - "url 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", "url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -575,11 +788,14 @@ dependencies = [ name = "smith-server" version = "0.1.0" dependencies = [ - "clap 2.29.2 (registry+https://github.com/rust-lang/crates.io-index)", + "clap 2.30.0 (registry+https://github.com/rust-lang/crates.io-index)", "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.11.14 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.11.18 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "smith-aorta 0.1.0", "smith-config 0.1.0", + "smith-trove 0.1.0", ] [[package]] @@ -588,9 +804,15 @@ version = "0.1.0" dependencies = [ "failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.11.18 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", "smith-aorta 0.1.0", "smith-common 0.1.0", + "tokio-core 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -610,7 +832,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "strsim" -version = "0.6.0" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -645,6 +867,23 @@ name = "take" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "tempdir" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "remove_dir_all 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "termcolor" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "termion" version = "1.5.1" @@ -663,6 +902,15 @@ dependencies = [ "unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "thread_local" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "time" version = "0.1.39" @@ -670,7 +918,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", "redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -679,23 +927,23 @@ version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", "scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "tokio-io" -version = "0.1.4" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -703,15 +951,15 @@ name = "tokio-proto" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "smallvec 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-core 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -720,7 +968,18 @@ name = "tokio-service" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-tls" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-core 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -754,9 +1013,17 @@ name = "unicode-xid" version = "0.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "unreachable" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "url" -version = "1.6.0" +version = "1.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -770,18 +1037,28 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "utf8-ranges" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "uuid" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "rand 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "vcpkg" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "vec_map" version = "0.8.0" @@ -792,6 +1069,11 @@ name = "version_check" version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "void" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "winapi" version = "0.2.8" @@ -799,11 +1081,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi" -version = "0.3.3" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "winapi-i686-pc-windows-gnu 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-x86_64-pc-windows-gnu 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -813,14 +1095,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi-i686-pc-windows-gnu" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "winapi-x86_64-pc-windows-gnu" -version = "0.3.2" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "wincolor" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "ws2_32-sys" version = "0.2.1" @@ -835,66 +1125,89 @@ name = "yaml-rust" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "linked-hash-map 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", + "linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [metadata] +"checksum aho-corasick 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d6531d44de723825aa81398a6415283229725a00fa30713812ab9323faa82fc4" "checksum ansi_term 0.10.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6b3568b48b7cefa6b8ce125f9bb4989e52fbcc29ebea88df04cc7c5f12f70455" +"checksum ansi_term 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "23ac7c30002a5accbf7e8987d0632fa6de155b7c3d39d0067317a391e00a2ef6" "checksum atty 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8352656fd42c30a0c3c89d26dea01e3b77c0ab2af18230835c15e2e13cd51859" "checksum backtrace 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ebbbf59b1c43eefa8c3ede390fcc36820b4999f7914104015be25025e0d62af2" "checksum backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "44585761d6161b0f57afc49482ab6bd067e4edef48c12a152c237eb0203f7661" "checksum base64 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "229d032f1a99302697f10b27167ae6d03d49d032e6a8e2550e8d3fc13356d2b4" +"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5" "checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf" "checksum byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23" "checksum bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1b7db437d718977f6dc9b2e3fd6fc343c02ac6b899b73fdd2179163447bd9ce9" "checksum cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "deaf9ec656256bb25b404c51ef50097207b9cbb29c933d31f92cae5a8a0ffee0" "checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de" "checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9" -"checksum clap 2.29.2 (registry+https://github.com/rust-lang/crates.io-index)" = "4151c5790817c7d21bbdc6c3530811f798172915f93258244948b93ba19604a6" +"checksum clap 2.30.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1c07b9257a00f3fc93b7f3c417fc15607ec7a56823bc2c37ec744e266387de5b" +"checksum core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67" +"checksum core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d" "checksum dtoa 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "09c3753c3db574d215cba4ea76018483895d7bff25a31b49ba45db21c48e50ab" +"checksum env_logger 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f15f0b172cb4f52ed5dbf47f774a387cd2315d1bf7894ab5af9b083ae27efa5a" "checksum failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "934799b6c1de475a012a02dab0ace1ace43789ee4b99bcfbf1a2e3e8ced5de82" "checksum failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cdda555bb90c9bb67a3b670a0f42de8e73f5981524123ad8578aafec8ddb8b" +"checksum foreign-types 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" +"checksum foreign-types-shared 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" -"checksum futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "118b49cac82e04121117cbd3121ede3147e885627d82c4546b87c702debb90c1" +"checksum futures 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0bab5b5e94f5c31fc764ba5dd9ad16568aae5d4825538c01d6bca680c9bf94a7" "checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" -"checksum httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "af2f2dd97457e8fb1ae7c5a420db346af389926e36f43768b96f101546b04a07" -"checksum hyper 0.11.14 (registry+https://github.com/rust-lang/crates.io-index)" = "f57f74deb81fb91b776012ed7605e96b1ffb88c4fd5c031ce5c90534b604a6e0" +"checksum httparse 1.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c2f407128745b78abc95c0ffbe4e5d37427fdc0d45470710cfef8c44522a2e37" +"checksum hyper 0.11.18 (registry+https://github.com/rust-lang/crates.io-index)" = "c4f9b276c87e3fc1902a8bdfcce264c3f7c8a1c35e5e0c946062739f55026664" +"checksum hyper-tls 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9c81fa95203e2a6087242c38691a0210f23e9f3f8f944350bd676522132e2985" "checksum idna 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "014b298351066f1512874135335d62a789ffe78a9974f94b43ed5621951eaf7d" -"checksum iovec 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b6e8b9c2247fcf6c6a1151f1156932be5606c9fd6f55a2d7f9fc1cb29386b2f7" +"checksum iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dbe6e417e7d0975db6512b90796e8ce223145ac4e33c377e4a42882a0e88bb08" "checksum itoa 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8324a32baf01e2ae060e9de58ed0bc2320c9a2833491ee36cd3b4c414de4db8c" "checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d" "checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a" +"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73" +"checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d" "checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef" "checksum libc 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)" = "1e5d97d6708edaa407429faa671b942dc0f2727222fb6b6539bf1db936e4b121" "checksum libsodium-sys 0.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "fcbd1beeed8d44caa8a669ebaa697c313976e242c03cc9fb23d88bf1656f5542" -"checksum linked-hash-map 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d2aab0478615bb586559b0114d94dd8eca4fdbb73b443adcb0d00b61692b4bf" +"checksum linked-hash-map 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "70fb39025bc7cdd76305867c4eccf2f2dcf6e9a57f5b21a93e1c2d86cd03ec9e" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2" "checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376" +"checksum memchr 2.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "796fba70e76612589ed2ce7f45282f5af869e0fdd7cc6199fa1aa1f1d591ba9d" "checksum mime 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "e2e00e17be181010a91dbfefb01660b17311059dc8c7f48b9017677721e732bd" -"checksum mio 0.6.12 (registry+https://github.com/rust-lang/crates.io-index)" = "75f72a93f046f1517e3cfddc0a096eb756a2ba727d36edc8227dee769a50a9b0" +"checksum mio 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "7da01a5e23070d92d99b1ecd1cd0af36447c6fd44b0fe283c2db199fa136724f" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +"checksum native-tls 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f74dbadc8b43df7864539cedb7bc91345e532fdd913cfdc23ad94f4d2d40fbc0" "checksum net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "3a80f842784ef6c9a958b68b7516bc7e35883c614004dd94959a4dca1b716c09" -"checksum num 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "cc4083e14b542ea3eb9b5f33ff48bd373a92d78687e74f4cc0a30caeb754f0ca" -"checksum num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "d1452e8b06e448a07f0e6ebb0bb1d92b8890eea63288c0b627331d53514d0fba" -"checksum num-iter 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "7485fcc84f85b4ecd0ea527b14189281cf27d60e583ae65ebc9c088b13dffe01" -"checksum num-traits 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "cacfcab5eb48250ee7d0c7896b51a2c5eec99c1feea5f32025635f5ae4b00070" +"checksum num 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "4703ad64153382334aa8db57c637364c322d3372e097840c72000dabdcf6156e" +"checksum num-integer 0.1.36 (registry+https://github.com/rust-lang/crates.io-index)" = "f8d26da319fb45674985c78f1d1caf99aa4941f785d384a2ae36d0740bc3e2fe" +"checksum num-iter 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "4b226df12c5a59b63569dd57fafb926d91b385dfce33d8074a412411b689d593" +"checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" +"checksum num-traits 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e7de20f146db9d920c45ee8ed8f71681fd9ade71909b48c3acbd766aa504cf10" "checksum num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c51a3322e4bca9d212ad9a158a02abc6934d005490c054a2778df73a70aa0a30" +"checksum openssl 0.9.24 (registry+https://github.com/rust-lang/crates.io-index)" = "a3605c298474a3aa69de92d21139fb5e2a81688d308262359d85cdd0d12a7985" +"checksum openssl-sys 0.9.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5a41ce2f5f2d939c80decde8fcfcf5837c203ca6c06a553510a2fcb84fa3ef1" "checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37" "checksum parking_lot 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3e7f7c9857874e54afeb950eebeae662b1e51a2493666d2ea4c0a5d91dcf0412" -"checksum parking_lot_core 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "9f35048d735bb93dd115a0030498785971aab3234d311fbe273d020084d26bd8" +"checksum parking_lot_core 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "538ef00b7317875071d5e00f603f24d16f0b474c1a5fc0ccb8b454ca72eafa79" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" "checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903" +"checksum pretty_env_logger 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "fd5c507cd6729e967cdbd3912bea44f2920e4ffa170f1242706e67a657eeddf0" "checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" -"checksum rand 0.3.20 (registry+https://github.com/rust-lang/crates.io-index)" = "512870020642bb8c221bf68baa1b2573da814f6ccfe5c9699b1c303047abe9b1" +"checksum rand 0.3.22 (registry+https://github.com/rust-lang/crates.io-index)" = "15a732abf9d20f0ad8eeb6f909bf6868722d9a06e1e50802b6a70351f40b4eb1" "checksum rand 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "eba5f8cb59cc50ed56be8880a5c7b496bfd9bd26394e176bc67884094145c2c5" "checksum redox_syscall 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "0d92eecebad22b767915e4d529f89f28ee96dbbf5a4810d2b844373f136417fd" "checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" -"checksum relay 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f301bafeb60867c85170031bdb2fcf24c8041f33aee09e7b116a58d4e9f781c5" -"checksum rustc-demangle 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "aee45432acc62f7b9a108cc054142dac51f979e69e71ddce7d6fc7adf29e817e" +"checksum regex 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "5be5347bde0c48cfd8c3fdc0766cdfe9d8a755ef84d620d6794c778c91de8b2b" +"checksum regex-syntax 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "8e931c58b93d86f080c734bfd2bce7dd0079ae2331235818133c8be7f422e20e" +"checksum relay 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1576e382688d7e9deecea24417e350d3062d97e32e45d70b1cde65994ff1489a" +"checksum remove_dir_all 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b5d2f806b0fcdabd98acd380dc8daef485e22bcb7cddc811d1337967f2528cf5" +"checksum rustc-demangle 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f312457f8a4fa31d3581a6f423a70d6c33a10b95291985df55f1ff670ec10ce8" "checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" +"checksum schannel 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "acece75e0f987c48863a6c792ec8b7d6c4177d4a027f8ccc72f849794f437016" "checksum scoped-tls 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f417c22df063e9450888a7561788e9bd46d3bb3c1466435b4eccb903807f147d" +"checksum security-framework 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "dfa44ee9c54ce5eecc9de7d5acbad112ee58755239381f687e564004ba4a2332" +"checksum security-framework-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "5421621e836278a0b139268f36eee0dc7e389b784dc3f79d8f11aabadf41bead" "checksum serde 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "db99f3919e20faa51bb2996057f5031d8685019b5a06139b1ce761da671b8526" "checksum serde_derive 1.0.27 (registry+https://github.com/rust-lang/crates.io-index)" = "f4ba7591cfe93755e89eeecdbcc668885624829b020050e6aec99c2a03bd3fd0" "checksum serde_derive_internals 0.19.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6e03f1c9530c3fb0a0a5c9b826bdd9246a5921ae995d75f512ac917fc4dd55b5" @@ -906,32 +1219,41 @@ dependencies = [ "checksum smallvec 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "44db0ecb22921ef790d17ae13a3f6d15784183ff5f2a01aa32098c7498d2b4b9" "checksum sodiumoxide 0.0.16 (registry+https://github.com/rust-lang/crates.io-index)" = "eb5cb2f14f9a51352ad65e59257a0a9459d5a36a3615f3d53a974c82fdaaa00a" "checksum stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "15132e0e364248108c5e2c02e3ab539be8d6f5d52a01ca9bbf27ed657316f02b" -"checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694" +"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" "checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" "checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" "checksum synstructure 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3a761d12e6d8dcb4dcf952a7a89b475e3a9d69e4a69307e01a470977642914bd" "checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5" +"checksum tempdir 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "f73eebdb68c14bcb24aef74ea96079830e7fa7b31a6106e42ea7ee887c1e134e" +"checksum termcolor 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "73e83896da740a4541a6f21606b35f2aa4bada5b65d89dc61114bf9d6ff2dc7e" "checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" "checksum textwrap 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0b59b6b4b44d867f1370ef1bd91bfb262bf07bf0ae65c202ea2fbc16153b693" +"checksum thread_local 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "279ef31c19ededf577bfd12dfae728040a21f635b06a24cd670ff510edd38963" "checksum time 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "a15375f1df02096fb3317256ce2cee6a1f42fc84ea5ad5fc8c421cfe40c73098" "checksum tokio-core 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "52b4e32d8edbf29501aabb3570f027c6ceb00ccef6538f4bddba0200503e74e8" -"checksum tokio-io 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "514aae203178929dbf03318ad7c683126672d4d96eccb77b29603d33c9e25743" +"checksum tokio-io 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "b9532748772222bf70297ec0e2ad0f17213b4a7dd0e6afb68e0a0768f69f4e4f" "checksum tokio-proto 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fbb47ae81353c63c487030659494b295f6cb6576242f907f203473b191b0389" "checksum tokio-service 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "24da22d077e0f15f55162bdbdc661228c1581892f52074fb242678d015b45162" +"checksum tokio-tls 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "772f4b04e560117fe3b0a53e490c16ddc8ba6ec437015d91fa385564996ed913" "checksum unicase 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "284b6d3db520d67fbe88fd778c21510d1b0ba4a551e5d0fbb023d33405f6de8a" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "51ccda9ef9efa3f7ef5d91e8f9b83bbe6955f9bf86aec89d5cce2c874625920f" "checksum unicode-width 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "bf3a113775714a22dcb774d8ea3655c53a32debae63a063acc00a91cc586245f" "checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" -"checksum url 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fa35e768d4daf1d85733418a49fb42e10d7f633e394fccab4ab7aba897053fe2" +"checksum unreachable 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "382810877fe448991dfc7f0dd6e3ae5d58088fd0ea5e35189655f84e6814fa56" +"checksum url 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f808aadd8cfec6ef90e4a14eb46f24511824d1ac596b9682703c87056c8678b7" "checksum url_serde 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74e7d099f1ee52f823d4bdd60c93c3602043c728f5db3b97bdb548467f7bddea" +"checksum utf8-ranges 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "662fab6525a98beff2921d7f61a39e7d59e0b425ebc7d0d9e66d316e55124122" "checksum uuid 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "bcc7e3b898aa6f6c08e5295b6c89258d1331e9ac578cc992fb818759951bdc22" +"checksum vcpkg 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "9e0a7d8bed3178a8fb112199d466eeca9ed09a14ba8ad67718179b4fd5487d0b" "checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c" "checksum version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6b772017e347561807c1aa192438c5fd74242a670a6cffacc40f2defd1dc069d" +"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b09fb3b6f248ea4cd42c9a65113a847d612e17505d6ebd1f7357ad68a8bf8693" +"checksum winapi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "04e3bd221fcbe8a271359c04f21a76db7d0c6028862d1bb5512d85e1e2eb5bb3" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" -"checksum winapi-i686-pc-windows-gnu 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ec6667f60c23eca65c561e63a13d81b44234c2e38a6b6c959025ee907ec614cc" -"checksum winapi-x86_64-pc-windows-gnu 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "98f12c52b2630cd05d2c3ffd8e008f7f48252c042b4871c72aed9dc733b96668" +"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +"checksum wincolor 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "eeb06499a3a4d44302791052df005d5232b927ed1a9658146d842165c4de7767" "checksum ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d59cefebd0c892fa2dd6de581e937301d8552cb44489cdff035c6187cb63fa5e" "checksum yaml-rust 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "57ab38ee1a4a266ed033496cf9af1828d8d6e6c1cfa5f643a2809effcae4d628" diff --git a/Cargo.toml b/Cargo.toml index be5b4d6c77a..998eb4448bb 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,15 +10,12 @@ version = "0.1.0" [dependencies] clap = "2.29.2" failure = "0.1.1" +pretty_env_logger = "0.2.0" [dependencies.smith-aorta] path = "aorta" version = "0.1.0" -[dependencies.smith-trove] -path = "trove" -version = "0.1.0" - [dependencies.smith-common] path = "common" version = "0.1.0" @@ -31,4 +28,8 @@ version = "0.1.0" path = "server" version = "0.1.0" +[dependencies.smith-trove] +path = "trove" +version = "0.1.0" + [workspace] diff --git a/aorta/Cargo.toml b/aorta/Cargo.toml index 94c1987dda8..f4c2637321f 100644 --- a/aorta/Cargo.toml +++ b/aorta/Cargo.toml @@ -12,12 +12,16 @@ version = "0.1.0" base64 = "0.9.0" failure = "0.1.1" failure_derive = "0.1.1" +futures = "0.1.17" +hyper = "0.11.18" +hyper-tls = "0.1.2" parking_lot = "0.5.3" rand = "0.4.2" serde = "1.0.27" serde_derive = "1.0.27" serde_json = "1.0.9" sodiumoxide = "0.0.16" +tokio-core = "0.1.12" url = "1.6.0" [dependencies.chrono] diff --git a/aorta/src/auth.rs b/aorta/src/auth.rs index abcc6de874e..f535113907a 100644 --- a/aorta/src/auth.rs +++ b/aorta/src/auth.rs @@ -82,6 +82,7 @@ pub struct PublicKey { /// Secret keys are based on ed25519 but this should be considered an /// implementation detail for now. We only ever represent public keys /// on the wire as opaque ascii encoded strings of arbitrary format or length. +#[derive(Clone)] pub struct SecretKey { inner: sign_backend::SecretKey, } diff --git a/aorta/src/config.rs b/aorta/src/config.rs index 72f27fc9607..feafee80720 100644 --- a/aorta/src/config.rs +++ b/aorta/src/config.rs @@ -1,8 +1,12 @@ use chrono::Duration; +use hyper::{Method, Request, Uri}; +use hyper::header::{ContentLength, ContentType}; +use serde::Serialize; +use serde_json; +use auth::{AgentId, PublicKey, SecretKey}; use upstream::UpstreamDescriptor; - /// Holds common config values that affect the aorta behavior. /// /// This config is typically created by something and then passed down @@ -14,6 +18,12 @@ pub struct AortaConfig { pub snapshot_expiry: Duration, /// The upstream descriptor for this aorta pub upstream: UpstreamDescriptor<'static>, + /// The agent ID. + pub agent_id: Option, + /// The private key for authentication. + pub secret_key: Option, + /// The public key for authentication. + pub public_key: Option, } impl Default for AortaConfig { @@ -21,6 +31,57 @@ impl Default for AortaConfig { AortaConfig { snapshot_expiry: Duration::seconds(60), upstream: Default::default(), + agent_id: None, + secret_key: None, + public_key: None, + } + } +} + +impl AortaConfig { + /// Returns the agent id or panics. + pub fn agent_id(&self) -> &AgentId { + self.agent_id + .as_ref() + .expect("agent id must be set on aorta config") + } + + /// Returns the public key or panics. + pub fn public_key(&self) -> &PublicKey { + self.public_key + .as_ref() + .expect("public key must be set on aorta config") + } + + /// Returns the secret key or panics. + pub fn secret_key(&self) -> &SecretKey { + self.secret_key + .as_ref() + .expect("secret key must be set on aorta config") + } + + /// Returns the URL to hit for an api request on the upstream. + pub fn get_api_uri(&self, path: &str) -> Uri { + format!( + "{}api/0/{}", + self.upstream, + path.trim_left_matches(&['/'][..]) + ).parse() + .unwrap() + } + + /// Prepares a JSON bodied API request to aorta with signature. + pub fn prepare_aorta_req(&self, method: Method, path: &str, body: &S) -> Request { + let mut req = Request::new(method, self.get_api_uri(path)); + let json = serde_json::to_vec(body).unwrap(); + let signature = self.secret_key().sign(&json); + { + let headers = req.headers_mut(); + headers.set_raw("X-Sentry-Agent-Signature", signature); + headers.set(ContentType::json()); + headers.set(ContentLength(json.len() as u64)); } + req.set_body(json); + req } } diff --git a/aorta/src/lib.rs b/aorta/src/lib.rs index f76c3b1b617..9a3d2d4da6d 100644 --- a/aorta/src/lib.rs +++ b/aorta/src/lib.rs @@ -4,6 +4,8 @@ extern crate chrono; extern crate failure; #[macro_use] extern crate failure_derive; +extern crate futures; +extern crate hyper; extern crate parking_lot; extern crate rand; extern crate serde; @@ -13,6 +15,7 @@ extern crate serde_json; #[macro_use] extern crate smith_common; extern crate sodiumoxide; +extern crate tokio_core; extern crate url; extern crate uuid; diff --git a/cabi/.gitignore b/cabi/.gitignore new file mode 100644 index 00000000000..fa8d85ac52f --- /dev/null +++ b/cabi/.gitignore @@ -0,0 +1,2 @@ +Cargo.lock +target diff --git a/cabi/Cargo.toml b/cabi/Cargo.toml new file mode 100644 index 00000000000..ec87414870f --- /dev/null +++ b/cabi/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "smith-cabi" +version = "0.1.0" +license = "MIT" +authors = ["Sentry "] +homepage = "https://github.com/getsentry/sentry-agent" +repository = "https://github.com/getsentry/sentry-agent" +description = "Exposes some internals of the agent to C." + +[lib] +name = "smith" +crate-type = ["cdylib"] + +[workspace] + +[profile.release] +debug = true +lto = true + +[dependencies] +smith-aorta = { version = "0.1.0", path = "../aorta" } +failure = "0.1.1" diff --git a/cabi/src/core.rs b/cabi/src/core.rs new file mode 100644 index 00000000000..d5f4886e565 --- /dev/null +++ b/cabi/src/core.rs @@ -0,0 +1,159 @@ +use std::mem; +use std::ptr; +use std::str; +use std::slice; +use std::ffi::CStr; +use std::os::raw::c_char; + +use utils::{set_panic_hook, LAST_ERROR}; + +/// Represents a string. +#[repr(C)] +pub struct SmithStr { + pub data: *mut c_char, + pub len: usize, + pub owned: bool, +} + +impl Default for SmithStr { + fn default() -> SmithStr { + SmithStr { + data: ptr::null_mut(), + len: 0, + owned: false, + } + } +} + +impl SmithStr { + pub fn new(s: &str) -> SmithStr { + SmithStr { + data: s.as_ptr() as *mut c_char, + len: s.len(), + owned: false, + } + } + + pub fn from_string(mut s: String) -> SmithStr { + s.shrink_to_fit(); + let rv = SmithStr { + data: s.as_ptr() as *mut c_char, + len: s.len(), + owned: true, + }; + mem::forget(s); + rv + } + + pub unsafe fn free(&mut self) { + if self.owned { + String::from_raw_parts(self.data as *mut _, self.len, self.len); + self.data = ptr::null_mut(); + self.len = 0; + self.owned = false; + } + } + + pub fn as_str(&self) -> &str { + unsafe { + str::from_utf8_unchecked(slice::from_raw_parts( + self.data as *const _, self.len)) + } + } +} + +/// Initializes the library +#[no_mangle] +pub unsafe extern "C" fn smith_init() { + set_panic_hook(); +} + +/// Returns the last error code. +/// +/// If there is no error, 0 is returned. +#[no_mangle] +pub unsafe extern "C" fn smith_err_failed() -> bool { + LAST_ERROR.with(|e| { + if let Some(..) = *e.borrow() { + true + } else { + false + } + }) +} + +/// Returns the last error message. +/// +/// If there is no error an empty string is returned. This allocates new memory +/// that needs to be freed with `smith_str_free`. +#[no_mangle] +pub unsafe extern "C" fn smith_err_get_last_message() -> SmithStr { + use std::fmt::Write; + use std::error::Error; + LAST_ERROR.with(|e| { + if let Some(ref err) = *e.borrow() { + let mut msg = err.to_string(); + for cause in err.causes().skip(1) { + write!(&mut msg, "\n caused by: {}", cause).ok(); + } + SmithStr::from_string(msg) + } else { + Default::default() + } + }) +} + +/// Returns the panic information as string. +#[no_mangle] +pub unsafe extern "C" fn smith_err_get_backtrace() -> SmithStr { + LAST_ERROR.with(|e| { + if let Some(ref error) = *e.borrow() { + let backtrace = error.backtrace().to_string(); + if !backtrace.is_empty() { + use std::fmt::Write; + let mut out = String::new(); + write!(&mut out, "stacktrace: {}", backtrace).ok(); + SmithStr::from_string(out) + } else { + Default::default() + } + } else { + Default::default() + } + }) +} + +/// Clears the last error. +#[no_mangle] +pub unsafe extern "C" fn smith_err_clear() { + LAST_ERROR.with(|e| { + *e.borrow_mut() = None; + }); +} + +ffi_fn! { + /// Creates a smith str from a c string. + /// + /// This sets the string to owned. In case it's not owned you either have + /// to make sure you are not freeing the memory or you need to set the + /// owned flag to false. + unsafe fn smith_str_from_cstr(s: *const c_char) -> Result { + let s = CStr::from_ptr(s).to_str()?; + Ok(SmithStr { + data: s.as_ptr() as *mut _, + len: s.len(), + owned: true, + }) + } +} + +/// Frees a smith str. +/// +/// If the string is marked as not owned then this function does not +/// do anything. +#[no_mangle] +pub unsafe extern "C" fn smith_str_free(s: *mut SmithStr) { + if !s.is_null() { + (*s).free() + } +} diff --git a/cabi/src/lib.rs b/cabi/src/lib.rs new file mode 100644 index 00000000000..a2588fe1629 --- /dev/null +++ b/cabi/src/lib.rs @@ -0,0 +1,8 @@ +#[macro_use] extern crate failure; +extern crate smith_aorta; + +#[macro_use] mod utils; + +mod core; + +pub use core::*; diff --git a/cabi/src/utils.rs b/cabi/src/utils.rs new file mode 100644 index 00000000000..016f91706a5 --- /dev/null +++ b/cabi/src/utils.rs @@ -0,0 +1,90 @@ +use std::mem; +use std::panic; +use std::thread; +use std::cell::RefCell; + +use failure::Error; + +thread_local! { + pub static LAST_ERROR: RefCell> = RefCell::new(None); +} + +#[derive(Fail, Debug)] +#[fail(display="smith panicked: {}", _0)] +pub struct Panic(String); + +fn set_last_error(err: Error) { + LAST_ERROR.with(|e| { + *e.borrow_mut() = Some(err); + }); +} + +pub unsafe fn set_panic_hook() { + panic::set_hook(Box::new(|info| { + let thread = thread::current(); + let thread = thread.name().unwrap_or("unnamed"); + let message = match info.payload().downcast_ref::<&str>() { + Some(s) => *s, + None => match info.payload().downcast_ref::() { + Some(s) => &**s, + None => "Box", + }, + }; + + let description = match info.location() { + Some(location) => format!( + "thread '{}' panicked with '{}' at {}:{}", + thread, + message, + location.file(), + location.line() + ), + None => format!("thread '{}' panicked with '{}'", thread, message), + }; + + set_last_error(Panic(description).into()) + })); +} + +pub unsafe fn landingpad(f: F) -> T +where + F: FnOnce() -> Result + panic::UnwindSafe, +{ + match panic::catch_unwind(f) { + Ok(Ok(result)) => result, + Ok(Err(err)) => { + set_last_error(err); + mem::zeroed() + } + Err(_) => mem::zeroed(), + } +} + +macro_rules! ffi_fn ( + // a function that catches patnics and returns a result (err goes to tls) + ( + $(#[$attr:meta])* + unsafe fn $name:ident($($aname:ident: $aty:ty),* $(,)*) -> Result<$rv:ty> $body:block + ) => ( + #[no_mangle] + $(#[$attr])* + pub unsafe extern "C" fn $name($($aname: $aty,)*) -> $rv + { + $crate::utils::landingpad(|| $body) + } + ); + + // a function that catches patnics and returns nothing (err goes to tls) + ( + $(#[$attr:meta])* + unsafe fn $name:ident($($aname:ident: $aty:ty),* $(,)*) $body:block + ) => { + #[no_mangle] + $(#[$attr])* + pub unsafe extern "C" fn $name($($aname: $aty,)*) + { + // this silences panics and stuff + $crate::utils::landingpad(|| { $body; Ok(0 as ::std::os::raw::c_int) }); + } + } +); diff --git a/config/Cargo.toml b/config/Cargo.toml index 1369575ff10..5797575bcd4 100644 --- a/config/Cargo.toml +++ b/config/Cargo.toml @@ -9,6 +9,7 @@ repository = "https://github.com/getsentry/sentry-agent" version = "0.1.0" [dependencies] +chrono = "0.4.0" failure = "0.1.1" failure_derive = "0.1.1" serde = "1.0.27" @@ -17,6 +18,10 @@ serde_yaml = "0.7.3" url = "1.6.0" url_serde = "0.2.0" +[dependencies.log] +features = ["serde"] +version = "0.4.1" + [dependencies.smith-aorta] path = "../aorta" version = "0.1.0" diff --git a/config/src/lib.rs b/config/src/lib.rs index 1e71075e2d5..2b6f729c854 100644 --- a/config/src/lib.rs +++ b/config/src/lib.rs @@ -1,7 +1,9 @@ //! Config system for the agent. +extern crate chrono; extern crate failure; #[macro_use] extern crate failure_derive; +extern crate log; extern crate serde; #[macro_use] extern crate serde_derive; diff --git a/config/src/types.rs b/config/src/types.rs index c58e19edc20..f8ae31e9d12 100644 --- a/config/src/types.rs +++ b/config/src/types.rs @@ -3,11 +3,14 @@ use std::io::Write; use std::fs; use std::io; use std::env; +use std::sync::Arc; use std::net::{IpAddr, SocketAddr}; +use log; use serde_yaml; -use smith_aorta::{generate_agent_id, generate_key_pair, AgentId, PublicKey, SecretKey, - UpstreamDescriptor}; +use chrono::Duration; +use smith_aorta::{generate_agent_id, generate_key_pair, AgentId, AortaConfig, PublicKey, + SecretKey, UpstreamDescriptor}; /// Indicates config related errors. #[derive(Fail, Debug)] @@ -35,6 +38,20 @@ struct Agent { port: u16, } +/// Controls the logging system. +#[derive(Serialize, Deserialize, Debug)] +#[serde(default)] +struct Logging { + level: log::LevelFilter, +} + +/// Controls the aorta +#[derive(Serialize, Deserialize, Debug)] +#[serde(default)] +struct Aorta { + snapshot_expiry: u32, +} + impl Default for Agent { fn default() -> Agent { Agent { @@ -50,15 +67,30 @@ impl Default for Agent { } } +impl Default for Logging { + fn default() -> Logging { + Logging { + level: log::LevelFilter::Info, + } + } +} + +impl Default for Aorta { + fn default() -> Aorta { + Aorta { + snapshot_expiry: 60, + } + } +} + /// Config struct. -#[derive(Serialize, Deserialize, Debug)] +#[derive(Serialize, Deserialize, Debug, Default)] pub struct Config { - #[serde(skip, default)] - changed: bool, - #[serde(skip, default = "PathBuf::new")] - filename: PathBuf, - #[serde(default)] - agent: Agent, + #[serde(skip, default)] changed: bool, + #[serde(skip, default = "PathBuf::new")] filename: PathBuf, + #[serde(default)] agent: Agent, + #[serde(default)] aorta: Aorta, + #[serde(default)] logging: Logging, } impl Config { @@ -93,7 +125,7 @@ impl Config { Config { filename: path, changed: false, - agent: Default::default(), + ..Default::default() } }; if !config.is_configured() { @@ -163,4 +195,25 @@ impl Config { pub fn listen_addr(&self) -> SocketAddr { (self.agent.host, self.agent.port).into() } + + /// Returns the log level. + pub fn log_level_filter(&self) -> log::LevelFilter { + self.logging.level + } + + /// Returns the aorta snapshot expiry. + pub fn aorta_snapshot_expiry(&self) -> Duration { + Duration::seconds(self.aorta.snapshot_expiry as i64) + } + + /// Return a new aorta config based on this config file. + pub fn make_aorta_config(&self) -> Arc { + Arc::new(AortaConfig { + snapshot_expiry: self.aorta_snapshot_expiry(), + upstream: self.upstream_descriptor().clone().into_owned(), + agent_id: Some(self.agent_id().clone()), + secret_key: Some(self.secret_key().clone()), + public_key: Some(self.public_key().clone()), + }) + } } diff --git a/server/Cargo.toml b/server/Cargo.toml index 6d182d65719..393bc945a20 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -13,7 +13,16 @@ clap = "2.29.2" failure = "0.1.1" failure_derive = "0.1.1" hyper = "0.11.14" +log = "0.4.1" + +[dependencies.smith-aorta] +path = "../aorta" +version = "0.1.0" [dependencies.smith-config] path = "../config" -version = "0.1.0" \ No newline at end of file +version = "0.1.0" + +[dependencies.smith-trove] +path = "../trove" +version = "0.1.0" diff --git a/server/src/errors.rs b/server/src/errors.rs index 691b7554302..c7fee9edffd 100644 --- a/server/src/errors.rs +++ b/server/src/errors.rs @@ -16,6 +16,14 @@ pub enum ErrorKind { /// Listening on the HTTP socket failed. #[fail(display = "listening failed")] ListenFailed, + + /// Spawning the trove governor failed. + #[fail(display = "aorta trove governor spawn failed")] + TroveGovernSpawnFailed, + + /// Abdicating the trove governor failed. + #[fail(display = "aorta trove governor shutdown failed")] + TroveGovernShutdownFailed, } impl Fail for Error { diff --git a/server/src/lib.rs b/server/src/lib.rs index 46206e429a8..57b33d64e16 100644 --- a/server/src/lib.rs +++ b/server/src/lib.rs @@ -3,7 +3,11 @@ extern crate failure; #[macro_use] extern crate failure_derive; extern crate hyper; +#[macro_use] +extern crate log; +extern crate smith_aorta; extern crate smith_config; +extern crate smith_trove; mod service; mod errors; diff --git a/server/src/service.rs b/server/src/service.rs index d2ec88d4aa9..037ee726bc9 100644 --- a/server/src/service.rs +++ b/server/src/service.rs @@ -6,24 +6,39 @@ use errors::{Error, ErrorKind}; use failure::ResultExt; use smith_config::Config; +use smith_trove::Trove; static TEXT: &'static str = "Doing absolutely nothing so far!"; +fn dump_spawn_infos(config: &Config) { + info!( + "launching agent with config {}", + config.filename().display() + ); + info!(" agent id: {}", config.agent_id()); + info!(" public key: {}", config.public_key()); + info!(" listening on http://{}/", config.listen_addr()); +} + pub fn run(config: &Config) -> Result<(), Error> { - println!("spawning with config: {}", config.filename().display()); - println!(" agent id: {}", config.agent_id()); - println!(" public key: {}", config.public_key()); - println!(" listening on {}", config.listen_addr()); + dump_spawn_infos(config); + + let trove = Trove::new(config.make_aorta_config()); + trove.govern().context(ErrorKind::TroveGovernSpawnFailed)?; - let hello = const_service(service_fn(|_req| { + let hello = const_service(service_fn(move |_req| { Ok(Response::::new() .with_header(ContentLength(TEXT.len() as u64)) .with_header(ContentType::plaintext()) - .with_body("")) + .with_body(TEXT)) })); let server = Http::new() .bind(&config.listen_addr(), hello) .context(ErrorKind::BindFailed)?; - Ok(server.run().context(ErrorKind::ListenFailed)?) + + server.run().context(ErrorKind::ListenFailed)?; + trove.abdicate().context(ErrorKind::TroveGovernSpawnFailed)?; + + Ok(()) } diff --git a/src/main.rs b/src/main.rs index 01a0c7a30c5..7272875e303 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,5 +1,6 @@ extern crate clap; extern crate failure; +extern crate pretty_env_logger; extern crate smith_config; extern crate smith_server; @@ -12,6 +13,13 @@ use smith_config::Config; pub const VERSION: &'static str = env!("CARGO_PKG_VERSION"); pub const ABOUT: &'static str = "Runs a sentry-agent (fancy proxy server)"; +fn init_logging(config: &Config) { + if env::var("RUST_LOG").is_err() { + env::set_var("RUST_LOG", config.log_level_filter().to_string()); + } + pretty_env_logger::init(); +} + pub fn execute() -> Result<(), Error> { let app = App::new("sentry-agent") .setting(AppSettings::UnifiedHelpMessage) @@ -31,6 +39,7 @@ pub fn execute() -> Result<(), Error> { let matches = app.get_matches(); let mut config = Config::open(matches.value_of("config").unwrap())?; + init_logging(&config); // upon loading the config can be initialized. In that case it will be // modified and we want to write it back automatically for now. diff --git a/trove/Cargo.toml b/trove/Cargo.toml index 5be28bf6e49..6dccbde0f75 100644 --- a/trove/Cargo.toml +++ b/trove/Cargo.toml @@ -11,7 +11,13 @@ version = "0.1.0" [dependencies] failure = "0.1.1" failure_derive = "0.1.1" +futures = "0.1.18" +log = "0.4.1" parking_lot = "0.5.3" +tokio-core = "0.1.12" +hyper = "0.11.18" +hyper-tls = "0.1.2" +native-tls = "0.1.5" [dependencies.smith-aorta] path = "../aorta" diff --git a/trove/src/auth.rs b/trove/src/auth.rs new file mode 100644 index 00000000000..2438fc26f36 --- /dev/null +++ b/trove/src/auth.rs @@ -0,0 +1,47 @@ +use std::io::{self, Write}; +use std::sync::Arc; + +use futures::{Future, Stream}; +use hyper::Method; + +use types::TroveContext; + +use smith_aorta::RegisterRequest; + +/// Represents the current auth state of the trove. +#[derive(Debug)] +pub enum AuthState { + Unknown, + Unregistered, + Registering, + Unauthenticated, + Authenticated, +} + +#[derive(Fail, Debug)] +#[fail(display = "could not authenticate")] +pub struct AuthError; + +pub(crate) fn spawn_authenticator(ctx: &TroveContext) { + debug!("Starting authenticator"); + check_agent_state(ctx); +} + +fn check_agent_state(ctx: &TroveContext) { + let mut state = AuthState::Unknown; + + let config = &ctx.state().config; + let reg_req = RegisterRequest::new(config.agent_id(), config.public_key()); + let req = config.prepare_aorta_req(Method::Post, "agents/", ®_req); + let work = ctx.http_client().request(req).and_then(|res| { + println!("Response: {}", res.status()); + + res.body().for_each(|chunk| { + io::stdout() + .write_all(&chunk) + .map(|_| ()) + .map_err(From::from) + }) + }); + ctx.handle().spawn(work.map_err(|_| ())); +} diff --git a/trove/src/lib.rs b/trove/src/lib.rs index b4ac404a843..6e102386ac1 100644 --- a/trove/src/lib.rs +++ b/trove/src/lib.rs @@ -5,10 +5,18 @@ extern crate failure; #[macro_use] extern crate failure_derive; +extern crate futures; +extern crate hyper; +extern crate hyper_tls; +#[macro_use] +extern crate log; +extern crate native_tls; extern crate parking_lot; extern crate smith_aorta; extern crate smith_common; +extern crate tokio_core; +mod auth; mod types; pub use types::*; diff --git a/trove/src/types.rs b/trove/src/types.rs index e24c8c7d4bd..e057ff30109 100644 --- a/trove/src/types.rs +++ b/trove/src/types.rs @@ -1,13 +1,26 @@ use std::io; use std::thread; use std::sync::Arc; -use std::sync::atomic::{AtomicBool, Ordering}; use std::collections::HashMap; use parking_lot::{Mutex, RwLock}; +use tokio_core::reactor::{Core, Handle, Remote}; +use futures::Stream; +use futures::sync::{mpsc, oneshot}; +use hyper::client::{Client, HttpConnector}; +use hyper_tls::HttpsConnector; use smith_common::ProjectId; -use smith_aorta::{ProjectState, AortaConfig}; +use smith_aorta::{AortaConfig, ProjectState}; + +use auth::{spawn_authenticator, AuthError, AuthState}; + +/// Represents an event that can be sent to the governor. +#[derive(Debug)] +pub(crate) enum GovernorEvent { + /// Tells the trove governor to shut down. + Shutdown, +} /// Raised for errors that happen in the context of trove governing. #[derive(Debug, Fail)] @@ -15,15 +28,51 @@ pub enum GovernorError { /// Raised if the governor could not be spawned. #[fail(display = "could not spawn governor thread")] SpawnError(#[cause] io::Error), + /// Raised if the event loop failed to spawn. + #[fail(display = "cannot spawn event loop")] + CannotSpawnEventLoop(#[cause] io::Error), + /// Raised if the authentication handler could not spawn. + #[fail(display = "governor could not start authentication")] + CannotSpawnAuthenticator(#[cause] AuthError), /// Raised if the governor panicked. #[fail(display = "governor thread panicked")] Panic, } -struct TroveInner { - states: RwLock>>, - config: Arc, - is_governed: AtomicBool, +/// An internal helper struct that represents the shared state of the +/// trove. An `Arc` of the state is passed around various systems. +#[derive(Debug)] +pub(crate) struct TroveState { + pub states: RwLock>>, + pub config: Arc, + pub governor_tx: RwLock>>, + pub remote: RwLock>, + pub auth_state: RwLock, +} + +/// Convenience context that never crosses threads. +#[derive(Debug)] +pub(crate) struct TroveContext { + handle: Handle, + state: Arc, + client: Client>, +} + +impl TroveContext { + /// Returns the handle of the core loop. + pub fn handle(&self) -> Handle { + self.handle.clone() + } + + /// Returns the state of the trove. + pub fn state(&self) -> Arc { + self.state.clone() + } + + /// Returns a reference to the http client. + pub fn http_client(&self) -> &Client> { + &self.client + } } /// The trove holds project states and manages the upstream aorta. @@ -32,7 +81,7 @@ struct TroveInner { /// synchronized. It also typically has a governing thread running which /// automatically manages the state for the individual projects. pub struct Trove { - inner: Arc, + state: Arc, join_handle: Mutex>>>, } @@ -43,10 +92,12 @@ impl Trove { /// shared around. pub fn new(config: Arc) -> Trove { Trove { - inner: Arc::new(TroveInner { + state: Arc::new(TroveState { states: RwLock::new(HashMap::new()), config: config, - is_governed: AtomicBool::new(false), + governor_tx: RwLock::new(None), + remote: RwLock::new(None), + auth_state: RwLock::new(AuthState::Unknown), }), join_handle: Mutex::new(None), } @@ -64,7 +115,7 @@ impl Trove { pub fn state_for_project(&self, project_id: ProjectId) -> Arc { // state already exists, return it. { - let states = self.inner.states.read(); + let states = self.state.states.read(); if let Some(ref rv) = states.get(&project_id) { return (*rv).clone(); } @@ -72,18 +123,18 @@ impl Trove { // insert an empty state { - let state = ProjectState::new(project_id, self.inner.config.clone()); - self.inner + let state = ProjectState::new(project_id, self.state.config.clone()); + self.state .states .write() .insert(project_id, Arc::new(state)); } - (*self.inner.states.read().get(&project_id).unwrap()).clone() + (*self.state.states.read().get(&project_id).unwrap()).clone() } /// Returns `true` if the trove is governed. pub fn is_governed(&self) -> bool { - self.inner.is_governed.load(Ordering::Relaxed) + self.state.remote.read().is_some() } /// Spawns a trove governor thread. @@ -96,12 +147,16 @@ impl Trove { panic!("trove is already governed"); } - let inner = self.inner.clone(); - inner.is_governed.store(true, Ordering::Relaxed); + let state = self.state.clone(); + debug!("spawning trove governor"); *self.join_handle.lock() = Some(thread::Builder::new() .name("trove-governor".into()) - .spawn(move || inner.run()) + .spawn(move || { + let (tx, rx) = mpsc::unbounded::(); + *state.governor_tx.write() = Some(tx); + run_governor(state, rx) + }) .map_err(GovernorError::SpawnError)?); Ok(()) @@ -115,7 +170,11 @@ impl Trove { /// and kill the thread. This however might not be executed as there is no /// guarantee that dtors are invoked in all cases. pub fn abdicate(&self) -> Result<(), GovernorError> { - self.inner.is_governed.store(false, Ordering::Relaxed); + // indicate on the trove state that we're no longer governed and then + // attempt to send a message into the event channel if we can safely + // do so. + self.emit_event(GovernorEvent::Shutdown); + if let Some(handle) = self.join_handle.lock().take() { match handle.join() { Err(_) => Err(GovernorError::Panic), @@ -125,6 +184,21 @@ impl Trove { Ok(()) } } + + /// Returns the remote of the underlying governor. + /// + /// In case the governor is not running this will panic. + pub fn remote(&self) -> Remote { + self.state.remote() + } + + fn emit_event(&self, event: GovernorEvent) -> bool { + if let Some(ref tx) = *self.state.governor_tx.read() { + tx.unbounded_send(event).is_ok() + } else { + false + } + } } impl Drop for Trove { @@ -133,12 +207,61 @@ impl Drop for Trove { } } -impl TroveInner { - fn run(&self) -> Result<(), GovernorError> { - Ok(()) +impl TroveState { + /// Returns the remote for the underlying state. + pub fn remote(&self) -> Remote { + self.remote + .read() + .as_ref() + .expect("trove is not goverened, remote unavailable") + .clone() } } +fn run_governor( + state: Arc, + rx: mpsc::UnboundedReceiver, +) -> Result<(), GovernorError> { + let mut core = Core::new().map_err(GovernorError::CannotSpawnEventLoop)?; + let (shutdown_tx, shutdown_rx) = oneshot::channel(); + let mut shutdown_tx = Some(shutdown_tx); + + // Make the remote available outside. + *state.remote.write() = Some(core.remote()); + debug!("spawned trove governor"); + + let ctx = TroveContext { + handle: core.handle(), + state: state.clone(), + client: Client::configure() + .connector(HttpsConnector::new(4, &core.handle()).unwrap()) + .build(&core.handle()), + }; + + // spawn a stream that just listens in on the events sent into the + // trove governor so we can figure out when to terminate the thread + // or do similar things. + core.handle().spawn(rx.for_each(move |event| { + match event { + GovernorEvent::Shutdown => { + if let Some(shutdown_tx) = shutdown_tx.take() { + shutdown_tx.send(()).ok(); + } + } + } + Ok(()) + })); + + // spawn the authentication handler + spawn_authenticator(&ctx); + + core.run(shutdown_rx).ok(); + *state.remote.write() = None; + debug!("shut down trove governor"); + + Ok(()) +} + #[cfg(test)] mod test { use super::*;