Closed babolivier closed 2 years ago
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.
file
m.room.message
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).
validate_encrypted_file_metadata
Closes #7
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 them.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