From cd8b11e222071f544d6ef7d98f5d4dc090ed7fdd Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 25 Jul 2018 18:37:04 +0200 Subject: [PATCH 1/7] remove Cargo.lock It is intended only for binaries and not libraries. Signed-off-by: Igor Gnatenko --- Cargo.lock | 531 ----------------------------------------------------- 1 file changed, 531 deletions(-) delete mode 100644 Cargo.lock diff --git a/Cargo.lock b/Cargo.lock deleted file mode 100644 index 80edd7e..0000000 --- a/Cargo.lock +++ /dev/null @@ -1,531 +0,0 @@ -[root] -name = "yup-oauth2" -version = "1.0.5" -dependencies = [ - "base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "chrono 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)", - "getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.10.10 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper-rustls 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "itertools 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)", - "url 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)", - "yup-hyper-mock 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "base64" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "base64" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "byteorder" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "chrono" -version = "0.2.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "deque" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "dtoa" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "gcc" -version = "0.3.45" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "getopts" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "httparse" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "hyper" -version = "0.10.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", - "httparse 1.2.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.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "mime 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", - "typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", - "unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "hyper-rustls" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "hyper 0.10.10 (registry+https://github.com/rust-lang/crates.io-index)", - "rustls 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki-roots 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "idna" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "itertools" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "itoa" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "kernel32-sys" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "language-tags" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "lazy_static" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "libc" -version = "0.2.22" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "log" -version = "0.3.7" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "matches" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "mime" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", - "num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-integer" -version = "0.1.34" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-iter" -version = "0.1.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "num-traits" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "num_cpus" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "open" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "quote" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rand" -version = "0.3.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rayon" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rayon-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rayon-core" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "deque 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "redox_syscall" -version = "0.1.17" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "ring" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", - "rayon 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", - "untrusted 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustc-serialize" -version = "0.3.24" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "rustc_version" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "rustls" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", - "ring 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "untrusted 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "safemem" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "semver" -version = "0.1.20" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "serde_derive" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)", - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_derive_internals" -version = "0.15.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", - "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "serde_json" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", - "itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", - "num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "syn" -version = "0.11.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", - "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "synom" -version = "0.11.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "time" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "traitobject" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "typeable" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicase" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicode-bidi" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "unicode-normalization" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "unicode-xid" -version = "0.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "untrusted" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "url" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", - "unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "uuid 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "url" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "idna 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "uuid" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "webpki" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "ring 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)", - "untrusted 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "webpki-roots" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "untrusted 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)", - "webpki 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "winapi" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "winapi-build" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - -[[package]] -name = "yup-hyper-mock" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "hyper 0.10.10 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[metadata] -"checksum base64 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "30e93c03064e7590d0466209155251b90c22e37fab1daf2771582598b5827557" -"checksum base64 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "96434f987501f0ed4eb336a411e0631ecd1afa11574fe148587adc4ff96143c9" -"checksum byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c40977b0ee6b9885c9013cd41d9feffdd22deb3bb4dc3a71d901cc7a77de18c8" -"checksum chrono 0.2.25 (registry+https://github.com/rust-lang/crates.io-index)" = "9213f7cd7c27e95c2b57c49f0e69b1ea65b27138da84a170133fd21b07659c00" -"checksum deque 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a694dae478589798d752c7125542f8a5ae8b6e59476172baf2eed67357bdfa27" -"checksum dtoa 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "80c8b71fd71146990a9742fc06dcbbde19161a267e0ad4e572c35162f4578c90" -"checksum gcc 0.3.45 (registry+https://github.com/rust-lang/crates.io-index)" = "40899336fb50db0c78710f53e87afc54d8c7266fb76262fecc78ca1a7f09deae" -"checksum getopts 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9047cfbd08a437050b363d35ef160452c5fe8ea5187ae0a624708c91581d685" -"checksum httparse 1.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "77f756bed9ee3a83ce98774f4155b42a31b787029013f3a7d83eca714e500e21" -"checksum hyper 0.10.10 (registry+https://github.com/rust-lang/crates.io-index)" = "36e108e0b1fa2d17491cbaac4bc460dc0956029d10ccf83c913dd0e5db3e7f07" -"checksum hyper-rustls 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "04535774f79684c99528944ebdb89756c945c027e55ce52faa245879d836c8fb" -"checksum idna 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "6ac85ec3f80c8e4e99d9325521337e14ec7555c458a14e377d189659a427f375" -"checksum itertools 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "c4a9b56eb56058f43dc66e58f40a214b2ccbc9f3df51861b63d51dec7b65bc3f" -"checksum itoa 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "eb2f404fbc66fd9aac13e998248505e7ecb2ad8e44ab6388684c5fb11c6c251c" -"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.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3b37545ab726dd833ec6420aaba8231c5b320814b9029ad585555d2a03e94fbf" -"checksum libc 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)" = "babb8281da88cba992fa1f4ddec7d63ed96280a1a53ec9b919fd37b53d71e502" -"checksum log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)" = "5141eca02775a762cc6cd564d8d2c50f67c0ea3a372cbf1c51592b3e029e10ad" -"checksum matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efd7622e3022e1a6eaa602c4cea8912254e5582c9c692e9167714182244801b1" -"checksum mime 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "5514f038123342d01ee5f95129e4ef1e0470c93bc29edf058a46f9ee3ba6737e" -"checksum num 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "98b15ba84e910ea7a1973bccd3df7b31ae282bf9d8bd2897779950c9b8303d40" -"checksum num-integer 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "ef1a4bf6f9174aa5783a9b4cc892cacd11aebad6c69ad027a0b65c6ca5f8aa37" -"checksum num-iter 0.1.33 (registry+https://github.com/rust-lang/crates.io-index)" = "f7d1891bd7b936f12349b7d1403761c8a0b85a18b148e9da4429d5d102c1a41e" -"checksum num-traits 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "e1cbfa3781f3fe73dc05321bed52a06d2d491eaa764c52335cf4399f046ece99" -"checksum num_cpus 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ca313f1862c7ec3e0dfe8ace9fa91b1d9cb5c84ace3d00f5ec4216238e93c167" -"checksum open 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3478ed1686bd1300c8a981a940abc92b06fac9cbef747f4c668d4e032ff7b842" -"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" -"checksum rand 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "022e0636ec2519ddae48154b028864bdce4eaf7d35226ab8e65c611be97b189d" -"checksum rayon 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8c83adcb08e5b922e804fe1918142b422602ef11f2fd670b0b52218cb5984a20" -"checksum rayon-core 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "767d91bacddf07d442fe39257bf04fd95897d1c47c545d009f6beb03efd038f8" -"checksum redox_syscall 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "29dbdfd4b9df8ab31dec47c6087b7b13cbf4a776f335e4de8efba8288dda075b" -"checksum ring 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1f2a6dc7fc06a05e6de183c5b97058582e9da2de0c136eafe49609769c507724" -"checksum rustc-serialize 0.3.24 (registry+https://github.com/rust-lang/crates.io-index)" = "dcf128d1287d2ea9d80910b5f1120d0b8eede3fbf1abe91c40d39ea7d51e6fda" -"checksum rustc_version 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "c5f5376ea5e30ce23c03eb77cbe4962b988deead10910c372b226388b594c084" -"checksum rustls 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "17727f4b991294da2c84d75a43c003151ff58072212768800f66c56ee46dca43" -"checksum safemem 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e27a8b19b835f7aea908818e871f5cc3a5a186550c30773be987e155e8163d8f" -"checksum semver 0.1.20 (registry+https://github.com/rust-lang/crates.io-index)" = "d4f410fedcf71af0345d7607d246e7ad15faaadd49d240ee3b24e5dc21a820ac" -"checksum serde 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "c2f530d36fb84ec48fb7146936881f026cdbf4892028835fd9398475f82c1bb4" -"checksum serde_derive 1.0.8 (registry+https://github.com/rust-lang/crates.io-index)" = "10552fad5500771f3902d0c5ba187c5881942b811b7ba0d8fbbfbf84d80806d3" -"checksum serde_derive_internals 0.15.1 (registry+https://github.com/rust-lang/crates.io-index)" = "37aee4e0da52d801acfbc0cc219eb1eda7142112339726e427926a6f6ee65d3a" -"checksum serde_json 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "48b04779552e92037212c3615370f6bd57a40ebba7f20e554ff9f55e41a69a7b" -"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 time 0.1.37 (registry+https://github.com/rust-lang/crates.io-index)" = "ffd7ccbf969a892bf83f1e441126968a07a3941c24ff522a26af9f9f4585d1a3" -"checksum traitobject 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "efd1f82c56340fdf16f2a953d7bda4f8fdffba13d93b00844c25572110b26079" -"checksum typeable 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "1410f6f91f21d1612654e7cc69193b0334f909dcf2c790c4826254fbb86f8887" -"checksum unicase 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "13a5906ca2b98c799f4b1ab4557b76367ebd6ae5ef14930ec841c74aed5f3764" -"checksum unicode-bidi 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "d3a078ebdd62c0e71a709c3d53d2af693fe09fe93fbff8344aebe289b78f9032" -"checksum unicode-normalization 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "e28fa37426fceeb5cf8f41ee273faa7c82c47dc8fba5853402841e665fcd86ff" -"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" -"checksum untrusted 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6b65243989ef6aacd9c0d6bd2b822765c3361d8ed352185a6f3a41f3a718c673" -"checksum url 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4a3440c1ed62af4a2aee71c6fb78ef32ddcb75cfa24bf42f45e07c02b6d6a2f6" -"checksum url 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f5ba8a749fb4479b043733416c244fa9d1d3af3d7c23804944651c8a448cb87e" -"checksum uuid 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "885acc3b17fdef6230d1f7765dff1106dfd5e75a93c2f26459fbf600ed6dcc14" -"checksum webpki 0.14.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e499345fc4c6b7c79a5b8756d4592c4305510a13512e79efafe00dfbd67bbac6" -"checksum webpki-roots 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5bfb3f50499f21ad2317f442845e3b5805b007f1e728f59885c99e61b8c181a7" -"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" -"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc" -"checksum yup-hyper-mock 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1b19be9a18db9400bac5717cafb85a5d97fe16c5796c63faf3ea73a3e3ec47fe" From b7e9822052a9aee625c3d2a7a39461180a9cd7b0 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 25 Jul 2018 22:45:09 +0200 Subject: [PATCH 2/7] deps: update base64 to 0.9 Signed-off-by: Igor Gnatenko --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index aa46421..09a2669 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,7 +10,7 @@ keywords = ["google", "oauth", "v2"] license = "MIT OR Apache-2.0" [dependencies] -base64 = "0.5.2" +base64 = "0.9" chrono = "0.2" hyper = "0.10.2" hyper-rustls = "0.6.1" From 35fc95b066c23c6723efd00084fc31f35a95baf2 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 25 Jul 2018 22:45:25 +0200 Subject: [PATCH 3/7] deps: update itertools to 0.7 Signed-off-by: Igor Gnatenko --- Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Cargo.toml b/Cargo.toml index 09a2669..0b1ee87 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ base64 = "0.9" chrono = "0.2" hyper = "0.10.2" hyper-rustls = "0.6.1" -itertools = "0.4" +itertools = "0.7" log = "0.3" rustls = "0.9.0" serde = "1.0" From e634d3f139dd314afa96d9f0365d981a6bb01a8d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 25 Jul 2018 22:44:32 +0200 Subject: [PATCH 4/7] deps: update chrono to 0.4 Signed-off-by: Igor Gnatenko --- Cargo.toml | 2 +- src/authenticator_delegate.rs | 8 ++++---- src/device.rs | 6 +++--- src/refresh.rs | 4 ++-- src/service_account.rs | 4 ++-- src/types.rs | 10 +++++----- 6 files changed, 17 insertions(+), 17 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 0b1ee87..ffccfed 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0" [dependencies] base64 = "0.9" -chrono = "0.2" +chrono = "0.4" hyper = "0.10.2" hyper-rustls = "0.6.1" itertools = "0.7" diff --git a/src/authenticator_delegate.rs b/src/authenticator_delegate.rs index 381ec15..e46c5c0 100644 --- a/src/authenticator_delegate.rs +++ b/src/authenticator_delegate.rs @@ -7,7 +7,7 @@ use std::error::Error; use authenticator::Retry; use types::RequestError; -use chrono::{DateTime, Local, UTC}; +use chrono::{DateTime, Local, Utc}; use std::time::Duration; /// Contains state of pending authentication requests @@ -20,7 +20,7 @@ pub struct PollInformation { /// The `user_code` expires at the given time /// It's the time the user has left to authenticate your application - pub expires_at: DateTime, + pub expires_at: DateTime, /// The interval in which we may poll for a status change /// The server responds with errors of we poll too fast. pub interval: Duration, @@ -38,7 +38,7 @@ pub enum PollError { /// Connection failure - retry if you think it's worth it HttpError(hyper::Error), /// indicates we are expired, including the expiration date - Expired(DateTime), + Expired(DateTime), /// Indicates that the user declined access. String is server response AccessDenied, } @@ -83,7 +83,7 @@ pub trait AuthenticatorDelegate { /// Called if the request code is expired. You will have to start over in this case. /// This will be the last call the delegate receives. /// Given `DateTime` is the expiration date - fn expired(&mut self, &DateTime) {} + fn expired(&mut self, &DateTime) {} /// Called if the user denied access. You would have to start over. /// This will be the last call the delegate receives. diff --git a/src/device.rs b/src/device.rs index c89cd47..f61ca50 100644 --- a/src/device.rs +++ b/src/device.rs @@ -7,7 +7,7 @@ use hyper::header::ContentType; use url::form_urlencoded; use itertools::Itertools; use serde_json as json; -use chrono::{self, UTC}; +use chrono::{self, Utc}; use std::borrow::BorrowMut; use std::io::Read; use std::i64; @@ -133,7 +133,7 @@ impl DeviceFlow let pi = PollInformation { user_code: decoded.user_code, verification_url: decoded.verification_url, - expires_at: UTC::now() + chrono::Duration::seconds(decoded.expires_in), + expires_at: Utc::now() + chrono::Duration::seconds(decoded.expires_in), interval: Duration::from_secs(i64::abs(decoded.interval) as u64), }; self.state = Some(DeviceFlowState::Pending(pi.clone())); @@ -175,7 +175,7 @@ impl DeviceFlow _ => panic!("You have to call request_code() beforehand"), }; - if pi.expires_at <= UTC::now() { + if pi.expires_at <= Utc::now() { self.error = Some(PollError::Expired(pi.expires_at)); self.state = Some(DeviceFlowState::Error); return Err(&self.error.as_ref().unwrap()); diff --git a/src/refresh.rs b/src/refresh.rs index b980021..f68dd54 100644 --- a/src/refresh.rs +++ b/src/refresh.rs @@ -1,6 +1,6 @@ use types::{ApplicationSecret, FlowType, JsonError}; -use chrono::UTC; +use chrono::Utc; use hyper; use hyper::header::ContentType; use serde_json as json; @@ -107,7 +107,7 @@ impl RefreshFlow token_type: t.token_type, refresh_token: refresh_token.to_string(), expires_in: None, - expires_in_timestamp: Some(UTC::now().timestamp() + t.expires_in), + expires_in_timestamp: Some(Utc::now().timestamp() + t.expires_in), }); &self.result diff --git a/src/service_account.rs b/src/service_account.rs index 082b58d..80a5bf3 100644 --- a/src/service_account.rs +++ b/src/service_account.rs @@ -133,7 +133,7 @@ fn init_claims_from_key<'a, I, T>(key: &ServiceAccountKey, scopes: I) -> Claims where T: AsRef + 'a, I: IntoIterator { - let iat = chrono::UTC::now().timestamp(); + let iat = chrono::Utc::now().timestamp(); let expiry = iat + 3600 - 5; // Max validity is 1h. let mut scopes_string = scopes.into_iter().fold(String::new(), |mut acc, sc| { @@ -179,7 +179,7 @@ struct TokenResponse { impl TokenResponse { fn to_oauth_token(self) -> Token { - let expires_ts = chrono::UTC::now().timestamp() + self.expires_in.unwrap_or(0); + let expires_ts = chrono::Utc::now().timestamp() + self.expires_in.unwrap_or(0); Token { access_token: self.access_token.unwrap(), diff --git a/src/types.rs b/src/types.rs index e924d69..0f905f4 100644 --- a/src/types.rs +++ b/src/types.rs @@ -1,4 +1,4 @@ -use chrono::{DateTime, UTC, TimeZone}; +use chrono::{DateTime, Utc, TimeZone}; use std::error::Error; use std::fmt; use std::str::FromStr; @@ -203,12 +203,12 @@ impl Token { if self.access_token.len() == 0 { panic!("called expired() on unset token"); } - self.expiry_date() <= UTC::now() + self.expiry_date() <= Utc::now() } /// Returns a DateTime object representing our expiry date. - pub fn expiry_date(&self) -> DateTime { - UTC.timestamp(self.expires_in_timestamp + pub fn expiry_date(&self) -> DateTime { + Utc.timestamp(self.expires_in_timestamp .expect("Tokens without an absolute expiry are invalid"), 0) } @@ -220,7 +220,7 @@ impl Token { return self; } - self.expires_in_timestamp = Some(UTC::now().timestamp() + self.expires_in.unwrap()); + self.expires_in_timestamp = Some(Utc::now().timestamp() + self.expires_in.unwrap()); self.expires_in = None; self } From 78cefeab474bb5ab503d6c10c697394e98032ebe Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 25 Jul 2018 22:50:45 +0200 Subject: [PATCH 5/7] deps: update url to 1 Signed-off-by: Igor Gnatenko --- Cargo.toml | 2 +- src/device.rs | 26 ++++++++++++++------------ src/installed.rs | 17 ++++++++--------- src/refresh.rs | 10 ++++++---- src/service_account.rs | 7 ++++--- 5 files changed, 33 insertions(+), 29 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ffccfed..e8d72f5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -20,7 +20,7 @@ rustls = "0.9.0" serde = "1.0" serde_json = "1.0" serde_derive = "1.0" -url = "0.5" +url = "1" [dev-dependencies] getopts = "0.2" diff --git a/src/device.rs b/src/device.rs index f61ca50..da5090f 100644 --- a/src/device.rs +++ b/src/device.rs @@ -87,13 +87,14 @@ impl DeviceFlow // note: cloned() shouldn't be needed, see issue // https://github.com/servo/rust-url/issues/81 - let req = form_urlencoded::serialize(&[("client_id", &self.application_secret.client_id), - ("scope", - &scopes.into_iter() - .map(|s| s.as_ref()) - .intersperse(" ") - .collect::() - )]); + let req = form_urlencoded::Serializer::new(String::new()) + .extend_pairs(&[("client_id", &self.application_secret.client_id), + ("scope", &scopes + .into_iter() + .map(|s| s.as_ref()) + .intersperse(" ") + .collect::())]) + .finish(); // note: works around bug in rustlang // https://github.com/rust-lang/rust/issues/22252 @@ -182,11 +183,12 @@ impl DeviceFlow } // We should be ready for a new request - let req = form_urlencoded::serialize(&[("client_id", &self.application_secret.client_id[..]), - ("client_secret", &self.application_secret.client_secret), - ("code", &self.device_code), - ("grant_type", - "http://oauth.net/grant_type/device/1.0")]); + let req = form_urlencoded::Serializer::new(String::new()) + .extend_pairs(&[("client_id", &self.application_secret.client_id[..]), + ("client_secret", &self.application_secret.client_secret), + ("code", &self.device_code), + ("grant_type", "http://oauth.net/grant_type/device/1.0")]) + .finish(); let json_str: String = match self.client .borrow_mut() diff --git a/src/installed.rs b/src/installed.rs index 300f84e..c3b6f3c 100644 --- a/src/installed.rs +++ b/src/installed.rs @@ -52,7 +52,7 @@ fn build_authentication_request_url<'a, T, I>(auth_uri: &str, format!("&client_id={}", client_id)] .into_iter() .fold(url, |mut u, param| { - u.push_str(&percent_encode(param.as_ref(), QUERY_ENCODE_SET)); + u.push_str(&percent_encode(param.as_ref(), QUERY_ENCODE_SET).to_string()); u }) } @@ -221,14 +221,13 @@ impl InstalledFlow Some(p) => redirect_uri = format!("http://localhost:{}", p), } - let body = form_urlencoded::serialize(vec![("code".to_string(), authcode.to_string()), - ("client_id".to_string(), - appsecret.client_id.clone()), - ("client_secret".to_string(), - appsecret.client_secret.clone()), - ("redirect_uri".to_string(), redirect_uri), - ("grant_type".to_string(), - "authorization_code".to_string())]); + let body = form_urlencoded::Serializer::new(String::new()) + .extend_pairs(vec![("code".to_string(), authcode.to_string()), + ("client_id".to_string(), appsecret.client_id.clone()), + ("client_secret".to_string(), appsecret.client_secret.clone()), + ("redirect_uri".to_string(), redirect_uri), + ("grant_type".to_string(), "authorization_code".to_string())]) + .finish(); let result: Result = self.client .borrow_mut() diff --git a/src/refresh.rs b/src/refresh.rs index f68dd54..883a59b 100644 --- a/src/refresh.rs +++ b/src/refresh.rs @@ -64,10 +64,12 @@ impl RefreshFlow return &self.result; } - let req = form_urlencoded::serialize(&[("client_id", client_secret.client_id.as_ref()), - ("client_secret", client_secret.client_secret.as_ref()), - ("refresh_token", refresh_token), - ("grant_type", "refresh_token")]); + let req = form_urlencoded::Serializer::new(String::new()) + .extend_pairs(&[("client_id", client_secret.client_id.as_ref()), + ("client_secret", client_secret.client_secret.as_ref()), + ("refresh_token", refresh_token), + ("grant_type", "refresh_token")]) + .finish(); let json_str: String = match self.client .borrow_mut() diff --git a/src/service_account.rs b/src/service_account.rs index 80a5bf3..6fc0c10 100644 --- a/src/service_account.rs +++ b/src/service_account.rs @@ -220,9 +220,10 @@ impl<'a, C> ServiceAccountAccess let signed = try!(JWT::new(claims) .sign(self.key.private_key.as_ref().unwrap())); - let body = form_urlencoded::serialize(vec![("grant_type".to_string(), - GRANT_TYPE.to_string()), - ("assertion".to_string(), signed)]); + let body = form_urlencoded::Serializer::new(String::new()) + .extend_pairs(vec![("grant_type".to_string(), GRANT_TYPE.to_string()), + ("assertion".to_string(), signed)]) + .finish(); let mut response = String::new(); let mut result = try!(self.client From 9b5bbf5459625f410cba65387ba81c1d8e93883b Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 25 Jul 2018 22:51:37 +0200 Subject: [PATCH 6/7] =?UTF-8?q?deps:=20hyper-rustls=20=E2=86=92=20hyper-na?= =?UTF-8?q?tive-tls?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Igor Gnatenko --- Cargo.toml | 2 +- examples/drive_example/Cargo.toml | 2 +- examples/drive_example/src/main.rs | 7 ++++--- examples/service_account/Cargo.toml | 2 +- examples/service_account/src/main.rs | 7 ++++--- src/lib.rs | 8 ++++---- src/service_account.rs | 4 ++-- 7 files changed, 17 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index e8d72f5..ab446aa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,7 +13,7 @@ license = "MIT OR Apache-2.0" base64 = "0.9" chrono = "0.4" hyper = "0.10.2" -hyper-rustls = "0.6.1" +hyper-native-tls = "0.2" itertools = "0.7" log = "0.3" rustls = "0.9.0" diff --git a/examples/drive_example/Cargo.toml b/examples/drive_example/Cargo.toml index 656e4a1..e99cb50 100644 --- a/examples/drive_example/Cargo.toml +++ b/examples/drive_example/Cargo.toml @@ -7,4 +7,4 @@ authors = ["Lewin Bormann "] yup-oauth2 = "^ 1.0" google-drive3 = "^ 1.0" hyper = "^ 0.10" -hyper-rustls = "0.6.1" +hyper-native-tls = "0.2" diff --git a/examples/drive_example/src/main.rs b/examples/drive_example/src/main.rs index 3d3dfb4..1cb8180 100644 --- a/examples/drive_example/src/main.rs +++ b/examples/drive_example/src/main.rs @@ -7,13 +7,14 @@ //! Copyright (c) 2016 Google, Inc. (Lewin Bormann ) extern crate hyper; -extern crate hyper_rustls; +extern crate hyper_native_tls; extern crate yup_oauth2; extern crate google_drive3; use std::path::Path; use hyper::net::HttpsConnector; +use hyper_native_tls::NativeTlsClient; use yup_oauth2::{Authenticator, FlowType, ApplicationSecret, DiskTokenStorage, DefaultAuthenticatorDelegate, read_application_secret}; @@ -29,7 +30,7 @@ fn read_client_secret(file: String) -> ApplicationSecret { fn main() { let secret = read_client_secret(CLIENT_SECRET_FILE.to_string()); let client = hyper::Client::with_connector( - HttpsConnector::new(hyper_rustls::TlsClient::new())); + HttpsConnector::new(NativeTlsClient::new().unwrap())); let authenticator = Authenticator::new(&secret, DefaultAuthenticatorDelegate, client, @@ -37,7 +38,7 @@ fn main() { .unwrap(), Some(FlowType::InstalledInteractive)); let client = hyper::Client::with_connector( - HttpsConnector::new(hyper_rustls::TlsClient::new())); + HttpsConnector::new(NativeTlsClient::new().unwrap())); let hub = Drive::new(client, authenticator); let (_resp, list_result) = hub.files().list().q("'root' in parents and trashed = false").doit().unwrap(); diff --git a/examples/service_account/Cargo.toml b/examples/service_account/Cargo.toml index dacdbfa..86125ba 100644 --- a/examples/service_account/Cargo.toml +++ b/examples/service_account/Cargo.toml @@ -12,4 +12,4 @@ base64 = "0.2" yup-oauth2 = "^ 1.0" google-pubsub1 = "^ 1.0" hyper = "0.10" -hyper-rustls = "0.6.1" +hyper-native-tls = "0.2" diff --git a/examples/service_account/src/main.rs b/examples/service_account/src/main.rs index f2eef99..a228095 100644 --- a/examples/service_account/src/main.rs +++ b/examples/service_account/src/main.rs @@ -28,13 +28,14 @@ extern crate base64; extern crate yup_oauth2 as oauth; extern crate google_pubsub1 as pubsub; extern crate hyper; -extern crate hyper_rustls; +extern crate hyper_native_tls; use std::env; use std::time; use std::thread; use hyper::net::HttpsConnector; +use hyper_native_tls::NativeTlsClient; use pubsub::{Topic, Subscription}; // The prefixes are important! @@ -166,14 +167,14 @@ fn publish_stuff(methods: &PubsubMethods, message: &str) { fn main() { let client_secret = oauth::service_account_key_from_file(&"pubsub-auth.json".to_string()) .unwrap(); - let client = hyper::Client::with_connector(HttpsConnector::new(hyper_rustls::TlsClient::new())); + let client = hyper::Client::with_connector(HttpsConnector::new(NativeTlsClient::new().unwrap())); let mut access = oauth::ServiceAccountAccess::new(client_secret, client); use oauth::GetToken; println!("{:?}", access.token(&vec!["https://www.googleapis.com/auth/pubsub"]).unwrap()); - let client = hyper::Client::with_connector(HttpsConnector::new(hyper_rustls::TlsClient::new())); + let client = hyper::Client::with_connector(HttpsConnector::new(NativeTlsClient::new().unwrap())); let hub = pubsub::Pubsub::new(client, access); let methods = hub.projects(); diff --git a/src/lib.rs b/src/lib.rs index 9b53009..c668199 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -39,7 +39,7 @@ //! extern crate serde_derive; //! //! extern crate hyper; -//! extern crate hyper_rustls; +//! extern crate hyper_native_tls; //! extern crate yup_oauth2 as oauth2; //! extern crate serde; //! extern crate serde_json; @@ -48,13 +48,13 @@ //! use serde_json as json; //! use std::default::Default; //! use hyper::{Client, net::HttpsConnector}; -//! use hyper_rustls::TlsClient; +//! use hyper_native_tls::NativeTlsClient; //! # const SECRET: &'static str = "{\"installed\":{\"auth_uri\":\"https://accounts.google.com/o/oauth2/auth\",\"client_secret\":\"UqkDJd5RFwnHoiG5x5Rub8SI\",\"token_uri\":\"https://accounts.google.com/o/oauth2/token\",\"client_email\":\"\",\"redirect_uris\":[\"urn:ietf:wg:oauth:2.0:oob\",\"oob\"],\"client_x509_cert_url\":\"\",\"client_id\":\"14070749909-vgip2f1okm7bkvajhi9jugan6126io9v.apps.googleusercontent.com\",\"auth_provider_x509_cert_url\":\"https://www.googleapis.com/oauth2/v1/certs\"}}"; //! //! # #[test] fn device() { //! let secret = json::from_str::(SECRET).unwrap().installed.unwrap(); //! let res = Authenticator::new(&secret, DefaultAuthenticatorDelegate, -//! Client::with_connector(HttpsConnector::new(TlsClient::new())), +//! Client::with_connector(HttpsConnector::new(NativeTlsClient::new().unwrap())), //! ::default(), None) //! .token(&["https://www.googleapis.com/auth/youtube.upload"]); //! match res { @@ -77,7 +77,7 @@ extern crate serde_json; extern crate base64; extern crate chrono; extern crate hyper; -extern crate hyper_rustls; +extern crate hyper_native_tls; extern crate rustls; #[cfg(test)] diff --git a/src/service_account.rs b/src/service_account.rs index 6fc0c10..3b71b7b 100644 --- a/src/service_account.rs +++ b/src/service_account.rs @@ -283,7 +283,7 @@ mod tests { use helper::service_account_key_from_file; use hyper; use hyper::net::HttpsConnector; - use hyper_rustls; + use hyper_native_tls::NativeTlsClient; use authenticator::GetToken; // This is a valid but deactivated key. @@ -294,7 +294,7 @@ mod tests { #[allow(dead_code)] fn test_service_account_e2e() { let key = service_account_key_from_file(&TEST_PRIVATE_KEY_PATH.to_string()).unwrap(); - let client = hyper::Client::with_connector(HttpsConnector::new(hyper_rustls::TlsClient::new())); + let client = hyper::Client::with_connector(HttpsConnector::new(NativeTlsClient::new().unwrap())); let mut acc = ServiceAccountAccess::new(key, client); println!("{:?}", acc.token(vec![&"https://www.googleapis.com/auth/pubsub"]).unwrap()); From 3163be984d9a926f54900dd16b6fa3af5dbdfc6e Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 25 Jul 2018 22:51:51 +0200 Subject: [PATCH 7/7] =?UTF-8?q?deps:=20rustls=20=E2=86=92=20openssl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Igor Gnatenko --- Cargo.toml | 2 +- src/lib.rs | 2 +- src/service_account.rs | 34 +++++++++++----------------------- 3 files changed, 13 insertions(+), 25 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ab446aa..e8d7b5f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -16,7 +16,7 @@ hyper = "0.10.2" hyper-native-tls = "0.2" itertools = "0.7" log = "0.3" -rustls = "0.9.0" +openssl = "0.10" serde = "1.0" serde_json = "1.0" serde_derive = "1.0" diff --git a/src/lib.rs b/src/lib.rs index c668199..d542e25 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -78,7 +78,7 @@ extern crate base64; extern crate chrono; extern crate hyper; extern crate hyper_native_tls; -extern crate rustls; +extern crate openssl; #[cfg(test)] extern crate log; diff --git a/src/service_account.rs b/src/service_account.rs index 3b71b7b..21f1286 100644 --- a/src/service_account.rs +++ b/src/service_account.rs @@ -14,7 +14,7 @@ use std::borrow::BorrowMut; use std::default::Default; use std::error; -use std::io::{self, Read}; +use std::io::Read; use std::result; use std::str; @@ -25,9 +25,10 @@ use types::{StringError, Token}; use hyper::header; use url::form_urlencoded; -use rustls::{self, PrivateKey}; -use rustls::sign::{self, Signer}; -use rustls::internal::pemfile; +use openssl::sign::Signer; +use openssl::hash::MessageDigest; +use openssl::pkey::{PKey, Private}; +use openssl::rsa::Padding; use base64; use chrono; @@ -42,21 +43,9 @@ fn encode_base64>(s: T) -> String { base64::encode_config(s.as_ref(), base64::URL_SAFE) } -fn decode_rsa_key(pem_pkcs8: &str) -> Result> { +fn decode_rsa_key(pem_pkcs8: &str) -> Result, Box> { let private = pem_pkcs8.to_string().replace("\\n", "\n").into_bytes(); - let mut private_reader: &[u8] = private.as_ref(); - let private_keys = pemfile::pkcs8_private_keys(&mut private_reader); - - if let Ok(pk) = private_keys { - if pk.len() > 0 { - Ok(pk[0].clone()) - } else { - Err(Box::new(io::Error::new(io::ErrorKind::InvalidInput, - "Not enough private keys in PEM"))) - } - } else { - Err(Box::new(io::Error::new(io::ErrorKind::InvalidInput, "Error reading key from PEM"))) - } + Ok(try!(PKey::private_key_from_pem(&private))) } /// JSON schema of secret service account key. You can obtain the key from @@ -115,11 +104,10 @@ impl JWT { fn sign(&self, private_key: &str) -> Result> { let mut jwt_head = self.encode_claims(); let key = try!(decode_rsa_key(private_key)); - let signer = try!(sign::RSASigner::new(&key) - .map_err(|_| io::Error::new(io::ErrorKind::Other, "Couldn't initialize signer"))); - let signature = try!(signer.sign(rustls::SignatureScheme::RSA_PKCS1_SHA256, - jwt_head.as_bytes()) - .map_err(|_| io::Error::new(io::ErrorKind::Other, "Couldn't sign claims"))); + let mut signer = try!(Signer::new(MessageDigest::sha256(), &key)); + try!(signer.set_rsa_padding(Padding::PKCS1)); + try!(signer.update(jwt_head.as_bytes())); + let signature = try!(signer.sign_to_vec()); let signature_b64 = encode_base64(signature); jwt_head.push_str(".");