Skip to content

Commit

Permalink
Bump version to 3.3.0 and MSRV to 1.65
Browse files Browse the repository at this point in the history
This also addresses clippy lints reported in 1.65.
  • Loading branch information
ramosbugs committed Jun 27, 2023
1 parent ed641f6 commit e9b1c53
Show file tree
Hide file tree
Showing 15 changed files with 43 additions and 41 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fail-fast: false
matrix:
rust_os:
- { rust: 1.57.0, os: ubuntu-22.04 }
- { rust: 1.65.0, os: ubuntu-22.04 }
- { rust: stable, os: ubuntu-22.04 }
- { rust: beta, os: ubuntu-22.04 }
- { rust: nightly, os: ubuntu-22.04 }
Expand All @@ -52,12 +52,12 @@ jobs:
components: clippy, rustfmt
target: wasm32-unknown-unknown

# Newer dependency versions may not support rustc 1.57, so we use a Cargo.lock file for those
# Newer dependency versions may not support rustc 1.65, so we use a Cargo.lock file for those
# builds.
- name: Use Rust 1.57 lockfile
if: ${{ matrix.rust_os.rust == '1.57.0' }}
- name: Use Rust 1.65 lockfile
if: ${{ matrix.rust_os.rust == '1.65.0' }}
run: |
cp Cargo-1.57.lock Cargo.lock
cp Cargo-1.65.lock Cargo.lock
echo "CARGO_LOCKED=--locked" >> $GITHUB_ENV
- name: Run tests
Expand All @@ -68,11 +68,11 @@ jobs:
run: cargo ${CARGO_LOCKED} test --all-features

- name: Check fmt
if: ${{ matrix.rust_os.rust == '1.57.0' }}
if: ${{ matrix.rust_os.rust == '1.65.0' }}
run: cargo ${CARGO_LOCKED} fmt --all -- --check

- name: Clippy
if: ${{ matrix.rust_os.rust == '1.57.0' }}
if: ${{ matrix.rust_os.rust == '1.65.0' }}
run: cargo ${CARGO_LOCKED} clippy --all --all-features -- --deny warnings

- name: Audit
Expand All @@ -90,7 +90,7 @@ jobs:
coverage:
runs-on: ubuntu-latest
container:
image: xd009642/tarpaulin:0.21.0
image: xd009642/tarpaulin:0.26.0
options: --security-opt seccomp=unconfined
steps:
- uses: actions/checkout@v2
Expand Down
2 changes: 1 addition & 1 deletion Cargo-1.57.lock → Cargo-1.65.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,7 @@ checksum = "86f0b0d4bf799edbc74508c1e8bf170ff5f41238e5f8225603ca7caaae2b7860"

[[package]]
name = "openidconnect"
version = "3.2.1"
version = "3.3.0"
dependencies = [
"anyhow",
"base64",
Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[package]
name = "openidconnect"
version = "3.2.1"
version = "3.3.0"
authors = ["David A. Ramos <[email protected]>"]
description = "OpenID Connect library"
license = "MIT"
repository = "https://github.com/ramosbugs/openidconnect-rs"
edition = "2021"
readme = "README.md"
rust-version = "1.65"

[package.metadata.docs.rs]
all-features = true
Expand Down
9 changes: 6 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,17 @@ API documentation and examples are available on [docs.rs](https://docs.rs/openid

## Minimum Supported Rust Version (MSRV)

The MSRV for *3.0.y to 3.1.y* releases of this crate is Rust **1.57**.
The MSRV for *3.3* and newer releases of this crate is Rust **1.65**.

The MSRV for *2.x.y* releases of this crate is Rust 1.45.
The MSRV for *3.0* to *3.2* releases of this crate is Rust **1.57**.

The MSRV for *2.x* releases of this crate is Rust 1.45.

Since the 3.0.0 release, this crate maintains a policy of supporting
Rust releases going back at least 6 months. Changes that break compatibility with Rust releases
older than 6 months will no longer be considered SemVer breaking changes and will not result in a
new major version number for this crate.
new major version number for this crate. MSRV changes will coincide with minor version updates
and will not happen in patch releases.

## Standards

Expand Down
4 changes: 1 addition & 3 deletions examples/okta_device_grant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,7 @@ fn main() -> Result<(), anyhow::Error> {
env::var("CLIENT_SECRET").expect("Missing the CLIENT_SECRET environment variable."),
);
let issuer_url = IssuerUrl::new(
env::var("ISSUER_URL")
.expect("Missing the ISSUER_URL environment variable.")
.to_string(),
env::var("ISSUER_URL").expect("Missing the ISSUER_URL environment variable."),
)
.expect("Invalid issuer URL");

Expand Down
6 changes: 3 additions & 3 deletions src/claims.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ pub trait AdditionalClaims: Debug + DeserializeOwned + Serialize + 'static {}
///
/// No additional claims.
///
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Eq, Serialize)]
// In order to support serde flatten, this must be an empty struct rather than an empty
// tuple struct.
pub struct EmptyAdditionalClaims {}
Expand All @@ -35,7 +35,7 @@ impl AdditionalClaims for EmptyAdditionalClaims {}
///
/// Address claims.
///
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Eq, Serialize)]
pub struct AddressClaim {
///
/// Full mailing address, formatted for display or use on a mailing label.
Expand Down Expand Up @@ -86,7 +86,7 @@ pub trait GenderClaim: Clone + Debug + DeserializeOwned + Serialize + 'static {}
///
/// Standard Claims defined by OpenID Connect Core.
///
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct StandardClaims<GC>
where
GC: GenderClaim,
Expand Down
8 changes: 4 additions & 4 deletions src/core/jwk.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use super::{crypto, CoreJwsSigningAlgorithm};
///
/// Public or symmetric key expressed as a JSON Web Key.
///
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
pub struct CoreJsonWebKey {
pub(crate) kty: CoreJsonWebKeyType,
#[serde(rename = "use", skip_serializing_if = "Option::is_none")]
Expand Down Expand Up @@ -544,7 +544,7 @@ impl
///
/// Type of JSON Web Key.
///
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
#[non_exhaustive]
pub enum CoreJsonWebKeyType {
///
Expand All @@ -570,7 +570,7 @@ impl JsonWebKeyType for CoreJsonWebKeyType {}
///
/// Type of EC-Curve
///
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
#[non_exhaustive]
pub enum CoreJsonCurveType {
///
Expand All @@ -594,7 +594,7 @@ impl JsonCurveType for CoreJsonWebKeyType {}
///
/// Usage restriction for a JSON Web key.
///
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum CoreJsonWebKeyUse {
///
Expand Down
4 changes: 2 additions & 2 deletions src/discovery.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub trait AdditionalProviderMetadata: Clone + Debug + DeserializeOwned + Seriali
///
/// Empty (default) extra [`ProviderMetadata`] fields.
///
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Eq, Serialize)]
pub struct EmptyAdditionalProviderMetadata {}
impl AdditionalProviderMetadata for EmptyAdditionalProviderMetadata {}

Expand All @@ -41,7 +41,7 @@ impl AdditionalProviderMetadata for EmptyAdditionalProviderMetadata {}
///
#[serde_as]
#[skip_serializing_none]
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
#[allow(clippy::type_complexity)]
pub struct ProviderMetadata<A, AD, CA, CN, CT, G, JE, JK, JS, JT, JU, K, RM, RT, S>
where
Expand Down
2 changes: 1 addition & 1 deletion src/id_token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ where
JT: JsonWebKeyType,
{
fn to_string(&self) -> String {
serde_json::to_value(&self)
serde_json::to_value(self)
// This should never arise, since we're just asking serde_json to serialize the
// signing input concatenated with the signature, both of which are precomputed.
.expect("ID token serialization failed")
Expand Down
8 changes: 4 additions & 4 deletions src/jwt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ new_type![
JsonWebTokenType(String)
];

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum JsonWebTokenAlgorithm<JE, JS, JT>
where
Expand Down Expand Up @@ -95,7 +95,7 @@ where
}
}

#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
pub struct JsonWebTokenHeader<JE, JS, JT>
where
JE: JweContentEncryptionAlgorithm<JT>,
Expand Down Expand Up @@ -133,7 +133,7 @@ where
fn serialize(payload: &P) -> Result<String, serde_json::Error>;
}

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct JsonWebTokenJsonPayloadSerde;
impl<P> JsonWebTokenPayloadSerde<P> for JsonWebTokenJsonPayloadSerde
where
Expand Down Expand Up @@ -192,7 +192,7 @@ pub enum JsonWebTokenError {
SigningError(#[source] SigningError),
}

#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct JsonWebToken<JE, JS, JT, P, S>
where
JE: JweContentEncryptionAlgorithm<JT>,
Expand Down
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -689,7 +689,7 @@ const OPENID_SCOPE: &str = "openid";
/// Authentication flow, which determines how the Authorization Server returns the OpenID Connect
/// ID token and OAuth2 access token to the Relying Party.
///
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
#[non_exhaustive]
pub enum AuthenticationFlow<RT: ResponseType> {
///
Expand Down Expand Up @@ -1693,7 +1693,7 @@ mod tests {
);

let (authorize_url, _, _) = client
.authorize_url(flow.clone(), new_csrf, new_nonce)
.authorize_url(flow, new_csrf, new_nonce)
.add_scopes(vec![
Scope::new("email".to_string()),
Scope::new("profile".to_string()),
Expand Down
2 changes: 1 addition & 1 deletion src/logout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ use crate::{
///
#[non_exhaustive]
#[skip_serializing_none]
#[derive(Clone, Debug, PartialEq, Deserialize, Serialize)]
#[derive(Clone, Debug, PartialEq, Eq, Deserialize, Serialize)]
pub struct LogoutProviderMetadata<A>
where
A: AdditionalProviderMetadata,
Expand Down
4 changes: 2 additions & 2 deletions src/registration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub trait AdditionalClientMetadata: Debug + DeserializeOwned + Serialize {}
///
/// Empty (default) extra [`ClientMetadata`] fields.
///
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Eq, Serialize)]
pub struct EmptyAdditionalClientMetadata {}
impl AdditionalClientMetadata for EmptyAdditionalClientMetadata {}

Expand Down Expand Up @@ -661,7 +661,7 @@ pub trait AdditionalClientRegistrationResponse: Debug + DeserializeOwned + Seria
///
/// Empty (default) extra [`ClientRegistrationResponse`] fields.
///
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Default, Deserialize, PartialEq, Eq, Serialize)]
pub struct EmptyAdditionalClientRegistrationResponse {}
impl AdditionalClientRegistrationResponse for EmptyAdditionalClientRegistrationResponse {}

Expand Down
8 changes: 4 additions & 4 deletions src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ use super::{
/// This structure associates one more `Option<LanguageTag>` locales with the corresponding
/// claims values.
///
#[derive(Clone, Debug, PartialEq)]
#[derive(Clone, Debug, PartialEq, Eq)]
pub struct LocalizedClaim<T>(HashMap<LanguageTag, T>, Option<T>);
impl<T> LocalizedClaim<T> {
///
Expand Down Expand Up @@ -194,7 +194,7 @@ pub trait GrantType: Debug + DeserializeOwned + Serialize + 'static {}
///
/// Error signing a message.
///
#[derive(Clone, Debug, Error, PartialEq)]
#[derive(Clone, Debug, Error, PartialEq, Eq)]
#[non_exhaustive]
pub enum SigningError {
/// Failed to sign the message using the given key and parameters.
Expand Down Expand Up @@ -719,7 +719,7 @@ new_type![
/// JSON Web Key Set.
///
#[serde_as]
#[derive(Debug, Deserialize, PartialEq, Serialize)]
#[derive(Debug, Deserialize, PartialEq, Eq, Serialize)]
pub struct JsonWebKeySet<JS, JT, JU, K>
where
JS: JwsSigningAlgorithm<JT>,
Expand Down Expand Up @@ -1005,7 +1005,7 @@ new_url_type![
/// http://openid.net/specs/oauth-v2-multiple-response-types-1_0.html#ResponseTypesAndModes)
/// for further details.
///
#[derive(Clone, Debug, Deserialize, PartialEq, Serialize)]
#[derive(Clone, Debug, Deserialize, PartialEq, Eq, Serialize)]
pub struct ResponseTypes<RT: ResponseType>(
#[serde(
deserialize_with = "deserialize_space_delimited_vec",
Expand Down
4 changes: 2 additions & 2 deletions src/verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ pub(crate) trait IssuerClaim {
///
/// Error verifying claims.
///
#[derive(Clone, Debug, Error, PartialEq)]
#[derive(Clone, Debug, Error, PartialEq, Eq)]
#[non_exhaustive]
pub enum ClaimsVerificationError {
/// Claims have expired.
Expand Down Expand Up @@ -71,7 +71,7 @@ pub enum ClaimsVerificationError {
///
/// Error verifying claims signature.
///
#[derive(Clone, Debug, Error, PartialEq)]
#[derive(Clone, Debug, Error, PartialEq, Eq)]
#[non_exhaustive]
pub enum SignatureVerificationError {
/// More than one key matches the supplied key constraints (e.g., key ID).
Expand Down

0 comments on commit e9b1c53

Please sign in to comment.