Skip to content

Releases: CaptainDriftwood/python-icap

v0.2.0

Choose a tag to compare

@CaptainDriftwood CaptainDriftwood released this 08 Jul 22:21
1dc4eed

What's Changed

Protocol & Security Hardening

  • Drop the connection after a mid-request timeout or socket error so a stale response can never be attributed to the next request (sync and async)
  • Async read timeouts now apply per read instead of to the whole response, so slow-but-steady large transfers are no longer cancelled
  • Cap chunked trailer sections at the header size limit to prevent unbounded memory growth
  • Add header section size limits, max_response_size, and negative Content-Length / Encapsulated offset / chunk size validation to prevent DoS
  • Validate service names and filenames against CRLF/request-line injection while still allowing URI query components (e.g. avscan?allow204=on)
  • Tolerate non-UTF-8 bytes in response headers (replaced with U+FFFD) instead of failing the whole scan verdict
  • Validate status code range and make ICAP headers case-insensitive per RFC 3507

New Features

  • Add ISTag header support and Encapsulated header parsing to IcapResponse
  • Add max_response_size client parameter
  • Full API parity between IcapClient and AsyncIcapClient

Refactoring

  • Extract shared protocol logic into _protocol.py
  • Split the pytest plugin mock.py into focused modules (mock_client, mock_async, matchers, call_record, protocols)

Testing & Documentation

  • Add property-based fuzzing (Hypothesis), benchmarks, connection robustness, concurrent load, and large-file integration tests (511 unit + 64 integration tests)
  • Add LLMS.txt API documentation; expand README with Quick Reference and Preview Mode sections

Breaking Changes

  1. IcapResponse.headers is now a CaseInsensitiveDict, not a plain dict. Lookups are case-insensitive per RFC 3507, but isinstance(response.headers, dict) is now False and json.dumps(response.headers) raises TypeError. Wrap with dict(response.headers) where a plain dict is required.

  2. Pytest plugin: filename_matches patterns now use re.fullmatch instead of prefix-anchored re.match. A pattern must span the entire filename: when(filename_matches=r"invoice") no longer matches "invoice.pdf" — use r"invoice.*".

  3. Pytest plugin: MockIcapClient.assert_scanned uses substring matching for respmod() payloads (previously required http_response to end with the given bytes). Tests relying on the stricter suffix semantics should assert on the exact payload instead.

Full Changelog: v0.1.2...v0.2.0

v0.1.2

Choose a tag to compare

@CaptainDriftwood CaptainDriftwood released this 15 Jan 02:58
eafde65

What's Changed

Improvements

  • Improved code coverage with additional unit tests for async mock client, error handling, and client method edge cases
  • Fixed flaky connection reuse tests by using a more reliable wait mechanism
  • Configured coverage to exclude docstrings from coverage metrics

Internal

  • Cleaned up test file organization and removed redundant protocol module code
  • Version bump to 0.1.2

Full Changelog: v0.1.1...v0.1.2

v0.1.1

Choose a tag to compare

@CaptainDriftwood CaptainDriftwood released this 14 Jan 08:02
8fa53c8

What's Changed

Full Changelog: v0.1.0...v0.1.1

v0.1.0

Choose a tag to compare

@CaptainDriftwood CaptainDriftwood released this 14 Jan 07:43
6c51236

What's Changed

  • feat: RFC 3507 ICAP client with async, SSL/TLS, and pytest plugin by @CaptainDriftwood in #20
  • chore: project enhancements and pycap to py-cap rename by @CaptainDriftwood in #22
  • ci: bump actions/dependency-review-action from 4.7.1 to 4.8.2 by @dependabot[bot] in #23
  • ci: bump codecov/codecov-action from 0561704f0f02c16a585d4c7555e57fa2e44cf909 to 671740ac38dd9b0130fbe1cec585b89eea48d3de by @dependabot[bot] in #24
  • ci: bump github/codeql-action from 4.31.9 to 4.31.10 by @dependabot[bot] in #25
  • Bump virtualenv from 20.35.4 to 20.36.1 by @dependabot[bot] in #28
  • ci: bump actions/checkout from 4.2.2 to 6.0.1 by @dependabot[bot] in #26
  • ci: bump actions/labeler from 5.0.0 to 6.0.1 by @dependabot[bot] in #27
  • refactor: rename project from py-cap to python-icap by @CaptainDriftwood in #29
  • chore: remove manual CodeQL workflow in favor of default setup by @CaptainDriftwood in #30
  • fix: add explicit permissions to publish workflow build job by @CaptainDriftwood in #31

New Contributors

Full Changelog: https://github.com/CaptainDriftwood/python-icap/commits/v0.1.0