Update deps, release 0.1.0
This commit is contained in:
parent
e25c1b5b34
commit
602275fcd0
17
Cargo.toml
17
Cargo.toml
|
@ -2,7 +2,7 @@
|
||||||
name = "oidc"
|
name = "oidc"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
license = "Apache-2.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"
|
readme = "README.md"
|
||||||
authors = ["Matthew Scheirer <matt.scheirer@gmail.com>"]
|
authors = ["Matthew Scheirer <matt.scheirer@gmail.com>"]
|
||||||
categories = ["web-programming", "authentication"]
|
categories = ["web-programming", "authentication"]
|
||||||
|
@ -10,17 +10,14 @@ keywords = ["sync", "authentication", "client", "reqwest",
|
||||||
"oauth", "openid", "openid_connect", "web"]
|
"oauth", "openid", "openid_connect", "web"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
base64 = "0.9"
|
base64 = "0.10"
|
||||||
biscuit = "0.0.8"
|
biscuit = "0.1"
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
inth-oauth2 = "0.15"
|
inth-oauth2 = "0.16"
|
||||||
reqwest = "0.8"
|
reqwest = { version = "0.9", features = ["hyper-011"] }
|
||||||
serde = "1"
|
serde = "1"
|
||||||
serde_derive = "1"
|
serde_derive = "1"
|
||||||
serde_json = "1"
|
serde_json = "1"
|
||||||
url_serde = "0.2"
|
url_serde = "0.2"
|
||||||
validator = "0.7"
|
validator = "0.8"
|
||||||
validator_derive = "0.7"
|
validator_derive = "0.8"
|
||||||
|
|
||||||
[patch.crates-io]
|
|
||||||
biscuit = { git = "https://github.com/Korvox/biscuit" }
|
|
||||||
|
|
|
@ -91,7 +91,7 @@ use biscuit::jwk::{AlgorithmParameters, JWKSet};
|
||||||
use biscuit::jws::{Compact, Secret};
|
use biscuit::jws::{Compact, Secret};
|
||||||
use chrono::{Duration, NaiveDate, Utc};
|
use chrono::{Duration, NaiveDate, Utc};
|
||||||
use inth_oauth2::token::Token as _t;
|
use inth_oauth2::token::Token as _t;
|
||||||
use reqwest::{header, Url};
|
use reqwest::Url;
|
||||||
use validator::Validate;
|
use validator::Validate;
|
||||||
|
|
||||||
use discovery::{Config, Discovered};
|
use discovery::{Config, Discovered};
|
||||||
|
@ -275,7 +275,7 @@ impl Client {
|
||||||
SignatureAlgorithm::RS256 |
|
SignatureAlgorithm::RS256 |
|
||||||
SignatureAlgorithm::RS384 |
|
SignatureAlgorithm::RS384 |
|
||||||
SignatureAlgorithm::RS512 => {
|
SignatureAlgorithm::RS512 => {
|
||||||
let pkcs = Secret::Pkcs {
|
let pkcs = Secret::RSAModulusExponent {
|
||||||
n: params.n.clone(),
|
n: params.n.clone(),
|
||||||
e: params.e.clone(),
|
e: params.e.clone(),
|
||||||
};
|
};
|
||||||
|
@ -402,7 +402,9 @@ impl Client {
|
||||||
let claims = token.id_token.payload()?;
|
let claims = token.id_token.payload()?;
|
||||||
let auth_code = token.access_token().to_string();
|
let auth_code = token.access_token().to_string();
|
||||||
let mut resp = client.get(url.clone())
|
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()?;
|
.send()?;
|
||||||
let info: Userinfo = resp.json()?;
|
let info: Userinfo = resp.json()?;
|
||||||
if claims.sub != info.sub {
|
if claims.sub != info.sub {
|
||||||
|
|
Loading…
Reference in New Issue