-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Key backup: add PUT /room_keys/version/{version}
#1
Conversation
…ients to add signatures to an existing backup
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple of minor issues, but overall looks pretty good. I'm wondering, though, if we should say that the server will ensure that the public key in the auth_data is the same as the previous value, though that means that the server must understand the different backup formats.
|
||
Body parameters: | ||
|
||
- `algorithm` (string): Optional. Must be the same as in the body parameters for `GET |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AIUI, in REST, the contents of PUT are supposed to be the full object that is to be stored, so I think algorithm
should be required.
@@ -177,6 +177,42 @@ Error codes: | |||
|
|||
- `M_NOT_FOUND`: No backup version has been created. | |||
|
|||
##### `PUT /room_keys/version/{version}` | |||
|
|||
Update information about the given version, or the current version if `{version}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having the {version}
optional seems like it makes it a bit too easy for a client to accidentally overwrite a new backup version with an old backup version. I think we should just make the version
required.
There's a race condition in this API for use with updating signatures. If the user is setting up backup on two devices A and B, they both fetch the backup version info, and then both sign the backup info, and then both send their updates to the server, then the server will only end up with one of the signatures. This might not be too bad in practice, but clients should do what they can to avoid this situation (e.g. re-fetching the backup info just before signing and sending, so that they have as much up-to-date information as they can get). |
Given we specify
You are right. Client should manage it. |
since they're marked as required
Reinstate and fix schema validation files
Reinstate and fix schema validation files
to allow matrix clients to add signatures to an existing backup or update any information in the
auth_data
field.