feat: add matrix content scanner support#2332
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #2332 +/- ##
==========================================
+ Coverage 53.49% 58.29% +4.80%
==========================================
Files 160 161 +1
Lines 19854 19912 +58
==========================================
+ Hits 10621 11608 +987
+ Misses 9233 8304 -929
... and 32 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
krille-chan
left a comment
There was a problem hiding this comment.
@kamor-famedly can you link an issue here?
| @@ -0,0 +1,605 @@ | |||
| #!/usr/bin/env dart | |||
| // ignore_for_file: avoid_print | |||
There was a problem hiding this comment.
Would it make sense to move this to /test/tool? So we don't introduce another root level directory
| if (isEncrypted && !room.client.encryptionEnabled) { | ||
| throw ('Encryption is not enabled in your Client.'); | ||
| } | ||
| // File attachments use per-file keys, independent of room encryption state. |
There was a problem hiding this comment.
I do not see why this was removed
There was a problem hiding this comment.
I treated file encryption as seperate from room/events encryption.
I think this is more appropriate
if (isEncrypted && !room.client.fileEncryptionEnabled) {
throw ('Encryption is not enabled in your Client.');
}
c0d2a9e to
14369da
Compare
This PR implements support for routing media downloads through a Matrix content scanner proxy.
When
contentScannerConfigis set, MXC download and thumbnail URLs are resolved against the scanner endpoints.downloadAndDecryptAttachment()now also supports scanner-backed downloads for encryptedattachments by posting the encrypted file metadata to
download_encrypted, then decrypting the returned bytes client-side as before.The implementation was tested end-to-end against our staging server using the local scanner proxy tool at
tool/content_scanner_proxy.dart.