Datadome: Add configurable bypass header and remove tag injection for bypasses - #992
Open
ChristianPavilonis wants to merge 9 commits into
Open
Datadome: Add configurable bypass header and remove tag injection for bypasses#992ChristianPavilonis wants to merge 9 commits into
ChristianPavilonis wants to merge 9 commits into
Conversation
ChristianPavilonis
added a commit
that referenced
this pull request
Aug 3, 2026
ChristianPavilonis
added a commit
that referenced
this pull request
Aug 3, 2026
ChristianPavilonis
added a commit
that referenced
this pull request
Aug 3, 2026
This reverts commit 8589431.
ChristianPavilonis
added a commit
that referenced
this pull request
Aug 3, 2026
ChristianPavilonis
marked this pull request as ready for review
August 6, 2026 18:18
Log whether protection_test_bypass is enabled when registering the DataDome integration and include configured header name when enabled. Keep credential secret out of logs.,
ChristianPavilonis
force-pushed
the
log/datadome
branch
from
August 6, 2026 18:25
b4ccee2 to
7e6f365
Compare
aram356
requested changes
Aug 8, 2026
aram356
left a comment
Collaborator
There was a problem hiding this comment.
Summary
Aligns the two DataDome protection layers (IP-based exclusions now skip the Protection API and omit only Trusted Server's auto-injected browser tag) and adds a secret-backed staging bypass header. The design is sound: single scope evaluation, typed request extension instead of a synthetic header, constant-time credential comparison, cache privacy on tag-suppressed HTML, and no client IPs in logs. One CI gate is failing and there are a handful of non-blocking concerns, detailed inline.
Blocking
🔧 wrench
- format-docs CI failure:
docs/superpowers/plans/2026-08-03-datadome-ip-excluded-client-tag.mdfails the pinned Prettier check (stray blank lines after indented code blocks inside list items, at lines 139, 163, 223, 244, 252, 335, and 346). Fix withcd docs && npx prettier --write superpowers/plans/2026-08-03-datadome-ip-excluded-client-tag.md.
Non-blocking
🤔 thinking
- Bypass header reaches the origin when the bypass is disabled (
protection.rs:176, inline) - Validator stripping is over-broad and misses Range parity with the ad-stack strip (
publisher.rs:2908, inline) - Suppression marker rides a one-slot-per-integration document-state map (
html_processor.rs:250, inline)
♻️ refactor
- Duplicate
cdn-cache-controlentry inCDN_CACHE_HEADERS(response_privacy.rs:25, inline) - Missing regression test for publisher-originated tags under suppression (
datadome.rs:846, inline)
🌱 seedling
- No expiry or environment guard on the staging bypass (
datadome.rs:129, inline)
CI Status
- fmt: PASS
- rust tests (fastly/axum/cloudflare/spin + cross-adapter parity): PASS
- cloudflare/spin checks: PASS
- vitest: PASS
- format-typescript: PASS
- format-docs: FAIL
- integration tests (browser, Fastly EC lifecycle): pending at review time
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
x-ts-datadome-bypassheader skips server-side protection, suppresses the automatic tag, and is removed before the request reaches DataDome or the publisher origin.The issue was that an IP allowlist skipped server-side DataDome validation but still allowed the automatically injected browser tag to run. The new flow keeps those layers consistent while providing a controlled way to test protected staging sites without logging client IPs or exposing bypass credentials.
Changes
crates/trusted-server-core/benches/html_processor_bench.rscrates/trusted-server-core/src/config.rscrates/trusted-server-core/src/html_processor.rscrates/trusted-server-core/src/integrations/datadome.rscrates/trusted-server-core/src/integrations/datadome/protection.rscrates/trusted-server-core/src/integrations/registry.rscrates/trusted-server-core/src/platform/test_support.rscrates/trusted-server-core/src/publisher.rscrates/trusted-server-core/src/response_privacy.rscdn-cache-control.docs/guide/integrations/datadome.mddocs/superpowers/plans/2026-08-03-datadome-ip-excluded-client-tag.mddocs/superpowers/specs/2026-08-03-datadome-ip-excluded-client-tag-design.mdScope
This PR is intentionally limited to the existing DataDome request-filter, HTML-processing, publisher, and privacy paths, plus their tests and operator documentation. It does not change JavaScript bundles, publisher-originated DataDome markup, direct DataDome integration routes, or unrelated adapters; the staging bypass is included because it uses the same request-scoped protection decision and is needed for controlled staging verification.
Closes
Closes #994
Test plan
cargo test-fastlycargo test-axumcargo test-cloudflarecargo clippy-fastlycargo clippy-axumcargo clippy-cloudflarecargo fmt --all -- --checkgit diff --checkChecklist