No project description provided
Project description
Famedly Control Synapse
Table of Contents
Documentation
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.
Note for users being deactivated: Highly recommended to remove a user from a group before it is deactivated. Upon deactivation, the user will be removed from the room regardless of any group. If the user should be reactivated in the future, it will not automatically re-join any rooms its groups are in.
Worker routing
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.
Installation
pip install famedly-control-synapse
Configuration
Here 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
error_retry_queue_enabled: bool = true, # Enable retrying membership changes that previously errored
error_retry_queue_interval_seconds: int = 30, # Interval in seconds between retrying a failed membership change
error_retry_queue_log_after_retry_count: int = 3, # The count of error retry queue attempts to start logging warnings
auth_provider: str = "", # The unique, internal ID of the external identity provider.
Testing
To create a virtual development environment and install dependencies:
hatch shell
The tests use pytest, with the development environment managed by Hatch. Running the tests can be done like this:
hatch test
Additional optional testing arguments:
Run the tests in parallel: -p
Collect coverage data (automatically output as lcov.info): -c
Running a specific test:
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.
Code Quality
Use hatch fmt to automatically format code, enforce style rules, and check types using:
blackandisortfor formattingrufffor lintingmypyfor static type checking
Check Code Without Modifying It
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
Auto-formatting Code
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
License
famedly-control-synapse is distributed under the terms of the
AGPL-3.0 license.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file famedly_control_synapse-0.0.4.tar.gz.
File metadata
- Download URL: famedly_control_synapse-0.0.4.tar.gz
- Upload date:
- Size: 102.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c4931eecd0ef50358c9c00b4940da080c848e5417a2b6214fca569dcc6ded91f
|
|
| MD5 |
73b8a3eab6b9f99653dc809d0f6d2565
|
|
| BLAKE2b-256 |
6fcc55321a7ccd57f08c24a5341ed48a255dc187723727ef51429ba7a12a3126
|
Provenance
The following attestation bundles were made for famedly_control_synapse-0.0.4.tar.gz:
Publisher:
publish.yml on famedly/famedly-control-synapse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
famedly_control_synapse-0.0.4.tar.gz -
Subject digest:
c4931eecd0ef50358c9c00b4940da080c848e5417a2b6214fca569dcc6ded91f - Sigstore transparency entry: 1633603593
- Sigstore integration time:
-
Permalink:
famedly/famedly-control-synapse@67297d3dbe0d988f28c1b32c898439a9fc9ce16a -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/famedly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@67297d3dbe0d988f28c1b32c898439a9fc9ce16a -
Trigger Event:
release
-
Statement type:
File details
Details for the file famedly_control_synapse-0.0.4-py3-none-any.whl.
File metadata
- Download URL: famedly_control_synapse-0.0.4-py3-none-any.whl
- Upload date:
- Size: 43.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cec786f5d583e8bac333990f5b7dd06b15ff33c6099075165c648f53feb1de4b
|
|
| MD5 |
805e21e7a3b86227dee8104e4d2bd6c3
|
|
| BLAKE2b-256 |
6b25464f0ae67fdd463001aef14e7aa8f51db441083c863a84d0aaf41bc5f6c1
|
Provenance
The following attestation bundles were made for famedly_control_synapse-0.0.4-py3-none-any.whl:
Publisher:
publish.yml on famedly/famedly-control-synapse
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
famedly_control_synapse-0.0.4-py3-none-any.whl -
Subject digest:
cec786f5d583e8bac333990f5b7dd06b15ff33c6099075165c648f53feb1de4b - Sigstore transparency entry: 1633603655
- Sigstore integration time:
-
Permalink:
famedly/famedly-control-synapse@67297d3dbe0d988f28c1b32c898439a9fc9ce16a -
Branch / Tag:
refs/tags/v0.0.4 - Owner: https://github.com/famedly
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@67297d3dbe0d988f28c1b32c898439a9fc9ce16a -
Trigger Event:
release
-
Statement type: