From 18d2662b0154cf8c2110f189a3b14ccc53e60594 Mon Sep 17 00:00:00 2001 From: Niklas Wojtkowiak Date: Sun, 22 Feb 2026 21:34:51 -0500 Subject: [PATCH] fix(config): remove allow_public_room_directory_without_auth --- complement/complement.config.toml | 1 - conduwuit-example.toml | 6 ------ src/api/router/auth.rs | 28 +++++++++++----------------- src/core/config/mod.rs | 6 ------ 4 files changed, 11 insertions(+), 30 deletions(-) diff --git a/complement/complement.config.toml b/complement/complement.config.toml index 4c98f8d1..6ef65029 100644 --- a/complement/complement.config.toml +++ b/complement/complement.config.toml @@ -9,7 +9,6 @@ address = "0.0.0.0" allow_device_name_federation = true allow_guest_registration = true allow_public_room_directory_over_federation = true -allow_public_room_directory_without_auth = true allow_registration = true database_path = "/database" log = "trace,h2=debug,hyper=debug" diff --git a/conduwuit-example.toml b/conduwuit-example.toml index e80d5554..722ed6f9 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -546,12 +546,6 @@ # #allow_public_room_directory_over_federation = false -# Set this to true to allow your server's public room directory to be -# queried without client authentication (access token) through the Client -# APIs. Set this to false to protect against /publicRooms spiders. -# -#allow_public_room_directory_without_auth = false - # Allow guests/unauthenticated users to access TURN credentials. # # This is the equivalent of Synapse's `turn_allow_guests` config option. diff --git a/src/api/router/auth.rs b/src/api/router/auth.rs index afd05d1b..8f48166d 100644 --- a/src/api/router/auth.rs +++ b/src/api/router/auth.rs @@ -67,23 +67,17 @@ pub(super) async fn auth( if metadata.authentication == AuthScheme::None { match metadata { | &get_public_rooms::v3::Request::METADATA => { - if !services - .server - .config - .allow_public_room_directory_without_auth - { - match token { - | Token::Appservice(_) | Token::User(_) => { - // we should have validated the token above - // already - }, - | Token::None | Token::Invalid => { - return Err(Error::BadRequest( - ErrorKind::MissingToken, - "Missing or invalid access token.", - )); - }, - } + match token { + | Token::Appservice(_) | Token::User(_) => { + // we should have validated the token above + // already + }, + | Token::None | Token::Invalid => { + return Err(Error::BadRequest( + ErrorKind::MissingToken, + "Missing or invalid access token.", + )); + }, } }, | &get_profile::v3::Request::METADATA diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs index 9792766d..272873ef 100644 --- a/src/core/config/mod.rs +++ b/src/core/config/mod.rs @@ -678,12 +678,6 @@ pub struct Config { #[serde(default)] pub allow_public_room_directory_over_federation: bool, - /// Set this to true to allow your server's public room directory to be - /// queried without client authentication (access token) through the Client - /// APIs. Set this to false to protect against /publicRooms spiders. - #[serde(default)] - pub allow_public_room_directory_without_auth: bool, - /// Allow guests/unauthenticated users to access TURN credentials. /// /// This is the equivalent of Synapse's `turn_allow_guests` config option.