{"id":20218072,"url":"https://github.com/matrix-org/synapse-3pid-checker","last_synced_at":"2025-04-10T15:46:03.074Z","repository":{"id":44632866,"uuid":"454114666","full_name":"matrix-org/synapse-3pid-checker","owner":"matrix-org","description":"A module that checks whether a 3PID (email address, phone number) can be allowed to register by querying a remote backend.","archived":false,"fork":false,"pushed_at":"2022-10-31T19:07:39.000Z","size":43,"stargazers_count":4,"open_issues_count":0,"forks_count":3,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-24T13:36:25.880Z","etag":null,"topics":["python","synapse"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matrix-org.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2022-01-31T18:03:22.000Z","updated_at":"2025-01-11T04:20:13.000Z","dependencies_parsed_at":"2023-01-20T05:48:02.067Z","dependency_job_id":null,"html_url":"https://github.com/matrix-org/synapse-3pid-checker","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrix-org%2Fsynapse-3pid-checker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrix-org%2Fsynapse-3pid-checker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrix-org%2Fsynapse-3pid-checker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matrix-org%2Fsynapse-3pid-checker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matrix-org","download_url":"https://codeload.github.com/matrix-org/synapse-3pid-checker/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248243511,"owners_count":21071055,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["python","synapse"],"created_at":"2024-11-14T06:37:03.925Z","updated_at":"2025-04-10T15:46:03.039Z","avatar_url":"https://github.com/matrix-org.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 3PID checker for Synapse\n\nA module that checks whether a 3PID (email address, phone number) can be allowed to be\nregistered on the local homeserver by querying a remote backend.\n\n## Installation\n\nFrom the virtual environment that you use for Synapse, install this module with:\n```shell\npip install threepid-checker\n```\n(If you run into issues, you may need to upgrade `pip` first, e.g. by running\n`pip install --upgrade pip`)\n\nThen alter your homeserver configuration, adding to your `modules` configuration:\n```yaml\nmodules:\n  - module: threepid_checker.ThreepidChecker\n    config:\n      # The URL to send requests to when checking if a 3PID can be associated to an account.\n      # See below for more information.\n      # Required.\n      url: https://foo/bar\n\n      # If true, the module will only send requests to the URL as part of registering a\n      # new user. This means no request will be sent to the URL when associating a 3PID with\n      # an already existing account.\n      # Optional, defaults to false.\n      only_check_at_registration: false\n```\n\nThe configured URL will be hit by a `GET` HTTP request. Note that this is _not_ subject to Synapse's IP blacklist, with 2 parameters to qualify the 3PID:\n\n* `medium`: The 3PID's medium (`email` for an email address, `msisdn` for a phone number)\n* `address`: The 3PID's address\n\nThe server at that URL is expected to respond with a JSON object that contains the following keys:\n\n* `hs` (string): Required. The name of the homeserver the 3PID is allowed to be associated\n                 on. This is the `server_name` variable in Synapse's configuration file. \n                 The 3PID will be denied if this is absent from the response's body.\n* `requires_invite` (bool): Optional. Whether an invite is required for this 3PID to be associated \n                            with an account on this homeserver. What qualifies as an invite is left to the\n                            server serving the configured URL to define. Defaults to `false`.\n* `invited` (bool): Optional. Whether there is a pending invite for the 3PID. Defaults to `false`.\n\nThe module will deny the 3PID's association based on the response if:\n\n* `hs` does not match the homeserver's configured server name, or is missing, or\n* `requires_invite` is `true` and `invited` is `false` or missing\n\nThe 3PID will be allowed to be associated with a local user otherwise.\n\n\n## Development\n\nIn a virtual environment with pip ≥ 21.1, run\n```shell\npip install -e .[dev]\n```\n\nTo run the unit tests, you can either use:\n```shell\ntox -e py\n```\nor\n```shell\ntrial tests\n```\n\nTo run the linters and `mypy` type checker, use `./scripts-dev/lint.sh`.\n\n\n## Releasing\n\nThe exact steps for releasing will vary; but this is an approach taken by the\nSynapse developers (assuming a Unix-like shell):\n\n 1. Set a shell variable to the version you are releasing (this just makes\n    subsequent steps easier):\n    ```shell\n    version=X.Y.Z\n    ```\n\n 2. Update `setup.cfg` so that the `version` is correct.\n\n 3. Stage the changed files and commit.\n    ```shell\n    git add -u\n    git commit -m v$version -n\n    ```\n\n 4. Push your changes.\n    ```shell\n    git push\n    ```\n\n 5. When ready, create a signed tag for the release:\n    ```shell\n    git tag -s v$version\n    ```\n    Base the tag message on the changelog.\n\n 6. Push the tag.\n    ```shell\n    git push origin tag v$version\n    ```\n\n 7. Create a source distribution and upload it to PyPI:\n    ```shell\n    python -m build\n    twine upload dist/threepid_checker-$version*\n    ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrix-org%2Fsynapse-3pid-checker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatrix-org%2Fsynapse-3pid-checker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatrix-org%2Fsynapse-3pid-checker/lists"}