Key backup: Add `hash` to represent stored keys

so that a matrix client A can check it is synchronised with the backup.
If not, that means that another client B has pushed keys client A does not have locally. Client A should then propose to the end user to retrieve  keys from the backup.
pull/977/head
manuroe 6 years ago committed by Hubert Chathi
parent ed945d6744
commit 82ff866b58

@ -172,6 +172,7 @@ On success, returns a JSON object with keys:
- `auth_data` (object): Required. Same as in the body parameters for - `auth_data` (object): Required. Same as in the body parameters for
`POST /room_keys/version`. `POST /room_keys/version`.
- `version` (string): Required. The backup version. - `version` (string): Required. The backup version.
- `hash` (string): Required. A hash value representing stored keys.
- `count` (number): Required. The number of keys stored in the backup. - `count` (number): Required. The number of keys stored in the backup.
Error codes: Error codes:
@ -240,7 +241,9 @@ Body parameters:
`m.megolm_backup.v1.curve25519-aes-sha2`, see below for the definition of `m.megolm_backup.v1.curve25519-aes-sha2`, see below for the definition of
this property. this property.
On success, returns the empty JSON object. On success, returns a JSON object with keys:
- `hash` (string): Required. The new hash value representing stored keys.
Error codes: Error codes:
@ -267,8 +270,11 @@ Example:
Result: Result:
```javascript ```javascript
{} {
"hash": "abcdefghi"
}
``` ```
##### `PUT /room_keys/keys/${roomId}?version=$v` ##### `PUT /room_keys/keys/${roomId}?version=$v`
Store several keys for the given room, using the given backup version. Store several keys for the given room, using the given backup version.
@ -308,8 +314,11 @@ Example:
Result: Result:
```javascript ```javascript
{} {
"hash": "abcdefghi"
}
``` ```
##### `PUT /room_keys/keys?version=$v` ##### `PUT /room_keys/keys?version=$v`
Store several keys, using the given backup version. Store several keys, using the given backup version.
@ -353,7 +362,9 @@ Example:
Result: Result:
```javascript ```javascript
{} {
"hash": "abcdefghi"
}
``` ```
#### Retrieving keys #### Retrieving keys

Loading…
Cancel
Save