fix(entities): count and page only authorized records - #154
Merged
Conversation
This was referenced Sep 10, 2026
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.
Entity list counts and offsets previously ran before record authorization. A page containing denied records could be empty while reporting a nonzero total, and readable records on later storage pages were skipped. Apply the existing operator record policy and Cedar checks before counting and paging for both GET lists and POST queries. Totals now count readable matches, and offsets skip readable records. No authorization rules or owner semantics change.
Scan complete candidate rows in batches of 256, retain the requested readable page, and stop early when totals are disabled. Field projection remains after authorization. Document the full-scan cost of exact totals, SQL Server's existing internal table scans, and the absence of a shared database snapshot across batches.
Validation: the committed dependency lockfile passed 720 integration tests (seven skipped) and all-target clippy with warnings denied for the integration crate and PostgreSQL CLI. New HTTP tests cover mixed and all-denied filters, beyond-end offsets, field projection, and a 520-row cross-batch case with both Cedar and an operator record policy. Independent PostgreSQL acceptance passed all 11 cases on the patched CLI; the prior official binary failed those same cases against the same database.
Fixes #152.