diff --git a/crates/data-model/src/upstream_oauth2/provider.rs b/crates/data-model/src/upstream_oauth2/provider.rs index c54e40d15..be42cb5a5 100644 --- a/crates/data-model/src/upstream_oauth2/provider.rs +++ b/crates/data-model/src/upstream_oauth2/provider.rs @@ -289,7 +289,7 @@ pub struct UpstreamOAuthProvider { impl PartialOrd for UpstreamOAuthProvider { fn partial_cmp(&self, other: &Self) -> Option { - Some(self.id.cmp(&other.id)) + Some(self.cmp(other)) } } diff --git a/crates/handlers/src/graphql/model/oauth.rs b/crates/handlers/src/graphql/model/oauth.rs index 4f628e8bd..20a4d527f 100644 --- a/crates/handlers/src/graphql/model/oauth.rs +++ b/crates/handlers/src/graphql/model/oauth.rs @@ -8,8 +8,7 @@ use anyhow::Context as _; use async_graphql::{Context, Description, Enum, ID, Object}; use chrono::{DateTime, Utc}; use mas_storage::{oauth2::OAuth2ClientRepository, user::BrowserSessionRepository}; -use oauth2_types::{oidc::ApplicationType, scope::Scope}; -use ulid::Ulid; +use oauth2_types::oidc::ApplicationType; use url::Url; use super::{BrowserSession, NodeType, SessionState, User, UserAgent}; @@ -200,33 +199,3 @@ impl OAuth2Client { } } } - -/// An OAuth 2.0 consent represents the scope a user consented to grant to a -/// client. -#[derive(Description)] -pub struct OAuth2Consent { - scope: Scope, - client_id: Ulid, -} - -#[Object(use_type_description)] -impl OAuth2Consent { - /// Scope consented by the user for this client. - pub async fn scope(&self) -> String { - self.scope.to_string() - } - - /// OAuth 2.0 client for which the user granted access. - pub async fn client(&self, ctx: &Context<'_>) -> Result { - let state = ctx.state(); - let mut repo = state.repository().await?; - let client = repo - .oauth2_client() - .lookup(self.client_id) - .await? - .context("Could not load client")?; - repo.cancel().await?; - - Ok(OAuth2Client(client)) - } -} diff --git a/crates/i18n/src/sprintf/mod.rs b/crates/i18n/src/sprintf/mod.rs index 72ca75373..d58514f97 100644 --- a/crates/i18n/src/sprintf/mod.rs +++ b/crates/i18n/src/sprintf/mod.rs @@ -72,6 +72,7 @@ pub(crate) use sprintf; #[derive(Debug, thiserror::Error)] #[error(transparent)] +#[allow(dead_code)] enum Error { Format(#[from] self::formatter::FormatError), Parse(Box), diff --git a/crates/storage-pg/src/compat/mod.rs b/crates/storage-pg/src/compat/mod.rs index 32f26303f..2e903af77 100644 --- a/crates/storage-pg/src/compat/mod.rs +++ b/crates/storage-pg/src/compat/mod.rs @@ -697,7 +697,7 @@ mod tests { // List all logins let logins = repo.compat_sso_login().list(all, pagination).await.unwrap(); assert!(!logins.has_next_page); - assert_eq!(logins.edges, &[login.clone()]); + assert_eq!(logins.edges, vec![login.clone()]); // List the logins for the user let logins = repo @@ -706,7 +706,7 @@ mod tests { .await .unwrap(); assert!(!logins.has_next_page); - assert_eq!(logins.edges, &[login.clone()]); + assert_eq!(logins.edges, vec![login.clone()]); // List only the pending logins for the user let logins = repo diff --git a/crates/templates/src/lib.rs b/crates/templates/src/lib.rs index d588e12ea..1c0bef423 100644 --- a/crates/templates/src/lib.rs +++ b/crates/templates/src/lib.rs @@ -328,7 +328,7 @@ register_templates! { /// Render the Swagger API reference pub fn render_swagger(ApiDocContext) { "swagger/doc.html" } - /// Render the Swagger OAuth2 callback page + /// Render the Swagger OAuth callback page pub fn render_swagger_callback(ApiDocContext) { "swagger/oauth2-redirect.html" } /// Render the login page @@ -382,7 +382,7 @@ register_templates! { /// Render the account recovery disabled page pub fn render_recovery_disabled(WithLanguage) { "pages/recovery/disabled.html" } - /// Render the form used by the form_post response mode + /// Render the form used by the `form_post` response mode pub fn render_form_post(WithLanguage>) { "form_post.html" } /// Render the HTML error page diff --git a/docs/config.schema.json b/docs/config.schema.json index 6c4fadfcd..761f1dd62 100644 --- a/docs/config.schema.json +++ b/docs/config.schema.json @@ -2155,7 +2155,7 @@ "type": "boolean" }, "on_backchannel_logout": { - "description": "What to do when receiving an OIDC Backchannel logout request.\n\nDefaults to \"do_nothing\".", + "description": "What to do when receiving an OIDC Backchannel logout request.\n\nDefaults to `do_nothing`.", "allOf": [ { "$ref": "#/definitions/OnBackchannelLogout"