Federation Refactoring & Architecture Improvements#930
Conversation
|
GitHub CodeQL flags this because it sees a user-provided domain string being used to construct a URL for an outbound HTTP request. Historically, this allows Server-Side Request Forgery (SSRF), where an attacker could force our server to hit internal metadata services (like 169.254.169.254) or local services (localhost). We have to allow users to contact arbitrary servers to allow federation. However, this PR mitigates this risk by using a custom util.SafeHTTPClient(). This client is "hardened" against SSRF in the following ways:
|
Overview
This PR represents a significant architectural refactoring of the backend to better support ActivityPub federation. The changes extract monolithic code from
main.gointo modular hooks and route handlers, while implementing federation support for trails, lists, comments, and user interactions. The PR tries to offload as much federation logic as possible from the frontend API to the go backend.Testing Recommendations