element-hq / element-hq/synapse

Implement a blacklisting endpoint (instead of a blacklisting reactor and agent wrapper)

Open
#8,860 0 comments 0 reactions 0 assignees View on GitHub
T-Task
Dominant language
Python
Stars
4.6k
Forks
600
Avg merge
5d 22h
Merged PRs (30d)
51

Description

This issue has been migrated from [#8860](https://github.com/matrix-org/synapse/issues/8860).

---

See https://github.com/matrix-org/synapse/pull/8821#issuecomment-736586382 for background on this.

Currently to apply an IP range blacklist in Synapse it is necessary to wrap the the reactor with `BlacklistingReactorWrapper` and then the agent with `BlacklistingAgentWrapper`. Ideally all of this logic could be encompassed in a custom `BlacklistingHostnameEndpoint` which would implement similar logic to `HostnameEndpoint`, but apply the blacklisting logic to it (the necessary logic is almost identical to what is currently in `_IPBlacklistingResolver`).

This should allow creating an agent with `Agent. usingEndpointFactory`.

Some things to note:

* This has to fit in somehow with the `ProxyAgent` (I suspect it should be an either or sort of thing, but not this should be further investigated).
* The separation of `SimpleHttpClient` and `MatrixFederationClient` makes this a bit more difficult.
* There's also some use of the `RedirectAgent` which may or may not be involved here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.