fix appservice, add to frontend proxy

pull/4654/head
Amber Brown 2019-02-16 04:39:49 +11:00
parent ce5f3b1ba5
commit d9235b9e29
2 changed files with 10 additions and 0 deletions

View File

@ -39,8 +39,12 @@ from synapse.replication.slave.storage.registration import SlavedRegistrationSto
from synapse.replication.tcp.client import ReplicationClientHandler from synapse.replication.tcp.client import ReplicationClientHandler
from synapse.rest.client.v1.base import ClientV1RestServlet, client_path_patterns from synapse.rest.client.v1.base import ClientV1RestServlet, client_path_patterns
from synapse.rest.client.v2_alpha._base import client_v2_patterns from synapse.rest.client.v2_alpha._base import client_v2_patterns
from synapse.rest.client.v2_alpha.register import (
register_servlets as register_registration_servlets,
)
from synapse.server import HomeServer from synapse.server import HomeServer
from synapse.storage.engines import create_engine from synapse.storage.engines import create_engine
from synapse.storage.registration import RegistrationStore
from synapse.util.httpresourcetree import create_resource_tree from synapse.util.httpresourcetree import create_resource_tree
from synapse.util.logcontext import LoggingContext from synapse.util.logcontext import LoggingContext
from synapse.util.manhole import manhole from synapse.util.manhole import manhole
@ -141,6 +145,7 @@ class FrontendProxySlavedStore(
SlavedClientIpStore, SlavedClientIpStore,
SlavedApplicationServiceStore, SlavedApplicationServiceStore,
SlavedRegistrationStore, SlavedRegistrationStore,
RegistrationStore,
BaseSlavedStore, BaseSlavedStore,
): ):
pass pass
@ -161,6 +166,7 @@ class FrontendProxyServer(HomeServer):
elif name == "client": elif name == "client":
resource = JsonResource(self, canonical_json=False) resource = JsonResource(self, canonical_json=False)
KeyUploadServlet(self).register(resource) KeyUploadServlet(self).register(resource)
register_registration_servlets(self, resource)
# If presence is disabled, use the stub servlet that does # If presence is disabled, use the stub servlet that does
# not allow sending presence # not allow sending presence

View File

@ -479,6 +479,10 @@ class RegisterRestServlet(RestServlet):
user_id = yield self.registration_handler.appservice_register( user_id = yield self.registration_handler.appservice_register(
username, as_token username, as_token
) )
if self.hs.config.worker_app:
self._invalidate_caches_client(registered_user_id)
defer.returnValue((yield self._create_registration_details(user_id, body))) defer.returnValue((yield self._create_registration_details(user_id, body)))
@defer.inlineCallbacks @defer.inlineCallbacks