mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-06-19 08:24:07 -04:00
Add authentication to replication endpoints. (#8853)
Authentication is done by checking a shared secret provided in the Synapse configuration file.
This commit is contained in:
parent
df4b1e9c74
commit
96358cb424
7 changed files with 184 additions and 15 deletions
|
@ -14,27 +14,20 @@
|
|||
# limitations under the License.
|
||||
import logging
|
||||
|
||||
from synapse.api.constants import LoginType
|
||||
from synapse.http.site import SynapseRequest
|
||||
from synapse.rest.client.v2_alpha import register
|
||||
|
||||
from tests.replication._base import BaseMultiWorkerStreamTestCase
|
||||
from tests.rest.client.v2_alpha.test_auth import DummyRecaptchaChecker
|
||||
from tests.server import FakeChannel, make_request
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class ClientReaderTestCase(BaseMultiWorkerStreamTestCase):
|
||||
"""Base class for tests of the replication streams"""
|
||||
"""Test using one or more client readers for registration."""
|
||||
|
||||
servlets = [register.register_servlets]
|
||||
|
||||
def prepare(self, reactor, clock, hs):
|
||||
self.recaptcha_checker = DummyRecaptchaChecker(hs)
|
||||
auth_handler = hs.get_auth_handler()
|
||||
auth_handler.checkers[LoginType.RECAPTCHA] = self.recaptcha_checker
|
||||
|
||||
def _get_worker_hs_config(self) -> dict:
|
||||
config = self.default_config()
|
||||
config["worker_app"] = "synapse.app.client_reader"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue