-
Notifications
You must be signed in to change notification settings - Fork 10.3k
[api-minor] Implement securityHandler in the scripting API (bug 1731578) #14189
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
Conversation
ca99476
to
9b05fb5
Compare
src/core/catalog.js
Outdated
get securityHandler() { | ||
const encrypt = this.xref.trailer.get("Encrypt"); | ||
if (!isDict(encrypt)) { | ||
return null; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For future reference (since I've suggested changes that makes this getter unnecessary):
Please take care to shadow
all code-paths, rather than just one, when using that functionality.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, no problem!
e893b8c
to
50512c8
Compare
@Snuffleupagus Hope I'm on the right way. Basically if we including filter in info, we do not need to specify securityHandler on genericScripting ( as it is in btw - I see that the tests are falling, will research what suitable define entry would be. Followed the failing log and can see that I compare Standard with null so they fall, because my filter comes as a null now probably |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like there's a merge-commit accidentally included here, please remove than one and squash the commits.
However still cannot figure out why after building and everything it gives me error.
Where is the error thrown, in the terminal or in the browser?
Also, can you please provide the exact error message here?
3856e36
to
7691958
Compare
There's a number of conflicts here, which should go away if you rebase the patch. Assuming that you've followed https://github.com/mozilla/pdf.js/wiki/Contributing, then rebasing your local branch should be as simple as running |
@Snuffleupagus yeah right now working on it, sorry for extra submits. |
9a38042
to
74c7eaa
Compare
@Snuffleupagus basically what happens is localhost:8888 still throws me an error on load - thats the translation |
Yeah but it isn't the same message in the popup (you can open the pdf in firefox to compare). |
Hm, okay. I though it still mistake then ( even though I've noticed msgs are different. Will resubmit patch with null default val
|
04b58cb
to
0487282
Compare
test/integration/scripting_spec.js
Outdated
afterAll(async () => { | ||
await closePages(pages); | ||
}); | ||
it("must print secHandler valiue in a text field", async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: securityHandler instead of secHandler and there's a typo with value
0487282
to
bfad61a
Compare
bfad61a
to
91fc643
Compare
/botio unittest |
From: Bot.io (Linux m4)ReceivedCommand cmd_unittest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/2c04377959c9844/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/4e7f7d6a468af31/output.txt Total script time: 7.85 mins
|
/botio integrationtest |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/b277e1b0eebe027/output.txt |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/d1216af429db5a3/output.txt |
From: Bot.io (Linux m4)FailedFull output at http://54.241.84.105:8877/b277e1b0eebe027/output.txt Total script time: 4.69 mins
|
/botio-windows integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/4639e203f0e395a/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/4639e203f0e395a/output.txt Total script time: 6.53 mins
|
/botio-windows integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/c7c0c5aa3895fc6/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/c7c0c5aa3895fc6/output.txt Total script time: 8.78 mins
|
/botio-windows integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.193.163.58:8877/4f4adfaa91099d8/output.txt |
From: Bot.io (Windows)FailedFull output at http://54.193.163.58:8877/4f4adfaa91099d8/output.txt Total script time: 8.99 mins
|
- it could be the cause of the failures in mozilla#14189; - and the patch in firefox to enable the pref landed very recently: https://hg.mozilla.org/mozilla-central/rev/3de56e38f3c87f33a1e7849701edb3c62bc472a5
/botio integrationtest |
From: Bot.io (Windows)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 1 Live output at: http://54.193.163.58:8877/c19472a59cde797/output.txt |
From: Bot.io (Linux m4)ReceivedCommand cmd_integrationtest from @calixteman received. Current queue size: 0 Live output at: http://54.241.84.105:8877/3231efee05e10d2/output.txt |
From: Bot.io (Linux m4)SuccessFull output at http://54.241.84.105:8877/3231efee05e10d2/output.txt Total script time: 3.86 mins
|
From: Bot.io (Windows)SuccessFull output at http://54.193.163.58:8877/c19472a59cde797/output.txt Total script time: 6.54 mins
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for doing that.
- it could be the cause of the failures in mozilla#14189; - and the patch in firefox to enable the pref landed very recently: https://hg.mozilla.org/mozilla-central/rev/3de56e38f3c87f33a1e7849701edb3c62bc472a5
- it could be the cause of the failures in mozilla#14189; - and the patch in firefox to enable the pref landed very recently: https://hg.mozilla.org/mozilla-central/rev/3de56e38f3c87f33a1e7849701edb3c62bc472a5
Because
Missing security handler throws an error on pdf.js
The bug has been reported in bugzilla:
https://bugzilla.mozilla.org/show_bug.cgi?id=1731578
This pull request
Add Security Handler to pdf.js
Add puppeteer tests
Issue that this pull request solves
Closes: #14146