From 9c36971b117dc0dc25b90cc44d6e66fb37b3e309 Mon Sep 17 00:00:00 2001 From: terrill <314156936@qq.com> Date: Fri, 27 Jul 2018 11:20:02 +0800 Subject: [PATCH] a slight change to match master auth.Data --- .../matrix-org/dendrite/encryptoapi/routing/routing.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/github.com/matrix-org/dendrite/encryptoapi/routing/routing.go b/src/github.com/matrix-org/dendrite/encryptoapi/routing/routing.go index 9131345f0..1cb78238d 100644 --- a/src/github.com/matrix-org/dendrite/encryptoapi/routing/routing.go +++ b/src/github.com/matrix-org/dendrite/encryptoapi/routing/routing.go @@ -35,30 +35,30 @@ func Setup( encryptionDB *storage.Database, deviceDB *devices.Database, ) { - dataDB := auth.DeviceDatabase(deviceDB) + authData := auth.Data{nil, deviceDB, nil} unstablemux := apiMux.PathPrefix(pathPrefixUnstable).Subrouter() unstablemux.Handle("/keys/upload/{deviceID}", - common.MakeAuthAPI("upload keys", dataDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse { + common.MakeAuthAPI("upload keys", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse { return UploadPKeys(req, encryptionDB, device.UserID, device.ID) }), ).Methods(http.MethodPost, http.MethodOptions) unstablemux.Handle("/keys/upload", - common.MakeAuthAPI("upload keys", dataDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse { + common.MakeAuthAPI("upload keys", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse { return UploadPKeys(req, encryptionDB, device.UserID, device.ID) }), ).Methods(http.MethodPost, http.MethodOptions) unstablemux.Handle("/keys/query", - common.MakeAuthAPI("query keys", dataDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse { + common.MakeAuthAPI("query keys", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse { //vars := mux.Vars(req) return QueryPKeys(req, encryptionDB, device.ID, deviceDB) }), ).Methods(http.MethodPost, http.MethodOptions) unstablemux.Handle("/keys/claim", - common.MakeAuthAPI("claim keys", dataDB, func(req *http.Request, device *authtypes.Device) util.JSONResponse { + common.MakeAuthAPI("claim keys", authData, func(req *http.Request, device *authtypes.Device) util.JSONResponse { return ClaimOneTimeKeys(req, encryptionDB) }), ).Methods(http.MethodPost, http.MethodOptions)