summary refs log tree commit diff
path: root/synapse/api/auth.py
diff options
context:
space:
mode:
authorErik Johnston <erikj@jki.re>2018-08-22 17:18:28 +0100
committerGitHub <noreply@github.com>2018-08-22 17:18:28 +0100
commita5806aba2751d5a658e657ed489be26869d93f4e (patch)
tree9a9344671dc650b85a5bd42b0fb9d6649ae0834f /synapse/api/auth.py
parentMerge branch 'master' into develop (diff)
parentMerge branch 'develop' of github.com:matrix-org/synapse into neilj/server_not... (diff)
downloadsynapse-a5806aba2751d5a658e657ed489be26869d93f4e.tar.xz
Merge pull request #3680 from matrix-org/neilj/server_notices_on_blocking
server notices on resource limit blocking
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r--synapse/api/auth.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 6502a6be7b..4ca40a0f71 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -783,10 +783,16 @@ class Auth(object):
             user_id(str|None): If present, checks for presence against existing
             MAU cohort
         """
+
+        # Never fail an auth check for the server notices users
+        # This can be a problem where event creation is prohibited due to blocking
+        if user_id == self.hs.config.server_notices_mxid:
+            return
+
         if self.hs.config.hs_disabled:
             raise ResourceLimitError(
                 403, self.hs.config.hs_disabled_message,
-                errcode=Codes.RESOURCE_LIMIT_EXCEED,
+                errcode=Codes.RESOURCE_LIMIT_EXCEEDED,
                 admin_uri=self.hs.config.admin_uri,
                 limit_type=self.hs.config.hs_disabled_limit_type
             )
@@ -803,6 +809,6 @@ class Auth(object):
                     403, "Monthly Active User Limit Exceeded",
 
                     admin_uri=self.hs.config.admin_uri,
-                    errcode=Codes.RESOURCE_LIMIT_EXCEED,
+                    errcode=Codes.RESOURCE_LIMIT_EXCEEDED,
                     limit_type="monthly_active_user"
                 )