mirror of
https://github.com/open-policy-agent/opa.git
synced 2026-08-12 19:32:48 -06:00
02ea7b7dc2
Fixes: #962 Pasting a snippet containing a tab into the REPL triggered tab-completion on the pasted tab, corrupting the input (e.g. injecting a completion candidate mid-line and producing a spurious parse error). Spaces were unaffected, so the bug only surfaced with tab-indented pastes. The fix is bracketed paste: with it enabled, a terminal wraps pasted text in paste markers and the line-reader inserts it literally instead of treating an embedded tab as a completion request. The previous reader, peterh/liner, has no bracketed-paste support and is unmaintained (last release 2021; the same fix was proposed upstream in peterh/liner#114 in 2019 with no traction), so this replaces it with reeflective/readline, which supports bracketed paste, completion, and history. OPA's existing multi-line buffering (the r.buffer parse-retry mechanism) is kept as-is; readline's native multi-line editing is left disabled to avoid changing REPL behavior. --------- Signed-off-by: Sebastian Spaink <sebastianspaink@gmail.com>
github.com/open-policy-agent/opa/e2e
This Go module is for end-to-end tests that come with dependencies we don't otherwise need for OPA, to avoid bloat in OPA's Go module's deps.
Warning
This module should never be imported from any of the other
github.com/open-policy-agent/opa/*packages!