Repository navigation
[fix] enforce local SQLite host policy (STAR-102) - #21
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Complexity | 6 |
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
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.
A host can now opt out of process-wide SQLite functions with
NewModuleWithHostPolicy(HostPolicy{DisableCustomFunctions: true}). Registration is rejected before the global registry is touched, and every local connection uses an independent driver without registered functions. Built-in SQL functions and the ordinary database API remain available. The default constructors keep custom functions enabled.The regression audit also reproduced two file-policy bypasses.
connect_remote("file:...")now uses the same local connection path, including registration locking, host policy and PRAGMAs. Restricted modules freeze their configured database at construction and do not exportset_database, so scripts cannot widen the allowlist through a setter or a later environment change.Validation:
go mod tidyleft dependencies unchanged.Behavior changes are limited to the explicit host policy and closing the restricted-file bypasses. Real network libSQL endpoints retain their behavior. This does not isolate or budget UDFs that remain enabled: they still use the process-wide registry and a separate Starlark thread, and closing a connection does not unregister them. No dependency, Go floor or interpreter pin is changed.
Part of STAR-102; the remaining enabled-UDF budget/lifecycle work stays open.