Skip to content

fix: keep JSON payloads out of authorized count proofs - #161

Merged
rrrodzilla merged 2 commits into
mainfrom
fix/159-count-certification-followup
Sep 10, 2026
Merged

rrrodzilla merged 2 commits into
mainfrom
fix/159-count-certification-followup

Conversation

@rrrodzilla

Copy link
Copy Markdown
Contributor

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:

  • Seven PostgreSQL regressions passed, including broad arrays/objects, bracket-heavy and digit-heavy strings, unselected versus selected undecodable JSON, required/hidden JSON, foreign-tenant exclusion, and existing schema/identifier safety checks.
  • PostgreSQL all-target Clippy passed with warnings denied.
  • A generic 67,650-row, 33-field HTTP fixture with broad JSON in one fifth of its rows reproduces v0.44.1's HTTP 408 after 30.056 seconds. The corrected candidate returns the exact total in 0.372 seconds.
  • Selected broad JSON, filtered POST counts, and past-end paging passed in 0.29 to 0.39 seconds.

Includes CLI v0.44.2, PostgreSQL crate v0.12.2, and release notes in this fix PR. Integration and backend crate versions remain unchanged.

@rrrodzilla
rrrodzilla force-pushed the fix/159-count-certification-followup branch from fcf8edd to 62c3ee8 Compare September 10, 2026 08:58
@rrrodzilla
rrrodzilla merged commit 980ab74 into main Sep 10, 2026
5 checks passed
@rrrodzilla
rrrodzilla deleted the fix/159-count-certification-followup branch September 10, 2026 09:41
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