feat: forbid certain usernames & room aliases

squashed from https://gitlab.com/famedly/conduit/-/merge_requests/582

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
Matthias Ahouansou 2024-02-08 19:11:48 -05:00 committed by June
parent 784d307425
commit fc93b29abe
8 changed files with 143 additions and 1 deletions

View file

@ -1,6 +1,7 @@
mod data;
use argon2::Argon2;
pub use data::Data;
use regex::RegexSet;
use ruma::{
serde::Base64, OwnedDeviceId, OwnedEventId, OwnedRoomId, OwnedServerName,
OwnedServerSigningKeyId, OwnedUserId,
@ -389,6 +390,14 @@ impl Service<'_> {
&self.config.emergency_password
}
pub fn forbidden_room_names(&self) -> &RegexSet {
&self.config.forbidden_room_names
}
pub fn forbidden_usernames(&self) -> &RegexSet {
&self.config.forbidden_usernames
}
pub fn allow_local_presence(&self) -> bool {
self.config.allow_local_presence
}