diff options
author | Andrew Morgan <1342360+anoadragon453@users.noreply.github.com> | 2019-09-20 15:21:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-20 15:21:30 +0100 |
commit | df3401a71d78088da36a03c73d35bc116c712df6 (patch) | |
tree | 1adb9c2f50e75a39db53e27178e2705a39a430b4 /synapse/handlers/identity.py | |
parent | Remove trailing slash ability from password reset's submit_token endpoint (#6... (diff) | |
download | synapse-df3401a71d78088da36a03c73d35bc116c712df6.tar.xz |
Allow HS to send emails when adding an email to the HS (#6042)
Diffstat (limited to 'synapse/handlers/identity.py')
-rw-r--r-- | synapse/handlers/identity.py | 17 |
1 files changed, 3 insertions, 14 deletions
diff --git a/synapse/handlers/identity.py b/synapse/handlers/identity.py index 512f38e5a6..156719e308 100644 --- a/synapse/handlers/identity.py +++ b/synapse/handlers/identity.py @@ -81,11 +81,10 @@ class IdentityHandler(BaseHandler): given identity server Args: - id_server (str|None): The identity server to validate 3PIDs against. If None, - we will attempt to extract id_server creds + id_server (str): The identity server to validate 3PIDs against. Must be a + complete URL including the protocol (http(s)://) creds (dict[str, str]): Dictionary containing the following keys: - * id_server|idServer: An optional domain name of an identity server * client_secret|clientSecret: A unique secret str provided by the client * sid: The ID of the validation session @@ -104,20 +103,10 @@ class IdentityHandler(BaseHandler): raise SynapseError( 400, "Missing param session_id in creds", errcode=Codes.MISSING_PARAM ) - if not id_server: - # Attempt to get the id_server from the creds dict - id_server = creds.get("id_server") or creds.get("idServer") - if not id_server: - raise SynapseError( - 400, "Missing param id_server in creds", errcode=Codes.MISSING_PARAM - ) query_params = {"sid": session_id, "client_secret": client_secret} - url = "https://%s%s" % ( - id_server, - "/_matrix/identity/api/v1/3pid/getValidated3pid", - ) + url = id_server + "/_matrix/identity/api/v1/3pid/getValidated3pid" data = yield self.http_client.get_json(url, query_params) return data if "medium" in data else None |