summary refs log tree commit diff
path: root/synapse/api/auth.py
diff options
context:
space:
mode:
authorEric Eastwood <erice@element.io>2022-08-02 15:05:27 -0500
committerEric Eastwood <erice@element.io>2022-08-02 15:05:27 -0500
commit72c718df54c3c1dd02fd208020dfc6ccbb241870 (patch)
treebbc71e033e6c21161ec7984b6e28a37a55971aff /synapse/api/auth.py
parentSeems to (see test_side_by_side_spans) (diff)
parentAdd a `merge-back` command to the release script, which automates merging the... (diff)
downloadsynapse-72c718df54c3c1dd02fd208020dfc6ccbb241870.tar.xz
Merge branch 'develop' into madlittlemods/11850-migrate-to-opentelemetry
Conflicts:
	docs/usage/configuration/config_documentation.md
	synapse/logging/opentracing.py

Got changes from:

 - https://github.com/matrix-org/synapse/pull/13362/files
Diffstat (limited to 'synapse/api/auth.py')
-rw-r--r--synapse/api/auth.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/synapse/api/auth.py b/synapse/api/auth.py

index 7d429600af..7071f771a7 100644 --- a/synapse/api/auth.py +++ b/synapse/api/auth.py
@@ -26,6 +26,7 @@ from synapse.api.errors import ( Codes, InvalidClientTokenError, MissingClientTokenError, + UnstableSpecAuthError, ) from synapse.appservice import ApplicationService from synapse.http import get_request_user_agent @@ -106,8 +107,11 @@ class Auth: forgot = await self.store.did_forget(user_id, room_id) if not forgot: return membership, member_event_id - - raise AuthError(403, "User %s not in room %s" % (user_id, room_id)) + raise UnstableSpecAuthError( + 403, + "User %s not in room %s" % (user_id, room_id), + errcode=Codes.NOT_JOINED, + ) async def get_user_by_req( self, @@ -599,8 +603,9 @@ class Auth: == HistoryVisibility.WORLD_READABLE ): return Membership.JOIN, None - raise AuthError( + raise UnstableSpecAuthError( 403, "User %s not in room %s, and room previews are disabled" % (user_id, room_id), + errcode=Codes.NOT_JOINED, )