Repository navigation
Conversation
… return - Add src/allowlist/index.test.ts covering: disabled allowlist, admin role bypass, exact match, semicolon/whitespace normalization, rejection + audit log write, empty SQL, allowlist load failure, and cross-source isolation. - Fix: empty SQL returned an Error *object* instead of throwing. Since Error objects are truthy, callers doing if (await isQueryAllowed(...)) would treat the failure as allowed - an allowlist bypass. It now throws consistently.
This was referenced Nov 15, 2026
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.
Related to #71 (Improve test coverage with Vitest).
What
src/allowlist/index.test.tswith 8 tests forisQueryAllowed(previously untested): disabled feature, admin bypass, exact match, semicolon/whitespace normalization, rejection + audit-log write, empty SQL, allowlist load failure, cross-source isolation.src/allowlist/index.ts: empty SQL previously returned anErrorobject instead of throwing.Errorobjects are truthy, so callers doingif (await isQueryAllowed(...))would treat that failure as allowed — an allowlist bypass path. It now throws consistently.Verification
npx vitest run src/allowlist/index.test.ts→ 8/8 pass.Full suite: 159 passed; the 4 failures in
src/rls/index.test.tsare pre-existing onmainand untouched by this PR.