aboutsummaryrefslogtreecommitdiff
path: root/keyserver/inthttp/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'keyserver/inthttp/server.go')
-rw-r--r--keyserver/inthttp/server.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/keyserver/inthttp/server.go b/keyserver/inthttp/server.go
index f3d2882c..615b6f80 100644
--- a/keyserver/inthttp/server.go
+++ b/keyserver/inthttp/server.go
@@ -58,6 +58,17 @@ func AddRoutes(internalAPIMux *mux.Router, s api.KeyInternalAPI) {
return util.JSONResponse{Code: http.StatusOK, JSON: &response}
}),
)
+ internalAPIMux.Handle(QueryOneTimeKeysPath,
+ httputil.MakeInternalAPI("queryOneTimeKeys", func(req *http.Request) util.JSONResponse {
+ request := api.QueryOneTimeKeysRequest{}
+ response := api.QueryOneTimeKeysResponse{}
+ if err := json.NewDecoder(req.Body).Decode(&request); err != nil {
+ return util.MessageResponse(http.StatusBadRequest, err.Error())
+ }
+ s.QueryOneTimeKeys(req.Context(), &request, &response)
+ return util.JSONResponse{Code: http.StatusOK, JSON: &response}
+ }),
+ )
internalAPIMux.Handle(QueryKeyChangesPath,
httputil.MakeInternalAPI("queryKeyChanges", func(req *http.Request) util.JSONResponse {
request := api.QueryKeyChangesRequest{}