fix: keep JSON payloads out of authorized count proofs - #161
Merged
Merged
Conversation
rrrodzilla
force-pushed
the
fix/159-count-certification-followup
branch
from
September 10, 2026 08:58
fcf8edd to
62c3ee8
Compare
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.
Refs #159. Keep the issue open until the published patch is verified on the affected endpoint.
v0.44.1's PostgreSQL count proof inspected every JSON payload for decoder limits. Its opening-delimiter heuristic confused broad, shallow JSON with excessive nesting, so one such document forced the whole collection back to per-record scanning. Read-only investigation found 14,558 rejected documents in a 67,650-row collection, despite none exceeding actual structural-depth or numeric bounds.
The gate was unnecessary: JSON is omitted from both Cedar's schema and resource attributes, including required and hidden JSON. Applicable custom Read policies and explicit record policies already prevent this fast path. Removing JSON-content checks therefore preserves the exact authorized count and avoids work unrelated to authorization. Physical JSONB types, schema identity, tenant isolation, and Cedar-representable attributes remain checked.
Selected rows still decode normally. A distant undecodable JSON payload can now contribute to the authorized total without failing an otherwise valid page; selecting it still returns its decoding error. This is an intentional change from an incidental full-scan failure, not an assertion that every authorized payload can be decoded. Independent authorization review found no visibility or count counterexample under the existing proof gates.
Failed checks on stored authorization values now produce debug diagnostics with the field and category, without row values or extra database queries.
Validation:
Includes CLI v0.44.2, PostgreSQL crate v0.12.2, and release notes in this fix PR. Integration and backend crate versions remain unchanged.