@certrev/cert-block 1.2.0-canary.6 → 1.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +120 -35
  2. package/README.md +116 -21
  3. package/dist/builder/card-reader-css.d.ts +14 -0
  4. package/dist/builder/card-reader-css.d.ts.map +1 -0
  5. package/dist/builder/card-reader-css.js +17 -0
  6. package/dist/builder/card-reader-css.js.map +1 -0
  7. package/dist/builder/cert-review-card.d.ts +8 -0
  8. package/dist/builder/cert-review-card.d.ts.map +1 -1
  9. package/dist/builder/cert-review-card.js +234 -41
  10. package/dist/builder/cert-review-card.js.map +1 -1
  11. package/dist/builder/delivery-runtime.d.ts +15 -1
  12. package/dist/builder/delivery-runtime.d.ts.map +1 -1
  13. package/dist/builder/delivery-runtime.js +31 -3
  14. package/dist/builder/delivery-runtime.js.map +1 -1
  15. package/dist/builder/ssr-seed.d.ts +155 -0
  16. package/dist/builder/ssr-seed.d.ts.map +1 -0
  17. package/dist/builder/ssr-seed.js +278 -0
  18. package/dist/builder/ssr-seed.js.map +1 -0
  19. package/dist/reader/face.d.ts +6 -2
  20. package/dist/reader/face.d.ts.map +1 -1
  21. package/dist/reader/face.js +53 -5
  22. package/dist/reader/face.js.map +1 -1
  23. package/dist/reader/render.d.ts.map +1 -1
  24. package/dist/reader/render.js +10 -10
  25. package/dist/reader/render.js.map +1 -1
  26. package/dist/verify/cache.d.ts +39 -2
  27. package/dist/verify/cache.d.ts.map +1 -1
  28. package/dist/verify/cache.js +61 -12
  29. package/dist/verify/cache.js.map +1 -1
  30. package/dist/verify/get-verified-delivery.d.ts +28 -3
  31. package/dist/verify/get-verified-delivery.d.ts.map +1 -1
  32. package/dist/verify/get-verified-delivery.js +46 -9
  33. package/dist/verify/get-verified-delivery.js.map +1 -1
  34. package/package.json +112 -112
  35. package/src/builder/card-reader-css.ts +19 -0
  36. package/src/builder/cert-review-card.tsx +308 -56
  37. package/src/builder/delivery-runtime.ts +33 -3
  38. package/src/builder/ssr-seed.ts +343 -0
  39. package/src/reader/face.ts +59 -6
  40. package/src/reader/render.ts +12 -12
  41. package/src/verify/cache.ts +87 -11
  42. package/src/verify/get-verified-delivery.ts +77 -11
@@ -23,11 +23,13 @@ import { Suspense } from 'react';
23
23
  import { memoToggleFor, toggleMemo } from '../components/memo-toggle.js';
24
24
  import { renderCertBlock } from '../components/render-cert-block.js';
25
25
  import { CERT_STRINGS_VERSION } from '../components/render-def.js';
26
- import { READER_CSS } from '../reader/reader-css.generated.js';
27
- import { getVerifiedDelivery, parseDesignPin, peekVerifiedDelivery, } from '../verify/get-verified-delivery.js';
26
+ import { renderVerdict } from '../contract/kernel.js';
27
+ import { getVerifiedDelivery, parseDesignPin, readVerifiedDelivery, } from '../verify/get-verified-delivery.js';
28
+ import { CARD_READER_CSS } from './card-reader-css.js';
28
29
  import { BUILDER_CERT_CHROME_KEYS } from './cert-chrome-data.js';
29
30
  import { cardDeliveryRuntime } from './delivery-runtime.js';
30
31
  import { envelopeCardHtml, envelopeCardInput, isReaderFaceDef } from './envelope-face.js';
32
+ import { pageHoldsServerHtml, pageRecordFor, SEED_ATTRIBUTE, seedFor, serializeFallback, serializeSeed, withoutPhotos, } from './ssr-seed.js';
31
33
  /**
32
34
  * The canonical Builder block name. A brand's registration + the portal
33
35
  * `certComponent` connection field default to THIS; config exists only for
@@ -99,7 +101,7 @@ export function acceptedDeliveryMarker(value) {
99
101
  /**
100
102
  * Suspend on a Delivery read. React 19 gets `use` with ONE promise per placement while it is in
101
103
  * flight; React 18 (no `use`) gets the promise thrown, the Suspense protocol it supports. Either
102
- * way the retry finds the settled read in the cache through `peekVerifiedDelivery`, so it never
104
+ * way the retry finds the settled read in the cache through `readVerifiedDelivery`, so it never
103
105
  * suspends on a second promise.
104
106
  */
105
107
  const inflightReads = new Map();
@@ -152,6 +154,7 @@ function withSidebarFlow(reader, face) {
152
154
  */
153
155
  function EnvelopeFace(props) {
154
156
  const ref = React.useRef(null);
157
+ const { onBrokenPhoto } = props;
155
158
  React.useEffect(() => {
156
159
  const el = ref.current;
157
160
  if (!el)
@@ -164,15 +167,208 @@ function EnvelopeFace(props) {
164
167
  el.addEventListener('click', onClick);
165
168
  return () => el.removeEventListener('click', onClick);
166
169
  }, []);
167
- return withSidebarFlow(props.reader, _jsx("div", { ref: ref, "data-certrev-cert-chrome": "", "data-certrev-delivery": "", "data-certrev-strings-version": CERT_STRINGS_VERSION, "data-certrev-def-version": props.defVersion, ...(props.reader ? { 'data-certrev-face': 'reader', style: { display: 'flow-root' } } : {}),
170
+ React.useEffect(() => {
171
+ const el = ref.current;
172
+ if (!el || !onBrokenPhoto)
173
+ return;
174
+ // A photo that failed before this effect ran (during hydration) has no error event left to hear.
175
+ for (const img of Array.from(el.querySelectorAll('.certrev-r-face > img'))) {
176
+ if (img instanceof HTMLImageElement && img.complete && img.naturalWidth === 0)
177
+ onBrokenPhoto(photoPerson(img));
178
+ }
179
+ // An image's `error` does not bubble, so it is heard in the capture phase.
180
+ const onError = (e) => {
181
+ const img = e.target;
182
+ if (img instanceof HTMLImageElement && img.parentElement?.classList.contains('certrev-r-face')) {
183
+ onBrokenPhoto(photoPerson(img));
184
+ }
185
+ };
186
+ el.addEventListener('error', onError, true);
187
+ return () => el.removeEventListener('error', onError, true);
188
+ }, [onBrokenPhoto]);
189
+ return withSidebarFlow(props.reader, _jsx("div", { ref: ref, "data-certrev-cert-chrome": "", "data-certrev-delivery": "", "data-certrev-strings-version": CERT_STRINGS_VERSION, "data-certrev-def-version": props.defVersion, [SEED_ATTRIBUTE]: props.seed, ...(props.reader ? { 'data-certrev-face': 'reader', style: { display: 'flow-root' } } : {}),
190
+ // biome-ignore lint/security/noDangerouslySetInnerHtml: renderCertBlock is the escaping-safe SSR string renderer
191
+ dangerouslySetInnerHTML: { __html: props.html } }));
192
+ }
193
+ /** The reader face paints the author's avatar small (`.certrev-r-face.sm`); every other avatar is the expert's. */
194
+ function photoPerson(img) {
195
+ return img.parentElement?.classList.contains('sm') ? 'author' : 'expert';
196
+ }
197
+ /**
198
+ * 1.2.0-canary.5: a pinned read paints only the design it pinned, a reader def at exactly that version. A def served
199
+ * for anything else (none, another face, another version) paints nothing, never the live design in its place.
200
+ */
201
+ function pinnedDefHolds(design, renderDef) {
202
+ return !design || (isReaderFaceDef(renderDef) && renderDef?.v === design.version);
203
+ }
204
+ /**
205
+ * 1.2.0: the reader face, repainted with the reviewer's (or the author's) initials when the browser cannot load their
206
+ * photo: a brand's CSP `img-src` that does not name the photo's host, a 404. The first paint is the server's, photo
207
+ * included, so hydration matches; a photo that fails is dropped from the payload this face paints
208
+ * (`withoutPhotos`), and the face's own avatar rule paints the initials in its place. The seed is not touched.
209
+ */
210
+ function ReaderEnvelopeFace(props) {
211
+ const [broken, setBroken] = React.useState([]);
212
+ const onBrokenPhoto = React.useCallback((person) => setBroken((was) => (was.includes(person) ? was : [...was, person])), []);
213
+ const payload = broken.length > 0 ? withoutPhotos(props.payload, broken) : props.payload;
214
+ const reader = envelopeCardHtml(payload.content, props.renderDef, {
215
+ mode: props.card.mode,
216
+ part: props.card.part,
217
+ certId: payload.certId,
218
+ });
219
+ if (!reader)
220
+ return null;
221
+ return (_jsx(EnvelopeFace, { reader: true,
222
+ // The stylesheet rides inside the face, once per card: the portal's reader CSS less its remote font
223
+ // faces (card-reader-css.ts), so the card asks the page's CSP for nothing.
224
+ html: `<style data-certrev-reader-css>${CARD_READER_CSS}</style>${reader}`, defVersion: props.renderDef.v, seed: props.seed, onBrokenPhoto: onBrokenPhoto }));
225
+ }
226
+ /** Paint a verified payload with its def; null when the def and content give no face. */
227
+ function paintEnvelope(payload, renderDef, props, seed) {
228
+ if (!pinnedDefHolds(props.design, renderDef))
229
+ return null;
230
+ const defVersion = renderDef ? renderDef.v : undefined;
231
+ // The reader face is opt-in by the def's own `face` and is chosen HERE and nowhere else on this path; every other
232
+ // def (no face, an unknown face) falls through to the legacy lines below, untouched since 1.1.1.
233
+ if (isReaderFaceDef(renderDef) && renderDef) {
234
+ // Without a face there is nothing to repaint; checked here so the null stays this function's answer.
235
+ if (!envelopeCardHtml(payload.content, renderDef, { mode: props.mode, part: props.part, certId: payload.certId }))
236
+ return null;
237
+ return _jsx(ReaderEnvelopeFace, { payload: payload, renderDef: renderDef, card: props, seed: seed });
238
+ }
239
+ const input = envelopeCardInput(payload.content, renderDef, { mode: props.mode, part: props.part });
240
+ if (!input)
241
+ return null;
242
+ return _jsx(EnvelopeFace, { html: renderCertBlock(input), defVersion: defVersion, seed: seed });
243
+ }
244
+ const FALLBACK_LAYOUTS = ['banner', 'sidebar', 'floating'];
245
+ /**
246
+ * The options face a block with the delivery marker paints in place of the envelope (1.2.0), or null. Its placement is
247
+ * the block's own `mode`, else its def's layout, as the envelope face's is, else the banner bridge. A pinned card (the
248
+ * canary replica) paints it too, so the replica shows what a brand's page shows when CertREV is not reached; its
249
+ * record names the pin and says `'options'`, so a capture can never take it for the pinned design.
250
+ */
251
+ function fallbackFace(props) {
252
+ const { block } = props;
253
+ const layout = block.renderDef?.layout;
254
+ const mode = typeof block.mode === 'string' && FALLBACK_LAYOUTS.includes(block.mode)
255
+ ? block.mode
256
+ : typeof layout === 'string' && FALLBACK_LAYOUTS.includes(layout)
257
+ ? layout
258
+ : undefined;
259
+ return optionsFaceHtml(block, mode);
260
+ }
261
+ /** The block's options face, stamped with a fallback record when the server wrote one (`ssr-seed.ts`). */
262
+ function OptionsFace(props) {
263
+ return (_jsx("div", { "data-certrev-cert-chrome": "", "data-certrev-strings-version": optionalText(props.block.stringsVersion), "data-certrev-def-version": typeof props.block.renderDef?.v === 'number' ? props.block.renderDef.v : undefined, ...(props.record === undefined ? {} : { [SEED_ATTRIBUTE]: props.record }),
168
264
  // biome-ignore lint/security/noDangerouslySetInnerHtml: renderCertBlock is the escaping-safe SSR string renderer
169
265
  dangerouslySetInnerHTML: { __html: props.html } }));
170
266
  }
267
+ /** Where the server painted no face, an empty hidden element carries the record that says so. */
268
+ function NoFace(props) {
269
+ return _jsx("div", { hidden: true, [SEED_ATTRIBUTE]: props.record });
270
+ }
271
+ /** What a card with no verified envelope paints: the options face when CertREV was not reached, else nothing. */
272
+ function settleWithoutEnvelope(props, unreachable) {
273
+ const html = unreachable ? fallbackFace(props) : null;
274
+ const face = html === null ? 'none' : 'options';
275
+ const record = serializeFallback({
276
+ baseUrl: props.baseUrl,
277
+ externalId: props.externalId,
278
+ ...(props.design ? { design: props.design } : {}),
279
+ face,
280
+ });
281
+ return html === null ? _jsx(NoFace, { record: record }) : _jsx(OptionsFace, { block: props.block, html: html, record: record });
282
+ }
283
+ const subscribeNever = () => () => { };
284
+ /**
285
+ * True on a server and while a browser hydrates server HTML; false once the client has committed, and from the first
286
+ * render of a card mounted on the client. React re-renders a hydrated card when this flips, so the card can paint
287
+ * the server's tree first (no mismatch) and judge it at the browser's clock right after.
288
+ *
289
+ * It is true in BOTH of the first two cases and React gives a component no public way to tell them apart, so the card
290
+ * does not ask React: see `EnvelopeCertReviewCard`.
291
+ */
292
+ function useHydrating() {
293
+ return React.useSyncExternalStore(subscribeNever, () => false, () => true);
294
+ }
295
+ /**
296
+ * 1.2.0: the card never reads the Delivery API from the browser unless the brand opts in (`clientRead`), so a
297
+ * storefront whose CSP `connect-src` does not name CertREV (e.l.f.'s live policy) never sees a request or a violation
298
+ * from it, and a page never loses its card for want of one.
299
+ *
300
+ * - Server: read (up to `CARD_DELIVERY_TIMEOUT_MS`, a fresh or stale-while-revalidating cache first), verify and paint
301
+ * as through 1.1.1, and write a record of what it painted (`ssr-seed.ts`):
302
+ * - a verified envelope: its face and the envelope seed (less the fields the def hides, and with no signature if
303
+ * it hid any);
304
+ * - CertREV not reached (a timeout, a network error, a 5xx, a body that is not JSON): the block's own options face,
305
+ * as 0.5.x painted it, and an `'options'` record (a pinned card too: the record names its pin);
306
+ * - a definitive no (revoked, expired, unverifiable, for another entry, not found): nothing, and a `'none'` record
307
+ * on an empty hidden element.
308
+ * - Browser, the page carries this placement's record: paint what it says. A seed paints its envelope; while
309
+ * hydrating the server's verdict stands (the tree is the server's, byte for byte), and once hydrated the lifecycle
310
+ * and subject are judged at the browser's clock, so a card that expired since the server render is taken down. An
311
+ * `'options'` record paints the options face, a `'none'` record nothing. This holds when React renders the card
312
+ * again on the client after a hydration error elsewhere on the page: the record is still in the document (or in
313
+ * the page's memory of it), so the browser repaints the server's answer and reads nothing.
314
+ * - Browser, hydrating with no record: server HTML from before 1.2.0 painted nothing here, so nothing.
315
+ * - Browser, a card mounted on the client with no record (a client-side navigation to an article this page never
316
+ * server-rendered, Builder's editor): the block's options face, pinned or not. With `clientRead`, instead, the
317
+ * one read, settled exactly as on the server.
318
+ *
319
+ * WHICH OF THE TWO FIRST CASES THIS RENDER IS (server or browser) is decided from what the render can observe, with
320
+ * no switch a test could set. A server render and a hydration are both "hydrating" to React and both see a `document`
321
+ * under jsdom, so `typeof document` alone calls a jsdom server render a browser, which is what 1.2.0-canary.5 got
322
+ * wrong (its SSR painted `<!--$--><!--/$-->`). What differs between them is the one thing a hydration has and a server
323
+ * render cannot: server-rendered HTML IN the document, in front of it. So:
324
+ * 1. no `document`: a server (every real server render: Node, Workers, Oxygen, Bun);
325
+ * 2. not hydrating: a browser (a client mount, or a card past its hydration);
326
+ * 3. hydrating with a `document`: a browser only when the live document holds this placement's record, or any React
327
+ * Suspense boundary marker (`pageHoldsServerHtml`; the card's own Suspense leaves one). Otherwise it is a server
328
+ * render running beside a `document` (jsdom, a DOM shim): it reads and records as a server does, and never consults
329
+ * a record or the page's memory, so a long-lived shim process cannot paint one page's record into another's render.
330
+ * The one case this cannot see is a server render that runs while the document still holds server-rendered React HTML
331
+ * (a test or shim that hydrates a page and then renders another into the same document without clearing it): that
332
+ * render is taken for a hydration. Clear the document between pages in such a harness.
333
+ */
171
334
  function EnvelopeCertReviewCard(props) {
172
335
  const rt = cardDeliveryRuntime();
173
- const { design } = props;
336
+ const hydrating = useHydrating();
337
+ // Latched at mount: this instance hydrated server HTML (as opposed to a client mount).
338
+ const [hydratedMount] = React.useState(hydrating);
174
339
  // The clock is read per render, so the lifecycle is judged NOW, not when the envelope was fetched.
175
340
  const context = { platform: 'builder', externalId: props.externalId, now: new Date(rt.now()) };
341
+ // Hydrating: the live document decides (the memory of an earlier page must not). Past hydration: the memory is the
342
+ // record the hydration used, which the document still carries as well.
343
+ const fromPage = typeof document === 'undefined'
344
+ ? undefined
345
+ : pageRecordFor(props.baseUrl, props.externalId, props.design, { live: hydrating });
346
+ const inBrowser = typeof document !== 'undefined' && (!hydrating || fromPage !== undefined || pageHoldsServerHtml());
347
+ if (inBrowser) {
348
+ if (fromPage && 'seed' in fromPage) {
349
+ if (!hydrating) {
350
+ try {
351
+ if (renderVerdict(fromPage.seed.payload, context).decision !== 'render')
352
+ return null;
353
+ }
354
+ catch {
355
+ return null;
356
+ }
357
+ }
358
+ return paintEnvelope(fromPage.seed.payload, fromPage.seed.renderDef, props, fromPage.raw);
359
+ }
360
+ if (fromPage) {
361
+ const html = fromPage.fallback.face === 'options' ? fallbackFace(props) : null;
362
+ return html === null ? (_jsx(NoFace, { record: fromPage.raw })) : (_jsx(OptionsFace, { block: props.block, html: html, record: fromPage.raw }));
363
+ }
364
+ if (hydratedMount)
365
+ return null;
366
+ if (!props.clientRead) {
367
+ const html = fallbackFace(props);
368
+ return html === null ? null : _jsx(OptionsFace, { block: props.block, html: html });
369
+ }
370
+ }
371
+ const { design } = props;
176
372
  const read = {
177
373
  baseUrl: props.baseUrl,
178
374
  platform: 'builder',
@@ -180,40 +376,27 @@ function EnvelopeCertReviewCard(props) {
180
376
  context,
181
377
  cache: rt.cache,
182
378
  design,
379
+ resolveKid: rt.resolveKid,
380
+ fetchImpl: rt.fetchImpl(),
381
+ timeoutMs: rt.timeoutMs,
183
382
  };
184
383
  const key = design
185
384
  ? `${props.baseUrl}|${props.externalId}|design=${design.version}|${design.brand ?? ''}`
186
385
  : `${props.baseUrl}|${props.externalId}`;
187
- const settled = peekVerifiedDelivery(read) ??
188
- suspendOn(key, () => getVerifiedDelivery({ ...read, resolveKid: rt.resolveKid, fetchImpl: rt.fetchImpl(), timeoutMs: rt.timeoutMs }));
189
- // Revoked, expired, unverifiable, for another entry, or unreachable: nothing at all.
386
+ const settled = readVerifiedDelivery(read) ?? suspendOn(key, () => getVerifiedDelivery(read));
190
387
  if (settled.verdict.decision !== 'render')
191
- return null;
192
- // A pinned read paints only the design it pinned: a reader def at exactly that version. A def the API served for
193
- // anything else (none, another face, another version) paints nothing, never the live design in its place.
194
- if (design && !(isReaderFaceDef(settled.renderDef) && settled.renderDef?.v === design.version))
195
- return null;
196
- // The reader face is opt-in by the def's own `face` and is chosen HERE and nowhere else on this path; every other
197
- // def (no face, an unknown face) falls through to the legacy lines below, untouched since 1.1.1.
198
- if (isReaderFaceDef(settled.renderDef)) {
199
- const reader = envelopeCardHtml(settled.verdict.payload.content, settled.renderDef, {
200
- mode: props.mode,
201
- part: props.part,
202
- certId: settled.verdict.payload.certId,
203
- });
204
- if (!reader)
205
- return null;
206
- return (_jsx(EnvelopeFace, { reader: true,
207
- // The stylesheet rides inside the face, once per card; it is the portal's reader CSS byte for byte.
208
- html: `<style data-certrev-reader-css>${READER_CSS}</style>${reader}`, defVersion: settled.renderDef ? settled.renderDef.v : undefined }));
209
- }
210
- const input = envelopeCardInput(settled.verdict.payload.content, settled.renderDef, {
211
- mode: props.mode,
212
- part: props.part,
388
+ return settleWithoutEnvelope(props, settled.unreachable === true);
389
+ // The face is painted from the seed's payload (what the def hides is already out of it), so the server's HTML and
390
+ // the browser's, which paints from the seed, are the same bytes and neither holds a hidden field.
391
+ const seed = seedFor({
392
+ baseUrl: props.baseUrl,
393
+ externalId: props.externalId,
394
+ design,
395
+ payload: settled.verdict.payload,
396
+ signature: settled.signature,
397
+ renderDef: settled.renderDef,
213
398
  });
214
- if (!input)
215
- return null;
216
- return _jsx(EnvelopeFace, { html: renderCertBlock(input), defVersion: settled.renderDef ? settled.renderDef.v : undefined });
399
+ return paintEnvelope(seed.payload, seed.renderDef, props, serializeSeed(seed));
217
400
  }
218
401
  export function CertReviewCard(props) {
219
402
  // 1.1.0: a block that carries the delivery marker paints from the signed envelope and the
@@ -221,6 +404,8 @@ export function CertReviewCard(props) {
221
404
  // takes the options path below, unchanged from 1.0.3.
222
405
  // 1.2.0-canary.5: a design pin (CertREV's canary replica only) fails closed. One that cannot be read renders
223
406
  // nothing, and so does one on a block without the delivery marker: the options face is never the pinned design.
407
+ // 1.2.0: where the envelope cannot be had (CertREV not reached, or no server render and no `clientRead`), a block
408
+ // with the marker paints this options face too, pinned or not: see `EnvelopeCertReviewCard`.
224
409
  const design = parseDesignPin(props.builderContext?.context?.certrevDesignPin);
225
410
  if (design === 'invalid')
226
411
  return null;
@@ -229,14 +414,25 @@ export function CertReviewCard(props) {
229
414
  const entryId = text(props.builderContext?.content?.id);
230
415
  if (!marker || !entryId)
231
416
  return null;
232
- return (_jsx(Suspense, { fallback: null, children: _jsx(EnvelopeCertReviewCard, { baseUrl: marker.baseUrl, externalId: entryId, mode: props.mode, part: props.part, design: design }) }));
417
+ return (_jsx(Suspense, { fallback: null, children: _jsx(EnvelopeCertReviewCard, { baseUrl: marker.baseUrl, externalId: entryId, mode: props.mode, part: props.part, design: design, block: props, clientRead: props.clientRead === true }) }));
233
418
  }
234
419
  if (design)
235
420
  return null;
421
+ const html = optionsFaceHtml(props, 'banner');
422
+ if (html === null)
423
+ return null; // no chrome pre-cert (or an unreadable delivery)
424
+ return _jsx(OptionsFace, { block: props, html: html });
425
+ }
426
+ /**
427
+ * The options face's HTML (1.0.3's, unchanged), or null when the block lacks a reviewer or a certificate link. `bridge`
428
+ * is the placement a block with no `mode` gets: `'banner'` for a block without the delivery marker (the bridge below);
429
+ * the def's layout for a marked block's fallback (`fallbackFace`).
430
+ */
431
+ function optionsFaceHtml(props, bridge) {
236
432
  const reviewerName = text(props.reviewerName);
237
433
  const verifyUrl = text(props.verifyUrl);
238
434
  if (!reviewerName || !verifyUrl)
239
- return null; // no chrome pre-cert (or an unreadable delivery)
435
+ return null;
240
436
  // Name-only face when the pair is unreadable, or when the brand set showCredentials:false.
241
437
  const showCred = props.display?.showCredentials !== false;
242
438
  const withCred = showCred ? fusedCredential(props.credentialVerification) : null;
@@ -252,7 +448,7 @@ export function CertReviewCard(props) {
252
448
  inkColor: optionalText(tokens.inkColor),
253
449
  }
254
450
  : undefined;
255
- const html = renderCertBlock({
451
+ return renderCertBlock({
256
452
  // COMPATIBILITY BRIDGE, NOT THE DESIGN. Delete this fallback once the exporter emits an
257
453
  // explicit `mode` and existing entries have been backfilled; until then it must stay.
258
454
  //
@@ -274,7 +470,7 @@ export function CertReviewCard(props) {
274
470
  // still fixed: the helper text and the wire type's doc comment no longer name a default,
275
471
  // and this line names one only for input the renderer can no longer distinguish from a
276
472
  // deliberate choice. The exporter writing `mode` is what retires it.
277
- mode: props.mode ?? 'banner',
473
+ mode: props.mode ?? bridge ?? 'banner',
278
474
  theme,
279
475
  // First-class banner memo split — renderCertBlock composes the requested
280
476
  // part directly; no string-splitting. Ignored outside banner mode, and an unrecognised
@@ -301,9 +497,6 @@ export function CertReviewCard(props) {
301
497
  compensationCue: props.compensationCue === null ? null : undefined,
302
498
  },
303
499
  });
304
- return (_jsx("div", { "data-certrev-cert-chrome": "", "data-certrev-strings-version": optionalText(props.stringsVersion), "data-certrev-def-version": typeof props.renderDef?.v === 'number' ? props.renderDef.v : undefined,
305
- // biome-ignore lint/security/noDangerouslySetInnerHtml: renderCertBlock is the escaping-safe SSR string renderer
306
- dangerouslySetInnerHTML: { __html: html } }));
307
500
  }
308
501
  /** Builder input TYPE per wire-type key — the exporter serializes these option values. */
309
502
  const WIRE_INPUT_TYPE = {
@@ -341,7 +534,7 @@ const WIRE_INPUT_TYPE = {
341
534
  const WIRE_INPUT_HELPER_TEXT = {
342
535
  compensationCue: 'System-populated by CertREV. Only its PRESENCE is read (absent = a pro-bono reviewer, so no cue renders); the cue itself is a locked constant, so editing this text changes nothing on the page, and clearing it does not remove the disclosure.',
343
536
  scopeLine: 'System-populated by CertREV. The FTC scope line renders byte-verbatim from a locked constant: editing this text changes nothing on the page.',
344
- delivery: 'System-populated by CertREV. When set, the card shows the certificate CertREV serves for this entry, verified, and ignores the other fields; if CertREV revokes it or it expires, the card shows nothing. Do not edit.',
537
+ delivery: 'System-populated by CertREV. When set, the card shows the certificate CertREV serves for this entry, verified, in place of the other fields; if CertREV revokes it or it expires, the card shows nothing. If CertREV cannot be reached, or the page was not rendered on the server, the card shows the other fields. Do not edit.',
345
538
  };
346
539
  /**
347
540
  * The wire-type inputs — DERIVED from `BUILDER_CERT_CHROME_KEYS`, so the 20-field
@@ -1 +1 @@
1
- {"version":3,"file":"cert-review-card.js","sourceRoot":"","sources":["../../src/builder/cert-review-card.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAA;AACxE,OAAO,EAAsB,eAAe,EAAE,MAAM,oCAAoC,CAAA;AACxF,OAAO,EAAE,oBAAoB,EAA2B,MAAM,6BAA6B,CAAA;AAC3F,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAA;AAC9D,OAAO,EAEN,mBAAmB,EACnB,cAAc,EACd,oBAAoB,GAEpB,MAAM,oCAAoC,CAAA;AAE3C,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAA;AAEzF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,cAAc,CAAA;AAoCjD;;;;;;;;;GASG;AACH,SAAS,IAAI,CAAC,KAAc;IAC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AK,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,EAAE;SACrC;KACD;CACD,CAAA;AAWD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAiC;IACjE,IAAI,EAAE,mBAAmB;IACzB,SAAS,EAAE,cAAc;IACzB,MAAM,EAAE,CAAC,GAAG,gBAAgB,EAAE,GAAG,WAAW,CAAC;IAC7C,yBAAyB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;CACnD,CAAA;AAqBD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAsC;IACtE,IAAI,EAAE,mBAAmB;IACzB,SAAS,EAAE,cAAc;IACzB,WAAW,EACV,4HAA4H;IAC7H,MAAM,EAAE,CAAC,GAAG,gBAAgB,EAAE,GAAG,WAAW,CAAC;IAC7C,yBAAyB,EAAE,EAAE,cAAc,EAAE,IAAI,EAAE;CACnD,CAAA"}
@@ -6,10 +6,21 @@
6
6
  * swap the trust root through the published API: the card verifies against the baked
7
7
  * `cert-issuer-1` key, the same key the storefront badge bundle ships. The package's own tests
8
8
  * reach the setter by relative import to run the real kernel against fixture-signed envelopes.
9
+ *
10
+ * 1.2.0: the card's server read waits up to `CARD_DELIVERY_TIMEOUT_MS` (8s, against the
11
+ * verifier's 3s default), and its cache serves a certificate up to `CARD_DELIVERY_STALE_MS` past
12
+ * its TTL while one background refresh runs, or while CertREV cannot be reached. A cold or slow
13
+ * read on a brand's server then misses at most once per placement, and a warm one never waits.
14
+ * A revocation still lands on the first render after its refresh does. The tests' runtime gets
15
+ * the same cache shape, so they exercise what production runs.
9
16
  */
10
17
  import type { ResolvePublicKeyByKid } from '../contract/kernel.js';
11
18
  import { TtlCache } from '../verify/cache.js';
12
19
  import type { CachedDelivery } from '../verify/get-verified-delivery.js';
20
+ /** The card's server read deadline. A brand's server waits this long once per cold placement. */
21
+ export declare const CARD_DELIVERY_TIMEOUT_MS = 8000;
22
+ /** How long past its 60s TTL a certificate may still paint while it is refreshed or CertREV is down. */
23
+ export declare const CARD_DELIVERY_STALE_MS = 300000;
13
24
  export interface CardDeliveryRuntime {
14
25
  readonly resolveKid: ResolvePublicKeyByKid;
15
26
  readonly fetchImpl: () => typeof fetch;
@@ -18,6 +29,9 @@ export interface CardDeliveryRuntime {
18
29
  readonly timeoutMs?: number;
19
30
  }
20
31
  export declare function cardDeliveryRuntime(): CardDeliveryRuntime;
21
- /** Test seam: replace parts of the runtime (a fresh cache unless one is given). Returns a restore. */
32
+ /**
33
+ * Test seam: replace parts of the runtime (a fresh cache unless one is given) and forget the page's envelope seeds
34
+ * (a fresh runtime is a fresh page). Returns a restore.
35
+ */
22
36
  export declare function setCardDeliveryRuntimeForTests(overrides: Partial<CardDeliveryRuntime>): () => void;
23
37
  //# sourceMappingURL=delivery-runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"delivery-runtime.d.ts","sourceRoot":"","sources":["../../src/builder/delivery-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAGxE,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAA;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,KAAK,CAAA;IACtC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAA;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC3B;AAgBD,wBAAgB,mBAAmB,IAAI,mBAAmB,CAEzD;AAED,sGAAsG;AACtG,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,MAAM,IAAI,CAWlG"}
1
+ {"version":3,"file":"delivery-runtime.d.ts","sourceRoot":"","sources":["../../src/builder/delivery-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAClE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAC7C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAIxE,iGAAiG;AACjG,eAAO,MAAM,wBAAwB,OAAQ,CAAA;AAC7C,wGAAwG;AACxG,eAAO,MAAM,sBAAsB,SAAU,CAAA;AAE7C,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAA;IAC1C,QAAQ,CAAC,SAAS,EAAE,MAAM,OAAO,KAAK,CAAA;IACtC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAA;IACxC,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAA;IAC1B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAC3B;AA6BD,wBAAgB,mBAAmB,IAAI,mBAAmB,CAEzD;AAED;;;GAGG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,MAAM,IAAI,CAYlG"}
@@ -6,29 +6,57 @@
6
6
  * swap the trust root through the published API: the card verifies against the baked
7
7
  * `cert-issuer-1` key, the same key the storefront badge bundle ships. The package's own tests
8
8
  * reach the setter by relative import to run the real kernel against fixture-signed envelopes.
9
+ *
10
+ * 1.2.0: the card's server read waits up to `CARD_DELIVERY_TIMEOUT_MS` (8s, against the
11
+ * verifier's 3s default), and its cache serves a certificate up to `CARD_DELIVERY_STALE_MS` past
12
+ * its TTL while one background refresh runs, or while CertREV cannot be reached. A cold or slow
13
+ * read on a brand's server then misses at most once per placement, and a warm one never waits.
14
+ * A revocation still lands on the first render after its refresh does. The tests' runtime gets
15
+ * the same cache shape, so they exercise what production runs.
9
16
  */
10
17
  import { TtlCache } from '../verify/cache.js';
11
18
  import { CERT_ISSUER_KID, CERT_ISSUER_PUBLIC_KEY_PEM } from './issuer-key.js';
19
+ import { forgetPageSeedsForTests } from './ssr-seed.js';
20
+ /** The card's server read deadline. A brand's server waits this long once per cold placement. */
21
+ export const CARD_DELIVERY_TIMEOUT_MS = 8_000;
22
+ /** How long past its 60s TTL a certificate may still paint while it is refreshed or CertREV is down. */
23
+ export const CARD_DELIVERY_STALE_MS = 300_000;
12
24
  const bakedResolveKid = (kid) => kid === CERT_ISSUER_KID ? { format: 'pem', pem: CERT_ISSUER_PUBLIC_KEY_PEM } : null;
25
+ function newCardCache(now) {
26
+ return new TtlCache({
27
+ ttlMs: 60_000,
28
+ negativeTtlMs: 5_000,
29
+ staleMs: CARD_DELIVERY_STALE_MS,
30
+ // A refresh the host runtime abandoned (workerd cancels a finished request's I/O) never
31
+ // settles; after the deadline plus a margin, the next render starts a new one.
32
+ inflightMaxMs: CARD_DELIVERY_TIMEOUT_MS + 2_000,
33
+ ...(now ? { now } : {}),
34
+ });
35
+ }
13
36
  function defaultRuntime() {
14
37
  return {
15
38
  resolveKid: bakedResolveKid,
16
39
  fetchImpl: () => globalThis.fetch,
17
- cache: new TtlCache({ ttlMs: 60_000, negativeTtlMs: 5_000 }),
40
+ cache: newCardCache(),
18
41
  now: Date.now,
42
+ timeoutMs: CARD_DELIVERY_TIMEOUT_MS,
19
43
  };
20
44
  }
21
45
  let runtime = defaultRuntime();
22
46
  export function cardDeliveryRuntime() {
23
47
  return runtime;
24
48
  }
25
- /** Test seam: replace parts of the runtime (a fresh cache unless one is given). Returns a restore. */
49
+ /**
50
+ * Test seam: replace parts of the runtime (a fresh cache unless one is given) and forget the page's envelope seeds
51
+ * (a fresh runtime is a fresh page). Returns a restore.
52
+ */
26
53
  export function setCardDeliveryRuntimeForTests(overrides) {
54
+ forgetPageSeedsForTests();
27
55
  const previous = runtime;
28
56
  const now = overrides.now ?? previous.now;
29
57
  runtime = {
30
58
  ...previous,
31
- cache: new TtlCache({ ttlMs: 60_000, negativeTtlMs: 5_000, now }),
59
+ cache: newCardCache(now),
32
60
  ...overrides,
33
61
  };
34
62
  return () => {
@@ -1 +1 @@
1
- {"version":3,"file":"delivery-runtime.js","sourceRoot":"","sources":["../../src/builder/delivery-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C,OAAO,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAA;AAU7E,MAAM,eAAe,GAA0B,CAAC,GAAG,EAAE,EAAE,CACtD,GAAG,KAAK,eAAe,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,0BAA0B,EAAE,CAAC,CAAC,CAAC,IAAI,CAAA;AAEpF,SAAS,cAAc;IACtB,OAAO;QACN,UAAU,EAAE,eAAe;QAC3B,SAAS,EAAE,GAAG,EAAE,CAAC,UAAU,CAAC,KAAK;QACjC,KAAK,EAAE,IAAI,QAAQ,CAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC;QAC5E,GAAG,EAAE,IAAI,CAAC,GAAG;KACb,CAAA;AACF,CAAC;AAED,IAAI,OAAO,GAAwB,cAAc,EAAE,CAAA;AAEnD,MAAM,UAAU,mBAAmB;IAClC,OAAO,OAAO,CAAA;AACf,CAAC;AAED,sGAAsG;AACtG,MAAM,UAAU,8BAA8B,CAAC,SAAuC;IACrF,MAAM,QAAQ,GAAG,OAAO,CAAA;IACxB,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,IAAI,QAAQ,CAAC,GAAG,CAAA;IACzC,OAAO,GAAG;QACT,GAAG,QAAQ;QACX,KAAK,EAAE,IAAI,QAAQ,CAAiB,EAAE,KAAK,EAAE,MAAM,EAAE,aAAa,EAAE,KAAK,EAAE,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