Skip to content

Validate the incoming cursor where the criteria is parsed. - #10

Merged
gustavofreze merged 1 commit into
mainfrom
fix/validate-cursor-token-at-the-criteria-boundary
Sep 3, 2026
Merged

Validate the incoming cursor where the criteria is parsed.#10
gustavofreze merged 1 commit into
mainfrom
fix/validate-cursor-token-at-the-criteria-boundary

Conversation

@gustavofreze

Copy link
Copy Markdown
Member

Criteria::fromQuery documented itself as the point where the query string is validated, and raised eight of the nine failures a malformed request can produce. The cursor was the exception: Token defers the decode, so CursorIsInvalid surfaced from SeekClause while the seek was being built, long past the try every consumer wraps fromQuery in. Every consumer therefore answered 500 to a tampered cursor instead of 422. Decoding at the boundary completes the contract and fixes them with no change on their side.

Please follow the contributing guidelines.

Summary

What this pull request does.

Related issue

Closes #...

Checklist

  • Tests added or updated.
  • Documentation updated when applicable.
  • make review passes.
  • make tests passes.

Criteria::fromQuery documented itself as the point where the query
string is validated, and raised eight of the nine failures a malformed
request can produce. The cursor was the exception: Token defers the
decode, so CursorIsInvalid surfaced from SeekClause while the seek was
being built, long past the try every consumer wraps fromQuery in. Every
consumer therefore answered 500 to a tampered cursor instead of 422.
Decoding at the boundary completes the contract and fixes them with no
change on their side.
@gustavofreze
gustavofreze merged commit 382136d into main Sep 3, 2026
5 checks passed
@gustavofreze
gustavofreze deleted the fix/validate-cursor-token-at-the-criteria-boundary branch September 3, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant