add federation allow list

This commit is contained in:
Jade Ellis 2025-01-18 15:21:55 +00:00
parent eb7d893c86
commit 371103fb35
No known key found for this signature in database
GPG key ID: 8705A2A3EBF77BD2
15 changed files with 101 additions and 94 deletions

View file

@ -36,21 +36,14 @@ pub(crate) async fn create_invite_route(
}
if let Some(server) = body.room_id.server_name() {
if services
.server
.config
.forbidden_remote_server_names
.contains(&server.to_owned())
{
if services.moderation.is_remote_server_forbidden(server) {
return Err!(Request(Forbidden("Server is banned on this homeserver.")));
}
}
if services
.server
.config
.forbidden_remote_server_names
.contains(body.origin())
.moderation
.is_remote_server_forbidden(body.origin())
{
warn!(
"Received federated/remote invite from banned server {} for room ID {}. Rejecting.",