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