Skip to content

Add EC consent logging and Sourcepoint consent support#678

Closed
ChristianPavilonis wants to merge 12 commits intoedge-cookie-sourcepoint-consentfrom
debug/ec-kv
Closed

Add EC consent logging and Sourcepoint consent support#678
ChristianPavilonis wants to merge 12 commits intoedge-cookie-sourcepoint-consentfrom
debug/ec-kv

Conversation

@ChristianPavilonis
Copy link
Copy Markdown
Collaborator

@ChristianPavilonis ChristianPavilonis commented May 5, 2026

Summary

  • Adds EC consent decision logging so allow/block/withdrawal decisions are visible during request handling and finalization.
  • Expands Sourcepoint consent mirroring to support multiple localStorage payload shapes for GPP and TCF consent.
  • Adds Prebid User ID module build/config support.

Changes

File Change
crates/trusted-server-core/src/consent/mod.rs Adds explicit EC consent decision/reason modeling used by allows_ec_creation.
crates/trusted-server-core/src/ec/consent.rs Surfaces EC consent decision details for EC lifecycle callers.
crates/trusted-server-core/src/ec/finalize.rs Logs EC finalization actions, consent reasons, cookie/header state, and KV availability.
crates/trusted-server-core/src/ec/mod.rs Tracks EC lifecycle state used by consent/finalization logging.
crates/trusted-server-core/src/integrations/registry.rs Logs skipped EC generation decisions for non-navigation integration requests.
crates/trusted-server-core/src/publisher.rs Logs skipped EC generation decisions for non-HTML publisher responses.
crates/trusted-server-adapter-fastly/src/logging.rs Adjusts logging initialization/filtering for the new EC decision logs.
crates/js/lib/src/integrations/sourcepoint/index.ts Mirrors Sourcepoint GPP/TCF consent from supported localStorage shapes into IAB cookies.
crates/js/lib/test/integrations/sourcepoint/index.test.ts Adds Sourcepoint consent mirroring coverage.
crates/js/lib/build-all.mjs Adds Prebid User ID module build support and liveIntent alias handling.
crates/js/lib/src/integrations/prebid/_user_id_modules.generated.ts Adds generated Prebid User ID module import shim.
crates/js/lib/src/integrations/prebid/index.ts Applies configured Prebid userSync settings.
crates/js/lib/test/integrations/prebid/index.test.ts Adds Prebid User ID/userSync test coverage.
crates/trusted-server-core/src/integrations/prebid.rs Adds user_sync config serialization into the injected Prebid JS config.
trusted-server.toml Documents optional local Prebid User ID config.

Closes

Closes #

Test plan

  • cargo test --workspace
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo fmt --all -- --check
  • JS tests: cd crates/js/lib && npx vitest run
  • JS format: cd crates/js/lib && npm run format
  • Docs format: cd docs && npm run format
  • WASM build: cargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1
  • Manual testing via fastly compute serve
  • Other: cargo fmt --all; cargo check --workspace; cd crates/js/lib && npx vitest run test/integrations/sourcepoint/index.test.ts test/integrations/prebid/index.test.ts

Checklist

  • Changes follow CLAUDE.md conventions
  • No unwrap() in production code — use expect("should ...")
  • Uses tracing macros (not println!)
  • New code has tests
  • No secrets or credentials committed

Implement Story 4 (#537): partner KV store with API key hashing,
POST /admin/partners/register with basic-auth protection, strict
field validation (ID format, URL allowlists, domain normalization),
and pull-sync config validation. Includes index-based API key lookup
and comprehensive unit tests.
Implement Story 9 (#542): server-to-server pull sync that runs after
send_to_client() on organic traffic only. Refactors the Fastly adapter
entrypoint from #[fastly::main] to explicit Request::from_client() +
send_to_client() to enable post-send background work.

Pull sync enumerates pull-enabled partners, checks staleness against
pull_sync_ttl_sec, validates URL hosts against the partner allowlist,
enforces hourly rate limits, and dispatches concurrent outbound GETs
with Bearer auth. Responses with uid:null or 404 are no-ops; valid
UIDs are upserted into the identity graph.

Includes EC ID format validation to prevent dispatch on spoofed values,
partner list_registered() for KV store enumeration, and configurable
pull_sync_concurrency (default 3).
Move admin route matching and basic-auth coverage to /_ts/admin for a hard cutover, and align tests and docs so operational guidance matches runtime behavior.
Implement Story 4 (#537): partner KV store with API key hashing,
POST /admin/partners/register with basic-auth protection, strict
field validation (ID format, URL allowlists, domain normalization),
and pull-sync config validation. Includes index-based API key lookup
and comprehensive unit tests.
Move admin route matching and basic-auth coverage to /_ts/admin for a hard cutover, and align tests and docs so operational guidance matches runtime behavior.
@ChristianPavilonis ChristianPavilonis changed the title Add EC KV partner sync and Sourcepoint consent support Add EC consent logging and Sourcepoint consent support May 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant