Skip to content

v0.8.1

Compare
Choose a tag to compare
@github-actions github-actions released this 20 Sep 16:14
· 186 commits to main since this release
221efe5

[0.8.1] - 2023-09-20

Features

  • [breaking] Refactored the [Match]/[MatchSpan] types.
    • [Match] now takes 32 bytes, down from 40.
    • All fields are now private, accessible via associated functions.
    • Added the len function to [MatchSpan].
  • Added approximate_spans result mode. (#242)
    • Engine can return an approximate span of the match,
      where "approximate" means the start index is correct,
      but the end index might include trailing whitespace after the match.
    • This mode is much faster that full matches, close to the performance
      of count, especially for large result sets.
    • This is a library-only feature.
  • Library exposes a new optional feature, arbitrary.
    • When enabled, includes arbitrary
      as a dependency and provides an Arbitrary impl for JsonPathQuery,
      JsonString, and NonNegativeArrayIndex.

Bug fixes

  • Fixed a bug when memmem acceleration would fail for empty keys.
    • This was detected by fuzzing! The query $..[""] would panic
      on certain inputs due to invalid indexing.
  • Fixed a panic when parsing invalid queries with wide UTF8 characters.
    • This was detected by fuzzing! Parsing a query with invalid syntax
      caused by a longer-than-byte UTF-8 character would panic when
      the error handler tried to resume parsing from the next byte
      instead of respecting char boundaries.
  • Fixed a panic caused by node results in invalid JSON documents.
    • This was detected by fuzzing! Invalid JSON documents could
      cause the NodeRecorder to panic if the apparent match span
      was of length 1.
  • Fixed erroneous match span end reporting. (#247)
    • Fixed a bug where MatchSpan values given by the engine were
      almost always invalid.

Reliability

  • Fuzzing integration with libfuzzer and ClusterFuzzLite.
    • cargo-fuzz can be used
      to fuzz the project with libfuzzer. Currently we have three fuzzing targets,
      one for stressing the query parser, one for stressing the engine with arbitrary
      bytes, and one stressing the engine with structure-aware queries and JSONs.
    • Fuzzing is now enabled on every PR. Using ClusterFuzzLite
      we will fuzz the project every day on a cron schedule
      to establish a corpus.
  • Added correctness tests for match spans reporting (#247)

Dependencies

  • Bump clap from 4.4.2 to 4.4.4.
  • Bump vergen from 8.2.4 to 8.2.5.