2020-07-13 10:02:35 -05: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"
|
|
|
|
"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 09:29:33 -05:00
|
|
|
internalAPIMux.Handle(
|
|
|
|
PerformClaimKeysPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverPerformClaimKeys", s.PerformClaimKeys),
|
2020-07-13 10:02:35 -05:00
|
|
|
)
|
2022-08-11 09:29:33 -05:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
PerformDeleteKeysPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverPerformDeleteKeys", s.PerformDeleteKeys),
|
2021-08-18 06:07:09 -05:00
|
|
|
)
|
2022-08-11 09:29:33 -05:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
PerformUploadKeysPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverPerformUploadKeys", s.PerformUploadKeys),
|
2021-08-04 11:56:29 -05:00
|
|
|
)
|
2022-08-11 09:29:33 -05:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
PerformUploadDeviceKeysPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverPerformUploadDeviceKeys", s.PerformUploadDeviceKeys),
|
2021-08-04 11:56:29 -05:00
|
|
|
)
|
2022-08-11 09:29:33 -05:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
PerformUploadDeviceSignaturesPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverPerformUploadDeviceSignatures", s.PerformUploadDeviceSignatures),
|
2020-07-13 10:02:35 -05:00
|
|
|
)
|
2022-08-11 09:29:33 -05:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
QueryKeysPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverQueryKeys", s.QueryKeys),
|
2020-07-13 10:02:35 -05:00
|
|
|
)
|
2022-08-11 09:29:33 -05:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
QueryOneTimeKeysPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverQueryOneTimeKeys", s.QueryOneTimeKeys),
|
2020-08-03 06:29:58 -05:00
|
|
|
)
|
2022-08-11 09:29:33 -05:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
QueryDeviceMessagesPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverQueryDeviceMessages", s.QueryDeviceMessages),
|
2020-08-04 05:32:14 -05:00
|
|
|
)
|
2022-08-11 09:29:33 -05:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
QueryKeyChangesPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverQueryKeyChanges", s.QueryKeyChanges),
|
2020-07-28 12:25:16 -05:00
|
|
|
)
|
2022-08-11 09:29:33 -05:00
|
|
|
|
|
|
|
internalAPIMux.Handle(
|
|
|
|
QuerySignaturesPath,
|
|
|
|
httputil.MakeInternalRPCAPI("KeyserverQuerySignatures", s.QuerySignatures),
|
2021-08-06 04:13:35 -05:00
|
|
|
)
|
2020-07-13 10:02:35 -05:00
|
|
|
}
|