Check if Synapse should check given ISs

pull/5115/head
Brendan Abolivier 2019-05-09 12:53:24 +01:00 committed by Brendan Abolivier
parent f059a91085
commit 10e3ed83e9
1 changed files with 12 additions and 0 deletions

View File

@ -350,6 +350,12 @@ class IdentityHandler(BaseHandler):
https://matrix.org/docs/spec/identity_service/r0.1.0.html#association-lookup
for details
"""
if not self._should_trust_id_server(id_server):
raise SynapseError(
400, "Untrusted ID server '%s'" % id_server,
Codes.SERVER_NOT_TRUSTED
)
if not self._enable_lookup:
raise AuthError(
403, "Looking up third-party identifiers is denied from this server",
@ -395,6 +401,12 @@ class IdentityHandler(BaseHandler):
https://matrix.org/docs/spec/identity_service/r0.1.0.html#association-lookup
for details
"""
if not self._should_trust_id_server(id_server):
raise SynapseError(
400, "Untrusted ID server '%s'" % id_server,
Codes.SERVER_NOT_TRUSTED
)
if not self._enable_lookup:
raise AuthError(
403, "Looking up third-party identifiers is denied from this server",