Skip to content
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

Merged
merged 14 commits into from
Jul 4, 2022
Merged

Add key upload tests #375

merged 14 commits into from
Jul 4, 2022

Conversation

S7evinK
Copy link
Contributor

@S7evinK S7evinK commented May 24, 2022

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.

@S7evinK S7evinK requested a review from kegsay May 24, 2022 05:28
})

// sytest: Can query remote device keys using POST
t.Run("Can query remote device keys using POST", func(t *testing.T) {
Copy link
Member

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.

must.MatchResponse(t, resp, match.HTTPResponse{
StatusCode: http.StatusOK,
JSON: []match.JSON{
match.JSONKeyEqual("one_time_key_counts.signed_curve25519", float64(1)),
Copy link
Member

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) {
Copy link
Member

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

@kegsay
Copy link
Member

kegsay commented Jun 13, 2022

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

@kegsay
Copy link
Member

kegsay commented Jun 13, 2022

@S7evinK S7evinK merged commit 5954ae7 into main Jul 4, 2022
@S7evinK S7evinK deleted the s7evink/keyupload branch July 4, 2022 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants