summary refs log tree commit diff
path: root/synapse/app/federation_reader.py
diff options
context:
space:
mode:
authorJason Robinson <jasonr@matrix.org>2019-01-21 01:54:43 +0200
committerJason Robinson <jasonr@matrix.org>2019-01-23 10:32:41 +0200
commit82e13662c03a41c085e784a594b423711e0caffa (patch)
tree7bdeb6ff332305f216a2ea9b95cb750f5db2096b /synapse/app/federation_reader.py
parentAdd tests for the openid lister for SynapseHomeServer (diff)
downloadsynapse-82e13662c03a41c085e784a594b423711e0caffa.tar.xz
Split federation OpenID userinfo endpoint out of the federation resource
This allows the OpenID userinfo endpoint to be active even if the
federation resource is not active. The OpenID userinfo endpoint
is called by integration managers to verify user actions using the
client API OpenID access token. Without this verification, the
integration manager cannot know that the access token is valid.

The OpenID userinfo endpoint will be loaded in the case that either
"federation" or "openid" resource is defined. The new "openid"
resource is defaulted to active in default configuration.

Signed-off-by: Jason Robinson <jasonr@matrix.org>
Diffstat (limited to 'synapse/app/federation_reader.py')
-rw-r--r--synapse/app/federation_reader.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/synapse/app/federation_reader.py b/synapse/app/federation_reader.py
index ea594f0f1a..99e8a4cf6a 100644
--- a/synapse/app/federation_reader.py
+++ b/synapse/app/federation_reader.py
@@ -87,6 +87,13 @@ class FederationReaderServer(HomeServer):
                     resources.update({
                         FEDERATION_PREFIX: TransportLayerServer(self),
                     })
+                if name == "openid" and "federation" not in res["names"]:
+                    # Only load the openid resource separately if federation resource
+                    # is not specified since federation resource includes openid
+                    # resource.
+                    resources.update({
+                        FEDERATION_PREFIX: TransportLayerServer(self, servlet_groups=["openid"]),
+                    })
 
         root_resource = create_resource_tree(resources, NoResource())