Skip to content

Release 0.4.0

Choose a tag to compare

@stormer78 stormer78 released this 27 Mar 01:08
· 9 commits to main since this release
ef68129

Summary

  • HTTP response size limitsdownload_file() now enforces a maximum response body size (default 200 KB) to prevent memory exhaustion from malicious or misconfigured servers. Checks Content-Length header for early rejection, then reads body in chunks with a running byte counter as fallback.
  • ResolveOptions struct — Replaces the timeout + eager_witness_download parameters on resolve() / resolve_owned() with a single options struct that also carries max_response_bytes. This is a breaking API change.
  • ResponseTooLarge error variant — New DIDWebVHError::ResponseTooLarge { url, max_bytes } for size-limit rejections.
  • generate_large_did example — Generates a valid 1 MB+ did.jsonl with backdated timestamps for benchmarking. Accepts --url (properly parsed via WebVHURL), --target-kb, and --services flags with full timing output.
  • resolve example improvements — Now uses clap with --max-size-kb (-l) flag and detailed --help output.
  • Version bump to 0.4.0 for the breaking resolve() signature change.

Test plan

  • cargo test — all 396 tests pass including 3 new size-limit tests
  • cargo clippy — no warnings
  • cargo run --example generate_large_did -- --url https://example.com — generates 1 MB+ valid did.jsonl
  • cargo run --example resolve -- --help — shows detailed help with examples
  • Verify ResolveOptions::default() preserves previous default behavior (10s timeout, no eager witness, 200 KB limit)