Skip to content

Commit d4bd10b

Browse files
Change x-synthetic-trusted-server header to x-psid-ts (#66)
1 parent fe9b0ab commit d4bd10b

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

crates/common/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ Behavior is covered by an extensive test suite in `crates/common/src/creative.rs
5151

5252
- `synthetic.rs` generates a deterministic synthetic identifier per user request and exposes helpers:
5353
- `generate_synthetic_id` — creates a fresh HMAC-based ID using request signals.
54-
- `get_synthetic_id` — extracts an existing ID from the `X-Synthetic-Trusted-Server` header or `synthetic_id` cookie.
54+
- `get_synthetic_id` — extracts an existing ID from the `x-psid-ts` header or `synthetic_id` cookie.
5555
- `get_or_generate_synthetic_id` — reuses the existing ID when present, otherwise creates one.
56-
- `publisher.rs::handle_publisher_request` stamps proxied origin responses with `X-Synthetic-Fresh`, `X-Synthetic-Trusted-Server`, and (when absent) issues the `synthetic_id` cookie so the browser keeps the identifier on subsequent requests.
56+
- `publisher.rs::handle_publisher_request` stamps proxied origin responses with `X-Synthetic-Fresh`, `x-psid-ts`, and (when absent) issues the `synthetic_id` cookie so the browser keeps the identifier on subsequent requests.
5757
- `proxy.rs::handle_first_party_proxy` replays the identifier to third-party creative origins by appending `synthetic_id=<value>` to the reconstructed target URL, follows redirects (301/302/303/307/308) up to four hops, and keeps downstream fetches linked to the same user scope.
5858
- `proxy.rs::handle_first_party_click` adds `synthetic_id=<value>` to outbound click redirect URLs so analytics endpoints can associate clicks with impressions without third-party cookies.

crates/common/src/constants.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ use http::header::HeaderName;
33
pub const HEADER_SYNTHETIC_FRESH: HeaderName = HeaderName::from_static("x-synthetic-fresh");
44
pub const HEADER_SYNTHETIC_PUB_USER_ID: HeaderName = HeaderName::from_static("x-pub-user-id");
55
pub const HEADER_X_PUB_USER_ID: HeaderName = HeaderName::from_static("x-pub-user-id");
6-
pub const HEADER_SYNTHETIC_TRUSTED_SERVER: HeaderName =
7-
HeaderName::from_static("x-synthetic-trusted-server");
6+
pub const HEADER_SYNTHETIC_TRUSTED_SERVER: HeaderName = HeaderName::from_static("x-psid-ts");
87
pub const HEADER_X_CONSENT_ADVERTISING: HeaderName =
98
HeaderName::from_static("x-consent-advertising");
109
pub const HEADER_X_FORWARDED_FOR: HeaderName = HeaderName::from_static("x-forwarded-for");

crates/common/src/synthetic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ pub fn generate_synthetic_id(
8383
/// Gets or creates a synthetic ID from the request.
8484
///
8585
/// Attempts to retrieve an existing synthetic ID from:
86-
/// 1. The `X-Synthetic-Trusted-Server` header
86+
/// 1. The `x-psid-ts` header
8787
/// 2. The `synthetic_id` cookie
8888
///
8989
/// If neither exists, generates a new synthetic ID.

crates/js/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ The Rust services (`trusted-server-common`) expose several proxy entry points th
111111

112112
- Endpoint: `handle_publisher_request` (`crates/common/src/publisher.rs`).
113113
- Retrieves or generates the trusted synthetic identifier before Fastly consumes the request body.
114-
- Always stamps the proxied response with `X-Synthetic-Fresh` and `X-Synthetic-Trusted-Server` headers and, when the browser does not already present one, sets the `synthetic_id=<value>` cookie (Secure + SameSite=Lax) bound to the configured publisher domain.
114+
- Always stamps the proxied response with `X-Synthetic-Fresh` and `x-psid-ts` headers and, when the browser does not already present one, sets the `synthetic_id=<value>` cookie (Secure + SameSite=Lax) bound to the configured publisher domain.
115115
- Result: downstream assets fetched through the same first-party origin automatically include the synthetic ID header/cookie so subsequent proxy layers can read it.
116116

117117
### Creative Asset Proxy

0 commit comments

Comments
 (0)