Make the SSAT debug comment configurable#943
Open
prk-Jr wants to merge 7 commits into
Open
Conversation
…edundant closures)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[debug.auction_html_comment_options], making the SSAT<!-- ts-debug: ... -->HTML comment configurable: section toggles (provider responses / mediator response / bids), a metadata-key subset, and an opt-inverbosity = "full"that surfaces raw per-bidder request/response data.http_status,upstream_message, andupstream_message_truncatedwere already captured server-side by the prebid integration but omitted from the allowlist by oversight — now on by default.fullverbosity additionally exposes PBS'sdebug.httpcallssubtree on explicit opt-in, for deep per-bidder request/response debugging.metadata_keysis a subset selector against a hardcoded allowlist, never a way to add new keys, and identity-bearing data (device IP, geo, eids, TC consent string) only ever surfaces under the explicit, loudly-documentedfullopt-in.Changes
crates/trusted-server-core/src/settings.rsAuctionDebugCommentOptionsstruct +AuctionDebugCommentVerbosityenum;AUCTION_DEBUG_METADATA_ALLOWLIST(moved from publisher.rs, expanded withhttp_status/upstream_message/upstream_message_truncated, dropped unusedstatus); wired intoDebugConfigandSettings::finalize_deserializedcrates/trusted-server-core/src/publisher.rsredact_response_for_dump,redact_bid_for_dump,prepend_auction_debug_commentall take the new options and branch on verbosity; fail-closed allowlist intersection enforced at render time; 12 new tests covering toggles, verbosity, and the metadata-allowlist attack vectortrusted-server.example.toml[debug.auction_html_comment_options]with the never-production warning forfulldocs/superpowers/specs/2026-07-20-ssat-debug-comment-config-design.mddocs/superpowers/plans/2026-07-20-ssat-debug-comment-config.mdCloses
Closes #935
Test plan
cargo test-fastly && cargo test-axumcargo clippy-fastly && cargo clippy-axum(also ranclippy-cloudflare,clippy-cloudflare-wasm,clippy-spin-native,clippy-spin-wasm— all clean)cargo fmt --all -- --checkcd crates/trusted-server-js/lib && npx vitest runcd crates/trusted-server-js/lib && npm run formatcd docs && npm run formatfastly compute servecargo test-cloudflare,cargo test-spin, andcargo test --manifest-path crates/trusted-server-integration-tests/Cargo.toml --test parity— all adapters loadSettingsfrom the same TOML shape this PR extendsChecklist
unwrap()in production code — useexpect("should ...")tracingmacros (notprintln!) — N/A, no new logging