summary refs log tree commit diff
path: root/synapse/api
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2020-12-18 09:51:56 +0000
committerErik Johnston <erik@matrix.org>2020-12-18 09:51:56 +0000
commita7a913918cf04c6d900223b19e719fafbbe94efa (patch)
treeeada22da26f93fe8807a45ebb70d14bb15c80f1a /synapse/api
parentTry and drop stale extremities. (#8929) (diff)
parentUpdate tests/test_mau.py (diff)
downloadsynapse-a7a913918cf04c6d900223b19e719fafbbe94efa.tar.xz
Merge remote-tracking branch 'origin/erikj/as_mau_block' into develop
Diffstat (limited to 'synapse/api')
-rw-r--r--synapse/api/auth_blocking.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/api/auth_blocking.py b/synapse/api/auth_blocking.py
index 9c227218e0..d8088f524a 100644
--- a/synapse/api/auth_blocking.py
+++ b/synapse/api/auth_blocking.py
@@ -36,6 +36,7 @@ class AuthBlocking:
         self._limit_usage_by_mau = hs.config.limit_usage_by_mau
         self._mau_limits_reserved_threepids = hs.config.mau_limits_reserved_threepids
         self._server_name = hs.hostname
+        self._track_appservice_user_ips = hs.config.appservice.track_appservice_user_ips
 
     async def check_auth_blocking(
         self,
@@ -76,6 +77,12 @@ class AuthBlocking:
                 # We never block the server from doing actions on behalf of
                 # users.
                 return
+            elif requester.app_service and not self._track_appservice_user_ips:
+                # If we're authenticated as an appservice then we only block
+                # auth if `track_appservice_user_ips` is set, as that option
+                # implicitly means that application services are part of MAU
+                # limits.
+                return
 
         # Never fail an auth check for the server notices users or support user
         # This can be a problem where event creation is prohibited due to blocking