Expand description
Positive + per-category negative request driver against a live server.
Issue #79 round 13 (4) — Srikanth’s (e) ask: a way to test both positive and negative compliance scenarios separately, where the positive cases should pass and the negative cases should be rejected.
This module sits alongside the existing conformance executor
(which drives k6 / native checks on a single positive call per
operation). The self-test driver synthesises per-category
deliberately-bad requests and asserts that the server actually
rejects them with a 4xx — useful when verifying that
validate_request_with_all is wired correctly for the user’s spec
(the exact gap that round-13 (3) fixed).
Scope of the initial MVP: covers the highest-signal negatives — empty body when one is required, missing required query/header params, and wrong-type path params. Doesn’t try to mutate every field of a JSON-Schema-validated body; that’s a follow-up.
Structs§
- Accepted
Owasp Probe - Round 59 (#79) — a single OWASP injection probe the target ACCEPTED, for the
conformance-owasp-accepted.jsonsidecar so a WAF tester can grep which URLs let which payloads through (matching their proxy’s own logs). - Case
Capture - Round 23 (c-iii) — one captured request/response pair, one per
probe (positive or negative). Serialised as a JSON line in
conformance-self-test-requests.jsonl. Headers are kept asBTreeMapfor stable ordering. Bodies are truncated toCAPTURE_BODY_CAP_BYTES;*_truncatedflags whether more was dropped. - Case
Outcome - Outcome of a single test case (positive or negative).
- Definite
Issue - Round 58 (#79) — an unambiguous, no-analysis-needed problem surfaced by the self-test. Srikanth on 0.3.205: “Is it possible to give another option … that should say for sure this is an issue. Currently both caught and missed needs manual intervention and deep analysis … very time consuming.”
- Network
Event - Round 47 (#79) — wire-level network event captured by the self-test
driver. Same shape as the native executor’s
NetworkEventso downstream tooling can consume one file across executor variants. - Operation
Result - All cases run against one annotated operation.
- Security
Probe Stat - Round 59 (#79) — per-injection-type tally of OWASP probes. Srikanth on
0.3.206 was testing a WAF (
waaptest.nettargets): “owasp: 0 caught / 8127 missed” but “Definite issues: none”, and asked whether real issues were being hidden. They are not hidden from the CONTRACT view (an SQLi string in a string field is spec-valid, so it is correctly not a schema violation), but for a WAF each ACCEPTED injection payload is one it did not block. This surfaces that count so a security tester sees it without eyeballing rows. - Self
Test Config - Configuration for a self-test run.
- Self
Test Report - Summary report rolled up across all operations.
Functions§
- default_
geo_ source_ headers - Default forwarded-IP header set. Covers the three conventions a
real GEODB front-end is likely to read in this order of
preference: Cloudflare (
CF-Connecting-IP), Akamai/CloudFront (True-Client-IP), then the de-facto standardX-Forwarded-For. Override via--geo-source-headerto test a specific stack. - run_
self_ test - Execute the self-test plan against
config.target_urlfor everyAnnotatedOperation. Returns the aggregated report; callers decide how to display it (e.g. viarender_summaryor by writing the JSON serialisation to disk). - run_
self_ test_ with_ deadline - Round 49 (#79) — Srikanth on 0.3.193:
--conformance-self-test- duration 5mran 5:46 because the outer iteration loop in command.rs only checks the deadline AFTER a full matrix pass completes. For long iterations this can overshoot by minutes, which breaks automation that relies on a fixed wall-clock budget. New optionaldeadlineparameter lets the runner break out mid-iteration once the deadline elapses; returns the partial report with whatever operations finished before the deadline.