From efa6af32943138f35b139f2331fe9a6d10902351 Mon Sep 17 00:00:00 2001 From: Quentin Gliech Date: Fri, 8 Dec 2023 16:18:09 +0100 Subject: [PATCH] Run generated files updates, fix doc links & fmt --- crates/handlers/src/oauth2/token.rs | 8 +++++--- crates/storage/src/oauth2/device_code_grant.rs | 8 ++++---- translations/en.json | 8 ++++---- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/crates/handlers/src/oauth2/token.rs b/crates/handlers/src/oauth2/token.rs index 879964b4..fc9b68ca 100644 --- a/crates/handlers/src/oauth2/token.rs +++ b/crates/handlers/src/oauth2/token.rs @@ -686,7 +686,8 @@ async fn device_code_grant( let mut params = AccessTokenResponse::new(access_token.access_token.clone()).with_expires_in(ttl); - // If the client uses the refresh token grant type, we also generate a refresh token + // If the client uses the refresh token grant type, we also generate a refresh + // token if client.grant_types.contains(&GrantType::RefreshToken) { let refresh_token_str = TokenType::RefreshToken.generate(rng); @@ -1263,8 +1264,9 @@ mod tests { let ClientError { error, .. } = response.json(); assert_eq!(error, ClientErrorCode::AuthorizationPending); - // Let's provision a user and create a browser session for them. This part is hard to - // test with just HTTP requests, so we'll use the repository directly. + // Let's provision a user and create a browser session for them. This part is + // hard to test with just HTTP requests, so we'll use the repository + // directly. let mut repo = state.repository().await.unwrap(); let user = repo diff --git a/crates/storage/src/oauth2/device_code_grant.rs b/crates/storage/src/oauth2/device_code_grant.rs index 9b432ef2..4f8678a1 100644 --- a/crates/storage/src/oauth2/device_code_grant.rs +++ b/crates/storage/src/oauth2/device_code_grant.rs @@ -55,7 +55,7 @@ pub trait OAuth2DeviceCodeGrantRepository: Send + Sync { /// * `rng`: A random number generator /// * `clock`: The clock used to generate timestamps /// * `params`: The parameters used to create the device code grant. See the - /// fields of [`DeviceCodeGrantParams`] + /// fields of [`OAuth2DeviceCodeGrantParams`] /// /// # Errors /// @@ -128,7 +128,7 @@ pub trait OAuth2DeviceCodeGrantRepository: Send + Sync { /// Returns [`Self::Error`] if the underlying repository fails or if the /// device code grant is not in the [`Pending`] state /// - /// [`Pending`]: DeviceCodeGrantState::Pending + /// [`Pending`]: mas_data_model::DeviceCodeGrantState::Pending async fn fulfill( &mut self, clock: &dyn Clock, @@ -152,7 +152,7 @@ pub trait OAuth2DeviceCodeGrantRepository: Send + Sync { /// Returns [`Self::Error`] if the underlying repository fails or if the /// device code grant is not in the [`Pending`] state /// - /// [`Pending`]: DeviceCodeGrantState::Pending + /// [`Pending`]: mas_data_model::DeviceCodeGrantState::Pending async fn reject( &mut self, clock: &dyn Clock, @@ -176,7 +176,7 @@ pub trait OAuth2DeviceCodeGrantRepository: Send + Sync { /// Returns [`Self::Error`] if the underlying repository fails or if the /// device code grant is not in the [`Fulfilled`] state /// - /// [`Fulfilled`]: DeviceCodeGrantState::Fulfilled + /// [`Fulfilled`]: mas_data_model::DeviceCodeGrantState::Fulfilled async fn exchange( &mut self, clock: &dyn Clock, diff --git a/translations/en.json b/translations/en.json index 482696c7..9fbe6476 100644 --- a/translations/en.json +++ b/translations/en.json @@ -2,11 +2,11 @@ "action": { "cancel": "Cancel", "@cancel": { - "context": "pages/consent.html:72:11-29, pages/login.html:100:13-31, pages/policy_violation.html:50:11-29, pages/register.html:64:13-31" + "context": "pages/consent.html:72:11-29, pages/device_consent.html:76:13-31, pages/login.html:100:13-31, pages/policy_violation.html:50:11-29, pages/register.html:64:13-31" }, "continue": "Continue", "@continue": { - "context": "pages/account/emails/add.html:45:26-46, pages/account/emails/verify.html:60:26-46, pages/consent.html:60:28-48, pages/login.html:62:30-50, pages/reauth.html:40:28-48, pages/register.html:59:28-48, pages/sso.html:45:28-48" + "context": "pages/account/emails/add.html:45:26-46, pages/account/emails/verify.html:60:26-46, pages/consent.html:60:28-48, pages/device_consent.html:73:13-33, pages/device_link.html:50:26-46, pages/login.html:62:30-50, pages/reauth.html:40:28-48, pages/register.html:59:28-48, pages/sso.html:45:28-48" }, "create_account": "Create Account", "@create_account": { @@ -18,7 +18,7 @@ }, "sign_out": "Sign out", "@sign_out": { - "context": "pages/consent.html:68:28-48, pages/index.html:36:28-48, pages/policy_violation.html:46:28-48, pages/sso.html:53:28-48, pages/upstream_oauth2/link_mismatch.html:32:24-44, pages/upstream_oauth2/suggest_link.html:40:26-46" + "context": "pages/consent.html:68:28-48, pages/device_consent.html:85:30-50, pages/index.html:36:28-48, pages/policy_violation.html:46:28-48, pages/sso.html:53:28-48, pages/upstream_oauth2/link_mismatch.html:32:24-44, pages/upstream_oauth2/suggest_link.html:40:26-46" } }, "app": { @@ -246,7 +246,7 @@ }, "not_you": "Not %(username)s?", "@not_you": { - "context": "pages/consent.html:65:11-67, pages/sso.html:50:11-67", + "context": "pages/consent.html:65:11-67, pages/device_consent.html:82:13-69, pages/sso.html:50:11-67", "description": "Suggestions for the user to log in as a different user" }, "or_separator": "Or",