Skip to content

Commit c4981d4

Browse files
Rename Synthetic ID to Edge Cookie (EC) and simplify generation
- Rename 'Synthetic ID' to 'Edge Cookie (EC)' across all external-facing identifiers, config, internal Rust code, and documentation - Simplify EC hash generation to use only client IP (IPv4 or /64-masked IPv6) with HMAC-SHA256, removing User-Agent, Accept-Language, Accept-Encoding, random_uuid inputs and Handlebars template rendering - Downgrade EC ID generation logs to trace level since client IP and EC IDs are sensitive data - Remove unused counter_store and opid_store config fields and KV store declarations (vestigial from template-based generation) - Remove handlebars dependency Breaking changes: wire field synthetic_fresh → ec_fresh, response headers X-Synthetic-ID → X-TS-EC, cookie synthetic_id → ts-ec, query param synthetic_id → ts-ec, config section [synthetic] → [edge_cookie]. Closes #462
1 parent ae1176c commit c4981d4

74 files changed

Lines changed: 980 additions & 1386 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.claude/agents/issue-creator.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Output the issue URL and type.
7979
- Use issue **types**, not labels, for categorization.
8080
- Every issue should have clear done-when / acceptance criteria.
8181
- Use the affected area dropdown values from the templates:
82-
- Core (synthetic IDs, cookies, GDPR)
82+
- Core (Edge Cookies, GDPR)
8383
- Integrations (prebid, lockr, permutive, etc.)
8484
- HTML processing / JS injection
8585
- Ad serving (Equativ)

.claude/agents/repo-explorer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ implementation details.
1111

1212
This is a Rust workspace with three crates:
1313

14-
- `crates/trusted-server-core/` — core library (integrations, HTML processing, synthetic IDs, GDPR)
14+
- `crates/trusted-server-core/` — core library (integrations, HTML processing, Edge Cookies, GDPR)
1515
- `crates/trusted-server-adapter-fastly/` — Fastly Compute entry point
1616
- `crates/js/` — TypeScript/JS build pipeline (per-integration IIFE bundles)
1717

.github/actions/setup-integration-test-env/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ runs:
7171
env:
7272
TRUSTED_SERVER__PUBLISHER__ORIGIN_URL: http://127.0.0.1:${{ inputs.origin-port }}
7373
TRUSTED_SERVER__PUBLISHER__PROXY_SECRET: integration-test-proxy-secret
74-
TRUSTED_SERVER__SYNTHETIC__SECRET_KEY: integration-test-secret-key
74+
TRUSTED_SERVER__EDGE_COOKIE__SECRET_KEY: integration-test-secret-key
7575
TRUSTED_SERVER__PROXY__CERTIFICATE_CHECK: "false"
7676
run: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
7777

CLAUDE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
## Project Overview
77

88
Rust-based edge computing application targeting **Fastly Compute**. Handles
9-
privacy-preserving synthetic ID generation, ad serving with GDPR compliance,
9+
privacy-preserving Edge Cookie (EC) ID generation, ad serving with GDPR compliance,
1010
real-time bidding integration, and publisher-side JavaScript injection.
1111

1212
## Workspace Layout
@@ -366,7 +366,7 @@ both runtime behavior and build/tooling changes.
366366
| `crates/trusted-server-core/src/tsjs.rs` | Script tag generation with module IDs |
367367
| `crates/trusted-server-core/src/html_processor.rs` | Injects `<script>` at `<head>` start |
368368
| `crates/trusted-server-core/src/publisher.rs` | `/static/tsjs=` handler, concatenates modules |
369-
| `crates/trusted-server-core/src/synthetic.rs` | Synthetic ID generation |
369+
| `crates/trusted-server-core/src/edge_cookie.rs` | Edge Cookie (EC) ID generation |
370370
| `crates/trusted-server-core/src/cookies.rs` | Cookie handling |
371371
| `crates/trusted-server-core/src/consent/mod.rs` | GDPR and broader consent management |
372372
| `crates/trusted-server-core/src/http_util.rs` | HTTP abstractions and request utilities |

Cargo.lock

Lines changed: 0 additions & 63 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OPTIMIZATION.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ This document presents a performance analysis and optimization plan for the Trus
3535
| ~2% | `IntegrationRegistry` | Route lookup + attribute rewriting + initialization |
3636
| ~0.8% | Memory allocation (`RawVec::reserve`) | Buffer growth during processing |
3737
| ~0.5% | Logging (`fern` / `log_fastly`) | Minimal overhead |
38-
| ~0.5% | Synthetic ID generation | HMAC computation |
38+
| ~0.5% | EC ID generation | HMAC computation |
3939
| ~0.5% | Header extraction | `fastly::http::handle::get_header_values` |
4040

4141
### Key Takeaways
@@ -271,7 +271,6 @@ let settings: Settings = postcard::from_bytes(SETTINGS_DATA)
271271
| `eq_ignore_ascii_case` for compression detection | `streaming_processor.rs:47` | 5 |
272272
| `Cow<str>` for string replacements | `streaming_replacer.rs:120-125` | 5-10 |
273273
| Remove base64 roundtrip in token computation | `http_util.rs:286-294` | 10-15 |
274-
| Replace Handlebars with manual interpolation | `synthetic.rs:82-99` | ~20 |
275274
| Cache `origin_host()` result per-request | `settings.rs` | 5-10 |
276275

277276
---

PUBLISHER_IDS_AUDIT.md

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ This document lists all publisher-specific IDs and configurations found in the c
1111
- `server_url = "https://securepubads.g.doubleclick.net/gampad/ads"` (line 15)
1212

1313
**Equativ Configuration:**
14-
- `sync_url = "https://adapi-srv-eu.smartadserver.com/ac?pgid=2040327&fmtid=137675&synthetic_id={{synthetic_id}}"` (line 8)
14+
- `sync_url = "https://adapi-srv-eu.smartadserver.com/ac?pgid=2040327&fmtid=137675&ec_id={{ec_id}}"` (line 8)
1515
- Page ID: `2040327`
1616
- Format ID: `137675`
1717

@@ -20,9 +20,8 @@ This document lists all publisher-specific IDs and configurations found in the c
2020
- `cookie_domain = ".test-publisher.com"` (line 3)
2121
- `origin_url = "https://origin.test-publisher.com"` (line 4)
2222

23-
**KV Store Names (user-specific):**
24-
- `counter_store = "jevans_synth_id_counter"` (line 24)
25-
- `opid_store = "jevans_synth_id_opid"` (line 25)
23+
**KV Store Names:**
24+
*(Removed — `counter_store` and `opid_store` were removed in the EC rename; they were vestigial from the template-based SyntheticID generation.)*
2625

2726
## Hardcoded in Source Code
2827

crates/integration-tests/Cargo.lock

Lines changed: 46 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

crates/integration-tests/fixtures/configs/viceroy-template.toml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -7,16 +7,6 @@
77
[local_server.backends]
88

99
[local_server.kv_stores]
10-
# These inline placeholders satisfy Viceroy's local KV configuration
11-
# requirements without exercising KV-backed application behavior.
12-
[[local_server.kv_stores.counter_store]]
13-
key = "placeholder"
14-
data = "placeholder"
15-
16-
[[local_server.kv_stores.opid_store]]
17-
key = "placeholder"
18-
data = "placeholder"
19-
2010
[[local_server.kv_stores.creative_store]]
2111
key = "placeholder"
2212
data = "placeholder"

0 commit comments

Comments
 (0)