aboutsummaryrefslogtreecommitdiff
path: root/federationapi/routing
diff options
context:
space:
mode:
authorTill <2353100+S7evinK@users.noreply.github.com>2023-03-17 12:09:45 +0100
committerGitHub <noreply@github.com>2023-03-17 11:09:45 +0000
commit5579121c6f27105342a2aea05cf9a3119d73cecb (patch)
tree1d8b7bec90079b6f693585d306c19019ea426870 /federationapi/routing
parentd88f71ab71a60348518f7fa6735ac9f0bfb472c3 (diff)
Preparations for removing `BaseDendrite` (#3016)
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
Diffstat (limited to 'federationapi/routing')
-rw-r--r--federationapi/routing/profile_test.go2
-rw-r--r--federationapi/routing/query_test.go2
-rw-r--r--federationapi/routing/routing.go6
-rw-r--r--federationapi/routing/send_test.go2
4 files changed, 6 insertions, 6 deletions
diff --git a/federationapi/routing/profile_test.go b/federationapi/routing/profile_test.go
index 3b9d576b..df494a74 100644
--- a/federationapi/routing/profile_test.go
+++ b/federationapi/routing/profile_test.go
@@ -50,7 +50,7 @@ func TestHandleQueryProfile(t *testing.T) {
defer close()
fedMux := mux.NewRouter().SkipClean(true).PathPrefix(httputil.PublicFederationPathPrefix).Subrouter().UseEncodedPath()
- base.PublicFederationAPIMux = fedMux
+ base.Routers.Federation = fedMux
base.Cfg.FederationAPI.Matrix.SigningIdentity.ServerName = testOrigin
base.Cfg.FederationAPI.Matrix.Metrics.Enabled = false
fedClient := fakeFedClient{}
diff --git a/federationapi/routing/query_test.go b/federationapi/routing/query_test.go
index d839a16b..69cf7047 100644
--- a/federationapi/routing/query_test.go
+++ b/federationapi/routing/query_test.go
@@ -50,7 +50,7 @@ func TestHandleQueryDirectory(t *testing.T) {
defer close()
fedMux := mux.NewRouter().SkipClean(true).PathPrefix(httputil.PublicFederationPathPrefix).Subrouter().UseEncodedPath()
- base.PublicFederationAPIMux = fedMux
+ base.Routers.Federation = fedMux
base.Cfg.FederationAPI.Matrix.SigningIdentity.ServerName = testOrigin
base.Cfg.FederationAPI.Matrix.Metrics.Enabled = false
fedClient := fakeFedClient{}
diff --git a/federationapi/routing/routing.go b/federationapi/routing/routing.go
index 324740dd..c86d18d2 100644
--- a/federationapi/routing/routing.go
+++ b/federationapi/routing/routing.go
@@ -65,9 +65,9 @@ func Setup(
servers federationAPI.ServersInRoomProvider,
producer *producers.SyncAPIProducer,
) {
- fedMux := base.PublicFederationAPIMux
- keyMux := base.PublicKeyAPIMux
- wkMux := base.PublicWellKnownAPIMux
+ fedMux := base.Routers.Federation
+ keyMux := base.Routers.Keys
+ wkMux := base.Routers.WellKnown
cfg := &base.Cfg.FederationAPI
if base.EnableMetrics {
diff --git a/federationapi/routing/send_test.go b/federationapi/routing/send_test.go
index eed4e7e6..53e1399a 100644
--- a/federationapi/routing/send_test.go
+++ b/federationapi/routing/send_test.go
@@ -48,7 +48,7 @@ func TestHandleSend(t *testing.T) {
defer close()
fedMux := mux.NewRouter().SkipClean(true).PathPrefix(httputil.PublicFederationPathPrefix).Subrouter().UseEncodedPath()
- base.PublicFederationAPIMux = fedMux
+ base.Routers.Federation = fedMux
base.Cfg.FederationAPI.Matrix.SigningIdentity.ServerName = testOrigin
base.Cfg.FederationAPI.Matrix.Metrics.Enabled = false
fedapi := fedAPI.NewInternalAPI(base, nil, nil, nil, nil, true)