aboutsummaryrefslogtreecommitdiff
path: root/federationapi
AgeCommit message (Collapse)Author
2023-06-14Merge SenderID & Per Room User Key work (#3109)devonh
2023-06-12Cleanup remaining statekey usage for senderIDs (#3106)devonh
2023-06-07Use SenderID Type (#3105)devonh
2023-06-06PDU Sender split (#3100)devonh
Initial cut of splitting PDU Sender into SenderID & looking up UserID where required.
2023-06-06Make `StrictValidityChecking` a function (#3092)Till
Companion PR to https://github.com/matrix-org/gomatrixserverlib/pull/388
2023-05-31Move Invite logic to GMSL (#3086)devonh
This is both the federation receiving & sending side logic (which were previously entangeld in a single function)
2023-05-31Move CreateRoom logic to Roomserver (#3093)devonh
Move create room logic over to roomserver.
2023-05-23Move `MakeLeave` to GMSL (#3085)Till
Basically the same API shape as for `/make_join` https://github.com/matrix-org/gomatrixserverlib/pull/385
2023-05-19Move SendJoin logic to GMSL (#3084)devonh
Moves the core matrix logic for handling the send_join endpoint over to gmsl.
2023-05-17Move MakeJoin logic to GMSL (#3081)devonh
2023-05-09Move json errors over to gmsl (#3080)devonh
2023-05-04Use ProtoEvent where needed instead of EventBuilder (#3075)kegsay
They are fundamentally different concepts, so should be represented as such. Proto events are exchanged in /make_xxx calls over federation, and made as "fledgling" events in /createRoom and general event sending. *Building* events is a reasonably complex VERSION SPECIFIC process which needs amongst other things, auth event providers, prev events, signing keys, etc. Requires https://github.com/matrix-org/gomatrixserverlib/pull/379
2023-05-03Use PDU in even more places (#3074)kegsay
- No longer rely on *Event returning from NewEventFrom... functions Requires https://github.com/matrix-org/gomatrixserverlib/pull/377
2023-05-02Use PDU not *Event in HeaderedEvent (#3073)kegsay
Requires https://github.com/matrix-org/gomatrixserverlib/pull/376 This has numerous upsides: - Less type casting to `*Event` is required. - Making Dendrite work with `PDU` interfaces means we can swap out Event impls more easily. - Tests which represent weird event shapes are easier to write. Part of a series of refactors on GMSL.
2023-04-28Remove `PerformError` (#3066)Till
This removes `PerformError`, which was needed when we still had polylith. This removes quite a bunch of ```go if err != nil { return err } if err := res.Error; err != nil { return err.JSONResponse() } ``` Hopefully can be read commit by commit. [skip ci]
2023-04-27Pass RoomID to gmsl.PerformJoinDevon Hudson
2023-04-27Use PDU interface (#3070)kegsay
We only use it in a few places currently, enough to get things to compile and run. We should be using it in much more places. Similarly, in some places we cast []PDU back to []*Event, we need to not do that. Likewise, in some places we cast PDU to *Event, we need to not do that. For now though, hopefully this is a start.
2023-04-27Remove gmsl.HeaderedEvent (#3068)kegsay
Replaced with types.HeaderedEvent _for now_. In reality we want to move them all to gmsl.Event and only use HeaderedEvent when we _need_ to bundle the version/event ID with the event (seriailsation boundaries, and even then only when we don't have the room version). Requires https://github.com/matrix-org/gomatrixserverlib/pull/373
2023-04-27Add some roomserver UTs (#3067)Till
Adds tests for `QueryRestrictedJoinAllowed`, `IsServerAllowed` and `PerformRoomUpgrade`. Refactors the `QueryRoomVersionForRoom` method to accept a string and return a `gmsl.RoomVersion` instead of req/resp structs. Adds some more caching for `GetStateEvent` This should also fix #2912 by ignoring state events belonging to other users.
2023-04-27Move high level room joining logic to GMSL (#3065)devonh
GMSL PR: https://github.com/matrix-org/gomatrixserverlib/pull/372
2023-04-24Move fedclient interface over to gmsl (#3061)devonh
Companion PR: https://github.com/matrix-org/gomatrixserverlib/pull/366
2023-04-24Use IRoomVersion (#3064)kegsay
This is a step towards allowing arbitrary room version impls.
2023-04-21Implement new RoomVersionImpl API (#3062)kegsay
As outlined in https://github.com/matrix-org/gomatrixserverlib/pull/368 The main change Dendrite side is that `RoomVersion` no longer has any methods on it. Instead, you need to bounce via `gmsl.GetRoomVersion`. It's very interesting to see where exactly Dendrite cares about this. For some places it's creating events (fine) but others are way more specific. Those areas will need to migrate to GMSL at some point.
2023-04-20refactor: funnel event creation through room versions (#3060)kegsay
In preparation of interfacing up the room version value.
2023-04-19refactor: update GMSL (#3058)kegsay
Sister PR to https://github.com/matrix-org/gomatrixserverlib/pull/364 Read this commit by commit to avoid going insane.
2023-04-14Update GMSL: use static Check functions (#3052)kegsay
Sister PR to https://github.com/matrix-org/gomatrixserverlib/pull/359 A nice side effect is that we don't need to re-parse the events in some cases.
2023-04-06refactor: use latest GMSL which splits fed client from matrix room logic (#3051)kegsay
Part of a series of refactors on GMSL.
2023-04-03Add user profile tests, refactor user API methods (#3030)Till
This adds tests for `/profile`. Also, as a first change in this regard, refactors the methods defined on the `UserInternalAPI` to not use structs as the request/response parameters.
2023-03-23Move every `db.Prepare` to `sqlutil.Statementlist`, remove trace driver (#3026)Till
Doesn't buy us much, but makes everything a bit more consistent. Also removes the SQL trace driver, as it is unused and the output is hard to read anyway.
2023-03-22Remove `BaseDendrite` (#3023)Till
Removes `BaseDendrite` to, hopefully, make testing and composing of components easier in the future.
2023-03-17Preparations for removing `BaseDendrite` (#3016)Till
Preparations to actually remove/replace `BaseDendrite`. Quite a few changes: - SyncAPI accepts an `fulltext.Indexer` interface (fulltext is removed from `BaseDendrite`) - Caches are removed from `BaseDendrite` - Introduces a `Router` struct (likely to change) - also fixes #2903 - Introduces a `sqlutil.ConnectionManager`, which should remove `base.DatabaseConnection` later on - probably more
2023-03-01Refactor `StoreEvent`, add `MaybeRedactEvent`, create an `EventDatabase` (#2989)Till
This PR changes the following: - `StoreEvent` now only stores an event (and possibly prev event), instead of also doing redactions - Adds a `MaybeRedactEvent` (pulled out from `StoreEvent`), which should be called after storing events - a few other things
2023-02-20Merge keyserver & userapi (#2972)Till
As discussed yesterday, a first draft of merging the keyserver and the userapi.
2023-02-14Remove polylith/API mode (#2967)Till
This removes most of the code used for polylith/API mode. This removes the `/api` internal endpoints entirely. Binary size change roughly 5%: ``` 51437560 Feb 13 10:15 dendrite-monolith-server # old 48759008 Feb 13 10:15 dendrite-monolith-server # new ```
2023-01-28Relay integration to pinecone demos (#2955)devonh
This extends the dendrite monolith for pinecone to integrate the s&f features into the mobile apps. Also makes a few tweaks to federation queueing/statistics to make some edge cases more robust.
2023-01-23Initial Store & Forward Implementation (#2917)devonh
This adds store & forward relays into dendrite for p2p. A few things have changed: - new relay api serves new http endpoints for s&f federation - updated outbound federation queueing which will attempt to forward using s&f if appropriate - database entries to track s&f relays for other nodes
2023-01-20Make tests more reliable (#2948)Till
When using `testrig.CreateBase` and then using that base for other `NewInternalAPI` calls, we never actually shutdown the components. `testrig.CreateBase` returns a `close` function, which only removes the database, so still running components have issues connecting to the database, since we ripped it out underneath it - which can result in "Disk I/O" or "pq deadlock detected" issues.
2023-01-19Add `/_dendrite/admin/purgeRoom/{roomID}` (#2662)Neil
This adds a new admin endpoint `/_dendrite/admin/purgeRoom/{roomID}`. It completely erases all database entries for a given room ID. The roomserver will start by clearing all data for that room and then will generate an output event to notify downstream components (i.e. the sync API and federation API) to do the same. It does not currently clear media and it is currently not implemented for SQLite since it relies on SQL array operations right now. Co-authored-by: Neil Alexander <neilalexander@users.noreply.github.com> Co-authored-by: Till Faelligen <2353100+S7evinK@users.noreply.github.com>
2023-01-17`/sync` performance optimizations (#2927)Till
Since #2849 there is no limit for the current state we fetch to calculate history visibility. In large rooms this can cause us to fetch thousands of membership events we don't really care about. This now only gets the state event types and senders in our timeline, which should significantly reduce the amount of events we fetch from the database. Also removes `MaxTopologicalPosition`, as it is an unnecessary DB call, given we use the result in `topological_position < $1` calls.
2023-01-12Always initialize statistics server mapDevon Hudson
2022-12-22More flakey testsTill Faelligen
2022-12-22Fix flakey testTill Faelligen
2022-12-22Add federation peeking table tests (#2920)Till
As the title says, adds tests for inbound/outbound peeking federation table tests. Also removes some unused code
2022-12-06Fix issue with sending presence events to invalid serversTill Faelligen
2022-12-05Enable/Disable internal metrics (#2899)Till
Basically enables us to use `test.WithAllDatabases` when testing internal HTTP APIs, as this would otherwise result in Prometheus complaining about already registered metric names.
2022-11-18Fix registration for virtual hostingNeil Alexander
2022-11-18Add p2p wakeup broadcast handling to pinecone demos (#2841)devonh
Adds wakeup broadcast handling to the pinecone demos. This will reset their blacklist status and interrupt any ongoing federation queue backoffs currently in progress for this peer. The end result is that any queued events will quickly be sent to the peer if they had disconnected while attempting to send events to them.
2022-11-17Try that againNeil Alexander
2022-11-17Fix `/key/v2/server`, add HTTP `Host` matchingNeil Alexander
2022-11-16Fix bug in a2f72dd9Neil Alexander