🔒 feat(mq-lang,mq-run): make HTTP module imports opt-in via --allow-http-import - #2199
Merged
Conversation
…ttp-import http-import predates SandboxedIo and was left outside its permission boundary for compatibility, so --allow-net never gated import/include of github.com/... or https://... URLs. Add a new --allow-http-import flag (and --allow-all) required before any HTTP/GitHub import is attempted; --allowed-domain keeps scoping which hosts are reachable once enabled. Library-level defaults (LSP/FFI/WASM embedders) are unchanged.
mq.lock trusts a URL's content on first fetch and records it with no signal, so a new HTTP-imported module can get silently trusted mid-CI run instead of during a reviewable local run. Add --frozen (mirrors npm ci / cargo build --locked / Bundler's --frozen): a URL with no existing mq.lock entry becomes a hard error instead of being recorded. Mutually exclusive with --no-lockfile. mq-lang's runtime error messages (HTTP import disabled, lockfile frozen/mismatch/parse-failure) no longer embed mq-run's CLI flag spelling, matching the host-agnostic style already used by SandboxedIo's permission errors; mq-lang is consumed by other front-ends (LSP, FFI, WASM) that don't share mq-run's flags.
harehare
force-pushed
the
feat/http-import-opt-in
branch
from
August 14, 2026 03:33
d5fc947 to
29e9028
Compare
2 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
http-import predates SandboxedIo and was left outside its permission boundary for compatibility, so --allow-net never gated import/include of github.com/... or https://... URLs. Add a new --allow-http-import flag (and --allow-all) required before any HTTP/GitHub import is attempted; --allowed-domain keeps scoping which hosts are reachable once enabled. Library-level defaults (LSP/FFI/WASM embedders) are unchanged.
#2194
Type of Change
Checklist
cargo fmtandcargo clippyand addressed any warningsjust test-alland all tests pass/docs, crateREADME.md) if neededAdditional Context