From 586e101dcd05fd424596df61b9e2e7206d6af535 Mon Sep 17 00:00:00 2001 From: Pietro Albini Date: Sun, 31 Mar 2019 18:29:16 +0200 Subject: [PATCH] Integrate with the team repo (#267) * initialize dotenv during tests to pick up env vars * disable scraping if the envvar is omitted * put the team configuration behind a rwlock * switch from raw hyper to reqwest * allow loading teams from an URL updated every 5 minutes * import users into the database when missing * fix wrong github access token on ci --- .travis.yml | 2 +- CONTRIBUTING.md | 2 +- Cargo.lock | 579 ++++++++++++++++++++++++++++++++++++++++++- Cargo.toml | 3 +- rfcbot.toml | 164 +----------- src/config.rs | 10 +- src/error.rs | 7 +- src/github/client.rs | 141 ++++------- src/github/mod.rs | 1 + src/github/nag.rs | 30 ++- src/main.rs | 14 +- src/scraper.rs | 24 +- src/teams.rs | 85 +++++-- src/utils.rs | 32 +++ 14 files changed, 765 insertions(+), 329 deletions(-) create mode 100644 src/utils.rs diff --git a/.travis.yml b/.travis.yml index dab27d46..65b067f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ addons: install: - export RUST_LOG=debug,hyper=info,rustc=error,cargo=error,jobserver=error - export GITHUB_WEBHOOK_SECRETS=none -- export GITHUB_ACCESS_TOKEN=none +- export GITHUB_ACCESS_TOKEN= - export GITHUB_SCRAPE_INTERVAL=6000 - export GITHUB_USER_AGENT=none-agent-with-left-beef - export POST_COMMENTS=false diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 6776ee10..9071e174 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -76,7 +76,7 @@ Note that you can configure the Rocket web server using environment variables li * `GITHUB_USER_AGENT`: the UA string to send to GitHub (they request that you send your GitHub username or the app name you registered for the client ID) * `GITHUB_WEBHOOK_SECRETS`: a comma-delimited string of the secrets used for any ingestion webhooks. The webhook handler will attempt to validate any POST'd webhook against each secret until it either finds a matching one or runs out. * `RUST_LOG`: the logging configuration for [env_logger](https://crates.io/crates/env_logger). If you're unfamiliar, you can read about it in the documentation linked on crates.io. If it's not defined, logging will default to `info!()` and above. -* `GITHUB_SCRAPE_INTERVAL`: time (in minutes) to wait in between GitHub scrapes +* `GITHUB_SCRAPE_INTERVAL`: time (in minutes) to wait in between GitHub scrapes (scraping is disabled if this environment variable is omitted) * `POST_COMMENTS`: whether to post RFC bot comments on issues -- either `true` or `false`. Be very careful setting to true when testing -- it will post comments using whatever account is associated with the GitHub API key you provide. ## Database diff --git a/Cargo.lock b/Cargo.lock index 3eb9458b..e6cfd0b4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8,6 +8,11 @@ dependencies = [ "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "adler32" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "aho-corasick" version = "0.6.10" @@ -26,6 +31,14 @@ name = "arrayref" version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "arrayvec" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "autocfg" version = "0.1.2" @@ -101,6 +114,11 @@ dependencies = [ "serde_json 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "build_const" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "byte-tools" version = "0.2.0" @@ -111,6 +129,15 @@ name = "byteorder" version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "bytes" +version = "0.4.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "cc" version = "1.0.29" @@ -176,6 +203,61 @@ dependencies = [ "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "crc" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crc32fast" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-deque" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-epoch 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-queue" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "crossbeam-utils" +version = "0.6.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "devise" version = "0.2.0" @@ -251,11 +333,24 @@ name = "dtoa" version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "dtoa" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "either" version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "encoding_rs" +version = "0.8.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "env_logger" version = "0.4.3" @@ -309,6 +404,21 @@ dependencies = [ "redox_syscall 0.1.51 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "flate2" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz_oxide_c_api 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "fnv" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "foreign-types" version = "0.3.2" @@ -359,6 +469,20 @@ name = "fuchsia-zircon-sys" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "futures" +version = "0.1.25" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-cpupool" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "gcc" version = "0.3.55" @@ -377,6 +501,23 @@ name = "glob" version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "h2" +version = "0.1.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "handlebars" version = "1.1.0" @@ -398,6 +539,16 @@ name = "hex" version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "http" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "httparse" version = "1.3.3" @@ -422,13 +573,42 @@ dependencies = [ ] [[package]] -name = "hyper-native-tls" -version = "0.3.0" +name = "hyper" +version = "0.12.25" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "hyper-tls" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.25 (registry+https://github.com/rust-lang/crates.io-index)", "native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -553,6 +733,15 @@ name = "libc" version = "0.2.48" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "lock_api" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "log" version = "0.3.9" @@ -584,6 +773,11 @@ name = "memchr" version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "memoffset" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "mime" version = "0.2.6" @@ -592,6 +786,44 @@ dependencies = [ "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mime" +version = "0.3.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "unicase 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mime_guess" +version = "2.0.0-alpha.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miniz_oxide" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "miniz_oxide_c_api" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)", + "crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", + "miniz_oxide 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "mio" version = "0.6.16" @@ -664,6 +896,11 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "nodrop" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "notify" version = "4.0.9" @@ -740,6 +977,35 @@ dependencies = [ "vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "owning_ref" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "parking_lot_core" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "pear" version = "0.1.2" @@ -813,6 +1079,41 @@ dependencies = [ "sha-1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "phf" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_codegen" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_generator" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "phf_shared" +version = "0.7.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "pkg-config" version = "0.3.14" @@ -1043,6 +1344,35 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "reqwest" +version = "0.9.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "encoding_rs 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)", + "flate2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.12.25 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", + "mime_guess 2.0.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)", + "native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)", + "serde_urlencoded 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", + "uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "rfcbot-rs" version = "0.1.0" @@ -1052,12 +1382,11 @@ dependencies = [ "dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper-native-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", "maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "reqwest 0.9.12 (registry+https://github.com/rust-lang/crates.io-index)", "rocket 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rocket_contrib 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", "rust-crypto 0.2.36 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1208,6 +1537,11 @@ dependencies = [ "antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "scopeguard" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "security-framework" version = "0.2.2" @@ -1283,6 +1617,17 @@ dependencies = [ "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "serde_urlencoded" +version = "0.5.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "itoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)", + "serde 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)", + "url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "sha-1" version = "0.7.0" @@ -1294,6 +1639,11 @@ dependencies = [ "fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "siphasher" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "slab" version = "0.4.2" @@ -1304,11 +1654,21 @@ name = "smallvec" version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "stable_deref_trait" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "state" version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "string" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "syn" version = "0.15.26" @@ -1361,6 +1721,127 @@ dependencies = [ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "tokio" +version = "0.1.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-threadpool 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-timer 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-trace-core 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-current-thread" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-executor" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-io" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-reactor" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-sync 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-sync" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-tcp" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-threadpool" +version = "0.1.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "num_cpus 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)", + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-timer" +version = "0.2.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "tokio-trace-core" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "toml" version = "0.4.10" @@ -1374,6 +1855,11 @@ name = "traitobject" version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "try-lock" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "typeable" version = "0.1.2" @@ -1410,6 +1896,14 @@ dependencies = [ "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "unicase" +version = "2.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "unicode-bidi" version = "0.3.4" @@ -1470,6 +1964,14 @@ name = "utf8-ranges" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "uuid" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "rand 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "vcpkg" version = "0.2.6" @@ -1490,6 +1992,16 @@ dependencies = [ "winapi-util 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "want" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures 0.1.25 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", + "try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "winapi" version = "0.2.8" @@ -1548,9 +2060,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [metadata] "checksum MacTypes-sys 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "eaf9f0d0b1cc33a4d2aee14fb4b2eac03462ef4db29c8ac4057327d8a71ad86f" +"checksum adler32 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "7e522997b529f05601e05166c07ed17789691f562762c7f3b987263d2dedee5c" "checksum aho-corasick 0.6.10 (registry+https://github.com/rust-lang/crates.io-index)" = "81ce3d38065e618af2d7b77e10c5ad9a069859b4be3c2250f674af3840d9c8a5" "checksum antidote 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "34fde25430d87a9388dadbe6e34d7f72a462c8b43ac8d309b42b0a8505d7e2a5" "checksum arrayref 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "0d382e583f07208808f6b1249e60848879ba3543f57c32277bf52d69c2f0f0ee" +"checksum arrayvec 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "92c7fb76bc8826a8b33b4ee5bb07a247a81e76764ab4d55e8f73e3a4d8808c71" "checksum autocfg 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a6d640bee2da49f60a4068a7fae53acde8982514ab7bae8b8cea9e88cbcfd799" "checksum backtrace 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "cd5a90e2b463010cd0e0ce9a11d4a9d5d58d9f41d4a6ba3dcaf9e68b466e88b4" "checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6" @@ -1560,8 +2074,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" "checksum block-buffer 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a076c298b9ecdb530ed9d967e74a6027d6a7478924520acddcddc24c1c8ab3ab" "checksum bodyparser 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6928e817538b74a73d1dd6e9a942a2a35c632a597b6bb14fd009480f859a6bf5" +"checksum build_const 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "39092a32794787acd8525ee150305ff051b0aa6cc2abaf193924f5ab05425f39" "checksum byte-tools 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "560c32574a12a89ecd91f5e742165893f86e3ab98d21f8ea548658eb9eef5f40" "checksum byteorder 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a019b10a2a7cdeb292db131fc8113e57ea2a908f6e7894b0c3c671893b65dbeb" +"checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" "checksum cc 1.0.29 (registry+https://github.com/rust-lang/crates.io-index)" = "4390a3b5f4f6bce9c1d0c00128379df433e53777fdd30e92f16a529332baec4e" "checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" "checksum chrono 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "45912881121cb26fad7c38c17ba7daa18764771836b34fab7d3fbd93ed633878" @@ -1570,6 +2086,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum cookie 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1465f8134efa296b4c19db34d909637cb2bf0f7aaf21299e23e18fa29ac557cf" "checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980" "checksum core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa" +"checksum crc 1.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d663548de7f5cca343f1e0a48d14dcfb0e9eb4e079ec58883b7251539fa10aeb" +"checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" +"checksum crossbeam-deque 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b18cd2e169ad86297e6bc0ad9aa679aee9daa4f19e8163860faf7c164e4f5a71" +"checksum crossbeam-epoch 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "04c9e3102cc2d69cd681412141b390abd55a362afc1540965dad0ad4d34280b4" +"checksum crossbeam-queue 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7c979cd6cfe72335896575c6b5688da489e420d36a27a0b9eb0c73db574b4a4b" +"checksum crossbeam-utils 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f8306fcef4a7b563b76b7dd949ca48f52bc1141aa067d2ea09565f3e2652aa5c" "checksum devise 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "74e04ba2d03c5fa0d954c061fc8c9c288badadffc272ebb87679a89846de3ed3" "checksum devise_codegen 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "066ceb7928ca93a9bedc6d0e612a8a0424048b0ab1f75971b203d01420c055d7" "checksum devise_core 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "cf41c59b22b5e3ec0ea55c7847e5f358d340f3a8d6d53a5cf4f1564967f96487" @@ -1578,13 +2100,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum digest 0.7.6 (registry+https://github.com/rust-lang/crates.io-index)" = "03b072242a8cbaf9c145665af9d250c59af3b958f83ed6824e13533cf76d5b90" "checksum dotenv 0.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c0d0a1279c96732bc6800ce6337b6a614697b0e74ae058dc03c62ebeb78b4d86" "checksum dtoa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "0dd841b58510c9618291ffa448da2e4e0f699d984d436122372f446dae62263d" +"checksum dtoa 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6d301140eb411af13d3115f9a562c85cc6b541ade9dfa314132244aaee7489dd" "checksum either 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c67353c641dc847124ea1902d69bd753dee9bb3beff9aa3662ecf86c971d1fac" +"checksum encoding_rs 0.8.17 (registry+https://github.com/rust-lang/crates.io-index)" = "4155785c79f2f6701f185eb2e6b4caf0555ec03477cb4c70db67b465311620ed" "checksum env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3ddf21e73e016298f5cb37d6ef8e8da8e39f91f9ec8b0df44b7deb16a9f8cd5b" "checksum error 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "a6e606f14042bb87cc02ef6a14db6c90ab92ed6f62d87e69377bc759fd7987cc" "checksum failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "795bd83d3abeb9220f257e597aa0080a508b27533824adf336529648f6abf7e2" "checksum failure_derive 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ea1063915fd7ef4309e222a5a07cf9c319fb9c7836b1f89b85458672dbb127e1" "checksum fake-simd 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e88a8acf291dafb59c2d96e8f59828f3838bb1a70398823ade51a84de6a6deed" "checksum filetime 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)" = "a2df5c1a8c4be27e7707789dc42ae65976e60b394afd293d1419ab915833e646" +"checksum flate2 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "f87e68aa82b2de08a6e037f1385455759df6e445a8df5e005b4297191dbf18aa" +"checksum fnv 1.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" "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 fsevent 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "c4bbbf71584aeed076100b5665ac14e3d85eeb31fdbb45fbd41ef9a682b5ec05" @@ -1592,14 +2118,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum fuchsia-cprng 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" "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.25 (registry+https://github.com/rust-lang/crates.io-index)" = "49e7653e374fe0d0c12de4250f0bdb60680b8c80eed558c5c7538eec9c89e21b" +"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" "checksum gcc 0.3.55 (registry+https://github.com/rust-lang/crates.io-index)" = "8f5f3913fa0bfe7ee1fd8248b6b9f42a5af4b9d65ec2dd2c3c26132b950ecfc2" "checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d" "checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb" +"checksum h2 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "910a5e7be6283a9c91b3982fa5188368c8719cce2a3cf3b86048673bf9d9c36b" "checksum handlebars 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d82e5750d8027a97b9640e3fefa66bbaf852a35228e1c90790efd13c4b09c166" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" +"checksum http 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "fe67e3678f2827030e89cc4b9e7ecd16d52f132c0b940ab5005f88e821500f6a" "checksum httparse 1.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "e8734b0cfd3bc3e101ec59100e101c2eecd19282202e87808b3037b442777a83" "checksum hyper 0.10.15 (registry+https://github.com/rust-lang/crates.io-index)" = "df0caae6b71d266b91b4a83111a61d2b94ed2e2bea024c532b933dcff867e58c" -"checksum hyper-native-tls 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6d375598f442742b0e66208ee12501391f1c7ac0bafb90b4fe53018f81f06068" +"checksum hyper 0.12.25 (registry+https://github.com/rust-lang/crates.io-index)" = "7d5b6658b016965ae301fa995306db965c93677880ea70765a84235a96eae896" +"checksum hyper-tls 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "3a800d6aa50af4b5850b2b0f659625ce9504df908e9733b635720483be26174f" "checksum idna 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "38f09e0f0b1fb55fdee1f17470ad800da77af5186a1a76c026b679358b7e844e" "checksum indexmap 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7e81a7c05f79578dbc15793d8b619db9ba32b4577003ef3af1a91c416798c58d" "checksum inotify 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "40b54539f3910d6f84fbf9a643efd6e3aa6e4f001426c0329576128255994718" @@ -1616,18 +2147,25 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a374c89b9db55895453a74c1e38861d9deec0b01b405a82516e9d5de4820dea1" "checksum lazycell 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b294d6fa9ee409a054354afc4352b0b9ef7ca222c69b8812cbea9e7d2bf3783f" "checksum libc 0.2.48 (registry+https://github.com/rust-lang/crates.io-index)" = "e962c7641008ac010fa60a7dfdc1712449f29c44ef2d4702394aea943ee75047" +"checksum lock_api 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "62ebf1391f6acad60e5c8b43706dde4582df75c06698ab44511d15016bc2442c" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" "checksum log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c84ec4b527950aa83a329754b01dbe3f58361d1c5efacd1f6d68c494d08a17c6" "checksum maplit 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "08cbb6b4fef96b6d77bfc40ec491b1690c779e77b05cd9f07f787ed376fd4c43" "checksum matches 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" "checksum memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2efc7bc57c883d4a4d6e3246905283d8dae951bb3bd32f49d6ef297f546e1c39" +"checksum memoffset 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "0f9dc261e2b62d7a622bf416ea3c5245cdd5d9a7fcc428c0d06804dfce1775b3" "checksum mime 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" +"checksum mime 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "3e27ca21f40a310bd06d9031785f4801710d566c184a6e15bad4f1d9b65f9425" +"checksum mime_guess 2.0.0-alpha.6 (registry+https://github.com/rust-lang/crates.io-index)" = "30de2e4613efcba1ec63d8133f344076952090c122992a903359be5a4f99c3ed" +"checksum miniz_oxide 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c468f2369f07d651a5d0bb2c9079f8488a66d5466efe42d0c5c6466edcb7f71e" +"checksum miniz_oxide_c_api 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b7fe927a42e3807ef71defb191dc87d4e24479b221e67015fe38ae2b7b447bab" "checksum mio 0.6.16 (registry+https://github.com/rust-lang/crates.io-index)" = "71646331f2619b1026cc302f87a2b8b648d5c6dd6937846a16cc8ce0f347f432" "checksum mio-extras 2.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "46e73a04c2fa6250b8d802134d56d554a9ec2922bf977777c805ea5def61ce40" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" "checksum modifier 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "41f5c9112cb662acd3b204077e0de5bc66305fa8df65c8019d5adb10e9ab6e58" "checksum native-tls 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ff8e08de0070bbf4c31f452ea2a70db092f36f6f2e4d897adf5674477d488fb2" "checksum net2 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)" = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" +"checksum nodrop 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "2f9667ddcc6cc8a43afc9b7917599d7216aa09c463919ea32c59ed6cac8bc945" "checksum notify 4.0.9 (registry+https://github.com/rust-lang/crates.io-index)" = "9cc7ed2bd4b7edad3ee93b659c38e53dabb619f7274e127a0fab054ad2bb998d" "checksum num-integer 0.1.39 (registry+https://github.com/rust-lang/crates.io-index)" = "e83d528d2677f0518c570baf2b7abdcf0cd2d248860b68507bdcb3e91d4c0cea" "checksum num-traits 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "92e5113e9fd4cc14ded8e499429f396a20f98c772a47cc8622a736e1ec843c31" @@ -1636,6 +2174,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum openssl 0.10.16 (registry+https://github.com/rust-lang/crates.io-index)" = "ec7bd7ca4cce6dbdc77e7c1230682740d307d1218a87fb0349a571272be749f9" "checksum openssl-probe 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" "checksum openssl-sys 0.9.40 (registry+https://github.com/rust-lang/crates.io-index)" = "1bb974e77de925ef426b6bc82fce15fd45bdcbeb5728bffcfc7cdeeb7ce1c2d6" +"checksum owning_ref 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "49a4b8ea2179e6a2e27411d3bca09ca6dd630821cf6894c6c7c8467a8ee7ef13" +"checksum parking_lot 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)" = "ab41b4aed082705d1056416ae4468b6ea99d52599ecf3169b00088d43113e337" +"checksum parking_lot_core 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "94c8c7923936b28d546dfd14d4472eaf34c99b14e1c973a32b3e6d4eb04298c9" "checksum pear 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c26d2b92e47063ffce70d3e3b1bd097af121a9e0db07ca38a6cc1cf0cc85ff25" "checksum pear_codegen 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "336db4a192cc7f54efeb0c4e11a9245394824cc3bcbd37ba3ff51240c35d7a6e" "checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831" @@ -1644,6 +2185,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum pest_derive 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "833d1ae558dc601e9a60366421196a8d94bc0ac980476d0b67e1d0988d72b2d0" "checksum pest_generator 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "63120576c4efd69615b5537d3d052257328a4ca82876771d6944424ccfd9f646" "checksum pest_meta 2.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5a3492a4ed208ffc247adcdcc7ba2a95be3104f58877d0d02f0df39bf3efb5e" +"checksum phf 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" +"checksum phf_codegen 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" +"checksum phf_generator 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" +"checksum phf_shared 0.7.24 (registry+https://github.com/rust-lang/crates.io-index)" = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" "checksum pkg-config 0.3.14 (registry+https://github.com/rust-lang/crates.io-index)" = "676e8eb2b1b4c9043511a9b7bea0915320d7e502b0a079fb03f9635a5252b18c" "checksum plugin 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1a6a0dc3910bc8db877ffed8e457763b317cf880df4ae19109b9f77d277cf6e0" "checksum pq-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "6ac25eee5a0582f45a67e837e350d784e7003bd29a5f460796772061ca49ffda" @@ -1670,6 +2215,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum regex-syntax 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7d707a4fa2637f2dca2ef9fd02225ec7661fe01a53623c1e6515b6916511f7a7" "checksum regex-syntax 0.6.5 (registry+https://github.com/rust-lang/crates.io-index)" = "8c2f35eedad5295fdf00a63d7d4b238135723f92b434ec06774dad15c7ab0861" "checksum remove_dir_all 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3488ba1b9a2084d38645c4c08276a1752dcbf2c7130d74f1569681ad5d2799c5" +"checksum reqwest 0.9.12 (registry+https://github.com/rust-lang/crates.io-index)" = "962fa64e670e70b9d3a81c3688832eb59293ef490e0af5ad169763f62016ac5e" "checksum ring 0.13.5 (registry+https://github.com/rust-lang/crates.io-index)" = "2c4db68a2e35f3497146b7e4563df7d4773a2433230c5e4b448328e31740458a" "checksum rocket 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "242154377a85c2a9e036fc31ffc8c200b9e1f22a196e47baa3b57716606ca89d" "checksum rocket_codegen 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d907d6d458c859651c1cf4c8fa99b77685082bde0561db6a4600b365058f710" @@ -1684,6 +2230,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum same-file 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8f20c4be53a8a1ff4c1f1b2bd14570d2f634628709752f0702ecdd2b3f9a5267" "checksum schannel 0.1.14 (registry+https://github.com/rust-lang/crates.io-index)" = "0e1a231dc10abf6749cfa5d7767f25888d484201accbd919b66ab5413c502d56" "checksum scheduled-thread-pool 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1a2ff3fc5223829be817806c6441279c676e454cc7da608faf03b0ccc09d3889" +"checksum scopeguard 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "94258f53601af11e6a49f722422f6e3425c52b06245a5cf9bc09908b174f5e27" "checksum security-framework 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "bfab8dda0e7a327c696d893df9ffa19cadc4bd195797997f5223cf5831beaf05" "checksum security-framework-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3d6696852716b589dff9e886ff83778bb635150168e83afa8ac6b8a78cb82abc" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" @@ -1693,23 +2240,39 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum serde_derive 1.0.88 (registry+https://github.com/rust-lang/crates.io-index)" = "beed18e6f5175aef3ba670e57c60ef3b1b74d250d962a26604bff4c80e970dd4" "checksum serde_json 0.8.6 (registry+https://github.com/rust-lang/crates.io-index)" = "67f7d2e9edc3523a9c8ec8cd6ec481b3a27810aafee3e625d311febd3e656b4c" "checksum serde_json 1.0.38 (registry+https://github.com/rust-lang/crates.io-index)" = "27dce848e7467aa0e2fcaf0a413641499c0b745452aaca1194d24dedde9e13c9" +"checksum serde_urlencoded 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)" = "d48f9f99cd749a2de71d29da5f948de7f2764cc5a9d7f3c97e3514d4ee6eabf2" "checksum sha-1 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "51b9d1f3b5de8a167ab06834a7c883bd197f2191e1dda1a22d9ccfeedbf9aded" +"checksum siphasher 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" "checksum smallvec 0.6.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c4488ae950c49d403731982257768f48fada354a5203fe81f9bb6f43ca9002be" +"checksum stable_deref_trait 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "dba1a27d3efae4351c8051072d619e3ade2820635c3958d826bfea39d59b54c8" "checksum state 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7345c971d1ef21ffdbd103a75990a15eb03604fc8b8852ca8cb418ee1a099028" +"checksum string 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b639411d0b9c738748b5397d5ceba08e648f4f1992231aa859af1a017f31f60b" "checksum syn 0.15.26 (registry+https://github.com/rust-lang/crates.io-index)" = "f92e629aa1d9c827b2bb8297046c1ccffc57c99b947a680d3ccff1f136a3bee9" "checksum synstructure 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)" = "73687139bf99285483c96ac0add482c3776528beac1d97d444f6e91f203a2015" "checksum tempfile 3.0.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b86c784c88d98c801132806dadd3819ed29d8600836c4088e855cdf3e178ed8a" "checksum thread_local 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "c6b53e329000edc2b34dbe8545fd20e55a333362d0a321909685a19bd28c3f1b" "checksum time 0.1.42 (registry+https://github.com/rust-lang/crates.io-index)" = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" +"checksum tokio 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "65641e515a437b308ab131a82ce3042ff9795bef5d6c5a9be4eb24195c417fd9" +"checksum tokio-current-thread 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d16217cad7f1b840c5a97dfb3c43b0c871fef423a6e8d2118c604e843662a443" +"checksum tokio-executor 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "83ea44c6c0773cc034771693711c35c677b4b5a4b21b9e7071704c54de7d555e" +"checksum tokio-io 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "5090db468dad16e1a7a54c8c67280c5e4b544f3d3e018f0b913b400261f85926" +"checksum tokio-reactor 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "6af16bfac7e112bea8b0442542161bfc41cbfa4466b580bdda7d18cb88b911ce" +"checksum tokio-sync 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "fda385df506bf7546e70872767f71e81640f1f251bdf2fd8eb81a0eaec5fe022" +"checksum tokio-tcp 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "1d14b10654be682ac43efee27401d792507e30fd8d26389e1da3b185de2e4119" +"checksum tokio-threadpool 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "ec5759cf26cf9659555f36c431b515e3d05f66831741c85b4b5d5dfb9cf1323c" +"checksum tokio-timer 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "2910970404ba6fa78c5539126a9ae2045d62e3713041e447f695f41405a120c6" +"checksum tokio-trace-core 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "350c9edade9830dc185ae48ba45667a445ab59f6167ef6d0254ec9d2430d9dd3" "checksum toml 0.4.10 (registry+https://github.com/rust-lang/crates.io-index)" = "758664fc71a3a69038656bee8b6be6477d2a6c315a6b81f7081f591bffa4111f" "checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" +"checksum try-lock 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" "checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" "checksum typemap 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "653be63c80a3296da5551e1bfd2cca35227e13cdd08c6668903ae2f4f77aa1f6" "checksum typenum 1.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "612d636f949607bdf9b123b4a6f6d966dedf3ff669f7f045890d3a4a73948169" "checksum ucd-trie 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "71a9c5b1fe77426cf144cc30e49e955270f5086e31a6441dfa8b32efc09b9d77" "checksum ucd-util 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "535c204ee4d8434478593480b8f86ab45ec9aae0e83c568ca81abf0fd0e88f86" "checksum unicase 1.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" +"checksum unicase 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "41d17211f887da8e4a70a45b9536f26fc5de166b81e2d5d80de4a17fd22553bd" "checksum unicode-bidi 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" "checksum unicode-normalization 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "141339a08b982d942be2ca06ff8b076563cbe223d1befd5450716790d44e2426" "checksum unicode-xid 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" @@ -1718,9 +2281,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" "checksum url 1.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "dd4e7c0d531266369519a4aa4f399d748bd37043b00bde1e4ff1f60a120b355a" "checksum urlencoded 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8c28708636d6f7298a53b1cdb6af40f1ab523209a7cb83cf4d41b3ebc671d319" "checksum utf8-ranges 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "796f7e48bef87609f7ade7e06495a87d5cd06c7866e6a5cbfceffc558a243737" +"checksum uuid 0.7.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90dbc611eb48397705a6b0f6e917da23ae517e4d127123d2cf7674206627d32a" "checksum vcpkg 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "def296d3eb3b12371b2c7d0e83bfe1403e4db2d7a0bba324a12b21c4ee13143d" "checksum version_check 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" "checksum walkdir 2.2.7 (registry+https://github.com/rust-lang/crates.io-index)" = "9d9d7ed3431229a144296213105a390676cc49c9b6a72bd19f3176c98e129fa1" +"checksum want 0.0.6 (registry+https://github.com/rust-lang/crates.io-index)" = "797464475f30ddb8830cc529aaaae648d581f99e2036a928877dfde027ddf6b3" "checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" "checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" "checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" diff --git a/Cargo.toml b/Cargo.toml index 857c86ae..c83f7356 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,8 +7,6 @@ version = "0.1.0" dotenv = "0.13.0" env_logger = "0.4" hex = "0.3.2" -hyper = "0.10" -hyper-native-tls = "0.3.0" lazy_static = "1.2.0" log = "0.3.6" rocket = "0.4.0" @@ -22,6 +20,7 @@ url = "1.4" urlencoded = "0.5" maplit = "1.0.1" itertools = "0.8.0" +reqwest = "0.9.12" [dependencies.chrono] features = ["serde"] diff --git a/rfcbot.toml b/rfcbot.toml index 62eec7a3..4ed400ec 100644 --- a/rfcbot.toml +++ b/rfcbot.toml @@ -9,166 +9,4 @@ close = false postpone = false [teams] - -[teams.T-core] -name = "Core" -ping = "rust-lang/core" -members = [ - "alexcrichton", - "ashleygwilliams", - "aturon", - "carols10cents", - "nikomatsakis", - "nrc", - "steveklabnik", - "wycats", - "aidanhs", - "Mark-Simulacrum", -] - -[teams.T-lang] -name = "Language" -ping = "rust-lang/lang" -members = [ - "aturon", - "cramertj", - "eddyb", - "nikomatsakis", - "pnkfelix", - "withoutboats", - "joshtriplett", - "scottmcm", - "Centril", -] - -[teams.T-libs] -name = "Libraries" -ping = "rust-lang/libs" -members = [ - "alexcrichton", - "dtolnay", - "sfackler", - "withoutboats", - "Kimundi", - "SimonSapin", - "Amanieu", -] - -[teams.T-compiler] -name = "Compiler" -ping = "rust-lang/compiler" -members = [ - "cramertj", - "eddyb", - "estebank", - "michaelwoerister", - "nagisa", - "nikomatsakis", - "oli-obk", - "petrochenkov", - "pnkfelix", - "varkor", - "Zoxc", -] - -[teams.T-doc] -name = "Documentation" -ping = "rust-lang/docs" -members = [ - "frewsxcv", - "GuillaumeGomez", - "QuietMisdreavus", - "steveklabnik", -] - -[teams.T-infra] -name = "Infrastructure" -ping = "rust-lang/infra" -members = [ - "aidanhs", - "alexcrichton", - "erickt", - "kennytm", - "Mark-Simulacrum", - "shepmaster", - "TimNN", - "ashleygwilliams", - "sgrif", - "pietroalbini", -] - -[teams.T-cargo] -name = "Cargo" -ping = "rust-lang/cargo" -members = [ - "alexcrichton", - "dwijnand", - "Eh2406", - "ehuss", - "joshtriplett", - "nrc", - "withoutboats", - "wycats", -] - -[teams.T-dev-tools] -name = "Dev tools" -ping = "rust-lang/dev-tools" -members = [ - "fitzgen", - "japaric", - "killercup", - "nrc", - "Manishearth", - "withoutboats", - "steveklabnik", -] - -[teams.T-rustdoc] -name = "Rustdoc" -ping = "rust-lang/rustdoc" -members = [ - "GuillaumeGomez", - "QuietMisdreavus", - "ollie27", - "onur", - "steveklabnik", -] - -[teams.T-IDEs] -name = "IDEs and editors" -ping = "rust-lang/IDEs" -members = [ - "alexheretic", - "autozimu", - "jasonwilliams", - "LucasBullen", - "matklad", - "vlad20012", - "Xanewok", -] - -[teams.T-crates-io] -name = "Crates.io" -ping = "rust-lang/crates-io" -members = [ - "ashleygwilliams", - "carols10cents", - "ishitatsuyuki", - "joshtriplett", - "jtgeibel", - "sgrif", - "withoutboats", - "wycats", -] - -[teams.T-moderation] -name = "Moderation" -ping = "rust-lang/moderation" -members = [ - "BurntSushi", - "Manishearth", - "mbrubeck", - "niconii", - "pnkfelix", -] +url = "https://team-api.infra.rust-lang.org/v1/rfcbot.json" diff --git a/src/config.rs b/src/config.rs index 03100b5d..80b811d8 100644 --- a/src/config.rs +++ b/src/config.rs @@ -28,7 +28,7 @@ pub struct Config { pub github_access_token: String, pub github_user_agent: String, pub github_webhook_secrets: Vec, - pub github_interval_mins: u64, + pub github_interval_mins: Option, pub post_comments: bool, } @@ -57,7 +57,6 @@ pub fn init() -> Result> { GITHUB_TOKEN, GITHUB_WEBHOOK_SECRETS, GITHUB_UA, - GITHUB_INTERVAL, POST_COMMENTS]; for var in keys { @@ -77,8 +76,11 @@ pub fn init() -> Result> { let gh_token = vars.remove(GITHUB_TOKEN).unwrap(); let gh_ua = vars.remove(GITHUB_UA).unwrap(); - let gh_interval = vars.remove(GITHUB_INTERVAL).unwrap().parse::(); - let gh_interval = ok_or!(gh_interval, throw!(vec![GITHUB_INTERVAL])); + let gh_interval = if let Ok(val) = env::var(GITHUB_INTERVAL) { + Some(ok_or!(val.parse::(), throw!(vec![GITHUB_INTERVAL]))) + } else { + None + }; let post_comments = vars.remove(POST_COMMENTS).unwrap().parse::(); let post_comments = ok_or!(post_comments, throw!(vec![POST_COMMENTS])); diff --git a/src/error.rs b/src/error.rs index e96caede..84b41d7b 100644 --- a/src/error.rs +++ b/src/error.rs @@ -5,7 +5,6 @@ use std::convert::From; use std::io; use diesel; -use hyper; use serde_json; use rocket_contrib::templates::handlebars; @@ -13,7 +12,7 @@ pub type DashResult = std::result::Result; #[derive(Debug)] pub enum DashError { - Hyper(hyper::error::Error), + Reqwest(reqwest::Error), Io(io::Error), Serde(serde_json::error::Error), R2d2(diesel::r2d2::PoolError), @@ -26,8 +25,8 @@ impl From for DashError { fn from(e: handlebars::RenderError) -> Self { DashError::Template(e) } } -impl From for DashError { - fn from(e: hyper::error::Error) -> Self { DashError::Hyper(e) } +impl From for DashError { + fn from(e: reqwest::Error) -> Self { DashError::Reqwest(e) } } impl From for DashError { diff --git a/src/github/client.rs b/src/github/client.rs index 7f792ec2..1e8bbb07 100644 --- a/src/github/client.rs +++ b/src/github/client.rs @@ -1,24 +1,19 @@ // Copyright 2016 Adam Perry. Dual-licensed MIT and Apache 2.0 (see LICENSE files for details). use std::collections::BTreeMap; -use std::io::Read; use std::thread::sleep; use std::time::Duration; use std::u32; use chrono::{DateTime, Utc}; -use hyper; -use hyper::client::{RedirectPolicy, RequestBuilder, Response}; -use hyper::header::{Headers, Authorization, UserAgent}; -use hyper::net::HttpsConnector; -use hyper::status::StatusCode; -use hyper_native_tls::NativeTlsClient; use serde::de::DeserializeOwned; use serde_json; +use reqwest::{self, StatusCode, Response, header::HeaderMap}; use config::CONFIG; use error::{DashError, DashResult}; use github::models::{CommentFromJson, IssueFromJson, PullRequestFromJson, PullRequestUrls}; +use domain::github::GitHubUser; pub const BASE_URL: &'static str = "https://api.github.com"; @@ -26,39 +21,30 @@ pub const DELAY: u64 = 300; type ParameterMap = BTreeMap<&'static str, String>; -header! { (TZ, "Time-Zone") => [String] } -header! { (Accept, "Accept") => [String] } -header! { (RateLimitRemaining, "X-RateLimit-Remaining") => [u32] } -header! { (RateLimitReset, "X-RateLimit-Reset") => [i64] } -header! { (Link, "Link") => [String] } - const PER_PAGE: u32 = 100; #[derive(Debug)] pub struct Client { - token: String, - ua: String, - client: hyper::Client, + client: reqwest::Client, rate_limit: u32, rate_limit_timeout: DateTime, } -fn read_to_string(reader: &mut R) -> DashResult { - let mut string = String::new(); - reader.read_to_string(&mut string)?; - Ok(string) -} - impl Client { pub fn new() -> Self { - let tls_connector = HttpsConnector::new(NativeTlsClient::new().unwrap()); - let mut client = hyper::Client::with_connector(tls_connector); - client.set_redirect_policy(RedirectPolicy::FollowAll); - + let mut headers = HeaderMap::new(); + if !CONFIG.github_access_token.trim().is_empty() { + headers.insert( + "Authorization", + format!("token {}", CONFIG.github_access_token).parse().unwrap(), + ); + } + headers.insert("User-Agent", CONFIG.github_user_agent.parse().unwrap()); + headers.insert("Time-Zone", "UTC".parse().unwrap()); + headers.insert("Accept", "application/vnd.github.v3".parse().unwrap()); + headers.insert("Connection", "close".parse().unwrap()); Client { - token: CONFIG.github_access_token.clone(), - ua: CONFIG.github_user_agent.clone(), - client: client, + client: reqwest::Client::builder().default_headers(headers).build().unwrap(), rate_limit: u32::MAX, rate_limit_timeout: Utc::now(), } @@ -113,26 +99,26 @@ impl Client { -> DashResult> { let mut res = self.get(start_url, params)?; - let mut models = self.deserialize::>(&mut res)?; - while let Some(url) = Self::next_page(&res.headers) { + let mut models: Vec = res.json()?; + while let Some(url) = Self::next_page(res.headers()) { sleep(Duration::from_millis(DELAY)); res = self.get(&url, None)?; - models.extend(self.deserialize::>(&mut res)?); + models.extend(res.json::>()?); } Ok(models) } pub fn fetch_pull_request(&self, pr_info: &PullRequestUrls) -> DashResult { if let Some(url) = pr_info.get("url") { - let mut res = self.get(url, None)?; - self.deserialize(&mut res) + Ok(self.get(url, None)?.json()?) } else { throw!(DashError::Misc(None)) } } - fn next_page(h: &Headers) -> Option { - if let Some(lh) = h.get::() { + fn next_page(h: &HeaderMap) -> Option { + if let Some(lh) = h.get("Link") { + let lh = &lh.to_str().unwrap(); for link in (**lh).split(',').map(|s| s.trim()) { let tokens = link.split(';').map(|s| s.trim()).collect::>(); @@ -159,8 +145,8 @@ impl Client { let payload = serde_json::to_string(&btreemap!("state" => "closed"))?; let mut res = self.patch(&url, &payload)?; - if StatusCode::Ok != res.status { - throw!(DashError::Misc(Some(read_to_string(&mut res)?))) + if StatusCode::OK != res.status() { + throw!(DashError::Misc(Some(res.text()?))) } Ok(()) @@ -172,8 +158,8 @@ impl Client { let mut res = self.post(&url, &payload)?; - if StatusCode::Ok != res.status { - throw!(DashError::Misc(Some(read_to_string(&mut res)?))) + if StatusCode::OK != res.status() { + throw!(DashError::Misc(Some(res.text()?))) } Ok(()) @@ -187,8 +173,8 @@ impl Client { label); let mut res = self.delete(&url)?; - if StatusCode::NoContent != res.status { - throw!(DashError::Misc(Some(read_to_string(&mut res)?))) + if StatusCode::NO_CONTENT != res.status() { + throw!(DashError::Misc(Some(res.text()?))) } Ok(()) @@ -201,8 +187,7 @@ impl Client { -> DashResult { let url = format!("{}/repos/{}/issues/{}/comments", BASE_URL, repo, issue_num); let payload = serde_json::to_string(&btreemap!("body" => text))?; - // FIXME propagate an error if it's a 404 or other error - self.deserialize(&mut self.post(&url, &payload)?) + Ok(self.post(&url, &payload)?.error_for_status()?.json()?) } pub fn edit_comment(&self, @@ -214,69 +199,33 @@ impl Client { BASE_URL, repo, comment_num); - let payload = serde_json::to_string(&btreemap!("body" => text))?; - - // FIXME propagate an error if it's a 404 or other error - self.deserialize(&mut self.patch(&url, &payload)?) + Ok(self.patch(&url, &payload)?.error_for_status()?.json()?) } - fn patch(&self, url: &str, payload: &str) -> Result { - self.set_headers(self.client.patch(url).body(payload)) - .send() + pub fn get_user(&self, name: &str) -> DashResult { + let url = format!("{}/users/{}", BASE_URL, name); + Ok(self.get(&url, None)?.error_for_status()?.json()?) } - fn post(&self, url: &str, payload: &str) -> Result { - self.set_headers(self.client.post(url).body(payload)).send() + fn patch(&self, url: &str, payload: &str) -> Result { + self.client.patch(url).body(payload.to_string()).send() } - fn delete(&self, url: &str) -> Result { - self.set_headers(self.client.delete(url)).send() + fn post(&self, url: &str, payload: &str) -> Result { + self.client.post(url).body(payload.to_string()).send() } - fn get(&self, - url: &str, - params: Option<&ParameterMap>) - -> Result { - let qp_string = match params { - Some(p) => { - let mut qp = String::from("?"); - for (k, v) in p { - if qp.len() > 1 { - qp.push('&'); - } - qp.push_str(&format!("{}={}", k, v)); - } - qp - } - None => "".to_string(), - }; - - let url = format!("{}{}", url, qp_string); - - debug!("GETing: {}", &url); - - self.set_headers(self.client.get(&url)).send() + fn delete(&self, url: &str) -> Result { + self.client.delete(url).send() } - fn deserialize(&self, res: &mut Response) -> DashResult { - let mut buf = String::new(); - res.read_to_string(&mut buf)?; - - match serde_json::from_str(&buf) { - Ok(m) => Ok(m), - Err(why) => { - error!("Unable to parse from JSON ({:?}): {}", why, buf); - throw!(why) - } + fn get(&self, url: &str, params: Option<&ParameterMap>) -> Result { + debug!("GETing: {}", &url); + let mut builder = self.client.get(url); + if let Some(params) = params { + builder = builder.query(params); } - } - - fn set_headers<'a>(&self, req: RequestBuilder<'a>) -> RequestBuilder<'a> { - req.header(Authorization(format!("token {}", &self.token))) - .header(UserAgent(self.ua.clone())) - .header(TZ("UTC".to_string())) - .header(Accept("application/vnd.github.v3".to_string())) - .header(hyper::header::Connection::close()) + builder.send() } } diff --git a/src/github/mod.rs b/src/github/mod.rs index 69c27c19..6471e56a 100644 --- a/src/github/mod.rs +++ b/src/github/mod.rs @@ -214,6 +214,7 @@ mod tests { #[test] fn test_handle_user() { + ::utils::setup_test_env(); let db_url = env::var("DATABASE_URL").expect("DATABASE_URL must be set"); let conn = PgConnection::establish(&db_url) .expect(&format!("Error connecting to {}", db_url)); diff --git a/src/github/nag.rs b/src/github/nag.rs index d88fcdde..b2b429b1 100644 --- a/src/github/nag.rs +++ b/src/github/nag.rs @@ -57,7 +57,8 @@ pub fn update_nags(comment: &IssueComment) -> DashResult<()> { // Attempt to parse all commands out of the comment let mut any = false; - for command in RfcBotCommand::from_str_all(&SETUP, &comment.body) { + let teams = SETUP.read().unwrap(); + for command in RfcBotCommand::from_str_all(&teams, &comment.body) { any = true; if let RfcBotCommand::StartPoll {..} = command { @@ -488,11 +489,11 @@ fn evaluate_ffcps() -> DashResult<()> { } fn can_ffcp_close(issue: &Issue) -> bool { - SETUP.should_ffcp_auto_close(&issue.repository) + SETUP.read().unwrap().should_ffcp_auto_close(&issue.repository) } fn can_ffcp_postpone(issue: &Issue) -> bool { - SETUP.should_ffcp_auto_postpone(&issue.repository) + SETUP.read().unwrap().should_ffcp_auto_postpone(&issue.repository) } fn execute_ffcp_actions(issue: &Issue, disposition: FcpDisposition) { @@ -613,7 +614,7 @@ fn resolve_applicable_feedback_requests(author: &GitHubUser, Ok(()) } -fn resolve_logins_to_users(member_logins: &Vec<&str>) -> DashResult> { +fn resolve_logins_to_users(member_logins: &[String]) -> DashResult> { use diesel::pg::expression::dsl::any; use domain::schema::githubuser; let conn = &*DB_POOL.get()?; @@ -633,13 +634,15 @@ fn specific_subteam_members(included: F) -> DashResult> where F: Fn(&String) -> bool { - resolve_logins_to_users(&SETUP.teams() + let setup = SETUP.read().unwrap(); + let teams = setup.teams(); + let members = teams .filter(|&(label, _)| included(&label.0)) - .flat_map(|(_, team)| team.member_logins()) + .flat_map(|(_, team)| team.member_logins().map(|i| i.to_string())) .collect::>() .into_iter() // diesel won't work with btreeset, and dedup has weird lifetime errors - .collect::>() - ) + .collect::>(); + resolve_logins_to_users(&members) } /// Return a list of all known team members. @@ -652,7 +655,7 @@ fn all_team_members() -> DashResult> /// labelled on the issue. fn subteam_members(issue: &Issue) -> DashResult> { // retrieve all of the teams tagged on this issue - specific_subteam_members(|label| issue.labels.contains(label)) + specific_subteam_members(|label| issue.labels.contains(&label)) } fn cancel_fcp(author: &GitHubUser, issue: &Issue, existing: &FcpProposal) -> DashResult<()> { @@ -744,11 +747,14 @@ fn process_poll use domain::schema::poll_response_request; let conn = &*DB_POOL.get()?; + let tmp_teams; let teams = if teams.is_empty() { - SETUP.teams() + let setup = SETUP.read().unwrap(); + tmp_teams = setup.teams() .filter(|&(label, _)| issue.labels.contains(&label.0)) - .map(|(label, _)| &*label.0) - .collect::>() + .map(|(label, _)| label.0.clone()) + .collect::>(); + tmp_teams.iter().map(|team| team.as_str()).collect() } else { teams }; diff --git a/src/main.rs b/src/main.rs index a3141e27..a115deed 100644 --- a/src/main.rs +++ b/src/main.rs @@ -9,12 +9,10 @@ extern crate dotenv; extern crate env_logger; extern crate hex; #[macro_use] -extern crate hyper; -extern crate hyper_native_tls; -#[macro_use] extern crate lazy_static; #[macro_use] extern crate log; +extern crate reqwest; #[macro_use] extern crate rocket; extern crate rocket_contrib; @@ -41,6 +39,7 @@ mod nag; mod scraper; mod server; mod teams; +mod utils; use chrono::Local; use diesel::pg::PgConnection; @@ -74,8 +73,13 @@ fn main() { let _ = DB_POOL.get().expect("Unable to test connection pool."); // we want to panic if we're unable to find any of the usernames - let parsed_teams = teams::SETUP.team_labels().collect::>(); - info!("parsed teams: {:?}", parsed_teams); + { + let teams = teams::SETUP.read().unwrap(); + let parsed_teams = teams.team_labels().collect::>(); + info!("parsed teams: {:?}", parsed_teams); + } + + teams::start_updater_thread(); // FIXME(anp) need to handle panics in both the listeners and crash the server let _ = scraper::start_scraping(); diff --git a/src/scraper.rs b/src/scraper.rs index 12be988b..e8713ca2 100644 --- a/src/scraper.rs +++ b/src/scraper.rs @@ -1,27 +1,15 @@ -use std::thread::{spawn, JoinHandle}; -use std::thread; -use std::time::Duration; +use std::thread::JoinHandle; use chrono::{DateTime, Utc}; use config::{CONFIG, GH_ORGS}; use github; -pub fn start_scraping() -> JoinHandle<()> { - // spawn the github scraper in the background - spawn(|| { - let sleep_duration = Duration::from_secs(CONFIG.github_interval_mins * 60); - loop { - match github::most_recent_update() { - Ok(gh_most_recent) => scrape_github(gh_most_recent), - Err(why) => error!("Unable to determine most recent GH update: {:?}", why), - } - info!("GitHub scraper sleeping for {} seconds ({} minutes)", - sleep_duration.as_secs(), - CONFIG.github_interval_mins); - thread::sleep(sleep_duration); - } - }) +pub fn start_scraping() -> Option> { + Some(::utils::spawn_thread("GitHub scraper", CONFIG.github_interval_mins?, || { + scrape_github(github::most_recent_update()?); + Ok(()) + })) } pub fn scrape_github(since: DateTime) { diff --git a/src/teams.rs b/src/teams.rs index fe340133..e202fc33 100644 --- a/src/teams.rs +++ b/src/teams.rs @@ -1,6 +1,5 @@ -// TODO maybe pull from https://github.com/rust-lang/rust-www/blob/master/_data/team.yml instead - use std::collections::BTreeMap; +use std::sync::{Arc, RwLock}; use diesel::prelude::*; use toml; @@ -8,30 +7,42 @@ use toml; use super::DB_POOL; use domain::github::GitHubUser; use error::*; +use github::GH; + +const UPDATE_CONFIG_EVERY_MIN: u64 = 5; //============================================================================== // Public API //============================================================================== +type TeamsMap = BTreeMap; + lazy_static! { - pub static ref SETUP: RfcbotConfig = read_rfcbot_cfg_validated(); + pub static ref SETUP: Arc> = Arc::new(RwLock::new(read_rfcbot_cfg_validated())); } #[derive(Debug, Deserialize)] pub struct RfcbotConfig { + #[serde(default)] + include_rust_team: bool, fcp_behaviors: BTreeMap, - teams: BTreeMap, + teams: RfcbotTeams, + #[serde(skip)] + cached_teams: TeamsMap, } impl RfcbotConfig { /// Retrive an iterator over all the team labels. pub fn team_labels(&self) -> impl Iterator { - self.teams.keys() + self.teams().map(|(k, _)| k) } /// Retrive an iterator over all the (team label, team) pairs. pub fn teams(&self) -> impl Iterator { - self.teams.iter() + match &self.teams { + RfcbotTeams::Local(teams) => teams.iter(), + RfcbotTeams::Remote { .. } => self.cached_teams.iter(), + } } /// Are we allowed to auto-close issues after F-FCP in this repo? @@ -43,6 +54,21 @@ impl RfcbotConfig { pub fn should_ffcp_auto_postpone(&self, repo: &str) -> bool { self.fcp_behaviors.get(repo).map(|fcp| fcp.postpone).unwrap_or_default() } + + // Update the list of teams from external sources, if needed + fn update(&mut self) -> Result<(), DashError> { + #[derive(Deserialize)] + struct ToDeserialize { + teams: TeamsMap, + } + if let RfcbotTeams::Remote { ref url } = &self.teams { + let de: ToDeserialize = ::reqwest::get(url)? + .error_for_status()? + .json()?; + self.cached_teams = de.teams; + } + Ok(()) + } } #[derive(Debug, Deserialize)] @@ -53,6 +79,19 @@ pub struct FcpBehavior { postpone: bool, } +// This enum definition mixes both struct-style and tuple-style variants: this is intentionally +// done to get the wanted deserialization behavior from serde. Since this is an untagged enum from +// serde's point of view it will deserialize a RfcbotTeams::Remote when it encounters a key named +// url with a string in it, otherwise the normal team map. +#[derive(Debug, Deserialize)] +#[serde(untagged)] +enum RfcbotTeams { + Local(TeamsMap), + Remote { + url: String, + } +} + #[derive(Debug, Deserialize)] pub struct Team { name: String, @@ -74,6 +113,17 @@ impl Team { #[serde(transparent)] pub struct TeamLabel(pub String); +pub fn start_updater_thread() { + let _ = ::utils::spawn_thread("teams updater", UPDATE_CONFIG_EVERY_MIN, || { + let mut teams = SETUP.write().unwrap(); + teams.update()?; + for (_name, team) in teams.teams() { + team.validate()?; + } + Ok(()) + }); +} + //============================================================================== // Implementation details //============================================================================== @@ -82,7 +132,7 @@ pub struct TeamLabel(pub String); fn read_rfcbot_cfg_validated() -> RfcbotConfig { let cfg = read_rfcbot_cfg(); - cfg.teams.values().for_each(|team| + cfg.teams().map(|(_, v)| v).for_each(|team| team.validate() .expect("unable to verify team member from database. if you're running this for tests, make sure you've pulled github users from prod") @@ -93,8 +143,10 @@ if you're running this for tests, make sure you've pulled github users from prod /// Read the unprocessed `rfcbot.toml` configuration file. fn read_rfcbot_cfg() -> RfcbotConfig { - read_rfcbot_cfg_from( - include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/rfcbot.toml"))) + let mut config = read_rfcbot_cfg_from( + include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/rfcbot.toml"))); + config.update().expect("couldn't update the configuration!"); + config } fn read_rfcbot_cfg_from(input: &str) -> RfcbotConfig { @@ -105,15 +157,14 @@ impl Team { fn validate(&self) -> DashResult<()> { use domain::schema::githubuser::dsl::*; let conn = &*(DB_POOL.get()?); + let gh = &*(GH); // bail if they don't exist, but we don't want to actually keep the id in ram for member_login in self.member_logins() { - let check_login = githubuser.filter(login.eq(member_login)) - .first::(conn); - ok_or!(check_login, why => { - error!("unable to find {} in database: {:?}", member_login, why); - throw!(why); - }); + if githubuser.filter(login.eq(member_login)).first::(conn).is_err() { + ::github::handle_user(&conn, &gh.get_user(member_login)?)?; + info!("loaded into the database user {}", member_login); + } } Ok(()) @@ -222,7 +273,9 @@ members = [ #[test] fn team_members_exist() { - for (label, _) in SETUP.teams.iter() { + ::utils::setup_test_env(); + let setup = SETUP.read().unwrap(); + for (label, _) in setup.teams() { println!("found team {:?}", label); } } diff --git a/src/utils.rs b/src/utils.rs new file mode 100644 index 00000000..96617060 --- /dev/null +++ b/src/utils.rs @@ -0,0 +1,32 @@ +use std::time::Duration; +use std::thread::{self, JoinHandle}; +use error::DashResult; + +pub(crate) fn spawn_thread(name: &'static str, interval_minutes: u64, f: F) -> JoinHandle<()> +where + F: Fn() -> DashResult<()> + Send + 'static, +{ + let duration = Duration::from_secs(interval_minutes * 60); + thread::spawn(move || { + loop { + if let Err(err) = f() { + error!("the {} thread failed an iteration: {:?}", name, err); + } + info!("{} thread sleeping for {} seconds", name, duration.as_secs()); + thread::sleep(duration); + } + }) +} + +#[cfg(test)] +pub(crate) fn setup_test_env() { + use std::sync::Once; + use std::path::Path; + + static ONCE: Once = Once::new(); + ONCE.call_once(|| { + if Path::new(".env").is_file() { + dotenv::dotenv().expect("failed to initialize dotenv"); + } + }); +}