From 08cd3fa100313440fc7d336c92e332aea1bc7a11 Mon Sep 17 00:00:00 2001 From: Trezy Date: Tue, 15 Sep 2026 14:36:05 -0500 Subject: [PATCH] chore: remove unreachable scope format check in consent Signed-off-by: Trezy --- .../src/endpoints/authorize/consent.rs | 8 -------- .../tranquil-oauth-server/src/endpoints/authorize/mod.rs | 7 ------- 2 files changed, 15 deletions(-) diff --git a/crates/tranquil-oauth-server/src/endpoints/authorize/consent.rs b/crates/tranquil-oauth-server/src/endpoints/authorize/consent.rs index 0eb66d4..0f6a11c 100644 --- a/crates/tranquil-oauth-server/src/endpoints/authorize/consent.rs +++ b/crates/tranquil-oauth-server/src/endpoints/authorize/consent.rs @@ -529,14 +529,6 @@ pub async fn consent_post( ); } let approved_scope_str = final_approved.join(" "); - let has_valid_scope = final_approved.iter().all(|s| is_valid_scope(s)); - if !has_valid_scope { - return json_error( - StatusCode::BAD_REQUEST, - "invalid_request", - "Invalid scope format", - ); - } if form.remember { let preferences: Vec = presented_items .iter() diff --git a/crates/tranquil-oauth-server/src/endpoints/authorize/mod.rs b/crates/tranquil-oauth-server/src/endpoints/authorize/mod.rs index e915240..0d50292 100644 --- a/crates/tranquil-oauth-server/src/endpoints/authorize/mod.rs +++ b/crates/tranquil-oauth-server/src/endpoints/authorize/mod.rs @@ -77,13 +77,6 @@ fn is_granular_scope(s: &str) -> bool { || s.starts_with("identity:") } -fn is_valid_scope(s: &str) -> bool { - !matches!( - tranquil_pds::oauth::scopes::parse_scope(s), - tranquil_pds::oauth::scopes::ParsedScope::Unknown(_) - ) -} - fn extract_device_cookie(headers: &HeaderMap) -> Option { headers .get("cookie")