-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Cross-signing [3/4] -- uploading signatures edition #5726
Conversation
9306355
to
9d38b5e
Compare
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.
I haven't done a full review here, just some ideas for upload_signatures_for_device_keys. I'm going to wait for #4970 to mature a bit more before proceeding.
synapse/handlers/e2e_keys.py
Outdated
device_id | ||
] = _exception_to_failure(e) | ||
except SynapseError as e: | ||
failures[user_id] = { |
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.
kinda wondering under what circumstances we are likely to hit this case, and whether it is worth special handling rather than just failing the whole request.
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.
I'm not sure. It's probably a spec discussion about whether the server can fail the whole request, and under what conditions.
47c5925
to
415d0a0
Compare
There seems to be an intermittent sytest is failure. b6e3dec failed with
but d3f2fbc (which only adds documentation) passed. I suspect that it is unrelated to my changes. I think this is ready for review again. |
Indeed. I've raised matrix-org/sytest#696. |
please could you link to the MSC or spec this is implementing? Also: can this target develop rather than an intermediate branch? |
I've realised that the earlier PRs have landed on said intermediate branch. I'm not a fan of long-lived feature branches: can we get it merged to develop? |
matrix-org/matrix-spec-proposals#1756
@erikjohnston had suggested that I merge to a separate branch rather than develop. I can do either way, so the two of you can |
thanks.
I've discussed this with erik a bit, and I think our position goes like this: we prefer to avoid feature branches (especially long-lived ones) because:
On the other hand:
TL;DR: If there are no particular reasons why the changes so far can't land on develop, I'd like to see them merged. If there are such reasons, could you identify them? |
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.
There's a lot of stuff here, and I'm struggling to hold it all in my head, so I'll take your word for it that it's doing about the right thing. A few requests though.
As a general principle: I'd like to see more validation of input (eg checking that things that should be dicts are in fact dicts), so that we return a 400 rather than a 500 in the case of malformed requests.
Sytest failures seem to be new 3pid-related stuff, which will hopefully get fixed when I merge develop in (again). The synapse unit test failure seems to be my old friend Aside from that, though, I think this is ready for review again now. I can fix #5726 (comment) if what I've written there makes sense. |
synapse/handlers/e2e_keys.py
Outdated
if ( | ||
signing_device_id not in devices | ||
or signing_key_id | ||
not in devices[signing_device_id]["keys"]["keys"] |
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.
that sounds sensible, I think. I'd love it if it could be a preliminary PR rather than rolled into this one, though.
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.
Once again I'm afraid I've totally paged out most of the context on this PR, but I think it's probably sensible. As well as the nits above, and fixing whatever's wrong with the CI: can we target develop
as per #5726 (comment)?
Yes, I'll do that, although I want to try to fix the CI before I merge the previous PRs into develop, so that we don't have a broken CI in develop. |
... again? How did you make it disappear, git?
I think I've addressed all the issues, and I've re-merged develop so the tests pass. I've also changed this PR so that it targets develop, now that the previous PRs have been merged in. |
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.
Looks plausible!
@uhoreg has confirmed these were both typos. They are only in comments and tests though, rather than anything critical. Introduced in: * matrix-org#7157 * matrix-org#5726
* commit '276173163': Add changelog entry fix doc strings make isort happy add some comments drop some logger lines to debug make changes based on PR feedback add function docs use something that's the right type for user_id run black split out signature processing into separate functions avoid modifying input parameter fix test update with newer coding style add test make isort happy make black happy allow uploading signatures of master key signed by devices implement device signature uploading/fetching
DO NOT MERGE until
uhoreg/e2e_cross-signing2
is merged, and the base of this PR changes todevelop
Allows users to upload signatures using the new
/keys/signatures/upload
endpoint.The
upload_signatures_for_device_keys
is really long. I'm not sure what's the best way to make it more manageable.