pub struct Context {
pub auth_required: bool,
pub expected_base_url: Option<String>,
pub webhook: Option<WebhookCtx>,
pub idempotency: Option<IdempotencyCtx>,
pub client_deadline_ms: Option<u64>,
pub now_unix: Option<i64>,
}Expand description
Free-form context the rules consume in addition to the wire request/response.
All fields are optional. Each rule documents which fields it
consults; a rule that does not see what it needs simply does not
fire. This is what lets the same Case shape serve multiple rules
without coupling them.
Fields§
§auth_required: boolWhether the endpoint requires client authentication. The
auth_missing rule consults this to decide whether a missing
Authorization header is actually a problem.
expected_base_url: Option<String>Documented API base URL the client should be hitting. Used
by config_dns_error for hostname / TLD comparison.
webhook: Option<WebhookCtx>Webhook context for cases that involve HMAC signing.
idempotency: Option<IdempotencyCtx>Idempotency context for cases that involve Idempotency-Key
reuse.
client_deadline_ms: Option<u64>Documented per-request client deadline in milliseconds. Used by
timeout_retry to decide whether the derived elapsed exceeds
the customer-side budget.
now_unix: Option<i64>Reference “now” (unix seconds) for stale-timestamp checks.
Pinning this in the fixture is what keeps webhook_timestamp_stale
deterministic across CI runs — the rule never reads the system
clock.