From e6fbd189d67daf33b5498b6c0c8bd10eae3805df Mon Sep 17 00:00:00 2001 From: Maurus Decimus <11444311+mdecimus@users.noreply.github.com> Date: Sat, 18 Apr 2026 08:15:54 +0200 Subject: [PATCH] Allow HTTP OAuth in recovery mode --- crates/http/src/auth/oauth/auth.rs | 8 +++++--- crates/store/src/build/lookup.rs | 8 ++++---- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/crates/http/src/auth/oauth/auth.rs b/crates/http/src/auth/oauth/auth.rs index 7cf6c77e..9e8d5f27 100644 --- a/crates/http/src/auth/oauth/auth.rs +++ b/crates/http/src/auth/oauth/auth.rs @@ -170,9 +170,11 @@ impl OAuthApiHandler for Server { .is_some_and(|uri| uri.starts_with("http://")) { #[cfg(not(feature = "dev_mode"))] - return Err(trc::AuthEvent::Error - .into_err() - .details("Redirect URI must be HTTPS.")); + if !self.registry().is_recovery_mode() { + return Err(trc::AuthEvent::Error + .into_err() + .details("Redirect URI must be HTTPS.")); + } } // Parse and validate PKCE challenge (RFC 7636). diff --git a/crates/store/src/build/lookup.rs b/crates/store/src/build/lookup.rs index 216fed50..5d802a95 100644 --- a/crates/store/src/build/lookup.rs +++ b/crates/store/src/build/lookup.rs @@ -4,7 +4,7 @@ * SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL */ -use crate::{InMemoryStore, LookupStores, registry::bootstrap::Bootstrap}; +use crate::{LookupStores, registry::bootstrap::Bootstrap}; use registry::schema::structs::{LookupStore, StoreLookup}; use std::collections::hash_map::Entry; @@ -28,18 +28,18 @@ impl LookupStores { LookupStore::PostgreSql(postgre_sql_store) => { crate::backend::postgres::PostgresStore::open(postgre_sql_store) .await - .map(InMemoryStore::Store) + .map(crate::InMemoryStore::Store) } #[cfg(feature = "mysql")] LookupStore::MySql(my_sql_store) => { crate::backend::mysql::MysqlStore::open(my_sql_store) .await - .map(InMemoryStore::Store) + .map(crate::InMemoryStore::Store) } #[cfg(feature = "sqlite")] LookupStore::Sqlite(sqlite_store) => { crate::backend::sqlite::SqliteStore::open(sqlite_store) - .map(InMemoryStore::Store) + .map(crate::InMemoryStore::Store) } // SPDX-SnippetBegin // SPDX-FileCopyrightText: 2020 Stalwart Labs LLC