Repository navigation
Add streaming JSON adapters and regression contracts for all engines - #5
Open
Easton97-Jens wants to merge 28 commits into
Open
Easton97-Jens wants to merge 28 commits into
Easton97-Jens wants to merge 28 commits into
Conversation
Use streaming jsoncons/YAJL and fix CLI and Sonar findings
Stream RapidJSON and nlohmann SAX with checked RAII and limits
…rage Validate native DOM and OnDemand adapters and address Sonar findings
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.
jsoncons previously parsed and discarded a complete DOM without producing the argument output needed for a ModSecurity comparison. Several adapters used fixed file buffers, inconsistent path/limit handling, unsafe numerical conversions or incomplete validation; the old runner could report success when output comparison was skipped.
This PR brings the complete reviewed implementation from Easton97-Jens/jsonbench.
Relationship to #4: this consolidated PR supersedes the original jsoncons SAX PR. Its head dd603ee is an ancestor of the submitted 715ae64 branch. All 12 original changed files are included, with 29 additional files (41 total); nine original files receive further corrections, while the public jsoncons header, shell entry point and RSS helper are unchanged. Original valid/invalid tests remain, and repaired YAJL defects now require equality. Once this replacement exists, #4 can be closed as superseded; these are not independent patches.
Validation on the exact submitted source tree:
Compatibility and analysis limits:
jsoncons normalizes integer -0 to 0 and removes exponent +; nlohmann also normalizes integer -0. Those spellings have explicit expected results. YAJL path/NUL/root-number-at-EOF defects are corrected rather than reproduced. Native representation failures remain assertions. Four const advisories on rj_parse_buffer, rj_parse_file, rj_parser_cleanup and nl_parser_cleanup are retained by explicit decision to preserve exact public C function types and typed callbacks; they are documented, not suppressed or marked accepted.
Fork PRs Easton97-Jens#11, Easton97-Jens#12 and Easton97-Jens#13 have been merged and passed their final Sonar gates, all with zero hotspots and zero new-code duplication. #11 reports zero new issues; #12/#13 report the same four retained const advisories. The subsequent fork-main analysis also passes but reports 11 new issues and supplies no inline annotations through GitHub. A complete server issue inventory is therefore not certified. Cloud line coverage is not imported and reports 0%; assertion counts do not establish a coverage percentage.
See tests/README.md for reproducible checks, docs/jsoncons-sax.md for SAX details, and docs/adapter-stack.md for per-engine limitations and future ModSecurity integration recommendations. Its measured DOM/SAX/YAJL report is explicitly the earlier e6fe3a3 snapshot, before Sonar corrections; no unmeasured performance claim is made. No other engines are removed, no JSON Schema dependency is added, and ModSecurity itself is unchanged.
Reference: owasp-modsecurity/ModSecurity#3308 (comment)
Überschneidung mit Upstream-PR #4
Geprüft: #4 und der veröffentlichte Gesamtbranch
Easton97-Jens:codex/streaming-parsers-and-regression-suite.git merge-base --is-ancestor dd603ee 715ae64erfolgreich; gemeinsamer Vorfahr ist dd603ee selbst.src/jsonconsparser.h,tests/run_tests.shundtests/benchmark_rusage.csind gegenüber Use streaming jsoncons SAX parsing and add regression tests for all engines #4 bytegleich.Der Gesamtbranch ersetzt #4 inhaltlich. Empfehlung: einen Gesamt-PR als Nachfolger anlegen und #4 erst danach als ersetzt schließen. Alternativ #4 zuerst mergen und anschließend nur dessen Ergänzungen einreichen. Beide Änderungen nicht als unabhängige Patches behandeln.
Der Gesamtbranch ist veröffentlicht; ein zusätzlicher Upstream-PR konnte noch nicht angelegt werden. GitHub antwortet auf die Erstellung mit HTTP 403,
Resource not accessible by integration. #4 bleibt daher offen. Die vollständige vorbereitete PR-Beschreibung steht injsonbench-upstream-pr.md.