Repository navigation
feat: serve API search over HTTP QUERY - #80
Merged
Merged
Conversation
Allowlist QUERY in Puma and draw GET|QUERY on /api/entries so the CLI can put q in a JSON body. Inbox stays GET; GET ?q= remains as a compatibility path. The action is unchanged. Refs #71. Do not flip drift-cli until an unauthenticated QUERY against production returns 401, not a blank Puma 501.
Keep resources :entries. query :index on the collection is the canonical action, so the path stays /api/entries instead of tearing the resource into match via: [:get, :query].
Owner
Author
|
CLI half is ready in iuhoay/drift-cli#1 — Held: do not merge or release that until this is deployed. Probe just now: still 501, empty body, no CI here is green. Merge + deploy this first; flip the CLI after the probe returns 401. |
iuhoay
added a commit
to iuhoay/drift-cli
that referenced
this pull request
Aug 22, 2026
Split entries(): inbox stays GET /api/entries. Search uses QUERY with q/scope/limit in a JSON body so the query is not in the URL. Refs iuhoay/drift#71. Follows iuhoay/drift#80 (now on production).
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.
Server half of #71. Same
Api::EntriesController#index, now reachable as QUERY with the query in the JSON body.x-runtime.match "entries", via: [:get, :query]. A GET-onlyresources#indexnever matches QUERY.?q=stays as the compatibility path. Inbox stays GET.?q=, QUERY JSON body, and a single-character CJK query.Not in this PR: flipping
drift searchin iuhoay/drift-cli. Shipping QUERY in the client first dies with a blank 501.After merge + deploy, probe before touching the CLI:
Done when that is 401 (Rails reached the token check), not 501. Then split
entries()in drift-cli: search uses QUERY +send_json; inbox stays GET.Locally, after restarting Puma, unauthenticated QUERY on
:3000already returns 401 withx-runtime.