mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-20 05:13:11 -06:00
Route server key API endpoints on internal API mux
This commit is contained in:
parent
a435154fc1
commit
0a3d2fdf0d
|
|
@ -4,14 +4,15 @@ import (
|
|||
"encoding/json"
|
||||
"net/http"
|
||||
|
||||
"github.com/gorilla/mux"
|
||||
"github.com/matrix-org/dendrite/internal"
|
||||
"github.com/matrix-org/dendrite/serverkeyapi/api"
|
||||
"github.com/matrix-org/gomatrixserverlib"
|
||||
"github.com/matrix-org/util"
|
||||
)
|
||||
|
||||
func (s *ServerKeyAPI) SetupHTTP(servMux *http.ServeMux) {
|
||||
servMux.Handle(api.ServerKeyQueryPublicKeyPath,
|
||||
func (s *ServerKeyAPI) SetupHTTP(internalAPIMux *mux.Router) {
|
||||
internalAPIMux.Handle(api.ServerKeyQueryPublicKeyPath,
|
||||
internal.MakeInternalAPI("queryPublicKeys", func(req *http.Request) util.JSONResponse {
|
||||
result := map[gomatrixserverlib.PublicKeyLookupRequest]gomatrixserverlib.PublicKeyLookupResult{}
|
||||
request := api.QueryPublicKeysRequest{}
|
||||
|
|
@ -38,7 +39,7 @@ func (s *ServerKeyAPI) SetupHTTP(servMux *http.ServeMux) {
|
|||
return util.JSONResponse{Code: http.StatusOK, JSON: &response}
|
||||
}),
|
||||
)
|
||||
servMux.Handle(api.ServerKeyInputPublicKeyPath,
|
||||
internalAPIMux.Handle(api.ServerKeyInputPublicKeyPath,
|
||||
internal.MakeInternalAPI("inputPublicKeys", func(req *http.Request) util.JSONResponse {
|
||||
request := api.InputPublicKeysRequest{}
|
||||
response := api.InputPublicKeysResponse{}
|
||||
|
|
|
|||
|
|
@ -79,11 +79,7 @@ func SetupServerKeyAPIComponent(
|
|||
}).Info("Enabled perspective key fetcher")
|
||||
}
|
||||
|
||||
/*
|
||||
if base.EnableHTTPAPIs {
|
||||
internalAPI.SetupHTTP(http.DefaultServeMux)
|
||||
}
|
||||
*/
|
||||
internalAPI.SetupHTTP(base.InternalAPIMux)
|
||||
|
||||
return &internalAPI
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue