From db25574a969cdb209eaf6c6758e09fd8943c334c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Commaille?= Date: Wed, 30 Nov 2022 12:42:43 +0100 Subject: [PATCH] Make sure Scope and InvalidScope are reexported from mas-oidc-client --- crates/oauth2-types/src/oidc.rs | 17 ++++++++++++----- crates/oauth2-types/src/requests.rs | 3 ++- crates/oauth2-types/src/scope.rs | 4 +++- crates/oidc-client/src/types/scope.rs | 3 ++- 4 files changed, 19 insertions(+), 8 deletions(-) diff --git a/crates/oauth2-types/src/oidc.rs b/crates/oauth2-types/src/oidc.rs index e73fa712..002acd91 100644 --- a/crates/oauth2-types/src/oidc.rs +++ b/crates/oauth2-types/src/oidc.rs @@ -126,7 +126,9 @@ pub enum ApplicationType { /// Subject Identifier types. /// -/// A Subject Identifier is a locally unique and never reassigned identifier within the Issuer for the End-User, which is intended to be consumed by the Client. +/// A Subject Identifier is a locally unique and never reassigned identifier +/// within the Issuer for the End-User, which is intended to be consumed by the +/// Client. #[derive( SerializeDisplay, DeserializeFromStr, Clone, Copy, PartialEq, Eq, Hash, Debug, Display, FromStr, )] @@ -135,7 +137,9 @@ pub enum SubjectType { /// This provides the same `sub` (subject) value to all Clients. Public, - /// This provides a different `sub` value to each Client, so as not to enable Clients to correlate the End-User's activities without permission. + /// This provides a different `sub` value to each Client, so as not to + /// enable Clients to correlate the End-User's activities without + /// permission. Pairwise, } @@ -148,10 +152,12 @@ pub enum ClaimType { /// Claims that are directly asserted by the OpenID Provider. Normal, - /// Claims that are asserted by a Claims Provider other than the OpenID Provider but are returned by OpenID Provider. + /// Claims that are asserted by a Claims Provider other than the OpenID + /// Provider but are returned by OpenID Provider. Aggregated, - /// Claims that are asserted by a Claims Provider other than the OpenID Provider but are returned as references by the OpenID Provider. + /// Claims that are asserted by a Claims Provider other than the OpenID + /// Provider but are returned as references by the OpenID Provider. Distributed, } @@ -163,7 +169,8 @@ pub static DEFAULT_RESPONSE_MODES_SUPPORTED: &[ResponseMode] = pub static DEFAULT_GRANT_TYPES_SUPPORTED: &[GrantType] = &[GrantType::AuthorizationCode, GrantType::Implicit]; -/// The default value of `token_endpoint_auth_methods_supported` if it is not set. +/// The default value of `token_endpoint_auth_methods_supported` if it is not +/// set. pub static DEFAULT_AUTH_METHODS_SUPPORTED: &[OAuthClientAuthenticationMethod] = &[OAuthClientAuthenticationMethod::ClientSecretBasic]; diff --git a/crates/oauth2-types/src/requests.rs b/crates/oauth2-types/src/requests.rs index faa2b65d..08495de8 100644 --- a/crates/oauth2-types/src/requests.rs +++ b/crates/oauth2-types/src/requests.rs @@ -352,7 +352,8 @@ pub struct DeviceAuthorizationRequest { pub scope: Option, } -/// The default value of the `interval` between polling requests, if it is not set. +/// The default value of the `interval` between polling requests, if it is not +/// set. pub const DEFAULT_DEVICE_AUTHORIZATION_INTERVAL_SECONDS: i64 = 5; /// A successful response from the [Device Authorization Endpoint]. diff --git a/crates/oauth2-types/src/scope.rs b/crates/oauth2-types/src/scope.rs index 232920b2..f4c4a631 100644 --- a/crates/oauth2-types/src/scope.rs +++ b/crates/oauth2-types/src/scope.rs @@ -69,7 +69,9 @@ pub const PHONE: ScopeToken = ScopeToken::from_static("phone"); /// `offline_access`. /// -/// Requests that an OAuth 2.0 Refresh Token be issued that can be used to obtain an Access Token that grants access to the End-User's Userinfo Endpoint even when the End-User is not present (not logged in). +/// Requests that an OAuth 2.0 Refresh Token be issued that can be used to +/// obtain an Access Token that grants access to the End-User's Userinfo +/// Endpoint even when the End-User is not present (not logged in). pub const OFFLINE_ACCESS: ScopeToken = ScopeToken::from_static("offline_access"); // As per RFC6749 appendix A: diff --git a/crates/oidc-client/src/types/scope.rs b/crates/oidc-client/src/types/scope.rs index 7681bff6..729da31f 100644 --- a/crates/oidc-client/src/types/scope.rs +++ b/crates/oidc-client/src/types/scope.rs @@ -16,7 +16,8 @@ use std::{fmt, str::FromStr}; -use oauth2_types::scope::{InvalidScope, Scope, ScopeToken as StrScopeToken}; +use oauth2_types::scope::ScopeToken as StrScopeToken; +pub use oauth2_types::scope::{InvalidScope, Scope}; use crate::PrivString;