Rename Synthetic ID to Server Side Cookie (SSC) and simplify generation#479
Open
ChristianPavilonis wants to merge 4 commits intomainfrom
Open
Rename Synthetic ID to Server Side Cookie (SSC) and simplify generation#479ChristianPavilonis wants to merge 4 commits intomainfrom
ChristianPavilonis wants to merge 4 commits intomainfrom
Conversation
aram356
previously requested changes
Mar 16, 2026
Collaborator
aram356
left a comment
There was a problem hiding this comment.
Summary
Comprehensive rename of Synthetic ID → Server Side Cookie (SSC) with simplified HMAC generation (client IP only, dropping Handlebars templates). Cookie, header, query parameter, config section, and error variants are all renamed. The handlebars dependency is removed.
Blocking
🔧 wrench
- Missing new SSC headers in
INTERNAL_HEADERS:x-ts-ssc-freshandx-ts-ssc-trusted-serverare defined but not added to theINTERNAL_HEADERSblocklist, allowing potential leak of user-identity headers to third-party origins viacopy_custom_headers(crates/common/src/constants.rs:49)
Non-blocking
🤔 thinking
- Cookie name break:
synthetic_id→ts-sscsilently invalidates existing user cookies (crates/common/src/constants.rs:3) - Query parameter break:
synthetic_id→ts-sscin proxy forwarding may break downstream consumers (crates/common/src/proxy.rs:438) - Entropy reduction: HMAC now uses only client IP; users behind same NAT share the HMAC prefix (
crates/common/src/ssc.rs:63)
📝 note
- Silent template field removal: Old configs with
template = "..."are silently ignored (nodeny_unknown_fields). Operators won't know the field is unused.
CI Status
- cargo fmt: PASS
- cargo clippy: PASS
- cargo test: PASS
- vitest: PASS
- format-docs: PASS
- format-typescript: PASS
- CodeQL: PASS
prk-Jr
previously requested changes
Mar 16, 2026
Collaborator
prk-Jr
left a comment
There was a problem hiding this comment.
Summary
This PR completes the Synthetic ID → Server Side Cookie rename and simplifies ID generation, but I found a couple of migration/privacy regressions plus a docs/behavior mismatch that should be fixed before merge.
Blocking
🔧 wrench
- Docs and implementation diverge on consent + proxy behavior: the new SSC docs state that ID generation/forwarding are consent-gated and that
/first-party/proxygenerates a new SSC ID when missing, but the current implementation still generates IDs unconditionally incrates/common/src/publisher.rs:239,crates/common/src/integrations/registry.rs:659, andcrates/common/src/auction/formats.rs:81, while proxy forwarding only reuses an existing ID incrates/common/src/proxy.rs:427. Either implement the documented rules or update the docs so they match the code.
CI Status
- fmt: PASS
- clippy: PASS
- rust tests: PASS
- js tests: PASS
- Rename all external identifiers: x-synthetic-id → x-ts-ssc, synthetic_id cookie → ts-ssc, synthetic_fresh → ssc_fresh - Simplify hash generation to use only client IP with HMAC-SHA256, removing User-Agent, Accept-Language, Accept-Encoding, and template rendering - Rename config section [synthetic] → [ssc] with backward-compat alias - Update 30+ docs files with new SSC terminology - Downgrade SSC ID generation logs from info to debug (IP is sensitive) Closes #462
…remove redundant x-ts-ssc-trusted-server header, add doc comment explaining IP-only HMAC design
692fcca to
6e51272
Compare
Addressed: added x-ts-ssc-fresh to INTERNAL_HEADERS, removed x-ts-ssc-trusted-server. Non-blocking items are intentional design choices.
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
infotodebuglevel since client IP is sensitive dataChanges
crates/common/src/ssc.rs(new)synthetic.rs; simplified hash to IP-only HMAC-SHA256; removed template renderingcrates/common/src/synthetic.rs(deleted)ssc.rscrates/common/src/constants.rsSYNTHETIC_ID_HEADER→SSC_HEADER, cookie/query names updatedcrates/common/src/cookies.rssynthetic_id→ts-ssc, function names to SSCcrates/common/src/error.rsSyntheticId→Sscerror variant; removedTemplatevariantcrates/common/src/settings.rs[synthetic]→[ssc]withalias = "synthetic"for backward compat; removedtemplatefieldcrates/common/src/settings_data.rscrates/common/src/lib.rssynthetic→ssccrates/common/src/http_util.rscrates/common/src/openrtb.rssynthetic_fresh→ssc_freshcrates/common/src/proxy.rssynthetic_id→ts-ssccrates/common/src/publisher.rscrates/common/src/auction/formats.rsX-Synthetic-ID→X-TS-SSC,X-Synthetic-Fresh→X-TS-SSC-Fresh,X-Synthetic-Trusted-Server→X-TS-SSC-Trusted-Servercrates/common/src/integrations/*.rscrates/common/src/test_support.rscrates/common/Cargo.tomlhandlebarsdependencycrates/js/lib/src/integrations/gpt/index.tsCargo.locktrusted-server.toml[synthetic]→[ssc]; removedtemplatefieldCLAUDE.mddocs/**/*.md(30+ files)Closes
Closes #462
Test plan
cargo test --workspace— 473 tests passingcargo clippy --all-targets --all-features -- -D warnings— zero warningscargo fmt --all -- --check— cleancd crates/js/lib && npx vitest run— 239 tests passingChecklist
unwrap()in production code — useexpect("should ...")tracingmacros (notprintln!)