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 validation utils for encrypted file metadata #25

Merged
merged 3 commits into from
Sep 29, 2022

Conversation

babolivier
Copy link
Contributor

@babolivier babolivier commented Sep 28, 2022

When scanning an encrypted file, clients are expected to send the content scanner some metadata it can use to decrypt it. This is typically the file property of the m.room.message event content. See https://github.com/matrix-org/matrix-content-scanner-python/blob/main/docs/api.md#post-_matrixmedia_proxyunstabledownload_encrypted to see how it fits into the API, and an example.

This adds a validate_encrypted_file_metadata util that performs a few validation checks on the client-provided data to ensure it's in the right format before passing it on to the scanner. This will then be used by the http handler code (coming in a future PR, see https://github.com/matrix-org/matrix-content-scanner-python-wip/blob/main/matrix_content_scanner/servlets/__init__.py#L166-L241 to see what it will looks like).

Closes #7

@babolivier babolivier requested a review from a team as a code owner September 28, 2022 09:51
@babolivier babolivier requested a review from clokep September 29, 2022 09:38
@babolivier babolivier merged commit c1b8d6c into main Sep 29, 2022
@babolivier babolivier deleted the babolivier/encrypted_metadata_utils branch September 29, 2022 14:49
babolivier added a commit to matrix-org/matrix-content-scanner-python-wip that referenced this pull request Sep 29, 2022
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.

Migrate encrypted file metadata utils
2 participants