Skip to content

Encypher RTD Provider: verified OpenRTB provenance carrier - #15354

Open
erik-sv wants to merge 9 commits into
prebid:masterfrom
erik-sv:feat/encypher-rtd-provider-v2
Open

Encypher RTD Provider: verified OpenRTB provenance carrier#15354
erik-sv wants to merge 9 commits into
prebid:masterfrom
erik-sv:feat/encypher-rtd-provider-v2

Conversation

@erik-sv

@erik-sv erik-sv commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Type of change

  • Feature

  • Does this change affect user-facing APIs or examples documented on http://prebid.org?

Description of change

Replaces the existing Encypher RTD provider implementation rather than adding a second module.

The provider is now a lookup-only, fail-open OpenRTB carrier:

  • Keeps the existing encypher provider name and one-setting realTimeData.dataProviders integration.
  • Computes the generated v1 canonical URL hash and performs a credentialless edge lookup.
  • Uses a query-bound simple GET with no custom domain header, avoiding a browser CORS preflight inside the 300 ms deadline.
  • Restricts params.signalBase to https://signals.encypher.com or Encypher-controlled subdomains below signals.encypher.com; arbitrary hosts, lookalikes, credentials, query strings, fragments, and custom ports fail open before network or telemetry.
  • Validates the exact response envelope, compact carrier, pinned Encypher issuer, deterministic attestation reference, ES256 JWS, public JWKS, publisher domain, URL hash, expiration, revision, validation status, and declaration.
  • Injects only { v, id, ref, att } at each ortb2Imp.ext.c2pa while preserving GPID, supply chain, and caller fields.
  • Keeps attestation and JWKS caches in page memory only. Ready status is reused for at most 30 seconds; the next auction refreshes the edge status so stale or revoked records stop injecting.
  • Fails open and calls back exactly once for misses, stale or revoked records, malformed responses, invalid signatures or claims, unsafe configuration, network failures, and timeouts.
  • Leaves optional diagnostic telemetry disabled by default and diagnostic-only when enabled.
  • Version 1.1.0 adds privacy-minimized publisher adoption reporting to the same attestation GET, with no second request. params.adoptionReporting defaults to true; exactly false adds adoption_reporting=0 and stops future adoption observations without changing auction behavior.

The edge records an adoption observation only when the browser Origin hostname exactly matches the publisher FQDN. It retains only that FQDN, first/last seen, module version, aggregate lookup/hit/miss counts, and provenance dataset version for up to 24 months. It does not retain the page URL or digest, IP, page content, user/cookie ID, bid, price, or creative. These counts are operational observations, not installation, entitlement, billing, scoring, or lift evidence.

This removes the legacy browser auto-signing, article extraction, manifest fetch, cross-page localStorage, signer-tier inference, and global site.ext.data.c2pa payload. No page content, user data, cookies, credentials, scores, prices, or billing fields leave the page.

Publisher configuration

pbjs.setConfig({
  realTimeData: {
    auctionDelay: 300,
    dataProviders: [{
      name: 'encypher',
      waitForIt: true
    }]
  }
});

The provider's default total deadline is 300 ms. realTimeData.auctionDelay must be at least as large as params.timeout so Prebid waits for the asynchronous lookup before releasing the auction. Publishers who do not want domain-level adoption reporting can set params.adoptionReporting: false.

The module documentation is updated in modules/encypherRtdProvider.md. There is no separate provider page on prebid.org today.

Verification

  • Targeted ESLint: passed.
  • TypeScript strict compilation: passed through the Prebid test and build pipelines.
  • Chrome Headless Karma: 61 tests passed in both feature modes, including canonical vectors, credentialless simple transport, endpoint-host allowlisting, default reporting and explicit opt-out on the existing request, exact carrier injection, pinned trust, mirror isolation, 30-second status freshness, expired-record refresh, unsafe URL fail-open, strict envelope handling, malformed JWS/JWKS, WebCrypto failures, synchronous request construction failure, deadline exhaustion, rejected verification, unknown-key refresh, and telemetry privacy.
  • Hit path permits exactly two reads: the attestation lookup and pinned JWKS. Default and opt-out miss paths perform exactly one lookup; adoption reporting adds no request.
  • Focused module coverage before the additional reporting cases: 100% lines, 100% functions, 82.49% branches.
  • Production bundle: npx gulp build --modules=rtdModule,encypherRtdProvider passed with webpack 5.108.4.

Related work

Landing dependency

The edge PR above must deploy before a v1.1 module release. The current edge supports the deployed v1.0 one-key query; PR #295 adds backward-compatible module_version and explicit opt-out handling.

@github-actions

Copy link
Copy Markdown

This PR introduces changes that may not work on all browsers. According to Babel, the following polyfills may be needed, and they are not automatically included:

  • Changes to modules/encypherRtdProvider.ts may need:
    • es.array-buffer.detached
    • es.array-buffer.transfer
    • es.array-buffer.transfer-to-fixed-length
    • es.array.push
    • es.iterator.constructor
    • es.iterator.every
    • es.iterator.for-each
    • es.typed-array.to-reversed
    • es.typed-array.to-sorted
    • es.typed-array.with
    • esnext.array-buffer.detached
    • esnext.array-buffer.transfer
    • esnext.array-buffer.transfer-to-fixed-length
    • esnext.iterator.constructor
    • esnext.iterator.every
    • esnext.iterator.for-each
    • esnext.typed-array.to-reversed
    • esnext.typed-array.to-sorted
    • esnext.typed-array.with
    • esnext.uint8-array.set-from-base64
    • esnext.uint8-array.set-from-hex
    • esnext.uint8-array.to-base64
    • esnext.uint8-array.to-hex
    • web.dom-exception.stack
  • Changes to test/spec/modules/encypherRtdProvider_spec.js may need:
    • es.iterator.filter
    • es.iterator.find
    • es.iterator.some
    • esnext.iterator.filter
    • esnext.iterator.find
    • esnext.iterator.some
    • web.dom-exception.stack
    • web.structured-clone
    • web.url-search-params.delete
    • web.url-search-params.has
    • web.url-search-params.size

The best way to address this is to provide good test coverage, as normal PR checks run unit tests on older browsers.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 5e1d07c808

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread modules/encypherRtdProvider.ts Outdated
Comment thread modules/encypherRtdProvider.ts Outdated
@barecheck

barecheck Bot commented Jul 13, 2026

Copy link
Copy Markdown

Barecheck - Code coverage report

Total: 96.58%

Your code coverage diff: 0.00% ▴

Uncovered files and lines
FileLines
test/spec/modules/encypherRtdProvider_spec.js316-317, 335, 946-947, 955, 990-991, 999, 1035-1036, 1044, 1072-1073, 1081, 1119-1120, 1128, 1151-1152, 1160, 1180-1181, 1187, 1235-1236, 1258, 1275

@erik-sv

erik-sv commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 415cd58214

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread modules/encypherRtdProvider.ts
@erik-sv

erik-sv commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e2aaac8472

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread modules/encypherRtdProvider.ts
Comment thread modules/encypherRtdProvider.ts
@patmmccann

Copy link
Copy Markdown
Collaborator

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: d75faeb6e2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

};
if (datasetVersion !== undefined) payload.dataset_version = datasetVersion;
try {
sendBeacon(signalBase + '/v1/telemetry/rtd', JSON.stringify(payload));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Send telemetry without ambient credentials

When telemetry: true and the browser has cross-site-eligible cookies for the Encypher signal domain, sendBeacon sends the request with ambient credentials and provides no option equivalent to credentials: 'omit'. Consequently, the telemetry transport is not actually credentialless despite the module's privacy contract; use the repository fetch/ajax wrapper with keepalive: true and explicitly omitted credentials instead.

AGENTS.md reference: AGENTS.md:L71-L71

Useful? React with 👍 / 👎.

} else if (Array.isArray(author) && author[0]) {
meta.author = author[0].name || (typeof author[0] === 'string' ? author[0] : undefined);
/** Synchronous SHA-256 for the canonical URL lookup key. */
export function sha256(value: string): Uint8Array {

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.

i do not follow the desire for a sync implementation; i opened #15404

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.

2 participants