diff options
author | Patrick Cloke <clokep@users.noreply.github.com> | 2020-08-20 15:42:58 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-20 15:42:58 -0400 |
commit | 3f91638da6ea0aeaf789ddc8ca1e624a11b7ebb2 (patch) | |
tree | a8630b302bda863880f4a763e179b5982567a0c8 /synapse/spam_checker_api | |
parent | Stop shadow-banned users from sending invites. (#8095) (diff) | |
download | synapse-3f91638da6ea0aeaf789ddc8ca1e624a11b7ebb2.tar.xz |
Allow denying or shadow banning registrations via the spam checker (#8034)
Diffstat (limited to 'synapse/spam_checker_api')
-rw-r--r-- | synapse/spam_checker_api/__init__.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/synapse/spam_checker_api/__init__.py b/synapse/spam_checker_api/__init__.py index 7f63f1bfa0..9be92e2565 100644 --- a/synapse/spam_checker_api/__init__.py +++ b/synapse/spam_checker_api/__init__.py @@ -13,6 +13,7 @@ # See the License for the specific language governing permissions and # limitations under the License. import logging +from enum import Enum from twisted.internet import defer @@ -25,6 +26,16 @@ if MYPY: logger = logging.getLogger(__name__) +class RegistrationBehaviour(Enum): + """ + Enum to define whether a registration request should allowed, denied, or shadow-banned. + """ + + ALLOW = "allow" + SHADOW_BAN = "shadow_ban" + DENY = "deny" + + class SpamCheckerApi(object): """A proxy object that gets passed to spam checkers so they can get access to rooms and other relevant information. |