2020-07-13 16:02:35 +01:00
|
|
|
// Copyright 2020 The Matrix.org Foundation C.I.C.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package inthttp
|
|
|
|
|
|
|
|
import (
|
|
|
|
"github.com/gorilla/mux"
|
2022-09-20 10:32:03 +01:00
|
|
|
|
2020-07-13 16:02:35 +01:00
|
|
|
"github.com/matrix-org/dendrite/internal/httputil"
|
|
|
|
"github.com/matrix-org/dendrite/keyserver/api"
|
|
|
|
)
|
|
|
|
|
|
|
|
func AddRoutes(internalAPIMux *mux.Router, s api.KeyInternalAPI) {
|
2022-08-11 15:29:33 +01:00
|
|
|
internalAPIMux.Handle(
|
|
|
|
PerformClaimKeysPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverPerformClaimKeys", s.PerformClaimKeys),
|
2020-07-13 16:02:35 +01:00
|
|
|
)
|
2022-08-11 15:29:33 +01:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
PerformDeleteKeysPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverPerformDeleteKeys", s.PerformDeleteKeys),
|
2021-08-18 12:07:09 +01:00
|
|
|
)
|
2022-08-11 15:29:33 +01:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
PerformUploadKeysPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverPerformUploadKeys", s.PerformUploadKeys),
|
2021-08-04 17:56:29 +01:00
|
|
|
)
|
2022-08-11 15:29:33 +01:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
PerformUploadDeviceKeysPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverPerformUploadDeviceKeys", s.PerformUploadDeviceKeys),
|
2021-08-04 17:56:29 +01:00
|
|
|
)
|
2022-08-11 15:29:33 +01:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
PerformUploadDeviceSignaturesPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverPerformUploadDeviceSignatures", s.PerformUploadDeviceSignatures),
|
2020-07-13 16:02:35 +01:00
|
|
|
)
|
2022-08-11 15:29:33 +01:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
QueryKeysPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverQueryKeys", s.QueryKeys),
|
2020-07-13 16:02:35 +01:00
|
|
|
)
|
2022-08-11 15:29:33 +01:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
QueryOneTimeKeysPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverQueryOneTimeKeys", s.QueryOneTimeKeys),
|
2020-08-03 12:29:58 +01:00
|
|
|
)
|
2022-08-11 15:29:33 +01:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
QueryDeviceMessagesPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverQueryDeviceMessages", s.QueryDeviceMessages),
|
2020-08-04 11:32:14 +01:00
|
|
|
)
|
2022-08-11 15:29:33 +01:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
QueryKeyChangesPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverQueryKeyChanges", s.QueryKeyChanges),
|
2020-07-28 18:25:16 +01:00
|
|
|
)
|
2022-08-11 15:29:33 +01:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
QuerySignaturesPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverQuerySignatures", s.QuerySignatures),
|
2021-08-06 10:13:35 +01:00
|
|
|
)
|
2022-09-20 10:32:03 +01:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
PerformMarkAsStalePath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverMarkAsStale", s.PerformMarkAsStaleIfNeeded),
|
|
|
|
)
|
2020-07-13 16:02:35 +01:00
|
|
|
}
|