Skip to content

Commit bbaf573

Browse files
committed
Restore publisher streaming integration lost in APS rebase
Rebasing the APS OpenRTB stack onto main resolved publisher.rs against its pre-streaming shape: the file reverted to the buffered design while streaming_processor.rs kept the end-to-end machinery from #867, leaving BodyStreamDecoder/BodyStreamEncoder and their helpers dead. With CI denying warnings, every workflow failed at compile (struct BodyStreamDecoder is never constructed, plus 8 sibling errors), so no tests ran on the branch. Re-merge publisher.rs three-way (base: pre-streaming main, ours: branch tip, theirs: main) so the file carries main's #867 async streaming and inline SSAT rendering with the APS additions reapplied on top: - build_bid_map keeps main's signature (settings, request_origin, include_debug_bid), the zero-dimension w/h omission, and the always-inline sanitized adm path, plus the APS renderer field and the renderer-aware hb_adid fallback (cache_id, then renderer bid_id, then ad_id) - the APS bid-map test moves to the new signature; the include_adm debug flag it exercised is superseded by main's debug_bid design Also update debug_metadata_preserves_malformed_and_error_responses for the fail-closed debug-header allowlist from the APS security review: content-type is preserved, retry-after is redacted. The compile failure had masked this test regression since the allowlist landed.
1 parent 0cb06ef commit bbaf573

2 files changed

Lines changed: 3440 additions & 206 deletions

File tree

‎crates/trusted-server-core/src/integrations/aps.rs‎

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1846,6 +1846,7 @@ mod tests {
18461846
let unavailable = PlatformResponse::new(
18471847
edgezero_core::http::response_builder()
18481848
.status(StatusCode::SERVICE_UNAVAILABLE)
1849+
.header("content-type", "text/plain")
18491850
.header("retry-after", "5")
18501851
.body(EdgeBody::from(b"temporarily unavailable".to_vec()))
18511852
.expect("should build unavailable APS response"),
@@ -1877,8 +1878,17 @@ mod tests {
18771878
assert_eq!(unavailable_call["status"], 503);
18781879
assert_eq!(unavailable_call["responsebody"], "temporarily unavailable");
18791880
assert_eq!(
1880-
unavailable_call["responseheaders"]["retry-after"],
1881-
json!(["5"])
1881+
unavailable_call["responseheaders"]["content-type"],
1882+
json!(["text/plain"]),
1883+
"should preserve allowlisted headers in debug metadata"
1884+
);
1885+
assert!(
1886+
unavailable_call["responseheaders"]
1887+
.as_object()
1888+
.expect("should include response headers")
1889+
.get("retry-after")
1890+
.is_none(),
1891+
"should redact headers outside the fail-closed allowlist"
18821892
);
18831893
let oversized_call = oversized.metadata["debug"]["httpcalls"]["aps"][0]
18841894
.as_object()

0 commit comments

Comments
 (0)