pub struct TransportProfile {
pub name: String,
pub expected_http2_settings: Vec<(u32, u32)>,
pub expected_pseudo_header_order: Vec<String>,
pub expected_header_order: Vec<String>,
pub expectations: Http2Expectations,
pub require_http2_observations: bool,
}Expand description
Per-target HTTP/2 transport expectations.
A TransportProfile carries the reference fingerprints the
score function compares the
TransportObservation
against. When the runner is asked to evaluate a request, the
profile travels with the AcquisitionRequest
and the resulting TransportCompatibility
is attached to the
AcquisitionResult::transport_realism
field as a strategy hint for downstream policy mapping (T83 / T85
/ T89 / T93).
§Example
use stygian_browser::transport_realism::TransportProfile;
let profile = TransportProfile::chrome_136_reference();
assert!(profile.expectations.contains(TransportProfile::SETTINGS));
assert_eq!(profile.expected_http2_settings.len(), 5);Fields§
§name: StringLogical profile name (e.g. "chrome-136", "firefox-130").
Free-form: callers can use it to label the profile in
telemetry.
expected_http2_settings: Vec<(u32, u32)>Reference HTTP/2 SETTINGS frame fingerprint.
expected_pseudo_header_order: Vec<String>Reference HTTP/2 pseudo-header order.
expected_header_order: Vec<String>Reference HTTP/2 header order (after pseudo-headers).
expectations: Http2ExpectationsHTTP/2 expectations bitmask (settings / pseudo-header order / header order).
require_http2_observations: boolWhen true, the runner rejects profiles with no HTTP/2
observations as incompatible (used to detect partial
instrumentation in hostile-target acquisition paths).
Implementations§
Source§impl TransportProfile
impl TransportProfile
Sourcepub const SETTINGS: u8 = Http2Expectations::SETTINGS
pub const SETTINGS: u8 = Http2Expectations::SETTINGS
Re-export of Http2Expectations::SETTINGS so callers can
write profile.expectations.contains(TransportProfile::SETTINGS).
Sourcepub const PSEUDO_HEADER_ORDER: u8 = Http2Expectations::PSEUDO_HEADER_ORDER
pub const PSEUDO_HEADER_ORDER: u8 = Http2Expectations::PSEUDO_HEADER_ORDER
Re-export of Http2Expectations::PSEUDO_HEADER_ORDER.
Sourcepub const HEADER_ORDER: u8 = Http2Expectations::HEADER_ORDER
pub const HEADER_ORDER: u8 = Http2Expectations::HEADER_ORDER
Re-export of Http2Expectations::HEADER_ORDER.
Source§impl TransportProfile
impl TransportProfile
Sourcepub fn chrome_136_reference() -> Self
pub fn chrome_136_reference() -> Self
Build a profile whose references match the Chrome 136 capture.
Convenience constructor for tests and the Chrome 136 default
path. The behaviour is identical to
TransportProfile::default.
Sourcepub fn with_http2_settings(self, settings: Vec<(u32, u32)>) -> Self
pub fn with_http2_settings(self, settings: Vec<(u32, u32)>) -> Self
Replace the HTTP/2 SETTINGS reference.
Sourcepub fn with_pseudo_header_order(self, order: Vec<String>) -> Self
pub fn with_pseudo_header_order(self, order: Vec<String>) -> Self
Replace the HTTP/2 pseudo-header order reference.
Sourcepub fn with_header_order(self, order: Vec<String>) -> Self
pub fn with_header_order(self, order: Vec<String>) -> Self
Replace the HTTP/2 header order reference.
Sourcepub const fn with_require_http2_observations(self, require: bool) -> Self
pub const fn with_require_http2_observations(self, require: bool) -> Self
Toggle the require_http2_observations flag.
Sourcepub const fn with_expectations(self, expectations: Http2Expectations) -> Self
pub const fn with_expectations(self, expectations: Http2Expectations) -> Self
Replace the expectations bitmask wholesale.
Sourcepub const fn with_expectation_bits(self, bits: u8) -> Self
pub const fn with_expectation_bits(self, bits: u8) -> Self
Replace the expectations bitmask from raw flag bits.
Sourcepub const fn has_any_http2_expectation(&self) -> bool
pub const fn has_any_http2_expectation(&self) -> bool
true when at least one HTTP/2 expectation is enabled.
Sourcepub const fn expected_http2_check_count(&self) -> usize
pub const fn expected_http2_check_count(&self) -> usize
Number of HTTP/2 expectations enabled.
Trait Implementations§
Source§impl Clone for TransportProfile
impl Clone for TransportProfile
Source§fn clone(&self) -> TransportProfile
fn clone(&self) -> TransportProfile
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more