Skip to main content

No project description provided

Project description

Famedly Control Synapse

PyPI - Version PyPI - Python Version


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.

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
        auth_provider: str = "", # The unique, internal ID of the external identity provider.

Testing

To create virtual env and install dependency:

hatch shell

The tests use pytest, with the development environment managed by Hatch. You can run the test suite and generate a coverage report with:

hatch run cov

Code Quality

Use hatch fmt to automatically format code, enforce style rules, and check types using:

  • black and isort for formatting
  • ruff for linting
  • mypy for static type checking

Check Code Without Modifying It

To check code quality without modifying files:

  • Check formatting with isort and black:
    hatch fmt --check -f
    
  • Check types and linting with mypy and ruff:
    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 black and isort:
    hatch fmt -f
    
  • Type checks(mypy) and lint, fixing autofixable ruff issues:
    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

famedly_control_synapse-0.0.2.tar.gz (78.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

famedly_control_synapse-0.0.2-py3-none-any.whl (34.6 kB view details)

Uploaded Python 3

File details

Details for the file famedly_control_synapse-0.0.2.tar.gz.

File metadata

  • Download URL: famedly_control_synapse-0.0.2.tar.gz
  • Upload date:
  • Size: 78.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for famedly_control_synapse-0.0.2.tar.gz
Algorithm Hash digest
SHA256 ab135c1f1890263586f5ebc6a014323f268e3fd0a873bcd0f70a6575e7676890
MD5 2c456f1bfb6be85b946ac36c1f9075d2
BLAKE2b-256 048b60e0e5bd7c2d27f581f36fc2dfde3d85184ca00d6448e66effddf5ae843b

See more details on using hashes here.

Provenance

The following attestation bundles were made for famedly_control_synapse-0.0.2.tar.gz:

Publisher: publish.yml on famedly/famedly-control-synapse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file famedly_control_synapse-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for famedly_control_synapse-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ca6715ee2b0beb0e4e0582b78489df63672c3eea427e506a5c87b3f7d153a359
MD5 75a71b4ebbe67f0e9c427531869a3f5d
BLAKE2b-256 e9d15ad4d0c24d03b340dc46dae3c5e101c61f1fe745627a9efb9d2c0c0885cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for famedly_control_synapse-0.0.2-py3-none-any.whl:

Publisher: publish.yml on famedly/famedly-control-synapse

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page