summary refs log tree commit diff
diff options
context:
space:
mode:
authorOlivier Wilkinson (reivilibre) <oliverw@matrix.org>2021-12-09 12:29:08 +0000
committerOlivier Wilkinson (reivilibre) <oliverw@matrix.org>2021-12-09 12:29:08 +0000
commitcc2bbcd4dce1f53dc057390cc740e25ba5e7fe64 (patch)
tree6dffe96d16637a6cdf274bce426ae5a9d1a1ba51
parentNewsfile (diff)
downloadsynapse-cc2bbcd4dce1f53dc057390cc740e25ba5e7fe64.tar.xz
Switch to the 400 M_EXCLUSIVE error code for non-existent device IDs
This is as a result of a discussion on the MSC
-rw-r--r--synapse/api/auth.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py
index 65369afd13..fd48735e1c 100644
--- a/synapse/api/auth.py
+++ b/synapse/api/auth.py
@@ -347,9 +347,12 @@ class Auth:
                 effective_user_id, effective_device_id
             )
             if device_opt is None:
+                # For now, use 400 M_EXCLUSIVE if the device doesn't exist.
+                # This is an open thread of discussion on MSC3202 as of 2021-12-09.
                 raise AuthError(
-                    403,
+                    400,
                     f"Application service trying to use a device that doesn't exist ('{effective_device_id}' for {effective_user_id})",
+                    Codes.EXCLUSIVE,
                 )
 
         return effective_user_id, effective_device_id, app_service