Repository navigation
fix(server): open the viewer store read-only and authenticate a non-loopback bind - #1676
Merged
Merged
Conversation
…oopback bind (#1667) Uteke::open_read_only opens SQLITE_OPEN_READ_ONLY with no WAL pragma, no migration and no index or cache file. A non-loopback bind requires the server auth token as a bearer on every request on top of the launch token, warns that the viewer is plain HTTP, and prints a usable launch URL host.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
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.
What
Uteke::open_read_only/Store::open_read_onlyin core:SQLITE_OPEN_READ_ONLY,query_only, no WAL pragma, noinit_schema, no vector-index file, no embedding cache. A missing store or a schema other than the current one is refused; an older one with a message to run any normalutekecommand once.uteke view(uteke-serve --viewer) uses it instead ofopen_with_backend.Authorization: Beareron top of the launch token (the bearer slot stops being a launch-token source on that bind). One-line warning that the viewer is plain HTTP and TLS must be terminated in front. The printed launch URL uses127.0.0.1/[::1]for a wildcard bind and brackets IPv6.docs/viewer.mdand CHANGELOG updated. The viewer is unreleased, so no compatibility shim.Why
"Read-only by construction" should hold below the router too: the old open set WAL and migrated an older store from the viewer, contending with the API server. And the bind guard read like authentication but did not authenticate.
Closes #1667
Testing
open_read_onlyleaves an older-schema file byte-identical and creates no files, refuses a missing store without creating it, and its handle rejects writes;Uteke::open_read_onlycreates no index/cache file.runreturns 1); with it, a request lacking the bearer, or with a wrong one, gets 401; the launch token alone, or the auth token alone, is not enough; launch URL host cases; the read routes still answer on a read-only handle.cargo fmt --check,cargo clippy -D warnings,cargo test -p uteke-server viewer.