Table of Contents
This repository contains a Synapse module which allows for creating and managing "managed rooms". Those rooms have the following properties: invite-only, non-federated, cannot be left. Users are associated to groups in an external service and those same groups are associated to rooms in this module. Users are then automatically added to the corresponding rooms. This module is only "half of the work", the other half being in the external service.
The openapi specification is available at openapi-spec.yaml. You can use tools like swagger.io for a more readable format.
The HTTP endpoints exposed by this module are only registered on the background task synapse worker (or the main process if no dedicated worker is configured). Requests to these endpoints on any other worker will return 404 NOT_FOUND.
This must be taken into account when configuring a reverse proxy for example; all requests under /_famedlyControl/ must be routed to the background task worker.
pip install famedly-control-synapseHere are the available configuration options:
# the outer modules section is just provided for completeness, the config block is the actual module config.
modules:
- module: "famedly_control_synapse.FamedlyControl"
config:
famedly_control:
api_url: str = "", # Prefix of the current famedly control http API
access_token: str = "", # Access token to authenticate against famedly control
sync_enabled: bool = true, # Whether to run the background group membership sync loop
sync_polling_interval_seconds: int = 30, # Interval in seconds between polling requests
auth_provider: str = "", # The unique, internal ID of the external identity provider.To create a virtual development environment and install dependencies:
hatch shellThe tests use pytest, with the development environment managed by Hatch. Running the tests can be done like this:
hatch testRun the tests in parallel: -p
Collect coverage data (automatically output as lcov.info): -c
Selecting a specific test to run can be as easy as providing the path to the test. All tests start from
the base test directory, tests. If running all tests, this can be left out. For specific tests, see
the pytest usage docs for more information.
Use hatch fmt to automatically format code, enforce style rules, and check types using:
blackandisortfor formattingrufffor lintingmypyfor static type checking
To check code quality without modifying files:
- Check formatting with
isortandblack:hatch fmt --check -f - Check types and linting with
mypyandruff:hatch fmt --check -l - Check all of above, formatting, linting, and typing:
hatch fmt --check
To automatically fix issues in the code:
- Format only using
blackandisort:hatch fmt -f - Type checks(
mypy) and lint, fixing autofixableruffissues:hatch fmt -l - Run all tools, format, lint, type-check:
hatch fmt
famedly-control-synapse is distributed under the terms of the
AGPL-3.0 license.