Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

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

Open
clokep opened this issue Dec 2, 2020 · 3 comments
Labels
T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.

Comments

@clokep
Copy link
Member

clokep commented Dec 2, 2020

See #8821 (comment) 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.
@richvdh
Copy link
Member

richvdh commented Jan 13, 2021

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).

is this now resolved thanks to #9084?

@clokep
Copy link
Member Author

clokep commented Jan 13, 2021

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).

is this now resolved thanks to #9084?

I think so, I think what you would end up doing is using a new BlacklistingEndpoint instead of the HostnameEndpoint when not using the proxy.

@clokep
Copy link
Member Author

clokep commented Jun 22, 2021

I had started playing with this briefly, but I don't remember if I even tested it... anyway my WIP was 854ed2a if that's useful to anyone. 😄

@erikjohnston erikjohnston added T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. and removed z-maintenance labels Jun 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.
Projects
None yet
Development

No branches or pull requests

3 participants