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