diff --git a/clientapi/clientapi.go b/clientapi/clientapi.go index 2780f367c..545b95b0e 100644 --- a/clientapi/clientapi.go +++ b/clientapi/clientapi.go @@ -41,7 +41,6 @@ func AddPublicRoutes( deviceDB devices.Database, accountsDB accounts.Database, federation *gomatrixserverlib.FederationClient, - keyRing *gomatrixserverlib.KeyRing, rsAPI roomserverAPI.RoomserverInternalAPI, eduInputAPI eduServerAPI.EDUServerInputAPI, asAPI appserviceAPI.AppServiceQueryAPI, @@ -62,7 +61,7 @@ func AddPublicRoutes( routing.Setup( router, cfg, eduInputAPI, rsAPI, asAPI, - accountsDB, deviceDB, federation, *keyRing, + accountsDB, deviceDB, federation, syncProducer, transactionsCache, fsAPI, ) } diff --git a/clientapi/routing/getevent.go b/clientapi/routing/getevent.go index 3ca9d1b62..16f36d661 100644 --- a/clientapi/routing/getevent.go +++ b/clientapi/routing/getevent.go @@ -32,7 +32,6 @@ type getEventRequest struct { eventID string cfg *config.Dendrite federation *gomatrixserverlib.FederationClient - keyRing gomatrixserverlib.KeyRing requestedEvent gomatrixserverlib.Event } @@ -46,7 +45,6 @@ func GetEvent( cfg *config.Dendrite, rsAPI api.RoomserverInternalAPI, federation *gomatrixserverlib.FederationClient, - keyRing gomatrixserverlib.KeyRing, ) util.JSONResponse { eventsReq := api.QueryEventsByIDRequest{ EventIDs: []string{eventID}, @@ -75,7 +73,6 @@ func GetEvent( eventID: eventID, cfg: cfg, federation: federation, - keyRing: keyRing, requestedEvent: requestedEvent, } diff --git a/clientapi/routing/routing.go b/clientapi/routing/routing.go index f6aff0f0b..82a80fff9 100644 --- a/clientapi/routing/routing.go +++ b/clientapi/routing/routing.go @@ -55,7 +55,6 @@ func Setup( accountDB accounts.Database, deviceDB devices.Database, federation *gomatrixserverlib.FederationClient, - keyRing gomatrixserverlib.KeyRing, syncProducer *producers.SyncAPIProducer, transactionsCache *transactions.Cache, federationSender federationSenderAPI.FederationSenderInternalAPI, @@ -154,7 +153,7 @@ func Setup( if err != nil { return util.ErrorResponse(err) } - return GetEvent(req, device, vars["roomID"], vars["eventID"], cfg, rsAPI, federation, keyRing) + return GetEvent(req, device, vars["roomID"], vars["eventID"], cfg, rsAPI, federation) }), ).Methods(http.MethodGet, http.MethodOptions) diff --git a/docs/WIRING-Current.md b/docs/WIRING-Current.md index 677338583..62450f2f8 100644 --- a/docs/WIRING-Current.md +++ b/docs/WIRING-Current.md @@ -10,18 +10,18 @@ Note in Monolith mode these are actually direct function calls and are not seria ``` Tier 1 Sync PublicRooms FederationAPI ClientAPI MediaAPI -Public Facing | .-----1------` | | | | | | | | - 2 | .-------3-----------------` | | | | | | | - | | | .--------4----------------------------------` | | | - | | | | .---5-----------` | | | | | - | | | | | .---6----------------------------` | | - | | | | | | | .-----7----------` | - | | | | | | 8 | | 10 - | | | | | | | | `---9----. | - V V V V V V V V V V +Public Facing | .-----1------` | | | | | | | | | + 2 | .-------3-----------------` | | | `--------|-|-|-|--11--------------------. + | | | .--------4----------------------------------` | | | | + | | | | .---5-----------` | | | | | | + | | | | | .---6----------------------------` | | | + | | | | | | | .-----7----------` | | + | | | | | | 8 | | 10 | + | | | | | | | | `---9----. | | + V V V V V V V V V V V Tier 2 Roomserver EDUServer FedSender AppService KeyServer ServerKeyAPI -Internal only - +Internal only | `------------------------12----------^ ^ + `------------------------------------------------------------13----------` Client ---> Server ``` @@ -32,9 +32,12 @@ Internal only - 5 (FedAPI -> EDUServer): Sending typing/send-to-device events - 6 (ClientAPI -> EDUServer): Sending typing/send-to-device events - 7 (ClientAPI -> FedSender): Handling directory lookups -- 8 (FedAPI -> FedSender): Resetting backoffs when receiving traffic from a server. Querying joined hosts when handling alias lookup requests. -- 9 (FedAPI -> AppService): Working out if the client is an appservice user. -- 10 (ClientAPI -> AppService): Working out if the client is an appservice user. +- 8 (FedAPI -> FedSender): Resetting backoffs when receiving traffic from a server. Querying joined hosts when handling alias lookup requests +- 9 (FedAPI -> AppService): Working out if the client is an appservice user +- 10 (ClientAPI -> AppService): Working out if the client is an appservice user +- 11 (FedAPI -> ServerKeyAPI): Verifying incoming event signatures +- 12 (FedSender -> ServerKeyAPI): Verifying event signatures of responses (e.g from send_join) +- 13 (Roomserver -> ServerKeyAPI): Verifying event signatures of backfilled events ## Kafka logs diff --git a/internal/setup/monolith.go b/internal/setup/monolith.go index 55ceffd6b..4dfbf7115 100644 --- a/internal/setup/monolith.go +++ b/internal/setup/monolith.go @@ -67,7 +67,7 @@ type Monolith struct { func (m *Monolith) AddAllPublicRoutes(publicMux *mux.Router) { clientapi.AddPublicRoutes( publicMux, m.Config, m.KafkaConsumer, m.KafkaProducer, m.DeviceDB, m.AccountDB, - m.FedClient, m.KeyRing, m.RoomserverAPI, + m.FedClient, m.RoomserverAPI, m.EDUInternalAPI, m.AppserviceAPI, transactions.New(), m.FederationSenderAPI, )