mirror of
https://github.com/girlbossceo/conduwuit.git
synced 2026-03-29 23:20:23 -04:00
feat: added basic ACL functionality
This commit is contained in:
parent
6a9f8dfa6f
commit
7562925aeb
13 changed files with 183 additions and 4 deletions
|
|
@ -99,7 +99,7 @@ impl FedDest {
|
|||
}
|
||||
}
|
||||
|
||||
fn hostname(&self) -> String {
|
||||
pub(crate) fn hostname(&self) -> String {
|
||||
match &self {
|
||||
Self::Literal(addr) => addr.ip().to_string(),
|
||||
Self::Named(host, _) => host.clone(),
|
||||
|
|
@ -154,6 +154,14 @@ where
|
|||
(result.0, result.1.into_uri_string())
|
||||
};
|
||||
|
||||
debug!("Checking acl allowance for {}", destination);
|
||||
|
||||
if !services().acl.is_federation_with_allowed_fedi_dest(&actual_destination) {
|
||||
debug!("blocked sending federation to {:?}", actual_destination);
|
||||
|
||||
return Err(Error::ACLBlock(destination.to_owned()));
|
||||
}
|
||||
|
||||
let actual_destination_str = actual_destination.clone().into_https_string();
|
||||
|
||||
let mut http_request = request
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue