[api-minor] Add support for /AuthEvent, on-demand decryption#21351
[api-minor] Add support for /AuthEvent, on-demand decryption#21351wooorm wants to merge 5 commits into
/AuthEvent, on-demand decryption#21351Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #21351 +/- ##
==========================================
- Coverage 81.45% 81.42% -0.03%
==========================================
Files 260 260
Lines 65805 65908 +103
==========================================
+ Hits 53600 53666 +66
- Misses 12205 12242 +37
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| /** | ||
| * @import { | ||
| * CatalogAttachmentContent, | ||
| * CatalogAttachment | ||
| * } from "../core/catalog.js"; | ||
| */ | ||
|
|
There was a problem hiding this comment.
Here, and in other places as well, please note that code residing in src/core/ runs in a worker-thread whereas code in src/display/ runs in the main-thread.
Hence, given how data is being cloned when sent between threads, what ends up in the main-thread is essentially a "proxy" to the worker-thread data and not actually the same type.
There was a problem hiding this comment.
The values I get here are the same type as there? 🤔
/AuthEvent, on-demand decryption/AuthEvent, on-demand decryption
Normally entire PDFs are encrypted (or not). But it is also possible to only encrypt attachments. It is then also possible to *only* prompt for a password when the user opens them. In the existing flow, prompting for passwords happens because things are decrypted. A specific error is thrown, caught, and the user is prompted. To keep this flow working, this PR changes to decrypting attachments on demand, instead of eagerly. This sounds logical: to not read attachments on startup. I’ve extensively tested this, not only with regular attachments, but also with outline items and attachments in annotations. This PR builds on mozillaGH-21234. It’s an alternative to the naïve mozillaGH-20732. Closes mozillaGH-20049.
f91d1bf to
2bd5c04
Compare
(This branch also includes the commit from GH-21234, but that’s supposed to land separately, first.)
Normally entire PDFs are encrypted (or not).
But it is also possible to only encrypt attachments.
It is then also possible to only prompt for a password when the user opens
them.
In the existing flow, prompting for passwords happens because things are decrypted.
A specific error is thrown, caught, and the user is prompted.
To keep this flow working, this PR changes to decrypting attachments on demand,
instead of eagerly.
This sounds logical: to not read attachments on startup.
I’ve extensively tested this, not only with regular attachments, but also with outline items
and attachments in annotations.
This PR builds on GH-21234.
It’s an alternative to the naïve GH-20732.
Closes GH-20049.