diff --git a/conduwuit-example.toml b/conduwuit-example.toml index bc9534e39..bc4d4339a 100644 --- a/conduwuit-example.toml +++ b/conduwuit-example.toml @@ -812,15 +812,6 @@ # env: CONTINUWUITY_FORGET_FORCED_UPON_LEAVE #forget_forced_upon_leave = false -# Set this to true to require authentication on the normally -# unauthenticated profile retrieval endpoints (GET) -# "/_matrix/client/v3/profile/{userId}". -# -# This can prevent profile scraping. -# -# env: CONTINUWUITY_REQUIRE_AUTH_FOR_PROFILE_REQUESTS -#require_auth_for_profile_requests = false - # Set this to true to allow your server's public room directory to be # federated. Set this to false to protect against /publicRooms spiders, # but will forbid external users from viewing your server's public room diff --git a/src/api/client/profile.rs b/src/api/client/profile.rs index 4f2d6bedc..2ccae1b3a 100644 --- a/src/api/client/profile.rs +++ b/src/api/client/profile.rs @@ -29,7 +29,7 @@ pub(crate) async fn get_profile_route( State(services): State, body: Ruma, ) -> Result { - if services.config.require_auth_for_profile_requests && body.identity.is_none() { + if body.identity.is_none() { return Err!(Request(Unauthorized( "This server requires authentication to access user profiles." ))); @@ -46,7 +46,7 @@ pub(crate) async fn get_profile_field_route( State(services): State, body: Ruma, ) -> Result { - if services.config.require_auth_for_profile_requests && body.identity.is_none() { + if body.identity.is_none() { return Err!(Request(Unauthorized( "This server requires authentication to access user profiles." ))); diff --git a/src/core/config/mod.rs b/src/core/config/mod.rs index b720756ee..838c75098 100644 --- a/src/core/config/mod.rs +++ b/src/core/config/mod.rs @@ -919,14 +919,6 @@ pub struct Config { #[serde(default)] pub forget_forced_upon_leave: bool, - /// Set this to true to require authentication on the normally - /// unauthenticated profile retrieval endpoints (GET) - /// "/_matrix/client/v3/profile/{userId}". - /// - /// This can prevent profile scraping. - #[serde(default)] - pub require_auth_for_profile_requests: bool, - /// Set this to true to allow your server's public room directory to be /// federated. Set this to false to protect against /publicRooms spiders, /// but will forbid external users from viewing your server's public room @@ -2977,6 +2969,7 @@ const DEPRECATED_KEYS: &[&str] = &[ "conduit_cache_capacity_modifier", "max_concurrent_requests", "otlp_protocol", + "require_auth_for_profile_requests", "roomid_spacehierarchy_cache_capacity", "well_known_client", "well_known_server",