From 8776aa9a5b400f194b3d6eb57808eaf775e9fc5a Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 7 Dec 2019 13:42:23 -0500 Subject: bump oauth2 --- Cargo.lock | 41 +++++++++-------------------------------- teleterm/Cargo.toml | 2 +- teleterm/src/oauth.rs | 14 ++++++++------ 3 files changed, 18 insertions(+), 39 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index a701ef8..55faf49 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -86,16 +86,6 @@ dependencies = [ "libc", ] -[[package]] -name = "base64" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" -dependencies = [ - "byteorder", - "safemem", -] - [[package]] name = "base64" version = "0.10.1" @@ -635,7 +625,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6fdb60074c9b82c91f8702fa5351b85d22b668dae7f73bf06b44a09bc372380f" dependencies = [ "hashbrown", - "smallvec 0.6.13", + "smallvec", ] [[package]] @@ -1295,11 +1285,11 @@ dependencies = [ [[package]] name = "oauth2" -version = "3.0.0-alpha.4" +version = "3.0.0-alpha.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3f982c1bf94501cbc124343dd87490190169f0b1c9cfb4da9caa214876f4ad4" +checksum = "8ab0a07654b6139dbedd80b904f396313370caa0b397c5d3956dd67909f1b676" dependencies = [ - "base64 0.9.3", + "base64 0.10.1", "failure", "failure_derive", "futures", @@ -1307,10 +1297,9 @@ dependencies = [ "rand 0.6.5", "reqwest", "serde", - "serde_derive", "serde_json", "sha2", - "tokio-io", + "unicode-normalization", "url 2.1.0", ] @@ -1384,7 +1373,7 @@ dependencies = [ "libc", "redox_syscall", "rustc_version", - "smallvec 0.6.13", + "smallvec", "winapi 0.3.8", ] @@ -1850,12 +1839,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" -[[package]] -name = "safemem" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" - [[package]] name = "same-file" version = "1.0.5" @@ -2075,12 +2058,6 @@ dependencies = [ "maybe-uninit", ] -[[package]] -name = "smallvec" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ecf3b85f68e8abaa7555aa5abdb1153079387e60b718283d732f03897fcfc86" - [[package]] name = "snafu" version = "0.5.0" @@ -2725,11 +2702,11 @@ dependencies = [ [[package]] name = "unicode-normalization" -version = "0.1.11" +version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b561e267b2326bb4cebfc0ef9e68355c7abe6c6f522aeac2f5bf95d56c59bdcf" +checksum = "09c8070a9942f5e7cfccd93f490fdebd230ee3c3c9f107cb25bad5351ef671cf" dependencies = [ - "smallvec 1.0.0", + "smallvec", ] [[package]] diff --git a/teleterm/Cargo.toml b/teleterm/Cargo.toml index 381be01..bc2c020 100644 --- a/teleterm/Cargo.toml +++ b/teleterm/Cargo.toml @@ -31,7 +31,7 @@ lazy-static-include = "2" log = { version = "0.4", features = ["release_max_level_info"] } mio = "0.6.19" native-tls = "0.2" -oauth2 = "=3.0.0-alpha.4" # need the alpha for async support +oauth2 = { version = "=3.0.0-alpha.6", features = ["futures-01"] } # need the alpha for async support open = "1.1" rand = "0.7" ratelimit_meter = "5" diff --git a/teleterm/src/oauth.rs b/teleterm/src/oauth.rs index 894ba1d..ee914b4 100644 --- a/teleterm/src/oauth.rs +++ b/teleterm/src/oauth.rs @@ -37,7 +37,7 @@ pub trait Oauth { let fut = self .client() .exchange_code(oauth2::AuthorizationCode::new(code.to_string())) - .request_async(oauth2::reqwest::async_http_client) + .request_future(oauth2::reqwest::future_http_client) .map_err(|e| { let msg = stringify_oauth2_http_error(&e); Error::ExchangeCode { msg } @@ -59,7 +59,7 @@ pub trait Oauth { .exchange_refresh_token(&oauth2::RefreshToken::new( token.to_string(), )) - .request_async(oauth2::reqwest::async_http_client) + .request_future(oauth2::reqwest::future_http_client) .map_err(|e| { let msg = stringify_oauth2_http_error(&e); Error::ExchangeRefreshToken { msg } @@ -153,10 +153,12 @@ impl Config { oauth2::basic::BasicClient::new( oauth2::ClientId::new(self.client_id), Some(oauth2::ClientSecret::new(self.client_secret)), - oauth2::AuthUrl::new(self.auth_url), - Some(oauth2::TokenUrl::new(self.token_url)), + oauth2::AuthUrl::new(self.auth_url.to_string()).unwrap(), + Some(oauth2::TokenUrl::new(self.token_url.to_string()).unwrap()), + ) + .set_redirect_url( + oauth2::RedirectUrl::new(self.redirect_url.to_string()).unwrap(), ) - .set_redirect_url(oauth2::RedirectUrl::new(self.redirect_url)) } } @@ -164,7 +166,7 @@ impl Config { // stringification is pretty useless fn stringify_oauth2_http_error( e: &oauth2::RequestTokenError< - oauth2::reqwest::Error, + oauth2::reqwest::Error, oauth2::StandardErrorResponse, >, ) -> String { -- cgit v1.2.3-54-g00ecf