Skip to content

Allow consented first-party relay auctions under TCF - #1498

Open
ChristianPavilonis wants to merge 6 commits into
mainfrom
codex/1497-prebid-gdpr-relay
Open

ChristianPavilonis wants to merge 6 commits into
mainfrom
codex/1497-prebid-gdpr-relay

Conversation

@ChristianPavilonis

@ChristianPavilonis ChristianPavilonis commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

With GDPR applicable and Purpose 2 consent granted, Prebid can block trustedServer before calling /auction because the first-party relay has no GVL vendor identity. This PR makes the relay's basic-ads soft vendor exception an explicit testing opt-in rather than applying it to every deployment.

  • Add integrations.prebid.relay_soft_vendor_exception, defaulting to false, and inject it as window.__tsjs_prebid.relaySoftVendorException.
  • Only when explicitly enabled, add trustedServer to the basicAds rule's softVendorExceptions before relay auctions. Keep Purpose 2 enforcement, unrelated bidders' consent checks, publisher rules, and publisher-supplied GVL identity enforcement.
  • With managed User IDs and a CMP, apply relay rule updates through the automatic IAB consent owner. They no longer retire that owner or open an unguarded CMP subscription, so a later publisher GDPR denial still holds.
  • With the setting omitted or false, leave publisher consent rules unchanged. Legacy top-level TCF configuration remains unchanged.

Existing behavior, unchanged here: /auction forwards the original consent signals, and downstream auction endpoints remain responsible for individual vendor enforcement.

Deployment setting

Production deployments should omit the setting, which means false. Set it to true only to opt into the relay exception for testing:

[integrations.prebid]
relay_soft_vendor_exception = true

Binaries built before this PR reject the key, even when it is set to false, so remove it from the stored configuration before rolling back. Without an appropriate publisher-configured relay GVL identity or exception, normal TCF vendor enforcement can still block relay auctions. This option does not set Prebid Server's test_mode or make traffic non-billable. No production deployment configuration was changed by this PR.

Changes

  • Rust browser configuration and head injection carry the flag from operator config to the existing Prebid shim.
  • The TypeScript shim gates the relay consent guard on explicit true, and routes its rule updates through the automatic CMP owner when one is active.
  • Rust tests cover omitted, false, and true through planned head injection, with the auction plan both enabled and disabled.
  • Real production-artifact Prebid tests cover omitted/disabled settings without rule mutation, enabled relay requests, Purpose 2 denial, mapped vendor denial, and unrelated bidders.
  • Managed-ID consent tests cover a relay auction under automatic CMP consent followed by a publisher static denial, with immediate and deferred CMP responses and a throwing config subscriber.
  • The integration guide, configuration reference, and changelog document the default, the testing opt-in, and rollback. The example config leaves the key commented out so ts config init output stays loadable by older binaries.

Verification

After the review fixes and main merge (b08647a4f):

  • Full JavaScript suite: 81 files, 3,319 tests; no type errors (before the merge, which changed no JavaScript).
  • Focused relay, artifact, and consent-enforcement tests: 369 tests.
  • Full native core suite: 3,399 passed, 2 ignored.
  • CLI suite, including tests that load the example config: 963 passed.
  • ESLint and Prettier on changed TypeScript; Rust formatting; docs and changelog formatting.

At f22a83fce, before the review fixes:

  • Fastly, reusable Fastly sandbox, Axum, Cloudflare, and Spin adapter test aliases.
  • Native core Clippy and all eight target-specific Clippy aliases.
  • Cross-adapter parity: 29 tests; native template build-digest: 10 tests and lint.
  • Fastly deadline tests and Cloudflare/Spin runtime deadline fixtures, including fixture builds and lint.
  • Docs-proposal scripts and ShellCheck, release-script tests/lint, domain and WASM clock lints, and CI Node pin checks.

The earlier live Chrome reproduction showed that temporarily applying the source guard restored /auction requests without changing CMP consent.

Closes #1497.

@ChristianPavilonis ChristianPavilonis self-assigned this Nov 4, 2026
ChristianPavilonis added a commit that referenced this pull request Nov 4, 2026
Backport Trusted Server PR #1498 to the EdgeZero RC demo branch. Keep the shim size regression bound matched to this branch, which does not include the newer trace implementation.

(cherry picked from commit 4b63348)

@aram356 aram356 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please make softVendorExceptions be config This should on for testing TS

@ChristianPavilonis

Copy link
Copy Markdown
Collaborator Author

Addressed in f22a83f. Added integrations.prebid.relay_soft_vendor_exception, defaulting to false. Set it to true to opt into the relay soft vendor exception for testing; production should leave it false or omitted. The existing server-injected config carries the flag to the shim. Tests cover omitted, false, and true, including actual Prebid enforcement of Purpose 2 and publisher GVL mappings. Updated the PR description, integration guide, and example config. This option does not enable non-billable test traffic.

@ChristianPavilonis

Copy link
Copy Markdown
Collaborator Author

Included the current feature delta from this PR at f22a83fceac98767979ac0dd406701e4a000c1db in compatible-baseline port #1545 and draft RC #1541, without merging newer-main ancestry or changing this PR's head/base/readiness.

The baseline replay reproduced the known automatic-CMP ownership regression with the testing flag explicitly enabled: a later publisher denial plus stale CMP grant produced a stubbed identity request/cookie. Port #1545 carries the existing guarded-setter correction and normal/deferred/throwing-subscriber regressions; this extra correction is not claimed present on this source branch. The default-off/testing-only setting and Purpose2/GVL controls remain unchanged. The port's45 focused artifact/consent cases and180 Rust Prebid cases pass, as do31 broader local gates and a fresh container smoke. Hosted checks for the port/advanced RC are pending; no deployment or production privacy acceptance is claimed.

@aram356
aram356 requested review from dhruv8sh and prk-Jr November 12, 2026 05:26

@aram356 aram356 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This round makes the relay basic-ads soft vendor exception an explicit testing opt-in (integrations.prebid.relay_soft_vendor_exception, default off), as requested last round. The config plumbing, the default, and the Prebid Purpose 2 and GVL-mapping enforcement hold up. One blocking issue remains: with the flag on and managed User IDs configured, the relay rule write breaks the shim's automatic CMP ownership handoff, and a later publisher GDPR denial can be overridden by a CMP grant.

1 of the inline comments below carries a one-click GitHub suggestion. Use Commit suggestion to apply it as a commit on the PR branch. The other comments describe the fix in prose because the change touches multiple files or lines outside the diff and can't be auto-applied.

Blocking

🔧 wrench

  • Relay rule writes go through the managed-ID ownership wrapper: see inline at crates/trusted-server-js/lib/src/integrations/prebid/index.ts:2487
  • Two CI checks failed: see Cross-cutting below

Non-blocking

🤔 thinking / ⛏ nitpick / 📝 note

  • 🤔 Leave the key out of the template: see inline at trusted-server.example.toml:533
  • ⛏ Keep the measured sizes in the budget comment: see inline at crates/trusted-server-js/lib/test/prebid-artifact-integration.test.mjs:415
  • ⛏ Configuration reference and CHANGELOG: see Cross-cutting below
  • 📝 Description bullet with no code change: see Cross-cutting below

Cross-cutting / body-level findings

  • 🔧 Two CI checks failed: browser integration tests and trace runtime and browser acceptance both failed while installing browser packages (Temporary failure resolving 'azure.archive.ubuntu.com'), before any test ran. Neither is required by branch protection, and the cause is the runner's apt mirror, not this diff. Please re-run both once the mirror recovers.
  • ⛏ Configuration reference and CHANGELOG: the Prebid browser-field table in docs/guide/configuration.md (around line 2005) is the full configuration reference but has no relay_soft_vendor_exception row; only the integration guide was updated. CHANGELOG.md [Unreleased] also has no Added entry for the key. That entry is the place to say it is testing-only, defaults to false, and is rejected by older binaries, so it must be removed before a rollback.
  • 📝 Description bullet with no code change: "Forward original consent signals to downstream auction endpoints" describes existing server behavior; nothing in this diff changes forwarding. The claim itself holds: /auction fails closed on TCF Purpose 1 for GDPR traffic and forwards the TC string to PBS.

CI Status

  • Analyze (actions): PASS
  • Analyze (javascript-typescript): PASS
  • Analyze (python): PASS
  • Analyze (rust): PASS
  • browser integration tests: FAIL
  • cargo check (cloudflare native + wasm32-unknown-unknown): PASS
  • cargo check/build/test (spin native + wasm32-wasip1): PASS
  • cargo fmt: PASS (required)
  • cargo test: PASS (required)
  • cargo test (axum native): PASS
  • cargo test (cross-adapter parity): PASS
  • cargo test (ts CLI, native) (macos-latest): PASS
  • cargo test (ts CLI, native) (ubuntu-latest): PASS
  • CI Node pin guard: PASS
  • CLAUDE.md symlink guard: PASS
  • CodeQL: PASS
  • docs-proposal scripts: PASS
  • format-docs: PASS (required)
  • format-typescript: PASS (required)
  • HTML EOF runtime (Fastly): PASS
  • integration tests: PASS
  • integration tests (Fastly EC lifecycle): PASS
  • prepare integration artifacts: PASS
  • release scripts: PASS
  • trace runtime and browser acceptance: FAIL
  • ts dev lint domains (changed lines): PASS
  • vitest: PASS
  • worker-deadlines (cloudflare): PASS
  • worker-deadlines (spin): PASS

Comment thread trusted-server.example.toml Resolved

@prk-Jr prk-Jr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

The default-off configuration plumbing and Purpose 2/vendor-mapping controls hold up. I independently reproduced the existing managed-ID consent ownership blocker at f22a83fce; no additional runtime defects found.

No one-click suggestions are included: the consent correction requires changes outside the diff and combined lifecycle tests.

Blocking

  • 🔧 P1 — Relay updates can override a later publisher denial — see inline at crates/trusted-server-js/lib/src/integrations/prebid/index.ts:2487.
  • 🔧 Two CI gates need successful reruns — browser integration tests and trace runtime and browser acceptance failed during browser dependency installation with Ubuntu mirror DNS errors. These are infrastructure failures, but browser acceptance remains unverified. Neither check is required by branch protection; both remain applicable repository gates.

Non-blocking

  • ⛏ Configuration reference and rollback guidance — document relay_soft_vendor_exception in the configuration reference and explain rollback compatibility: older binaries reject even an explicit false. Existing configurations that omit the key remain compatible.

Verification

All seven changed files and affected consumers were reviewed. Under pinned Node 24.20.0, 45 existing focused relay/artifact/consent tests passed, with no type errors. A separate production-artifact JSDOM probe reproduced an identity request and idl_env cookie after publisher denial with the flag enabled; its flag-disabled control passed. Rust suites were assessed through hosted CI, not rerun locally. No live deployment verification was performed.

CI Status

  • trace runtime and browser acceptance: FAIL
  • integration tests: PASS
  • browser integration tests: FAIL
  • integration tests (Fastly EC lifecycle): PASS
  • CodeQL: PASS
  • cargo check/build/test (spin native + wasm32-wasip1): PASS
  • CLAUDE.md symlink guard: PASS
  • Analyze (actions): PASS
  • worker-deadlines (spin): PASS
  • ts dev lint domains (changed lines): PASS
  • cargo test (ts CLI, native) (macos-latest): PASS
  • cargo test (ts CLI, native) (ubuntu-latest): PASS
  • docs-proposal scripts: PASS
  • cargo test: PASS (required)
  • cargo fmt: PASS (required)
  • prepare integration artifacts: PASS
  • cargo check (cloudflare native + wasm32-unknown-unknown): PASS
  • cargo test (cross-adapter parity): PASS
  • Analyze (javascript-typescript): PASS
  • cargo test (axum native): PASS
  • format-docs: PASS (required)
  • vitest: PASS
  • HTML EOF runtime (Fastly): PASS
  • format-typescript: PASS (required)
  • release scripts: PASS
  • CI Node pin guard: PASS
  • worker-deadlines (cloudflare): PASS
  • Analyze (rust): PASS
  • Analyze (javascript-typescript): PASS
  • Analyze (python): PASS

@dhruv8sh dhruv8sh left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Superseded by a follow-up review with inline comments: #1498 (review)

@dhruv8sh dhruv8sh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Adds an opt-in integrations.prebid.relay_soft_vendor_exception flag (default false) that lets the Prebid shim add trustedServer to the basicAds soft vendor exceptions before relay auctions. The guard is idempotent, keeps Purpose 2 and publisher GVL mappings enforced, and Prebid's per-purpose defaults keep the storage rule in place when the shim adds a basicAds rule. The code looks right; the only blocker is two browser CI jobs that failed on runner infrastructure.

1 of the inline comments below carries a one-click GitHub suggestion — use Commit suggestion to apply it as a commit on the PR branch.

Blocking

🔧 wrench

  • Two browser CI jobs failed — see cross-cutting below

Non-blocking

🤔 thinking / ⛏ nitpick

  • "Closes #1497" overstates the fix — see cross-cutting below
  • Keep the running size breakdown when raising the shim guard — see inline at crates/trusted-server-js/lib/test/prebid-artifact-integration.test.mjs:412

Cross-cutting / body-level findings

  • 🔧 Two browser CI jobs failed — browser integration tests and trace runtime and browser acceptance failed (neither is in the required set). Both logs show Temporary failure resolving 'azure.archive.ubuntu.com' while installing Playwright browser dependencies, so this looks like a runner DNS problem, not this diff. Please re-run them.
  • 🤔 "Closes #1497" overstates the fix — The flag defaults to false and is documented as a testing-only opt-in, so a production deployment that merges this still sees relay auctions blocked under GDPR, which is what #1497 reports. Consider "Refs #1497" (and a title like "Add an opt-in relay soft vendor exception for TCF testing") so the issue stays open until there is a production consent path, such as a publisher-configured relay GVL identity.

CI Status

  • cargo test: PASS (required)
  • cargo fmt: PASS (required)
  • format-docs: PASS (required)
  • format-typescript: PASS (required)
  • vitest: PASS
  • Analyze (rust), Analyze (javascript-typescript), Analyze (python), Analyze (actions), CodeQL: PASS
  • cargo test (axum native), cargo test (cross-adapter parity), cargo test (ts CLI, native) (ubuntu-latest / macos-latest): PASS
  • cargo check (cloudflare native + wasm32-unknown-unknown), cargo check/build/test (spin native + wasm32-wasip1): PASS
  • worker-deadlines (cloudflare / spin), HTML EOF runtime (Fastly): PASS
  • integration tests, integration tests (Fastly EC lifecycle), prepare integration artifacts: PASS
  • ts dev lint domains (changed lines), release scripts, docs-proposal scripts, CI Node pin guard, CLAUDE.md symlink guard: PASS
  • browser integration tests: FAIL
  • trace runtime and browser acceptance: FAIL

Route relay soft vendor exception updates through the active automatic IAB consent owner so they do not retire it or open an unguarded CMP subscription. Add combined managed-ID relay regressions, keep the setting out of the example config, and document it in the configuration reference and changelog.
@ChristianPavilonis

Copy link
Copy Markdown
Collaborator Author

Review round addressed in 33ce161, merged with current main in b08647a. Inline threads have their own replies; this covers the review-level points.

Checks after the merge: full native core suite (3,399 passed), CLI suite (963 passed), focused relay/artifact/consent JS tests (369 passed), Rust and docs formatting. The full JS suite (3,319 tests), ESLint and Prettier passed before the merge, which changed no JavaScript. Adapter, Clippy and browser jobs are left to CI.

@dhruv8sh dhruv8sh left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

This PR adds a testing-only integrations.prebid.relay_soft_vendor_exception flag. When it is on, the Prebid shim adds trustedServer to the basicAds rule's softVendorExceptions before each relay auction. It also sends the relay's rule writes through the automatic-CMP guard. The Rust flag wiring, the docs and the rollback note are clean, and the flag defaults to off. The problem is how the shim builds its rules array. Prebid's tcfControl treats any explicit gdpr.rules array as a full replacement for its defaults. So the guard changes enforcement for things other than the relay: it drops Purpose 1 storage enforcement in the common no-rules case, and it adds a Purpose 2 vendor gate on top of publisher rule sets that deliberately left one out. Both go against the documented promise that "storage, and User ID modules keep their existing rules".

The inline comments describe their fixes in prose. Each fix also needs changes to the unit tests in relay_consent.test.ts, which currently assert the faulty output, so neither can be applied as a one-click suggestion.

Blocking

🔧 wrench

  • Seeding rules with only basicAds drops Prebid's default Purpose 1 (storage) enforcement: see inline at crates/trusted-server-js/lib/src/integrations/prebid/relay_consent.ts:38
  • Adding a basicAds rule to publisher rule sets that left it out tightens P2 vendor enforcement for every other bidder: see inline at crates/trusted-server-js/lib/src/integrations/prebid/relay_consent.ts:57

Non-blocking

🤔 thinking

  • Relay rule writes subscribe through the __tcfapi captured at activation, which may be stale: see inline at crates/trusted-server-js/lib/src/integrations/prebid/index.ts:860

👍 praise

  • The end-to-end artifact matrix checks real tcfControl decisions (flag unset/false/true, P2 denied, GVL-mapped) against the actual bundle: see inline at crates/trusted-server-js/lib/test/prebid-artifact-integration.test.mjs:332

// An operator-supplied vendor identity keeps its vendor-consent gate.
if (mapped && !addedException) return;

const rules: unknown[] = gdpr.rules ?? [];

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 wrench: Seeding rules with only basicAds turns off Prebid's default Purpose 1 (storage) enforcement.

In Prebid's tcfControl, setEnforcementConfig uses DEFAULT_RULES only when gdpr.rules is absent. DEFAULT_RULES is both { purpose: 'storage', enforcePurpose: true, enforceVendor: true } and { purpose: 'basicAds', … }. Any explicit array fully replaces that default: purpose1Rule = rules['storage'] becomes undefined.

The most common publisher config is consentManagement.gdpr = { cmpApi: 'iab' } with no rules. This is also exactly what the automatic managed-User-ID activation writes. In that case this line starts from [], the branch at line 57 pushes only a basicAds rule, and the resulting setConfig silently removes device-access enforcement for every bidder, User ID module and analytics adapter on the page. A guard that is meant to relax one vendor check for one bidder ends up dropping a whole consent gate. That contradicts the docs ("storage, and User ID modules keep their existing rules").

The unit test retains both default basic-ads gates and is idempotent (relay_consent.test.ts:37-49) encodes the bug: it expects rules to contain only the basicAds entry.

Proposed fix (apply manually: the test expectation in relay_consent.test.ts must change with it, so this can't be a single-file suggestion):

      // Without explicit rules Prebid enforces both default rules. Writing any
      // `rules` array replaces those defaults, so materialise both before
      // adding the relay exception.
      const rules: unknown[] = gdpr.rules ?? [
        { purpose: 'storage', enforcePurpose: true, enforceVendor: true },
        { purpose: 'basicAds', enforcePurpose: true, enforceVendor: true },
      ];

Then update the idempotency test to expect both the storage rule and the basicAds rule with softVendorExceptions: ['trustedServer']. Also add an artifact-level assertion that a Purpose-1-denied page still blocks storage after a relay auction.

};
});

if (!foundBasicAds && !mapped) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔧 wrench: Adding a basicAds rule to a publisher's custom rule set adds a Purpose 2 vendor gate the publisher left out on purpose.

When a publisher passes an explicit rules array with no basicAds entry (for example only storage), tcfControl does not enforce Purpose 2 for anyone. The comment "Custom rules replace Prebid's defaults, so retain both default gates" has this backwards: the publisher's custom rules are the full policy. Pushing { purpose: 'basicAds', enforcePurpose: true, enforceVendor: true } therefore adds P2 purpose and vendor enforcement for every client-side bidder on the page. Bidders that were allowed before can now be blocked in tcf2Enforcement. That breaks the docs' promise that "unrelated bidders … keep their existing rules". It is also unnecessary: with no basicAds rule, trustedServer is not blocked by P2 in the first place.

With the line 38 fix (seed both defaults when rules is absent), every case that needs an exception already contains a basicAds rule. This branch can then go away completely:

      // An explicit rule set without `basicAds` does not enforce Purpose 2 for
      // any bidder, so the relay needs no exception and the publisher's
      // policy is left untouched.

(Apply manually. Removing this branch alone, without the line 38 change, would leave the default no-rules case blocked. Add a unit test showing that rules: [{ purpose: 'storage', … }] produces no setConfig call.)

} finally {
if (tcfWindow.__tcfapi === guardedTcfApi) tcfWindow.__tcfapi = originalTcfApi;
}
activation.applyConfig = (value) => {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 thinking: applyConfig now runs on every relay rule write, not only once at activation. Each consentManagement write makes Prebid's consent module re-run its IAB lookup, so a new addEventListener call goes out through guardedTcfApi. guardedTcfApi always forwards to the originalTcfApi captured when the automatic owner activated.

A common CMP pattern installs a __tcfapi stub first and later replaces it with the full implementation. If that swap happens between activation and the first relay auction, Prebid's new subscription goes to the old stub function. That stub may push onto a queue the real CMP has already drained, so the callback never fires and the auction waits out the consent timeout. Before this PR there was only one guarded subscription, made at activation time, so this window didn't exist.

One option: when previousTcfApi is not guardedTcfApi and differs from originalTcfApi, build the per-call guard over previousTcfApi, or skip the guard and use plain setConfig. That keeps the stale-listener cleanup bound to the API that accepted the subscription, as the existing comment intends. It would be worth a test that swaps window.__tcfapi between runGdprPage's activation and the relay auction.

}

describe('tsjs-prebid production artifacts', () => {
it.each([

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 praise: Running the real production bundle across flag unset/false/true, Purpose 2 denied and a GVL-mapped relay, and asserting on tcf2Enforcement.biddersBlocked, is the right level for this change. It proves the exception actually changes what Prebid decides, not only that a config object was written. Checking that rubicon stays blocked in every case is also a good guard against the exception spreading to other bidders.

@prk-Jr prk-Jr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Summary

Re-review at b08647a4f. The managed-ID ownership finding from my previous review is fixed: relay rule writes now go through the automatic consent owner, and the subscription they create keeps the callback guard. The flag defaults to off and stays testing-only, and Purpose 2 and publisher GVL mappings are still enforced. Approving.

Non-blocking

⛏ nitpick

  • The comment on the added basicAds rule describes Prebid's defaults wrongly: see inline at crates/trusted-server-js/lib/src/integrations/prebid/relay_consent.ts:58

📝 note

  • Prebid 10.26 does not drop default rules when gdpr.rules is set (this concerns @dhruv8sh's two wrench findings on relay_consent.ts:38 and :57). At the locked prebid.js 10.26.0, setEnforcementConfig maps the explicit array by purpose and then assigns ACTIVE_RULES[...] = rules[name] ?? opts.default for every configurable purpose (modules/tcfControl.ts:389-398; the built dist/src/modules/tcfControl.js:318 is the same). A rule set with only basicAds therefore still enforces the default storage, personalizedAds and measurement rules. A publisher rule set without basicAds still gets the default Purpose 2 gate, so the pushed entry matches that default plus the relay's soft exception and does not tighten other bidders. I checked this against the production artifact: with the flag on, Purpose 1 denied and no publisher rules, the relay writes rules: [basicAds only], and rubicon is still in ufpdBlocked. That is the Purpose 4 default rule, which would vanish if an explicit array replaced the defaults. The "replace the defaults" behavior is how older Prebid releases worked. So I don't think either change is needed at this version; only the code comment is misleading (inline above).
  • @dhruv8sh's 🤔 about the __tcfapi captured at activation going stale before a later relay write is still open. I agree it's worth a follow-up test and didn't repeat it.

Verification

  • Focused tests: relay_consent, prebid-artifact-integration and prebid-consent-enforcement pass (50 tests, no type errors), under Node 24.12.0; the repository pins 24.20.0.
  • Negative control: sending relay writes through the unguarded originalSetConfig, even with the automatic owner active, makes both deferred-CMP takeover regressions fail. The guard is what keeps the publisher's denial in place.
  • The suggestion passes Prettier, ESLint and the relay_consent unit tests, and changes only the comment.
  • Rust and docs changes were read in full; the Rust test covers omitted, false and true, with the plan both enabled and disabled.

CI Status

All 30 checks pass at b08647a4f, including browser integration tests, trace runtime and browser acceptance, vitest, cargo test, cargo fmt (which also runs clippy), format-typescript and format-docs.

});

if (!foundBasicAds && !mapped) {
// Custom rules replace Prebid's defaults, so retain both default gates.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⛏ nitpick: This comment says custom rules replace Prebid's defaults. At the locked Prebid 10.26.0 they don't: setEnforcementConfig falls back to opts.default for every purpose the explicit array omits (tcfControl.ts:397). So the default storage gate is still in force, and this entry matches the default basicAds gate with only the relay exception added. A reader who trusts the current wording could "fix" the guard to seed rules that Prebid already applies.

Suggested change
// Custom rules replace Prebid's defaults, so retain both default gates.
// tcfControl falls back to each purpose's default rule when an explicit
// rule set omits it, so this entry matches the default basic-ads gate
// and only adds the relay exception.

This branch has not been deployed

No deployments
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.

Auction endpoint not being called from UK IP despite consent given and EC being present - Fine on US VPN

4 participants