Uh oh!
There was an error while loading. Please reload this page.
Add DataDome server-side protection - #769
Conversation
988ec06 to
c18ba1bCompare
aram356
left a comment
There was a problem hiding this comment.
Summary
Adds DataDome server-side Protection API validation plus generic integration request-filter infrastructure. The implementation is solid: response effects are applied on every HandlerOutcome path, integration config is validated at load time, fail-open is deliberate and tested, and the new filter infra is cleanly factored and unit-tested. All 14 CI checks pass, and I separately verified the wasm32-wasip1 release build (which CI does not gate) compiles. Approving — every finding below is non-blocking.
Non-blocking
🤔 thinking / 🌱 seedling / 📝 note
- Config/setup errors fail open silently — see inline at
crates/trusted-server-core/src/integrations/datadome/protection.rs:51 - Head-injector attribute-context escaping — see inline at
crates/trusted-server-core/src/integrations/datadome.rs:736 - Server-side key cache has no TTL — see inline at
crates/trusted-server-core/src/integrations/datadome/protection.rs:37 - Challenge response depends on the pointer header — see inline at
crates/trusted-server-core/src/integrations/datadome/protection.rs:406
Cross-cutting / body-level findings
- 🤔 Test coverage gap — Behavioral tests cover the
403challenge and200allow paths well, but not the301/302redirect-challenge path norx-datadome-request-headersupstream enrichment routed through a realclassify_protection_responseresult. Adding both would close the gap and lock in the redirect/Locationbehavior. - 📌 No
wasm32-wasip1build gate in CI — This PR adds wasm-sensitive runtime dependencies (chrono::Utc::now(),std::time::Instant,std::env::var,urlencoding) on the request hot path. I verified thewasm32-wasip1release build compiles locally, but nothing in CI guards it. Worth a follow-up issue to add a wasm build job. (Out of scope for this PR.)
CI Status
- cargo fmt: PASS (required)
- cargo test: PASS (required)
- format-typescript: PASS (required)
- format-docs: PASS (required)
- vitest: PASS
- CodeQL: PASS
- Analyze (rust): PASS
- Analyze (javascript-typescript): PASS
- Analyze (actions): PASS
- integration tests: PASS
- browser integration tests: PASS
- prepare integration artifacts: PASS
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Summary
Changes
crates/trusted-server-core/src/integrations/registry.rscrates/trusted-server-core/src/integrations/datadome.rscrates/trusted-server-core/src/integrations/datadome/protection.rscrates/trusted-server-adapter-fastly/src/main.rscrates/trusted-server-adapter-fastly/src/platform.rs/crates/trusted-server-core/src/platform/types.rscrates/trusted-server-adapter-fastly/src/route_tests.rscrates/trusted-server-core/src/platform/test_support.rs/src/http_util.rscrates/trusted-server-core/Cargo.tomltrusted-server.tomldocs/guide/integrations/datadome.mddocs/superpowers/specs/2026-06-11-datadome-server-side-protection-design.mdCloses
Closes#317
Test plan
cargo test --workspacecargo clippy --workspace --all-targets --all-features -- -D warningscargo fmt --all -- --checkcd crates/js/lib && npx vitest runcd crates/js/lib && npm run formatcd docs && npm run formatcargo build --package trusted-server-adapter-fastly --release --target wasm32-wasip1fastly compute servecd docs && npx prettier --check guide/integrations/datadome.md superpowers/specs/2026-06-11-datadome-server-side-protection-design.mdChecklist
unwrap()in production code — useexpect("should ...")println!)