allow broken no-op deny+allow room server ACL keys
Signed-off-by: June Clementine Strawberry <june@3.dog>
This commit is contained in:
parent
fe65648296
commit
2c58a6efda
1 changed files with 10 additions and 3 deletions
|
@ -14,14 +14,21 @@ pub async fn acl_check(&self, server_name: &ServerName, room_id: &RoomId) -> Res
|
||||||
.room_state_get_content(room_id, &StateEventType::RoomServerAcl, "")
|
.room_state_get_content(room_id, &StateEventType::RoomServerAcl, "")
|
||||||
.await
|
.await
|
||||||
.map(|c: RoomServerAclEventContent| c)
|
.map(|c: RoomServerAclEventContent| c)
|
||||||
.inspect(|acl| trace!("ACL content found: {acl:?}"))
|
.inspect(|acl| trace!(%room_id, "ACL content found: {acl:?}"))
|
||||||
.inspect_err(|e| trace!("No ACL content found: {e:?}"))
|
.inspect_err(|e| trace!(%room_id, "No ACL content found: {e:?}"))
|
||||||
else {
|
else {
|
||||||
return Ok(());
|
return Ok(());
|
||||||
};
|
};
|
||||||
|
|
||||||
if acl_event_content.allow.is_empty() {
|
if acl_event_content.allow.is_empty() {
|
||||||
warn!("Ignoring broken ACL event (allow key is empty)");
|
warn!(%room_id, "Ignoring broken ACL event (allow key is empty)");
|
||||||
|
return Ok(());
|
||||||
|
}
|
||||||
|
|
||||||
|
if acl_event_content.deny.contains(&String::from("*"))
|
||||||
|
&& acl_event_content.allow.contains(&String::from("*"))
|
||||||
|
{
|
||||||
|
warn!(%room_id, "Ignoring broken ACL event (allow key and deny key both contain wildcard \"*\"");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue