mjolnir/src/models
Gnuxie 4d5447cb50
Rework the banning and unbanning of entities in PolicyLists. (#345)
* Rework the banning and unbanning of entities in PolicyLists.

1. We keep track of the event that created a list rule so that we
can remove the rule by having a way to determine the original state key for the rule.
This is because the state key of rules can be anything and should not be
relied on by Mjolnir to unban things (which it was doing).

2. The old scheme for producing a state key was causing for some entities to escape bans
https://github.com/matrix-org/mjolnir/issues/322.

We could have used a hash or something similar, but we know that
the reason for the `rule:${entity}` scheme existed was for ease of debugging
and finding rules in devtools. So instead we have followed a scheme simalar to
bridges where the first character of an mxid is replaced with an underscore.
Everything else just gets put into the state key. Since domains can't have '@'
and room ids, aliases can't either.

3. We have stopped the need for Mjolnir to wait for the next response from sync after banning,
unbanning an entity so that we can apply ACL's sooner.

* Use PolicyList's `banEntity` method to create imported rules.
2022-08-19 13:09:08 +01:00
..
ListRule.ts Rework the banning and unbanning of entities in PolicyLists. (#345) 2022-08-19 13:09:08 +01:00
PolicyList.ts Rework the banning and unbanning of entities in PolicyLists. (#345) 2022-08-19 13:09:08 +01:00
RoomUpdateError.ts Avoid spamming the management room with errors 2019-11-06 19:17:11 -07:00
RuleServer.ts Towards opinions in PolicyLists. (#336) 2022-07-26 21:47:26 +02:00
ServerAcl.ts Make ACL safe so that Mjolnir will not ban itself. (#213) 2022-02-07 17:02:06 +00:00