Skip to main content

Module unknown_paths

Module unknown_paths 

Source
Expand description

Unmatched-path request tracking.

Issue #79 round 13 — Srikanth’s question (a): when a client sends requests to paths that aren’t in the server’s loaded OpenAPI spec, the request never reaches the validator (router returns 404 from lookup), so conformance_violations never picks it up. This module captures those unmatched 404s into a separate bounded ring buffer so the TUI’s Conformance tab can surface them.

Use case: cross-checking a proxy’s path coverage against the server’s. If the proxy reports a path the server doesn’t know, it’ll show up here.

Structs§

UnknownPathRequest
One unmatched-path request — captured by the HTTP server’s fallback when no registered route matches.

Functions§

clear
Clear the buffer and reset the lifetime counter.
len
Current buffer length (≤ DEFAULT_BUFFER_SIZE).
record
Record an unmatched-path request. FIFO when the buffer is full.
shadow_mode_enabled
Issue #79 round 14 — Srikanth’s shadow-mode ask. When enabled, the server returns 200 for requests that would otherwise be rejected (unknown paths → 404, spec violations → 400/422) while still recording them to the unknown-paths / conformance buffers. Lets a proxy replay run flow through non-blocking with full violation capture — a “report-only” / monitor mode.
snapshot
Snapshot of buffered entries, newest first.
total_seen
Lifetime total of unknown-path requests recorded since process start, including ones the ring buffer has since evicted.