Skip to content

Commit

Permalink
release 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
kilork committed Mar 30, 2023
1 parent c48e29e commit cfa9559
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openid"
version = "0.11.1"
version = "0.12.0"
authors = ["Alexander Korolev <alexander.korolev.germany@gmail.com>"]
edition = "2021"
categories = ["authentication"]
Expand All @@ -24,10 +24,10 @@ rustls = ["reqwest/rustls-tls"]
[dependencies]
lazy_static = "1.4"
serde_json = { version = "1", default-features = false }
base64 = "0.13"
base64 = "0.21"
biscuit = "0.6"
thiserror = "1"
validator = { version = "0.15", features = ["derive"] }
validator = { version = "0.16", features = ["derive"] }
mime = "0.3"

[dependencies.url]
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ Add dependency to Cargo.toml:

```toml
[dependencies]
openid = "0.11"
openid = "0.12"
```

By default it uses native tls, if you want to use `rustls`:

```toml
[dependencies]
openid = { version = "0.11", default-features = false, features = ["rustls"] }
openid = { version = "0.12", default-features = false, features = ["rustls"] }
```

### Use case: [Warp](https://crates.io/crates/warp) web server with [JHipster](https://www.jhipster.tech/) generated frontend and [Google OpenID Connect](https://developers.google.com/identity/protocols/OpenIDConnect)
Expand All @@ -49,7 +49,7 @@ edition = "2021"
anyhow = "1.0"
cookie = "0.14"
log = "0.4"
openid = "0.11"
openid = "0.12"
pretty_env_logger = "0.4"
reqwest = "0.11"
serde = { version = "1", features = [ "derive" ] }
Expand Down
5 changes: 3 additions & 2 deletions src/claims.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use crate::Userinfo;
use base64::{engine::general_purpose::URL_SAFE, Engine as _};
use biscuit::SingleOrMultiple;
use url::Url;

Expand Down Expand Up @@ -38,14 +39,14 @@ pub trait Claims {
///
/// The returned Vec is the first 128 bits of the access token hash using alg's hash alg
fn at_hash_to_vec(&self) -> Option<Vec<u8>> {
base64::decode_config(self.at_hash()?, base64::URL_SAFE).ok()
URL_SAFE.decode(self.at_hash()?).ok()
}
/// Decodes c_hash. Returns None if it doesn't exist or something goes wrong.
///
/// See [spec 3.3.2.11](https://openid.net/specs/openid-connect-core-1_0.html#HybridIDToken)
///
/// The returned Vec is the first 128 bits of the code hash using alg's hash alg
fn c_hash_to_vec(&self) -> Option<Vec<u8>> {
base64::decode_config(self.c_hash()?, base64::URL_SAFE).ok()
URL_SAFE.decode(self.c_hash()?).ok()
}
}
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ Add dependency to Cargo.toml:
```toml
[dependencies]
openid = "0.11"
openid = "0.12"
```
By default it uses native tls, if you want to use `rustls`:
```toml
[dependencies]
openid = { version = "0.11", default-features = false, features = ["rustls"] }
openid = { version = "0.12", default-features = false, features = ["rustls"] }
```
### Use case: [Warp](https://crates.io/crates/warp) web server with [JHipster](https://www.jhipster.tech/) generated frontend and [Google OpenID Connect](https://developers.google.com/identity/protocols/OpenIDConnect)
Expand All @@ -50,9 +50,9 @@ edition = "2021"
anyhow = "1.0"
cookie = "0.14"
log = "0.4"
openid = "0.11"
openid = "0.12"
pretty_env_logger = "0.4"
reqwest = "0.11"
reqwest = "0.12"
serde = { version = "1", features = [ "derive" ] }
tokio = { version = "1", features = [ "full" ] }
uuid = { version = "0.8", features = [ "v4" ] }
Expand Down

0 comments on commit cfa9559

Please sign in to comment.