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

Ensure that uploaded keys are dicts #17097

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from

Conversation

S7evinK
Copy link
Contributor

@S7evinK S7evinK commented Apr 16, 2024

Similar to the existing checks for one_time_keys or fallback_keys, this adds a check that device_keys is a JSON object.
Also verifies that the uploaded keys match the uploading user.

@S7evinK S7evinK requested a review from a team as a code owner April 16, 2024 15:00
"message": "Not updating device_keys for user, user_id or device_id mismatch",
"user_id": user_id,
}
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should these not be errors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would result in us "rejecting" the OTKs and fallback keys, if they are present in the request.

if (
device_keys["user_id"] == user_id
and device_keys["device_id"] == device_id
):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we want to validate these things we should make pydantic models of the request format

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.

None yet

2 participants