mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Linting
This commit is contained in:
parent
c46f7d6316
commit
dd802ed3d4
|
|
@ -896,7 +896,8 @@ func Setup(
|
||||||
}),
|
}),
|
||||||
).Methods(http.MethodGet, http.MethodOptions)
|
).Methods(http.MethodGet, http.MethodOptions)
|
||||||
|
|
||||||
// Key Backup Versions
|
// Key Backup Versions (Metadata)
|
||||||
|
|
||||||
r0mux.Handle("/room_keys/version/{version}",
|
r0mux.Handle("/room_keys/version/{version}",
|
||||||
httputil.MakeAuthAPI("get_backup_keys_version", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
httputil.MakeAuthAPI("get_backup_keys_version", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
||||||
vars, err := httputil.URLDecodeMapValues(mux.Vars(req))
|
vars, err := httputil.URLDecodeMapValues(mux.Vars(req))
|
||||||
|
|
@ -935,7 +936,8 @@ func Setup(
|
||||||
}),
|
}),
|
||||||
).Methods(http.MethodPost, http.MethodOptions)
|
).Methods(http.MethodPost, http.MethodOptions)
|
||||||
|
|
||||||
// E2E Backup Keys
|
// Inserting E2E Backup Keys
|
||||||
|
|
||||||
// Bulk room and session
|
// Bulk room and session
|
||||||
r0mux.Handle("/room_keys/keys",
|
r0mux.Handle("/room_keys/keys",
|
||||||
httputil.MakeAuthAPI("put_backup_keys", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
httputil.MakeAuthAPI("put_backup_keys", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
||||||
|
|
@ -1022,6 +1024,8 @@ func Setup(
|
||||||
}),
|
}),
|
||||||
).Methods(http.MethodPut)
|
).Methods(http.MethodPut)
|
||||||
|
|
||||||
|
// Querying E2E Backup Keys
|
||||||
|
|
||||||
r0mux.Handle("/room_keys/keys",
|
r0mux.Handle("/room_keys/keys",
|
||||||
httputil.MakeAuthAPI("get_backup_keys", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
httputil.MakeAuthAPI("get_backup_keys", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
||||||
return GetBackupKeys(req, userAPI, device, req.URL.Query().Get("version"), "", "")
|
return GetBackupKeys(req, userAPI, device, req.URL.Query().Get("version"), "", "")
|
||||||
|
|
@ -1046,6 +1050,8 @@ func Setup(
|
||||||
}),
|
}),
|
||||||
).Methods(http.MethodGet, http.MethodOptions)
|
).Methods(http.MethodGet, http.MethodOptions)
|
||||||
|
|
||||||
|
// Deleting E2E Backup Keys
|
||||||
|
|
||||||
// Supplying a device ID is deprecated.
|
// Supplying a device ID is deprecated.
|
||||||
r0mux.Handle("/keys/upload/{deviceID}",
|
r0mux.Handle("/keys/upload/{deviceID}",
|
||||||
httputil.MakeAuthAPI("keys_upload", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
httputil.MakeAuthAPI("keys_upload", userAPI, func(req *http.Request, device *userapi.Device) util.JSONResponse {
|
||||||
|
|
|
||||||
|
|
@ -539,8 +539,10 @@ func (a *UserInternalAPI) QueryKeyBackup(ctx context.Context, req *api.QueryKeyB
|
||||||
res.Exists = !deleted
|
res.Exists = !deleted
|
||||||
|
|
||||||
if !req.ReturnKeys {
|
if !req.ReturnKeys {
|
||||||
// TODO return the counts
|
|
||||||
res.Count, err = a.AccountDB.CountBackupKeys(ctx, version, req.UserID)
|
res.Count, err = a.AccountDB.CountBackupKeys(ctx, version, req.UserID)
|
||||||
|
if err != nil {
|
||||||
|
res.Error = fmt.Sprintf("failed to count keys: %s", err)
|
||||||
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue