From 602275fcd0b946191c9d03e4ec64c3a9f0252ecc Mon Sep 17 00:00:00 2001 From: Matthew Scheirer Date: Tue, 30 Oct 2018 08:34:55 -0400 Subject: [PATCH] Update deps, release 0.1.0 --- Cargo.toml | 17 +++++++---------- src/lib.rs | 8 +++++--- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 2a5b6e4..4acef64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -2,7 +2,7 @@ name = "oidc" version = "0.1.0" license = "Apache-2.0" -description = "OpenID Connect client library using Reqwest" +description = "OpenID Connect client library using Reqwest, Biscuit, and inth-oauth2" readme = "README.md" authors = ["Matthew Scheirer "] categories = ["web-programming", "authentication"] @@ -10,17 +10,14 @@ keywords = ["sync", "authentication", "client", "reqwest", "oauth", "openid", "openid_connect", "web"] [dependencies] -base64 = "0.9" -biscuit = "0.0.8" +base64 = "0.10" +biscuit = "0.1" chrono = "0.4" -inth-oauth2 = "0.15" -reqwest = "0.8" +inth-oauth2 = "0.16" +reqwest = { version = "0.9", features = ["hyper-011"] } serde = "1" serde_derive = "1" serde_json = "1" url_serde = "0.2" -validator = "0.7" -validator_derive = "0.7" - -[patch.crates-io] -biscuit = { git = "https://github.com/Korvox/biscuit" } +validator = "0.8" +validator_derive = "0.8" diff --git a/src/lib.rs b/src/lib.rs index b499462..e4279b2 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -91,7 +91,7 @@ use biscuit::jwk::{AlgorithmParameters, JWKSet}; use biscuit::jws::{Compact, Secret}; use chrono::{Duration, NaiveDate, Utc}; use inth_oauth2::token::Token as _t; -use reqwest::{header, Url}; +use reqwest::Url; use validator::Validate; use discovery::{Config, Discovered}; @@ -275,7 +275,7 @@ impl Client { SignatureAlgorithm::RS256 | SignatureAlgorithm::RS384 | SignatureAlgorithm::RS512 => { - let pkcs = Secret::Pkcs { + let pkcs = Secret::RSAModulusExponent { n: params.n.clone(), e: params.e.clone(), }; @@ -402,7 +402,9 @@ impl Client { let claims = token.id_token.payload()?; let auth_code = token.access_token().to_string(); let mut resp = client.get(url.clone()) - .header(header::Authorization(header::Bearer { token: auth_code })) + // FIXME This is a transitional hack for Reqwest 0.9 that should be refactored + // when upstream restores typed header support. + .header_011(reqwest::hyper_011::header::Authorization(reqwest::hyper_011::header::Bearer { token: auth_code })) .send()?; let info: Userinfo = resp.json()?; if claims.sub != info.sub {