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

JQ is disabled on strict CSP #15

Closed
paolosimone opened this issue Nov 7, 2021 · 1 comment
Closed

JQ is disabled on strict CSP #15

paolosimone opened this issue Nov 7, 2021 · 1 comment
Labels
question Further information is requested wontfix This will not be worked on

Comments

@paolosimone
Copy link
Owner

paolosimone commented Nov 7, 2021

Description

When I load a json from a remote host served with strict Content Security Policy (CSP) rules, the JQ filter bar is not showing.
Example: https://api.github.com/users/paolosimone/repos

Details

This happens because JQ filtering relies on WebAssembly, but WASM execution is enabled only if CSP allows the execution of unsafe code ('script-src': 'unsafe-eval')... even if the wasm file is the one bundled with the extension package!

Error: Wasm code generation disallowed by embedder

References:

Why not Sandbox?

The recommended approach is to run wasm code in a sandbox and send/receive data through message passing. This solution introduces an additional overhead due to serialization/deserialization of the message content (in our case, the JSON itself).

How much overhead? Will it continue to work smoothly with ~10MB json?

Don't know, I guess we could give it a try (at least as a fallback strategy) before jumping to conclusion.

But I want to use the interactive JQ feature now

I feel you. In the meantime you could download the json (floppy disk icon) and load the file in the browser.

@paolosimone paolosimone added the question Further information is requested label Nov 7, 2021
@paolosimone paolosimone mentioned this issue Nov 7, 2021
@paolosimone paolosimone added the wontfix This will not be worked on label Jan 7, 2023
@paolosimone
Copy link
Owner Author

guess we'll deal with it 🤷

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant