Make the SSAT debug comment configurable - #943
Conversation
…edundant closures)
…nt-config # Conflicts: # crates/trusted-server-core/src/publisher.rs # crates/trusted-server-core/src/settings.rs
ChristianPavilonis
left a comment
There was a problem hiding this comment.
Summary
🔧 Requesting changes because the new default configuration serialization breaks rollback and mixed-version deployment compatibility. One P1 inline finding is included.
aram356
left a comment
There was a problem hiding this comment.
Summary
Adds [debug.auction_html_comment_options] — section toggles, a metadata_keys subset selector, a redacted/upstream/full verbosity ladder, and compact/pretty formatting — replacing the old single hardcoded allowlist. The security design is sound: the redacted-mode schema validation matches exactly what orchestrator.rs and prebid.rs actually write, all six upstream keys have real writers, the dropped "status" allowlist key has no production writer, and terminator neutralization plus the 256 KiB cap are exercised across every verbosity × format combination. One blocking config-validation gap and three smaller items, all inline.
Blocking
🔧 wrench
- Unknown
metadata_keysentries are silently dead config: validate membership inAUCTION_DEBUG_METADATA_ALLOWLISTat config load (crates/trusted-server-core/src/settings.rs:2007)
Non-blocking
♻️ refactor
error_typeliterals duplicated fromorchestrator.rs: reuse theERROR_TYPE_*constants to prevent drift (crates/trusted-server-core/src/publisher.rs:1895)
⛏ nitpick
metadata_keysdocs omit its Upstream-mode behavior: it still gates the three base keys inupstreammode (crates/trusted-server-core/src/settings.rs:1966,docs/guide/auction-orchestration.md:863)- Guide recipe pairs
metadata_keyswithverbosity = "full", where the field has no effect (docs/guide/auction-orchestration.md:842)
CI Status
- GitHub checks: pending at review time (fresh push)
- fmt (local): PASS
- targeted rust tests, new settings + publisher tests via
cargo test-fastly(local): PASS (11/11)
Omit the default `[debug.auction_html_comment_options]` table from serialized config blobs so an older binary's `deny_unknown_fields` `DebugConfig` still accepts a pushed blob during a mixed-version deployment or rollback. A non-default table still serializes. Reject `metadata_keys` entries outside the fixed allowlist at config load instead of silently rendering an empty metadata object, keeping the render-time intersection as defense-in-depth. Validate and describe redacted error classifications through the orchestrator's `ERROR_TYPE_*` constants, with a test that fails when a new classification ships without safe wording. Document that `metadata_keys` also gates the three validated keys in upstream mode and is ignored in full mode, and drop it from the full-verbosity recipe where it has no effect.
Summary
[debug.auction_html_comment_options]for controlling SSAT<!-- ts-debug: ... -->auction comments: provider/mediator/bid section toggles, a fail-closed metadata subset, sensitivity modes, and compact or pretty outer JSON formatting.redacted(default, schema-validated server-owned diagnostics),upstream(six named provider-controlled diagnostics), andfull(raw response metadata and untruncated creatives for local investigation).Configuration
format = "pretty"indents the outer auction dump for easier navigation. Nested JSON-looking values such as PBSrequestbodyandresponsebodyremain strings exactly as captured.upstreamandfullcan expose request or identity data and must not be enabled in production.Security model
redacted,metadata_keyscan only narrow the fixed Rust allowlist; it cannot expose arbitrary keys such as PBSdebug.error_typeandhttp_statusare schema-validated, andmessageis generated from fixed server-owned wording rather than copied from a provider.upstreamorfull.debug.httpcallsandresolvedrequestrequirefull.Main changes
crates/trusted-server-core/src/settings.rsAuctionDebugCommentVerbosity, andAuctionDebugCommentFormatwith backward-compatible defaultscrates/trusted-server-core/src/publisher.rstrusted-server.example.tomldocs/guide/auction-orchestration.mddocs/superpowers/specs/docs/superpowers/plans/Closes
Closes #935
Test plan
cargo fmt --all -- --checkcargo test-fastlycargo test-axumcargo test-cloudflarecargo test-spincargo clippy-fastlycargo clippy-axumcargo clippy-cloudflarecargo clippy-cloudflare-wasmcargo clippy-spin-nativecargo clippy-spin-wasmChecklist
CLAUDE.mdconventions