diff --git a/appservice/appservice.go b/appservice/appservice.go index 76181d2a3..be5b30e2b 100644 --- a/appservice/appservice.go +++ b/appservice/appservice.go @@ -82,9 +82,7 @@ func SetupAppServiceAPIComponent( Cfg: base.Cfg, } - if base.EnableHTTPAPIs { - appserviceQueryAPI.SetupHTTP(http.DefaultServeMux) - } + appserviceQueryAPI.SetupHTTP(base.InternalAPIMux) consumer := consumers.NewOutputRoomEventConsumer( base.Cfg, base.KafkaConsumer, accountsDB, appserviceDB, diff --git a/appservice/query/query.go b/appservice/query/query.go index a61997b42..812ca9f49 100644 --- a/appservice/query/query.go +++ b/appservice/query/query.go @@ -23,6 +23,7 @@ import ( "net/url" "time" + "github.com/gorilla/mux" "github.com/matrix-org/dendrite/appservice/api" "github.com/matrix-org/dendrite/internal" "github.com/matrix-org/dendrite/internal/config" @@ -182,8 +183,8 @@ func makeHTTPClient() *http.Client { // SetupHTTP adds the AppServiceQueryPAI handlers to the http.ServeMux. This // handles and muxes incoming api requests the to internal AppServiceQueryAPI. -func (a *AppServiceQueryAPI) SetupHTTP(servMux *http.ServeMux) { - servMux.Handle( +func (a *AppServiceQueryAPI) SetupHTTP(internalAPIMux *mux.Router) { + internalAPIMux.Handle( api.AppServiceRoomAliasExistsPath, internal.MakeInternalAPI("appserviceRoomAliasExists", func(req *http.Request) util.JSONResponse { var request api.RoomAliasExistsRequest @@ -197,7 +198,7 @@ func (a *AppServiceQueryAPI) SetupHTTP(servMux *http.ServeMux) { return util.JSONResponse{Code: http.StatusOK, JSON: &response} }), ) - servMux.Handle( + internalAPIMux.Handle( api.AppServiceUserIDExistsPath, internal.MakeInternalAPI("appserviceUserIDExists", func(req *http.Request) util.JSONResponse { var request api.UserIDExistsRequest diff --git a/eduserver/eduserver.go b/eduserver/eduserver.go index cba60b8ea..14fbd3328 100644 --- a/eduserver/eduserver.go +++ b/eduserver/eduserver.go @@ -13,8 +13,6 @@ package eduserver import ( - "net/http" - "github.com/matrix-org/dendrite/eduserver/api" "github.com/matrix-org/dendrite/eduserver/cache" "github.com/matrix-org/dendrite/eduserver/input" @@ -35,9 +33,7 @@ func SetupEDUServerComponent( OutputTypingEventTopic: string(base.Cfg.Kafka.Topics.OutputTypingEvent), } - if base.EnableHTTPAPIs { - inputAPI.SetupHTTP(http.DefaultServeMux) - } + inputAPI.SetupHTTP(base.InternalAPIMux) return inputAPI } diff --git a/eduserver/input/input.go b/eduserver/input/input.go index 50837154a..73777e323 100644 --- a/eduserver/input/input.go +++ b/eduserver/input/input.go @@ -19,6 +19,7 @@ import ( "time" "github.com/Shopify/sarama" + "github.com/gorilla/mux" "github.com/matrix-org/dendrite/eduserver/api" "github.com/matrix-org/dendrite/eduserver/cache" "github.com/matrix-org/dendrite/internal" @@ -90,8 +91,8 @@ func (t *EDUServerInputAPI) sendEvent(ite *api.InputTypingEvent) error { } // SetupHTTP adds the EDUServerInputAPI handlers to the http.ServeMux. -func (t *EDUServerInputAPI) SetupHTTP(servMux *http.ServeMux) { - servMux.Handle(api.EDUServerInputTypingEventPath, +func (t *EDUServerInputAPI) SetupHTTP(internalAPIMux *mux.Router) { + internalAPIMux.Handle(api.EDUServerInputTypingEventPath, internal.MakeInternalAPI("inputTypingEvents", func(req *http.Request) util.JSONResponse { var request api.InputTypingEventRequest var response api.InputTypingEventResponse diff --git a/sytest-whitelist b/sytest-whitelist index d4e6be9a4..460dc194e 100644 --- a/sytest-whitelist +++ b/sytest-whitelist @@ -289,3 +289,4 @@ Existing members see new members' join events Inbound federation can receive events Inbound federation can receive redacted events Can logout current device +Guest users can accept invites to private rooms over federation