Repository navigation
fix: allow read-only token on read POST endpoints (#524) - #525
Merged
Merged
Conversation
Read-only token was blocking ALL POST endpoints (403), but many POST endpoints are reads (/recall, /search, /list, /stats, /room/recall, etc.). Changed: blanket 'method != GET' check → per-endpoint allowlist based on operation semantics. ReadOnly tokens can now: - POST /recall, /search, /list, /stats (read queries) - POST /room/recall, /room/summary, /room/document, /room/stats (room reads) - POST /doc/get, /doc/list, /doc/search (document reads) - All GET endpoints (unchanged) Still blocked: - POST /remember, /forget, /room/create, /room/delete, /doc/create, /doc/move, /doc/delete, /context, /dream, /mcp (all writes)
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-cli · BYOK · MIT |
ajianaz
added a commit
that referenced
this pull request
Aug 13, 2026
…d-endpoints-524 fix: allow read-only token on read POST endpoints (#524)
This was referenced Nov 10, 2026
ajianaz
added a commit
that referenced
this pull request
Nov 11, 2026
) (#1725) The rooms field on memory hits is CORE (contract amendment 4 point 1, uteke-cloud #525). Exact-value tests now pin it on POST /recall (plain, fusion, unified, pack, explain), POST /search, POST /room/recall with a query, MCP uteke_recall, uteke_search and uteke_room_recall, and the CLI --json of recall, search and room recall: the list shape, the sort by room_id, room_name as the title or the id for a missing or blank title, the omitted key for a memory in no room, no rooms on a document item, and no leak from a hit cut by limit. A test reads docs/core-contract.json so the three routes must stay CORE. Mutation-checked by hand. Also: connect_hooks tolerates a broken pipe when a hook exits before reading its stdin (a race already on develop), and the unified hit check skips document items instead of panicking.
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.
Problem
Read-only token blocks all POST endpoints with 403, including reads like
POST /recall,POST /list,POST /search. Clients (e.g. CorIn desktop) that query memories via these endpoints get empty data with a read-only token.Fixes #524.
Root Cause
The read-only middleware used a blanket
method != Method::Getcheck (line 49), blocking all non-GET requests regardless of whether they are reads or writes.Fix
Replace blanket HTTP method check with per-endpoint allowlist based on operation semantics:
/recall,/search,/list,/stats/room/recall,/room/summary,/room/document,/room/stats/doc/get,/doc/list,/doc/search/remember,/forget,/room/create,/room/delete,/doc/create,/doc/move,/doc/delete,/context,/dream,/mcpAll GET endpoints remain unchanged (already allowed).
Security note
path == *ep) to prevent prefix-based bypass (Cora flagged this)./mcp) still blocked for read-only — it can perform writes viauteke_remembertool.Files
crates/uteke-server/src/handlers.rs— replace blanket check with allowlist