@certrev/cert-block 1.3.0 → 2.0.1
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.
- package/CHANGELOG.md +235 -0
- package/README.md +162 -9
- package/dist/builder/card-beacon.d.ts +73 -0
- package/dist/builder/card-beacon.d.ts.map +1 -0
- package/dist/builder/card-beacon.js +178 -0
- package/dist/builder/card-beacon.js.map +1 -0
- package/dist/builder/card-contract.d.ts +151 -0
- package/dist/builder/card-contract.d.ts.map +1 -0
- package/dist/builder/card-contract.js +286 -0
- package/dist/builder/card-contract.js.map +1 -0
- package/dist/builder/card-placement.d.ts +45 -0
- package/dist/builder/card-placement.d.ts.map +1 -0
- package/dist/builder/card-placement.js +193 -0
- package/dist/builder/card-placement.js.map +1 -0
- package/dist/builder/card-report.d.ts +49 -0
- package/dist/builder/card-report.d.ts.map +1 -0
- package/dist/builder/card-report.js +97 -0
- package/dist/builder/card-report.js.map +1 -0
- package/dist/builder/cert-review-card.d.ts +7 -5
- package/dist/builder/cert-review-card.d.ts.map +1 -1
- package/dist/builder/cert-review-card.js +202 -170
- package/dist/builder/cert-review-card.js.map +1 -1
- package/dist/builder/contract-card.d.ts +70 -0
- package/dist/builder/contract-card.d.ts.map +1 -0
- package/dist/builder/contract-card.js +191 -0
- package/dist/builder/contract-card.js.map +1 -0
- package/dist/builder/delivered-face.d.ts +9 -0
- package/dist/builder/delivered-face.d.ts.map +1 -1
- package/dist/builder/delivered-face.js +18 -5
- package/dist/builder/delivered-face.js.map +1 -1
- package/dist/builder/delivery-runtime.d.ts +27 -3
- package/dist/builder/delivery-runtime.d.ts.map +1 -1
- package/dist/builder/delivery-runtime.js +40 -4
- package/dist/builder/delivery-runtime.js.map +1 -1
- package/dist/builder/index.d.ts +7 -4
- package/dist/builder/index.d.ts.map +1 -1
- package/dist/builder/index.js +8 -4
- package/dist/builder/index.js.map +1 -1
- package/dist/builder/ssr-seed.d.ts +23 -4
- package/dist/builder/ssr-seed.d.ts.map +1 -1
- package/dist/builder/ssr-seed.js +29 -6
- package/dist/builder/ssr-seed.js.map +1 -1
- package/dist/builder/version.d.ts +3 -0
- package/dist/builder/version.d.ts.map +1 -0
- package/dist/builder/version.js +3 -0
- package/dist/builder/version.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/reader/reader-css.generated.d.ts +1 -1
- package/dist/reader/reader-css.generated.d.ts.map +1 -1
- package/dist/reader/reader-css.generated.js +1 -1
- package/dist/reader/reader-css.generated.js.map +1 -1
- package/dist/reader/render.d.ts.map +1 -1
- package/dist/reader/render.js +71 -34
- package/dist/reader/render.js.map +1 -1
- package/dist/reader/tokens.d.ts +2 -0
- package/dist/reader/tokens.d.ts.map +1 -1
- package/dist/reader/tokens.js +28 -6
- package/dist/reader/tokens.js.map +1 -1
- package/dist/verify/get-verified-delivery.d.ts +32 -0
- package/dist/verify/get-verified-delivery.d.ts.map +1 -1
- package/dist/verify/get-verified-delivery.js +30 -5
- package/dist/verify/get-verified-delivery.js.map +1 -1
- package/dist/verify/key-set.d.ts +67 -0
- package/dist/verify/key-set.d.ts.map +1 -0
- package/dist/verify/key-set.js +190 -0
- package/dist/verify/key-set.js.map +1 -0
- package/package.json +115 -112
- package/src/builder/card-beacon.ts +201 -0
- package/src/builder/card-contract.ts +336 -0
- package/src/builder/card-placement.ts +208 -0
- package/src/builder/card-report.ts +126 -0
- package/src/builder/cert-review-card.tsx +285 -201
- package/src/builder/contract-card.tsx +216 -0
- package/src/builder/delivered-face.ts +18 -4
- package/src/builder/delivery-runtime.ts +46 -4
- package/src/builder/index.tsx +16 -4
- package/src/builder/ssr-seed.ts +37 -7
- package/src/builder/version.ts +2 -0
- package/src/index.ts +9 -0
- package/src/reader/reader-css.generated.ts +1 -1
- package/src/reader/reader.css +297 -2
- package/src/reader/render.ts +87 -38
- package/src/reader/tokens.ts +29 -6
- package/src/verify/get-verified-delivery.ts +54 -5
- package/src/verify/key-set.ts +225 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contract-1 card face (2.0.0): one Builder block printing CertREV's server-rendered card verbatim.
|
|
3
|
+
*
|
|
4
|
+
* The block's wrapper holds, as its `dangerouslySetInnerHTML`, exactly `cardHtml(card, names)`: the block's part hosts
|
|
5
|
+
* in page order and, in the block holding the document's first part, the head fragment, both CertREV dialog hosts and
|
|
6
|
+
* the runtime's tag (`card-contract.ts`).
|
|
7
|
+
* Each host is a `<certrev-card>` with a declarative shadow root (`<template shadowrootmode="open">`), which the
|
|
8
|
+
* browser's HTML parser attaches as it reads the server's page: the card is complete with JavaScript off, and no page
|
|
9
|
+
* rule reaches inside it. React never reconciles the hosts (they are not React children), so the hosted runtime may
|
|
10
|
+
* remove a revoked placement's hosts without React noticing.
|
|
11
|
+
*
|
|
12
|
+
* What the parser does not do, the card does once it has mounted (`useCardRoots`):
|
|
13
|
+
* - ATTACH ROOTS the parser never saw. A card React inserts (an in-app navigation, Builder's editor, React's own
|
|
14
|
+
* re-render after a hydration error) gets its HTML through `innerHTML`, which leaves a declarative template inert.
|
|
15
|
+
* The wrapper is re-parsed with `setHTMLUnsafe`, which attaches declarative roots; a browser without it (or without
|
|
16
|
+
* declarative shadow DOM at all) gets each root attached from its template (`attachShadow` with the template's mode
|
|
17
|
+
* and options, then the template's content). A host that already has its root is left alone, so a hydrated card,
|
|
18
|
+
* whose roots the parser attached, is not touched.
|
|
19
|
+
* - LOAD THE RUNTIME a React-inserted `<script>` never runs: once per page, into `document.head`, with its SRI
|
|
20
|
+
* integrity and `crossorigin="anonymous"`, unless the runtime is already running (its global guard) or already
|
|
21
|
+
* injected. Only the block that prints the runtime's tag loads it (`cardCarriesAssets`). The server's HTML carries
|
|
22
|
+
* the same tag in that block's wrapper, which the parser runs; the runtime's init is idempotent, so it starts once.
|
|
23
|
+
* Both run in a layout effect, before the browser paints the inserted card, so a client-mounted card never shows an
|
|
24
|
+
* empty frame; the roots are checked after every commit of the block, whatever React wrote. React writes the card only
|
|
25
|
+
* when its HTML changes: the `dangerouslySetInnerHTML` object is kept per string, since React 19 rewrites `innerHTML`
|
|
26
|
+
* for every new object (2.0.0 on React 19 rebuilt the card on each re-render, and the hosted runtime re-attached it).
|
|
27
|
+
*
|
|
28
|
+
* NO CONSOLE NOISE (2.0.1). In a browser that parses declarative roots, the HTML React itself writes names each
|
|
29
|
+
* template's mode `data-certrev-shadowrootmode` instead of `shadowrootmode` (`clientCardHtml`): Chrome warns ("Found
|
|
30
|
+
* declarative shadowrootmode attribute on a template, but declarative Shadow DOM is not being parsed") for every such
|
|
31
|
+
* template `innerHTML` meets, and the layout effect re-parses the card's exact bytes anyway. The wrapper carries
|
|
32
|
+
* `suppressHydrationWarning` (React never prints it): the server's wrapper holds attached roots where React expects
|
|
33
|
+
* templates, which React's development build reported as a hydration mismatch on every page. React does not patch a
|
|
34
|
+
* hydrated element's HTML, so the server's card stays as the parser built it. A server, and a DOM without declarative
|
|
35
|
+
* roots (jsdom, an old browser), print the card's bytes unchanged.
|
|
36
|
+
*
|
|
37
|
+
* ONE BUILDER RULE, for the sidebar card only. The card's rail is a right float that the article's copy flows around
|
|
38
|
+
* (the Appearance preview's layout, and every other CMS's). On a Builder page the block sits in Builder's own wrapper,
|
|
39
|
+
* a flex item of the flex column that holds the entry's blocks, and a flex item contains its floats: the block spans
|
|
40
|
+
* the column at the rail's height and no copy sits beside it. `BUILDER_CARD_FLOW_CSS` lets the float out of Builder's
|
|
41
|
+
* wrappers, as 1.2.0-canary.6 did for the reader face: in a column that holds a printed rail, above the card's own
|
|
42
|
+
* 820px breakpoint (below it the rail stacks as a block), the column lays its blocks out as blocks and still contains
|
|
43
|
+
* the float, and the rail's block and the card wrapper become plain blocks. It reaches nothing inside the card (the
|
|
44
|
+
* shadow root is out of its reach) and nothing on a page without a rail, or in a browser without `:has()`.
|
|
45
|
+
*/
|
|
46
|
+
import * as React from 'react';
|
|
47
|
+
import { type CardDocumentV1, type CardPartName } from './card-contract.js';
|
|
48
|
+
/** What a client render prints in place of a template's `shadowrootmode` (the header comment). */
|
|
49
|
+
export declare const INERT_MODE_ATTRIBUTE = "data-certrev-shadowrootmode";
|
|
50
|
+
/** The card's HTML as React writes it in such a browser: each template's mode under `INERT_MODE_ATTRIBUTE`. */
|
|
51
|
+
export declare function clientCardHtml(html: string): string;
|
|
52
|
+
/**
|
|
53
|
+
* Give every host in `wrapper` its declarative root: a no-op where the parser attached them all; else the wrapper is
|
|
54
|
+
* re-parsed from `html` with `setHTMLUnsafe` where the browser has it, or each pending root is attached from its
|
|
55
|
+
* template. Returns how many hosts were pending (for tests and the replica's evidence).
|
|
56
|
+
*/
|
|
57
|
+
export declare function attachCardRoots(wrapper: Element, html: string): number;
|
|
58
|
+
/** Load the document's runtime once per page: unless it already runs, or this package already injected it. */
|
|
59
|
+
export declare function injectCardRuntime(card: CardDocumentV1): void;
|
|
60
|
+
/** Builder's wrappers around a printed rail let its float out (the header comment). */
|
|
61
|
+
export declare const BUILDER_CARD_FLOW_CSS: string;
|
|
62
|
+
export declare function ContractCardFace(props: {
|
|
63
|
+
readonly card: CardDocumentV1;
|
|
64
|
+
readonly names: readonly CardPartName[];
|
|
65
|
+
/** The record that names this card (`ssr-seed.ts`): the browser repaints it from here with no read. */
|
|
66
|
+
readonly seed: string;
|
|
67
|
+
/** 2.0.1: the delivery origin the block read, where its sampled health beacon goes (`card-beacon.ts`). */
|
|
68
|
+
readonly origin?: string;
|
|
69
|
+
}): React.JSX.Element;
|
|
70
|
+
//# sourceMappingURL=contract-card.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-card.d.ts","sourceRoot":"","sources":["../../src/builder/contract-card.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,EAAE,KAAK,cAAc,EAAE,KAAK,YAAY,EAA+B,MAAM,oBAAoB,CAAA;AAYxG,kGAAkG;AAClG,eAAO,MAAM,oBAAoB,gCAAgC,CAAA;AAOjE,+GAA+G;AAC/G,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnD;AA8BD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAkBtE;AAED,8GAA8G;AAC9G,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI,CAe5D;AAED,uFAAuF;AACvF,eAAO,MAAM,qBAAqB,QAK9B,CAAA;AAKJ,wBAAgB,gBAAgB,CAAC,KAAK,EAAE;IACvC,QAAQ,CAAC,IAAI,EAAE,cAAc,CAAA;IAC7B,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAA;IACvC,uGAAuG;IACvG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,0GAA0G;IAC1G,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CACxB,qBAqDA"}
|
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* The contract-1 card face (2.0.0): one Builder block printing CertREV's server-rendered card verbatim.
|
|
4
|
+
*
|
|
5
|
+
* The block's wrapper holds, as its `dangerouslySetInnerHTML`, exactly `cardHtml(card, names)`: the block's part hosts
|
|
6
|
+
* in page order and, in the block holding the document's first part, the head fragment, both CertREV dialog hosts and
|
|
7
|
+
* the runtime's tag (`card-contract.ts`).
|
|
8
|
+
* Each host is a `<certrev-card>` with a declarative shadow root (`<template shadowrootmode="open">`), which the
|
|
9
|
+
* browser's HTML parser attaches as it reads the server's page: the card is complete with JavaScript off, and no page
|
|
10
|
+
* rule reaches inside it. React never reconciles the hosts (they are not React children), so the hosted runtime may
|
|
11
|
+
* remove a revoked placement's hosts without React noticing.
|
|
12
|
+
*
|
|
13
|
+
* What the parser does not do, the card does once it has mounted (`useCardRoots`):
|
|
14
|
+
* - ATTACH ROOTS the parser never saw. A card React inserts (an in-app navigation, Builder's editor, React's own
|
|
15
|
+
* re-render after a hydration error) gets its HTML through `innerHTML`, which leaves a declarative template inert.
|
|
16
|
+
* The wrapper is re-parsed with `setHTMLUnsafe`, which attaches declarative roots; a browser without it (or without
|
|
17
|
+
* declarative shadow DOM at all) gets each root attached from its template (`attachShadow` with the template's mode
|
|
18
|
+
* and options, then the template's content). A host that already has its root is left alone, so a hydrated card,
|
|
19
|
+
* whose roots the parser attached, is not touched.
|
|
20
|
+
* - LOAD THE RUNTIME a React-inserted `<script>` never runs: once per page, into `document.head`, with its SRI
|
|
21
|
+
* integrity and `crossorigin="anonymous"`, unless the runtime is already running (its global guard) or already
|
|
22
|
+
* injected. Only the block that prints the runtime's tag loads it (`cardCarriesAssets`). The server's HTML carries
|
|
23
|
+
* the same tag in that block's wrapper, which the parser runs; the runtime's init is idempotent, so it starts once.
|
|
24
|
+
* Both run in a layout effect, before the browser paints the inserted card, so a client-mounted card never shows an
|
|
25
|
+
* empty frame; the roots are checked after every commit of the block, whatever React wrote. React writes the card only
|
|
26
|
+
* when its HTML changes: the `dangerouslySetInnerHTML` object is kept per string, since React 19 rewrites `innerHTML`
|
|
27
|
+
* for every new object (2.0.0 on React 19 rebuilt the card on each re-render, and the hosted runtime re-attached it).
|
|
28
|
+
*
|
|
29
|
+
* NO CONSOLE NOISE (2.0.1). In a browser that parses declarative roots, the HTML React itself writes names each
|
|
30
|
+
* template's mode `data-certrev-shadowrootmode` instead of `shadowrootmode` (`clientCardHtml`): Chrome warns ("Found
|
|
31
|
+
* declarative shadowrootmode attribute on a template, but declarative Shadow DOM is not being parsed") for every such
|
|
32
|
+
* template `innerHTML` meets, and the layout effect re-parses the card's exact bytes anyway. The wrapper carries
|
|
33
|
+
* `suppressHydrationWarning` (React never prints it): the server's wrapper holds attached roots where React expects
|
|
34
|
+
* templates, which React's development build reported as a hydration mismatch on every page. React does not patch a
|
|
35
|
+
* hydrated element's HTML, so the server's card stays as the parser built it. A server, and a DOM without declarative
|
|
36
|
+
* roots (jsdom, an old browser), print the card's bytes unchanged.
|
|
37
|
+
*
|
|
38
|
+
* ONE BUILDER RULE, for the sidebar card only. The card's rail is a right float that the article's copy flows around
|
|
39
|
+
* (the Appearance preview's layout, and every other CMS's). On a Builder page the block sits in Builder's own wrapper,
|
|
40
|
+
* a flex item of the flex column that holds the entry's blocks, and a flex item contains its floats: the block spans
|
|
41
|
+
* the column at the rail's height and no copy sits beside it. `BUILDER_CARD_FLOW_CSS` lets the float out of Builder's
|
|
42
|
+
* wrappers, as 1.2.0-canary.6 did for the reader face: in a column that holds a printed rail, above the card's own
|
|
43
|
+
* 820px breakpoint (below it the rail stacks as a block), the column lays its blocks out as blocks and still contains
|
|
44
|
+
* the float, and the rail's block and the card wrapper become plain blocks. It reaches nothing inside the card (the
|
|
45
|
+
* shadow root is out of its reach) and nothing on a page without a rail, or in a browser without `:has()`.
|
|
46
|
+
*/
|
|
47
|
+
import * as React from 'react';
|
|
48
|
+
import { maybeSendBrowserHealth } from './card-beacon.js';
|
|
49
|
+
import { cardCarriesAssets, cardHtml } from './card-contract.js';
|
|
50
|
+
import { afterPageSettles, applyCardPlacement } from './card-placement.js';
|
|
51
|
+
import { SEED_ATTRIBUTE } from './ssr-seed.js';
|
|
52
|
+
/** The global the hosted runtime sets once it has started (`Symbol.for('certrev.card-runtime')` on `document`). */
|
|
53
|
+
const RUNTIME_GUARD = Symbol.for('certrev.card-runtime');
|
|
54
|
+
/** Marks the runtime tag this package injected into `document.head`. */
|
|
55
|
+
const INJECTED_RUNTIME_ATTRIBUTE = 'data-certrev-card-runtime';
|
|
56
|
+
/** A layout effect in a browser; nothing on a server (where React would only warn about it). */
|
|
57
|
+
const useBrowserLayoutEffect = typeof document === 'undefined' ? () => { } : React.useLayoutEffect;
|
|
58
|
+
/** What a client render prints in place of a template's `shadowrootmode` (the header comment). */
|
|
59
|
+
export const INERT_MODE_ATTRIBUTE = 'data-certrev-shadowrootmode';
|
|
60
|
+
/** Whether this DOM parses declarative shadow roots (a browser does; a server and jsdom do not). */
|
|
61
|
+
function parsesDeclarativeRoots() {
|
|
62
|
+
return typeof HTMLTemplateElement === 'function' && 'shadowRootMode' in HTMLTemplateElement.prototype;
|
|
63
|
+
}
|
|
64
|
+
/** The card's HTML as React writes it in such a browser: each template's mode under `INERT_MODE_ATTRIBUTE`. */
|
|
65
|
+
export function clientCardHtml(html) {
|
|
66
|
+
return html.replace(/<template\b([^>]*?)\sshadowrootmode=/gi, `<template$1 ${INERT_MODE_ATTRIBUTE}=`);
|
|
67
|
+
}
|
|
68
|
+
/** The template's declared mode, under either name. */
|
|
69
|
+
function declaredMode(template) {
|
|
70
|
+
return template.getAttribute('shadowrootmode') ?? template.getAttribute(INERT_MODE_ATTRIBUTE);
|
|
71
|
+
}
|
|
72
|
+
/** Whether this host still holds an unattached declarative root. */
|
|
73
|
+
function pendingTemplate(host) {
|
|
74
|
+
if (host.shadowRoot)
|
|
75
|
+
return null;
|
|
76
|
+
for (const child of Array.from(host.children)) {
|
|
77
|
+
if (child instanceof HTMLTemplateElement && declaredMode(child) !== null)
|
|
78
|
+
return child;
|
|
79
|
+
}
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
/** Attach one host's root from its template, as the parser would have: its mode, its options, its content. */
|
|
83
|
+
function attachFromTemplate(host, template) {
|
|
84
|
+
const mode = declaredMode(template) === 'closed' ? 'closed' : 'open';
|
|
85
|
+
const init = {
|
|
86
|
+
mode,
|
|
87
|
+
delegatesFocus: template.hasAttribute('shadowrootdelegatesfocus'),
|
|
88
|
+
...(template.hasAttribute('shadowrootclonable') ? { clonable: true } : {}),
|
|
89
|
+
...(template.hasAttribute('shadowrootserializable') ? { serializable: true } : {}),
|
|
90
|
+
};
|
|
91
|
+
const root = host.attachShadow(init);
|
|
92
|
+
root.appendChild(template.content);
|
|
93
|
+
template.remove();
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Give every host in `wrapper` its declarative root: a no-op where the parser attached them all; else the wrapper is
|
|
97
|
+
* re-parsed from `html` with `setHTMLUnsafe` where the browser has it, or each pending root is attached from its
|
|
98
|
+
* template. Returns how many hosts were pending (for tests and the replica's evidence).
|
|
99
|
+
*/
|
|
100
|
+
export function attachCardRoots(wrapper, html) {
|
|
101
|
+
const pending = Array.from(wrapper.querySelectorAll('certrev-card')).filter((host) => pendingTemplate(host) !== null);
|
|
102
|
+
if (pending.length === 0)
|
|
103
|
+
return 0;
|
|
104
|
+
const parse = wrapper.setHTMLUnsafe;
|
|
105
|
+
if (typeof parse === 'function') {
|
|
106
|
+
parse.call(wrapper, html);
|
|
107
|
+
// A browser whose setHTMLUnsafe predates declarative roots leaves templates behind: attach those by hand.
|
|
108
|
+
for (const host of Array.from(wrapper.querySelectorAll('certrev-card'))) {
|
|
109
|
+
const template = pendingTemplate(host);
|
|
110
|
+
if (template)
|
|
111
|
+
attachFromTemplate(host, template);
|
|
112
|
+
}
|
|
113
|
+
return pending.length;
|
|
114
|
+
}
|
|
115
|
+
for (const host of pending) {
|
|
116
|
+
const template = pendingTemplate(host);
|
|
117
|
+
if (template)
|
|
118
|
+
attachFromTemplate(host, template);
|
|
119
|
+
}
|
|
120
|
+
return pending.length;
|
|
121
|
+
}
|
|
122
|
+
/** Load the document's runtime once per page: unless it already runs, or this package already injected it. */
|
|
123
|
+
export function injectCardRuntime(card) {
|
|
124
|
+
const runtime = card.assets.runtime;
|
|
125
|
+
if (!runtime || typeof document === 'undefined' || !document.head)
|
|
126
|
+
return;
|
|
127
|
+
if (document[RUNTIME_GUARD])
|
|
128
|
+
return;
|
|
129
|
+
for (const script of Array.from(document.head.querySelectorAll(`script[${INJECTED_RUNTIME_ATTRIBUTE}]`))) {
|
|
130
|
+
if (script.getAttribute('src') === runtime.src)
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
const script = document.createElement('script');
|
|
134
|
+
// Attributes, not IDL properties: the markup is then exactly the server's tag, wherever a property is not reflected.
|
|
135
|
+
script.setAttribute('src', runtime.src);
|
|
136
|
+
script.setAttribute('integrity', runtime.integrity);
|
|
137
|
+
script.setAttribute('crossorigin', 'anonymous');
|
|
138
|
+
script.defer = true;
|
|
139
|
+
script.setAttribute(INJECTED_RUNTIME_ATTRIBUTE, '');
|
|
140
|
+
document.head.appendChild(script);
|
|
141
|
+
}
|
|
142
|
+
/** Builder's wrappers around a printed rail let its float out (the header comment). */
|
|
143
|
+
export const BUILDER_CARD_FLOW_CSS = '@media not all and (max-width: 820px){' +
|
|
144
|
+
'.builder-blocks:has(> .builder-block > [data-certrev-face="card"] > certrev-card[data-certrev-part="rail"]){display:flow-root !important}' +
|
|
145
|
+
'.builder-blocks > .builder-block:has(> [data-certrev-face="card"] > certrev-card[data-certrev-part="rail"]){display:block !important}' +
|
|
146
|
+
'.builder-blocks > .builder-block > [data-certrev-face="card"]:has(> certrev-card[data-certrev-part="rail"]){display:block !important}' +
|
|
147
|
+
'}';
|
|
148
|
+
/** One object for the flow rule's element, so React 19 never rewrites it on a re-render. */
|
|
149
|
+
const BUILDER_CARD_FLOW_HTML = { __html: BUILDER_CARD_FLOW_CSS };
|
|
150
|
+
export function ContractCardFace(props) {
|
|
151
|
+
const ref = React.useRef(null);
|
|
152
|
+
const html = cardHtml(props.card, props.names);
|
|
153
|
+
const printed = typeof document !== 'undefined' && parsesDeclarativeRoots() ? clientCardHtml(html) : html;
|
|
154
|
+
// One object per printed string: React 19 rewrites `innerHTML` whenever this prop is a new object (React 18 compared
|
|
155
|
+
// the strings), which would replace the attached card on every re-render.
|
|
156
|
+
const inner = React.useMemo(() => ({ __html: printed }), [printed]);
|
|
157
|
+
const { card } = props;
|
|
158
|
+
const carriesAssets = cardCarriesAssets(card, props.names);
|
|
159
|
+
// After every commit of this block (a no-op while every root is attached): whatever React wrote, the card has its roots
|
|
160
|
+
// before the browser paints.
|
|
161
|
+
useBrowserLayoutEffect(() => {
|
|
162
|
+
if (ref.current)
|
|
163
|
+
attachCardRoots(ref.current, html);
|
|
164
|
+
});
|
|
165
|
+
useBrowserLayoutEffect(() => {
|
|
166
|
+
if (ref.current && carriesAssets)
|
|
167
|
+
injectCardRuntime(card);
|
|
168
|
+
}, [card, carriesAssets]);
|
|
169
|
+
const { origin } = props;
|
|
170
|
+
React.useEffect(() => {
|
|
171
|
+
maybeSendBrowserHealth(origin, card.subject.externalId);
|
|
172
|
+
}, [origin, card]);
|
|
173
|
+
// 2.0.1: the document's placement hints, once the page has settled (`card-placement.ts`). Keyed on the printed HTML,
|
|
174
|
+
// which the document and the parts decide, so a re-render that prints the same card moves nothing again.
|
|
175
|
+
const placing = React.useRef({ card, names: props.names });
|
|
176
|
+
placing.current = { card, names: props.names };
|
|
177
|
+
// biome-ignore lint/correctness/useExhaustiveDependencies: `html` is the trigger on purpose; the document and parts are read from the ref
|
|
178
|
+
React.useEffect(() => {
|
|
179
|
+
const wrapper = ref.current;
|
|
180
|
+
if (!wrapper)
|
|
181
|
+
return;
|
|
182
|
+
return afterPageSettles(() => applyCardPlacement(wrapper, placing.current.card, placing.current.names));
|
|
183
|
+
}, [html]);
|
|
184
|
+
const wrapper = (_jsx("div", { ref: ref, "data-certrev-cert-chrome": "", "data-certrev-delivery": "", "data-certrev-face": "card", "data-certrev-contract": String(props.card.contract), "data-certrev-def-version": props.card.defVersion, [SEED_ATTRIBUTE]: props.seed, suppressHydrationWarning: true,
|
|
185
|
+
// biome-ignore lint/security/noDangerouslySetInnerHtml: CertREV's card document, printed only after it hashes to the digest the verified envelope signs
|
|
186
|
+
dangerouslySetInnerHTML: inner }));
|
|
187
|
+
if (!props.names.includes('rail'))
|
|
188
|
+
return wrapper;
|
|
189
|
+
return (_jsxs(_Fragment, { children: [wrapper, _jsx("style", { "data-certrev-builder-flow": "", dangerouslySetInnerHTML: BUILDER_CARD_FLOW_HTML })] }));
|
|
190
|
+
}
|
|
191
|
+
//# sourceMappingURL=contract-card.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"contract-card.js","sourceRoot":"","sources":["../../src/builder/contract-card.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AACzD,OAAO,EAA0C,iBAAiB,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AACxG,OAAO,EAAE,gBAAgB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC1E,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE9C,mHAAmH;AACnH,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;AACxD,wEAAwE;AACxE,MAAM,0BAA0B,GAAG,2BAA2B,CAAA;AAE9D,gGAAgG;AAChG,MAAM,sBAAsB,GAAG,OAAO,QAAQ,KAAK,WAAW,CAAC,CAAC,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,eAAe,CAAA;AAEjG,kGAAkG;AAClG,MAAM,CAAC,MAAM,oBAAoB,GAAG,6BAA6B,CAAA;AAEjE,oGAAoG;AACpG,SAAS,sBAAsB;IAC9B,OAAO,OAAO,mBAAmB,KAAK,UAAU,IAAI,gBAAgB,IAAI,mBAAmB,CAAC,SAAS,CAAA;AACtG,CAAC;AAED,+GAA+G;AAC/G,MAAM,UAAU,cAAc,CAAC,IAAY;IAC1C,OAAO,IAAI,CAAC,OAAO,CAAC,wCAAwC,EAAE,eAAe,oBAAoB,GAAG,CAAC,CAAA;AACtG,CAAC;AAED,uDAAuD;AACvD,SAAS,YAAY,CAAC,QAAiB;IACtC,OAAO,QAAQ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AO,CAAA;QAC3B,IAAI,CAAC,OAAO;YAAE,OAAM;QACpB,OAAO,gBAAgB,CAAC,GAAG,EAAE,CAAC,kBAAkB,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;IACxG,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;IACV,MAAM,OAAO,GAAG,CACf,cACC,GAAG,EAAE,GAAG,8BACiB,EAAE,2BACL,EAAE,uBACN,MAAM,2BACD,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,QAAQ,CAAC,8BACxB,KAAK,CAAC,IAAI,CAAC,UAAU,EACzC,CAAC,cAAc,CAAC,EAAE,KAAK,CAAC,IAAI,EAClC,wBAAwB;QACxB,wJAAwJ;QACxJ,uBAAuB,EAAE,KAAK,GAC7B,CACF,CAAA;IACD,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;QAAE,OAAO,OAAO,CAAA;IACjD,OAAO,CACN,8BACE,OAAO,EAER,6CAAiC,EAAE,EAAC,uBAAuB,EAAE,sBAAsB,GAAI,IACrF,CACH,CAAA;AACF,CAAC"}
|
|
@@ -56,6 +56,15 @@ export declare function hashDeliveredFace(face: DeliveredFace): Promise<Delivere
|
|
|
56
56
|
export declare function deliveredFaceMatches(hashes: DeliveredFaceHashes | null, digest: CertFaceDigest): boolean;
|
|
57
57
|
/** The markup the card paints for a matching face: the stylesheet first, then the face. */
|
|
58
58
|
export declare function deliveredFaceHtml(face: DeliveredFace): string;
|
|
59
|
+
/**
|
|
60
|
+
* Make room in a memo of pending-then-settled work: drop the oldest SETTLED entry once the memo is full, never a pending
|
|
61
|
+
* one. A render suspends on a pending entry and, when React retries it, must find that entry again; evicting it would make
|
|
62
|
+
* every retry start (and suspend on) a new one, so a page with more documents than the memo holds would never finish
|
|
63
|
+
* (break-it B1). With nothing settled to drop, the memo grows past its bound until entries settle.
|
|
64
|
+
*/
|
|
65
|
+
export declare function evictOldestSettled<V extends {
|
|
66
|
+
settled?: unknown;
|
|
67
|
+
}>(memo: Map<string, V>, max: number): void;
|
|
59
68
|
/** One face's hashing: the pending digest, and its answer once settled. */
|
|
60
69
|
export interface FaceHashMemo {
|
|
61
70
|
readonly pending: Promise<DeliveredFaceHashes | null>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivered-face.d.ts","sourceRoot":"","sources":["../../src/builder/delivered-face.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACxE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAA;AACvE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAIhE;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAErD;AAED,wGAAwG;AACxG,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,cAAc,GAAG,IAAI,CAQjG;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,OAAO,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,EACvC,SAAS,EAAE,mBAAmB,GAAG,IAAI,EACrC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GACpC,cAAc,GAAG,IAAI,CAKvB;AAED,qEAAqE;AACrE,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKjE;AAED,2CAA2C;AAC3C,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACpB;AAED,uHAAuH;AACvH,wBAAsB,iBAAiB,CAAC,IAAI,EA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,cAAc,GAAG,IAAI,CAKvB;AAED,qEAAqE;AACrE,wBAAsB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAKjE;AAED,2CAA2C;AAC3C,MAAM,WAAW,mBAAmB;IACnC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAA;CACpB;AAED,uHAAuH;AACvH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAOhG;AAED,8EAA8E;AAC9E,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,EAAE,MAAM,EAAE,cAAc,GAAG,OAAO,CAExG;AAED,2FAA2F;AAC3F,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CAE7D;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,CAAC,SAAS;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,GAAG,IAAI,CAQ3G;AAED,2EAA2E;AAC3E,MAAM,WAAW,YAAY;IAC5B,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAAA;IACrD,OAAO,CAAC,EAAE;QAAE,QAAQ,CAAC,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAAA;KAAE,CAAA;CACzD;AAMD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,YAAY,CAc/D;AAED,6DAA6D;AAC7D,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C"}
|
|
@@ -88,6 +88,22 @@ export function deliveredFaceMatches(hashes, digest) {
|
|
|
88
88
|
export function deliveredFaceHtml(face) {
|
|
89
89
|
return `<style>${face.css}</style>${face.html}`;
|
|
90
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* Make room in a memo of pending-then-settled work: drop the oldest SETTLED entry once the memo is full, never a pending
|
|
93
|
+
* one. A render suspends on a pending entry and, when React retries it, must find that entry again; evicting it would make
|
|
94
|
+
* every retry start (and suspend on) a new one, so a page with more documents than the memo holds would never finish
|
|
95
|
+
* (break-it B1). With nothing settled to drop, the memo grows past its bound until entries settle.
|
|
96
|
+
*/
|
|
97
|
+
export function evictOldestSettled(memo, max) {
|
|
98
|
+
if (memo.size < max)
|
|
99
|
+
return;
|
|
100
|
+
for (const [key, entry] of memo) {
|
|
101
|
+
if (entry.settled !== undefined) {
|
|
102
|
+
memo.delete(key);
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
91
107
|
/** How many faces' hashes are kept (insertion order; the oldest goes first). A page or a brand has one or a few. */
|
|
92
108
|
const FACE_HASH_MEMO_MAX = 64;
|
|
93
109
|
const faceHashMemo = new Map();
|
|
@@ -107,11 +123,8 @@ export function faceHashesFor(face) {
|
|
|
107
123
|
return hashes;
|
|
108
124
|
}),
|
|
109
125
|
};
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
if (oldest !== undefined)
|
|
113
|
-
faceHashMemo.delete(oldest);
|
|
114
|
-
}
|
|
126
|
+
// 2.0.0: never a pending entry (break-it B1: more faces than the memo holds made every retry suspend again).
|
|
127
|
+
evictOldestSettled(faceHashMemo, FACE_HASH_MEMO_MAX);
|
|
115
128
|
faceHashMemo.set(key, fresh);
|
|
116
129
|
return fresh;
|
|
117
130
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivered-face.js","sourceRoot":"","sources":["../../src/builder/delivered-face.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,MAAM,UAAU,GAAG,gBAAgB,CAAA;AAEnC;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAAa;IAC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A;IACzD,MAAM,KAAK,GAAG,YAAY,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;IACnC,IAAI,KAAK;QAAE,OAAO,KAAK,CAAA;IACvB,MAAM,KAAK,GAAiB;QAC3B,OAAO,EAAE,iBAAiB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;YAChD,KAAK,CAAC,OAAO,GAAG,EAAE,MAAM,EAAE,CAAA;YAC1B,OAAO,MAAM,CAAA;QACd,CAAC,CAAC;KACF,CAAA;IACD,6GAA6G;IAC7G,kBAAkB,CAAC,YAAY,EAAE,kBAAkB,CAAC,CAAA;IACpD,YAAY,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;IAC5B,OAAO,KAAK,CAAA;AACb,CAAC;AAED,6DAA6D;AAC7D,MAAM,UAAU,wBAAwB;IACvC,YAAY,CAAC,KAAK,EAAE,CAAA;AACrB,CAAC"}
|
|
@@ -13,25 +13,49 @@
|
|
|
13
13
|
* read on a brand's server then misses at most once per placement, and a warm one never waits.
|
|
14
14
|
* A revocation still lands on the first render after its refresh does. The tests' runtime gets
|
|
15
15
|
* the same cache shape, so they exercise what production runs.
|
|
16
|
+
*
|
|
17
|
+
* 2.0.0: the trust root is a key SET (`verify/key-set.ts`). `resolveKid` is still the baked set (today
|
|
18
|
+
* `cert-issuer-1`), and the card verifies with `resolveKidFor(baseUrl)`: a baked kid resolves as before, any other kid
|
|
19
|
+
* makes one read of the delivery origin's published key set, accepted only when a baked kid signs it. A rotation then
|
|
20
|
+
* needs no reinstall. The card's (2.0) contract-1 document digests are memoized with the delivered faces' hashes.
|
|
16
21
|
*/
|
|
17
22
|
import type { ResolvePublicKeyByKid } from '../contract/kernel.js';
|
|
18
23
|
import { TtlCache } from '../verify/cache.js';
|
|
19
24
|
import type { CachedDelivery } from '../verify/get-verified-delivery.js';
|
|
20
25
|
/** The card's server read deadline. A brand's server waits this long once per cold placement. */
|
|
21
26
|
export declare const CARD_DELIVERY_TIMEOUT_MS = 8000;
|
|
22
|
-
/**
|
|
23
|
-
|
|
27
|
+
/**
|
|
28
|
+
* 2.0.1: how long a verified answer is fresh. With the stale window below, a card adds at most one minute to the Delivery
|
|
29
|
+
* API's own cache (`max-age=60, stale-while-revalidate=240`), so a revoked card is gone within ADR 0001 §7's five to
|
|
30
|
+
* six minutes (2.0.0's 60 s + 300 s here stacked to about twelve).
|
|
31
|
+
*/
|
|
32
|
+
export declare const CARD_DELIVERY_TTL_MS = 30000;
|
|
33
|
+
/**
|
|
34
|
+
* How long past its TTL a certificate may still paint while it is refreshed or CertREV is down (2.0.1: 30 s; 2.0.0:
|
|
35
|
+
* 300 s). Never longer: past it, a read that cannot reach CertREV prints nothing.
|
|
36
|
+
*/
|
|
37
|
+
export declare const CARD_DELIVERY_STALE_MS = 30000;
|
|
24
38
|
export interface CardDeliveryRuntime {
|
|
39
|
+
/** The baked kids: the package's own trust root (and the only keys that may sign a published key set). */
|
|
25
40
|
readonly resolveKid: ResolvePublicKeyByKid;
|
|
41
|
+
/**
|
|
42
|
+
* 2.0.0: what the card verifies a read from `baseUrl` with: the baked kids, then that origin's signed published set.
|
|
43
|
+
* Absent: derived from `resolveKid`, `fetchImpl` and `timeoutMs` (`keySetResolver`).
|
|
44
|
+
*/
|
|
45
|
+
readonly resolveKidFor?: (baseUrl: string) => ResolvePublicKeyByKid;
|
|
26
46
|
readonly fetchImpl: () => typeof fetch;
|
|
27
47
|
readonly cache: TtlCache<CachedDelivery>;
|
|
28
48
|
readonly now: () => number;
|
|
29
49
|
readonly timeoutMs?: number;
|
|
30
50
|
}
|
|
31
51
|
export declare function cardDeliveryRuntime(): CardDeliveryRuntime;
|
|
52
|
+
/** 2.0.0: the resolver for a read from `baseUrl`: the runtime's own, else the baked kids plus the origin's key set. */
|
|
53
|
+
export declare function cardResolveKidFor(rt: CardDeliveryRuntime, baseUrl: string): ResolvePublicKeyByKid;
|
|
32
54
|
/**
|
|
33
55
|
* 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)
|
|
56
|
+
* (a fresh runtime is a fresh page), (1.3.0) every delivered face's memoized hashes and (2.0.0) every card
|
|
57
|
+
* document's digest and every published key set. 2.0.1: beacons go nowhere (a test that wants them sets its own
|
|
58
|
+
* transport with `setCardBeaconForTests` after this). Returns a restore.
|
|
35
59
|
*/
|
|
36
60
|
export declare function setCardDeliveryRuntimeForTests(overrides: Partial<CardDeliveryRuntime>): () => void;
|
|
37
61
|
//# 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
|
|
1
|
+
{"version":3,"file":"delivery-runtime.d.ts","sourceRoot":"","sources":["../../src/builder/delivery-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;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;AASxE,iGAAiG;AACjG,eAAO,MAAM,wBAAwB,OAAQ,CAAA;AAC7C;;;;GAIG;AACH,eAAO,MAAM,oBAAoB,QAAS,CAAA;AAC1C;;;GAGG;AACH,eAAO,MAAM,sBAAsB,QAAS,CAAA;AAE5C,MAAM,WAAW,mBAAmB;IACnC,0GAA0G;IAC1G,QAAQ,CAAC,UAAU,EAAE,qBAAqB,CAAA;IAC1C;;;OAGG;IACH,QAAQ,CAAC,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,qBAAqB,CAAA;IACnE,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,uHAAuH;AACvH,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,mBAAmB,EAAE,OAAO,EAAE,MAAM,GAAG,qBAAqB,CAQjG;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,SAAS,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,MAAM,IAAI,CAkBlG"}
|
|
@@ -13,19 +13,37 @@
|
|
|
13
13
|
* read on a brand's server then misses at most once per placement, and a warm one never waits.
|
|
14
14
|
* A revocation still lands on the first render after its refresh does. The tests' runtime gets
|
|
15
15
|
* the same cache shape, so they exercise what production runs.
|
|
16
|
+
*
|
|
17
|
+
* 2.0.0: the trust root is a key SET (`verify/key-set.ts`). `resolveKid` is still the baked set (today
|
|
18
|
+
* `cert-issuer-1`), and the card verifies with `resolveKidFor(baseUrl)`: a baked kid resolves as before, any other kid
|
|
19
|
+
* makes one read of the delivery origin's published key set, accepted only when a baked kid signs it. A rotation then
|
|
20
|
+
* needs no reinstall. The card's (2.0) contract-1 document digests are memoized with the delivered faces' hashes.
|
|
16
21
|
*/
|
|
17
22
|
import { TtlCache } from '../verify/cache.js';
|
|
23
|
+
import { forgetKeySetsForTests, keySetResolver } from '../verify/key-set.js';
|
|
24
|
+
import { setCardBeaconForTests } from './card-beacon.js';
|
|
25
|
+
import { forgetCardDigestsForTests } from './card-contract.js';
|
|
26
|
+
import { forgetCardReportsForTests } from './card-report.js';
|
|
18
27
|
import { forgetFaceHashesForTests } from './delivered-face.js';
|
|
19
28
|
import { CERT_ISSUER_KID, CERT_ISSUER_PUBLIC_KEY_PEM } from './issuer-key.js';
|
|
20
29
|
import { forgetPageSeedsForTests } from './ssr-seed.js';
|
|
21
30
|
/** The card's server read deadline. A brand's server waits this long once per cold placement. */
|
|
22
31
|
export const CARD_DELIVERY_TIMEOUT_MS = 8_000;
|
|
23
|
-
/**
|
|
24
|
-
|
|
32
|
+
/**
|
|
33
|
+
* 2.0.1: how long a verified answer is fresh. With the stale window below, a card adds at most one minute to the Delivery
|
|
34
|
+
* API's own cache (`max-age=60, stale-while-revalidate=240`), so a revoked card is gone within ADR 0001 §7's five to
|
|
35
|
+
* six minutes (2.0.0's 60 s + 300 s here stacked to about twelve).
|
|
36
|
+
*/
|
|
37
|
+
export const CARD_DELIVERY_TTL_MS = 30_000;
|
|
38
|
+
/**
|
|
39
|
+
* How long past its TTL a certificate may still paint while it is refreshed or CertREV is down (2.0.1: 30 s; 2.0.0:
|
|
40
|
+
* 300 s). Never longer: past it, a read that cannot reach CertREV prints nothing.
|
|
41
|
+
*/
|
|
42
|
+
export const CARD_DELIVERY_STALE_MS = 30_000;
|
|
25
43
|
const bakedResolveKid = (kid) => kid === CERT_ISSUER_KID ? { format: 'pem', pem: CERT_ISSUER_PUBLIC_KEY_PEM } : null;
|
|
26
44
|
function newCardCache(now) {
|
|
27
45
|
return new TtlCache({
|
|
28
|
-
ttlMs:
|
|
46
|
+
ttlMs: CARD_DELIVERY_TTL_MS,
|
|
29
47
|
negativeTtlMs: 5_000,
|
|
30
48
|
staleMs: CARD_DELIVERY_STALE_MS,
|
|
31
49
|
// A refresh the host runtime abandoned (workerd cancels a finished request's I/O) never
|
|
@@ -47,13 +65,30 @@ let runtime = defaultRuntime();
|
|
|
47
65
|
export function cardDeliveryRuntime() {
|
|
48
66
|
return runtime;
|
|
49
67
|
}
|
|
68
|
+
/** 2.0.0: the resolver for a read from `baseUrl`: the runtime's own, else the baked kids plus the origin's key set. */
|
|
69
|
+
export function cardResolveKidFor(rt, baseUrl) {
|
|
70
|
+
if (rt.resolveKidFor)
|
|
71
|
+
return rt.resolveKidFor(baseUrl);
|
|
72
|
+
return keySetResolver({
|
|
73
|
+
baseUrl,
|
|
74
|
+
bakedResolveKid: rt.resolveKid,
|
|
75
|
+
fetchImpl: rt.fetchImpl(),
|
|
76
|
+
...(rt.timeoutMs !== undefined ? { timeoutMs: rt.timeoutMs } : {}),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
50
79
|
/**
|
|
51
80
|
* Test seam: replace parts of the runtime (a fresh cache unless one is given) and forget the page's envelope seeds
|
|
52
|
-
* (a fresh runtime is a fresh page)
|
|
81
|
+
* (a fresh runtime is a fresh page), (1.3.0) every delivered face's memoized hashes and (2.0.0) every card
|
|
82
|
+
* document's digest and every published key set. 2.0.1: beacons go nowhere (a test that wants them sets its own
|
|
83
|
+
* transport with `setCardBeaconForTests` after this). Returns a restore.
|
|
53
84
|
*/
|
|
54
85
|
export function setCardDeliveryRuntimeForTests(overrides) {
|
|
55
86
|
forgetPageSeedsForTests();
|
|
56
87
|
forgetFaceHashesForTests();
|
|
88
|
+
forgetCardDigestsForTests();
|
|
89
|
+
forgetKeySetsForTests();
|
|
90
|
+
forgetCardReportsForTests();
|
|
91
|
+
const restoreBeacon = setCardBeaconForTests();
|
|
57
92
|
const previous = runtime;
|
|
58
93
|
const now = overrides.now ?? previous.now;
|
|
59
94
|
runtime = {
|
|
@@ -63,6 +98,7 @@ export function setCardDeliveryRuntimeForTests(overrides) {
|
|
|
63
98
|
};
|
|
64
99
|
return () => {
|
|
65
100
|
runtime = previous;
|
|
101
|
+
restoreBeacon();
|
|
66
102
|
};
|
|
67
103
|
}
|
|
68
104
|
//# sourceMappingURL=delivery-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"delivery-runtime.js","sourceRoot":"","sources":["../../src/builder/delivery-runtime.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"delivery-runtime.js","sourceRoot":"","sources":["../../src/builder/delivery-runtime.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAA;AAE7C,OA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 @@
|
|
|
31
31
|
* (`face: { html, css }`, unsigned) and the verified envelope signs that face's sha256 digests for the
|
|
32
32
|
* def version served (`content.faceDigest`), an unpinned whole-card block paints that face instead;
|
|
33
33
|
* markup that does not hash to the signed digest is never painted. A revoked, expired, unverifiable or unreachable cert, a marker that
|
|
34
|
-
* is not exactly that shape, or a missing entry id renders nothing.
|
|
35
|
-
* (every entry exported before 1.1.0) renders
|
|
36
|
-
*
|
|
37
|
-
*
|
|
34
|
+
* is not exactly that shape, or a missing entry id renders nothing. 2.0.1: a block WITHOUT the marker
|
|
35
|
+
* (every entry exported before 1.1.0) renders nothing too, and reports `no_marker`: through 2.0.0 it
|
|
36
|
+
* painted its options as 1.0.3 did, unsigned export-time claims an editor could change. So deleting the
|
|
37
|
+
* marker no longer brings any face back.
|
|
38
38
|
*
|
|
39
39
|
* Three things the card DOES enforce, and they are the limit of it: no chrome at all without a
|
|
40
40
|
* `reviewerName` and a `verifyUrl`; a credential renders only welded to its dated verification
|
|
@@ -104,7 +104,10 @@ export interface CertRevBuilderRegistration {
|
|
|
104
104
|
*/
|
|
105
105
|
export declare const certRevAnchorComponent: CertRevBuilderRegistration;
|
|
106
106
|
export { type DesignPin, designPinFromUrl, parseDesignPin } from '../verify/get-verified-delivery.js';
|
|
107
|
+
export { acceptedCardBinding, type CardBinding, type CardDocumentV1, type CardPartName, cardDocumentDigest, cardPartsFor, parseCardDocument, } from './card-contract.js';
|
|
108
|
+
export { CARD_FALLBACK_EVENT, type CardFallbackDetail, type CardFallbackReason } from './card-report.js';
|
|
107
109
|
export { BUILDER_CERT_CHROME_KEYS, type BuilderCertChromeData, type BuilderCertChromeKey, type CertChromeRenderDef, type CertDeliveryMarker, } from './cert-chrome-data.js';
|
|
108
110
|
export { acceptedDeliveryMarker, BUILDER_REGISTRATION, type BuilderInput, CERT_COMPONENT_NAME, type CertBlockBuilderRegistration, CertReviewCard, type CertReviewCardProps, type CertReviewCardRegisteredComponent, certRevCertComponent, PLACEMENT_INPUTS, WIRE_INPUTS, } from './cert-review-card.js';
|
|
111
|
+
export { BUILDER_CARD_FLOW_CSS } from './contract-card.js';
|
|
109
112
|
export { CERT_FACE_FIELDS, credentialLabel, type EnvelopeCardOptions, envelopeCardHtml, envelopeCardInput, faceFromDef, isReaderFaceDef, layoutFor, READER_FACE, themeFromDef, } from './envelope-face.js';
|
|
110
113
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/builder/index.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,OAAO,EAAiB,KAAK,SAAS,EAAc,MAAM,OAAO,CAAA;AAEjE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAExD,mFAAmF;AACnF,MAAM,WAAW,iBAAiB;IACjC,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAA;IAC7B,sGAAsG;IACtG,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;CACzB;AASD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,EAC/B,OAAO,EACP,SAAiB,EACjB,QAAQ,GACR,EAAE;IACF,QAAQ,CAAC,OAAO,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC1C,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAA;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;CAC5B,+BAEA;AAED;;;;GAIG;AACH,wBAAgB,wBAAwB,gCAiBvC;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,uCAO5B;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IAC1C,SAAS,EAAE,OAAO,aAAa,CAAA;IAC/B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,KAAK,EAAE,CAAA;CACf;AAED;;;;GAIG;AACH,eAAO,MAAM,sBAA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EACX,YAAY,GACZ,MAAM,oBAAoB,CAAA"}
|
package/dist/builder/index.js
CHANGED
|
@@ -32,10 +32,10 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
32
32
|
* (`face: { html, css }`, unsigned) and the verified envelope signs that face's sha256 digests for the
|
|
33
33
|
* def version served (`content.faceDigest`), an unpinned whole-card block paints that face instead;
|
|
34
34
|
* markup that does not hash to the signed digest is never painted. A revoked, expired, unverifiable or unreachable cert, a marker that
|
|
35
|
-
* is not exactly that shape, or a missing entry id renders nothing.
|
|
36
|
-
* (every entry exported before 1.1.0) renders
|
|
37
|
-
*
|
|
38
|
-
*
|
|
35
|
+
* is not exactly that shape, or a missing entry id renders nothing. 2.0.1: a block WITHOUT the marker
|
|
36
|
+
* (every entry exported before 1.1.0) renders nothing too, and reports `no_marker`: through 2.0.0 it
|
|
37
|
+
* painted its options as 1.0.3 did, unsigned export-time claims an editor could change. So deleting the
|
|
38
|
+
* marker no longer brings any face back.
|
|
39
39
|
*
|
|
40
40
|
* Three things the card DOES enforce, and they are the limit of it: no chrome at all without a
|
|
41
41
|
* `reviewerName` and a `verifyUrl`; a credential renders only welded to its dated verification
|
|
@@ -110,8 +110,12 @@ export const certRevAnchorComponent = {
|
|
|
110
110
|
};
|
|
111
111
|
// 1.2.0-canary.5: the design pin, for CertREV's own canary replica (`<Content context={{ certrevDesignPin }}>`).
|
|
112
112
|
export { designPinFromUrl, parseDesignPin } from '../verify/get-verified-delivery.js';
|
|
113
|
+
// 2.0.0: the contract-1 card (CertREV's server-rendered card document), its fallback report and the Builder flow rule.
|
|
114
|
+
export { acceptedCardBinding, cardDocumentDigest, cardPartsFor, parseCardDocument, } from './card-contract.js';
|
|
115
|
+
export { CARD_FALLBACK_EVENT } from './card-report.js';
|
|
113
116
|
// ── The Builder.io PUSH kit (CertReviewCard) + the single-sourced wire type ──
|
|
114
117
|
export { BUILDER_CERT_CHROME_KEYS, } from './cert-chrome-data.js';
|
|
115
118
|
export { acceptedDeliveryMarker, BUILDER_REGISTRATION, CERT_COMPONENT_NAME, CertReviewCard, certRevCertComponent, PLACEMENT_INPUTS, WIRE_INPUTS, } from './cert-review-card.js';
|
|
119
|
+
export { BUILDER_CARD_FLOW_CSS } from './contract-card.js';
|
|
116
120
|
export { CERT_FACE_FIELDS, credentialLabel, envelopeCardHtml, envelopeCardInput, faceFromDef, isReaderFaceDef, layoutFor, READER_FACE, themeFromDef, } from './envelope-face.js';
|
|
117
121
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/builder/index.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AACH,OAAO,EAAE,aAAa,EAAkB,UAAU,EAAE,MAAM,OAAO,CAAA;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAA;AAexD,MAAM,cAAc,GAAG,aAAa,CAAsB,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC,CAAA;AAE9F;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,EAC/B,OAAO,EACP,SAAS,GAAG,KAAK,EACjB,QAAQ,GAKR;IACA,OAAO,KAAC,cAAc,CAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,YAAG,QAAQ,GAA2B,CAAA;AACpG,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,wBAAwB;IACvC,OAAO,CACN,kDACiC,EAAE,EAClC,KAAK,EAAE;YACN,MAAM,EAAE,oBAAoB;YAC5B,YAAY,EAAE,CAAC;YACf,OAAO,EAAE,WAAW;YACpB,IAAI,EAAE,gBAAgB;YACtB,KAAK,EAAE,SAAS;YAChB,UAAU,EAAE,SAAS;SACrB,iCAEe,8CAA0B,oJAErC,CACN,CAAA;AACF,CAAC;AAED;;;;;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