From c16abb089ce76b34736f425cf3c63d13f1e7a387 Mon Sep 17 00:00:00 2001 From: Neil Alexander Date: Tue, 1 Dec 2020 10:52:02 +0000 Subject: [PATCH] Give fsAPI to keyserver in polylith/gobind --- build/gobind/monolith.go | 14 ++++++++------ .../personalities/keyserver.go | 3 ++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/build/gobind/monolith.go b/build/gobind/monolith.go index fd010809..fdb14877 100644 --- a/build/gobind/monolith.go +++ b/build/gobind/monolith.go @@ -112,22 +112,24 @@ func (m *DendriteMonolith) Start() { serverKeyAPI := &signing.YggdrasilKeys{} keyRing := serverKeyAPI.KeyRing() - keyAPI := keyserver.NewInternalAPI(&base.Cfg.KeyServer, federation) - userAPI := userapi.NewInternalAPI(accountDB, &cfg.UserAPI, cfg.Derived.ApplicationServices, keyAPI) - keyAPI.SetUserAPI(userAPI) rsAPI := roomserver.NewInternalAPI( base, keyRing, ) + fsAPI := federationsender.NewInternalAPI( + base, federation, rsAPI, keyRing, + ) + + keyAPI := keyserver.NewInternalAPI(&base.Cfg.KeyServer, federation) + userAPI := userapi.NewInternalAPI(accountDB, &cfg.UserAPI, cfg.Derived.ApplicationServices, keyAPI) + keyAPI.SetUserAPI(userAPI) + eduInputAPI := eduserver.NewInternalAPI( base, cache.New(), userAPI, ) asAPI := appservice.NewInternalAPI(base, userAPI, rsAPI) - fsAPI := federationsender.NewInternalAPI( - base, federation, rsAPI, keyRing, - ) ygg.SetSessionFunc(func(address string) { req := &api.PerformServersAliveRequest{ diff --git a/cmd/dendrite-polylith-multi/personalities/keyserver.go b/cmd/dendrite-polylith-multi/personalities/keyserver.go index 8c159ad0..6a790760 100644 --- a/cmd/dendrite-polylith-multi/personalities/keyserver.go +++ b/cmd/dendrite-polylith-multi/personalities/keyserver.go @@ -21,7 +21,8 @@ import ( ) func KeyServer(base *setup.BaseDendrite, cfg *config.Dendrite) { - intAPI := keyserver.NewInternalAPI(&base.Cfg.KeyServer, base.CreateFederationClient()) + fsAPI := base.FederationSenderHTTPClient() + intAPI := keyserver.NewInternalAPI(&base.Cfg.KeyServer, fsAPI) intAPI.SetUserAPI(base.UserAPIClient()) keyserver.AddInternalRoutes(base.InternalAPIMux, intAPI)