-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add key upload tests #375
Add key upload tests #375
Conversation
}) | ||
|
||
// sytest: Can query remote device keys using POST | ||
t.Run("Can query remote device keys using POST", func(t *testing.T) { |
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.
This isn't the same as the sytest, which does stuff with displaynames.
tests/csapi/upload_keys_test.go
Outdated
must.MatchResponse(t, resp, match.HTTPResponse{ | ||
StatusCode: http.StatusOK, | ||
JSON: []match.JSON{ | ||
match.JSONKeyEqual("one_time_key_counts.signed_curve25519", float64(1)), |
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.
It's unclear why this should be signed_curve25519
, and in this way the sytest is clearer. Perhaps instead loop the oneTimeKeys
map.
}) | ||
|
||
// sytest: Rejects invalid device keys | ||
t.Run("Rejects invalid device keys", func(t *testing.T) { |
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.
Please please please keep useful sytest comments when porting things over. You don't explain in this test how this request is invalid :/
The sytest is clearer: # algorithms, keys and signatures are required fields, but missing
I think the device display name is optional now or something? Synapse is failing as it is missing. It's definitely configurable: see https://github.com/matrix-org/synapse/blob/2cc5ea933dbe65445e3711bb3f05022b007029ea/synapse/storage/databases/main/end_to_end_keys.py#L97 |
Again, the commit history should give an overview of what is added.
This also updates
maunium.net/go/mautrix
to fix an index out of range issue when generating keys.