Skip to main content

parlov_core/
exchange.rs

1//! Paired HTTP exchanges for differential analysis.
2
3use serde::{Deserialize, Serialize};
4
5use crate::{ProbeDefinition, ResponseSurface, Technique};
6
7/// A single HTTP exchange: request and response paired permanently.
8///
9/// Every response travels with the request that produced it. This ensures analyzers always have
10/// access to what was sent (method, headers, body) alongside what came back.
11#[derive(Debug, Clone, Serialize, Deserialize)]
12pub struct ProbeExchange {
13    /// The request that was sent.
14    pub request: ProbeDefinition,
15    /// The response that came back.
16    pub response: ResponseSurface,
17}
18
19/// Paired exchanges for differential analysis with full technique context.
20///
21/// Replaces the older `ProbeSet` which carried only `ResponseSurface` vectors without request
22/// context or technique metadata. `DifferentialSet` gives the analyzer everything it needs:
23/// what was sent, what came back, and why the probes were generated.
24#[derive(Debug, Clone)]
25pub struct DifferentialSet {
26    /// Exchanges for the known-valid / control input.
27    pub baseline: Vec<ProbeExchange>,
28    /// Exchanges for the unknown / suspect input.
29    pub probe: Vec<ProbeExchange>,
30    /// Technique metadata explaining why these probes were generated.
31    pub technique: Technique,
32}