capsite/docs: weekly-roundup wiring diagram, as on main
Who holds what in the S1 pipeline as it runs in dev: Alice's cache id, the one-shot wiring to a webapp access whose init.headers carry the cookie, and diigo-week reaching only the public cache's viewer. Drawn in the style of cookie-rotation-wiring.html (webapp-cookie-rotation branch), to contrast with it: on main a fresh cookie means a new access and a new cache. Generated-by: Claude Opus 5.5
This commit is contained in:
1 parent
1fb01b3d55
commit
7cd6d0af01
2 files changed
+148
No files matched your search
@@ -0,0 +1,148 @@
|
|||||||
|
<!doctype html>
|
||||||
|
<html><head><meta charset="utf-8">
|
||||||
|
<title>weekly roundup on main: who holds what</title>
|
||||||
|
<!-- drawn after the style of MarkM's ERTP slides, as cookie-rotation-wiring.html on the webapp-cookie-rotation branch; weekly-roundup-wiring.png is a headless-Chromium screenshot of this page -->
|
||||||
|
<style>
|
||||||
|
html, body { margin: 0; background: #fff; }
|
||||||
|
.sans { font-family: "Helvetica Neue", "DejaVu Sans", sans-serif; }
|
||||||
|
.obj { font-family: "DejaVu Serif", serif; font-style: italic; }
|
||||||
|
.mono { font-family: "DejaVu Sans Mono", monospace; }
|
||||||
|
</style></head>
|
||||||
|
<body>
|
||||||
|
<svg id="c" xmlns="http://www.w3.org/2000/svg" width="1120" height="820" viewBox="0 0 1120 820"
|
||||||
|
role="img" aria-labelledby="title desc">
|
||||||
|
<title id="title">weekly roundup on main: who holds what</title>
|
||||||
|
<desc id="desc">Three actors and two makers. Alice holds a cache id, saved in her
|
||||||
|
password manager, which refers to a DiigoCache. Each DiigoCache refers to its
|
||||||
|
wiring table: webappId and publicId. webappId refers to an access object made
|
||||||
|
by makeWebApp; publicId refers to a PublicCache, which refers to the same
|
||||||
|
access. Each access refers to its init table: url and headers, and the
|
||||||
|
headers hold the diigo session cookie. A viewer facet reads the PublicCache
|
||||||
|
and can't fetch or write; diigo-week, the potluck plugin, reaches only the
|
||||||
|
viewer, as the public page's h-feed. Mallory, who learned the instance id,
|
||||||
|
also refers to access, so she can use the cookie. The wiring is set once, so
|
||||||
|
when Alice logs in again she has to mint a new access and a new cache.</desc>
|
||||||
|
<defs>
|
||||||
|
<radialGradient id="ball" cx="40%" cy="35%" r="70%">
|
||||||
|
<stop offset="0%" stop-color="#7cc8f8"/>
|
||||||
|
<stop offset="100%" stop-color="#3aa6ee"/>
|
||||||
|
</radialGradient>
|
||||||
|
<linearGradient id="objfill" x1="0" y1="0" x2="0" y2="1">
|
||||||
|
<stop offset="0%" stop-color="#6cbcf4"/>
|
||||||
|
<stop offset="100%" stop-color="#4aa8ec"/>
|
||||||
|
</linearGradient>
|
||||||
|
<marker id="head" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="9" markerHeight="9" orient="auto-start-reverse">
|
||||||
|
<path d="M0,0 L10,5 L0,10 z" fill="#1d4f7a"/>
|
||||||
|
</marker>
|
||||||
|
</defs>
|
||||||
|
</svg>
|
||||||
|
<script>
|
||||||
|
const svg = document.getElementById("c");
|
||||||
|
const NS = "http://www.w3.org/2000/svg";
|
||||||
|
const el = (name, attrs, parent = svg) => {
|
||||||
|
const e = document.createElementNS(NS, name);
|
||||||
|
for (const [k, v] of Object.entries(attrs)) e.setAttribute(k, v);
|
||||||
|
parent.appendChild(e);
|
||||||
|
return e;
|
||||||
|
};
|
||||||
|
const text = (x, y, s, cls, attrs = {}) => {
|
||||||
|
const t = el("text", { x, y, class: cls, "text-anchor": "middle", fill: "#1d3550", ...attrs });
|
||||||
|
t.textContent = s;
|
||||||
|
return t;
|
||||||
|
};
|
||||||
|
|
||||||
|
const INK = "#1d4f7a";
|
||||||
|
const dot = (x, y) => el("circle", { cx: x, cy: y, r: 4.5, fill: INK });
|
||||||
|
/** a reference: dot at the holder, arrowhead at the target */
|
||||||
|
const ref = (x1, y1, x2, y2, bend = 0, extra = {}) => {
|
||||||
|
dot(x1, y1);
|
||||||
|
const mx = (x1 + x2) / 2 - (y2 - y1) * bend, my = (y1 + y2) / 2 + (x2 - x1) * bend;
|
||||||
|
el("path", { d: `M${x1},${y1} Q${mx},${my} ${x2},${y2}`, fill: "none", stroke: INK, "stroke-width": 2, "marker-end": "url(#head)", ...extra });
|
||||||
|
};
|
||||||
|
|
||||||
|
// maker box: a pale rounded region, with stacked instances inside
|
||||||
|
function maker(x, y, w, h, label) {
|
||||||
|
el("rect", { x, y, width: w, height: h, rx: 26, fill: "#d6ecfb", stroke: "#b5dbf5", "stroke-width": 1.5 });
|
||||||
|
text(x + 18, y + 30, label, "obj", { "text-anchor": "start", "font-size": 20 });
|
||||||
|
for (let i = 2; i >= 0; i -= 1) {
|
||||||
|
el("rect", {
|
||||||
|
x: x + 18 + i * 9, y: y + 48 + i * 9, width: w - 52, height: h - 82, rx: 22,
|
||||||
|
fill: "#c8e5fa", stroke: "#8ec9f2", "stroke-width": 1.5, "fill-opacity": 0.9,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// an object: rounded square, optionally stacked (several made)
|
||||||
|
function obj(x, y, w, h, label, stacked = false) {
|
||||||
|
const n = stacked ? 3 : 1;
|
||||||
|
for (let i = n - 1; i >= 0; i -= 1) {
|
||||||
|
el("rect", { x: x + i * 7, y: y - i * 7, width: w, height: h, rx: 12, fill: "url(#objfill)", stroke: "#2f8fd6", "stroke-width": 1.5 });
|
||||||
|
}
|
||||||
|
text(x + w / 2, y + h / 2 + 7, label, "obj", { "font-size": 19 });
|
||||||
|
}
|
||||||
|
function actor(cx, cy, label) {
|
||||||
|
el("circle", { cx, cy, r: 52, fill: "url(#ball)", stroke: "#2f8fd6", "stroke-width": 1.5 });
|
||||||
|
text(cx, cy + 6, label, "sans", { "font-size": label.length > 8 ? 15 : 17 });
|
||||||
|
}
|
||||||
|
// a table like the ERTP ledger
|
||||||
|
function table(x, y, title, rows, colW) {
|
||||||
|
const rowH = 28, w = colW[0] + colW[1];
|
||||||
|
el("rect", { x, y, width: w, height: 36 + rowH * rows.length, fill: "#5fb5f2", stroke: "#2f8fd6", "stroke-width": 1.5 });
|
||||||
|
text(x + w / 2, y + 25, title, "obj", { "font-size": 18 });
|
||||||
|
rows.forEach(([k, v], i) => {
|
||||||
|
const ry = y + 36 + i * rowH;
|
||||||
|
el("line", { x1: x, y1: ry, x2: x + w, y2: ry, stroke: "#2f8fd6", "stroke-width": 1.2 });
|
||||||
|
text(x + 10, ry + 19, k, "mono", { "text-anchor": "start", "font-size": 14 });
|
||||||
|
if (v) text(x + colW[0] + 10, ry + 19, v, "mono", { "text-anchor": "start", "font-size": 14 });
|
||||||
|
});
|
||||||
|
el("line", { x1: x + colW[0], y1: y + 36, x2: x + colW[0], y2: y + 36 + rowH * rows.length, stroke: "#1d4f7a", "stroke-width": 1.5 });
|
||||||
|
return { rowY: (i) => y + 36 + i * rowH + rowH / 2, x, w, colX: x + colW[0] };
|
||||||
|
}
|
||||||
|
|
||||||
|
// speech bubble (Alice, after logging in to diigo again)
|
||||||
|
el("path", {
|
||||||
|
d: "M30,22 h470 a16,16 0 0 1 16,16 v34 a16,16 0 0 1 -16,16 h-330 l-38,48 l6,-48 h-102 a16,16 0 0 1 -16,-16 v-34 a16,16 0 0 1 16,-16 z",
|
||||||
|
fill: "#d9d9d9", stroke: "#555", "stroke-width": 2,
|
||||||
|
});
|
||||||
|
text(46, 62, "fresh cookie? mint a new access, a new cache", "mono", { "text-anchor": "start", "font-size": 16, fill: "#222" });
|
||||||
|
|
||||||
|
// actors
|
||||||
|
actor(150, 200, "Alice");
|
||||||
|
actor(560, 200, "diigo-week");
|
||||||
|
actor(930, 200, "Mallory");
|
||||||
|
|
||||||
|
// makers
|
||||||
|
maker(30, 320, 500, 470, "diigo-cache");
|
||||||
|
maker(590, 320, 500, 470, "makeWebApp");
|
||||||
|
|
||||||
|
// diigo-cache insides
|
||||||
|
obj(70, 410, 150, 80, "DiigoCache", true);
|
||||||
|
const wiring = table(270, 410, "wiring", [["webappId", "…"], ["publicId", "…"]], [110, 90]);
|
||||||
|
obj(70, 610, 150, 80, "PublicCache", true);
|
||||||
|
obj(300, 640, 120, 60, "viewer", true);
|
||||||
|
|
||||||
|
// makeWebApp insides
|
||||||
|
obj(640, 560, 140, 90, "access", true);
|
||||||
|
const init = table(840, 420, "init", [["url", "diigo…"], ["headers", "{cookie}"]], [100, 105]);
|
||||||
|
|
||||||
|
// references
|
||||||
|
ref(140, 228, 130, 403, 0.03); // Alice → DiigoCache (cache id)
|
||||||
|
ref(560, 228, 380, 627, -0.04); // diigo-week → viewer
|
||||||
|
ref(930 - 14, 200 + 20, 740, 553, -0.08); // Mallory → access
|
||||||
|
ref(160, 450, wiring.x - 2, wiring.rowY(0), 0.05); // DiigoCache → wiring
|
||||||
|
ref(wiring.colX + 40, wiring.rowY(0), 646, 580, -0.12); // webappId → access
|
||||||
|
ref(wiring.colX + 40, wiring.rowY(1), 165, 598, -0.08); // publicId → PublicCache
|
||||||
|
ref(200, 688, 632, 640, 0.25); // PublicCache → access
|
||||||
|
ref(306, 675, 232, 668, 0.1); // viewer → PublicCache (read)
|
||||||
|
ref(780, 600, init.x - 2, init.rowY(1), -0.1); // access → init
|
||||||
|
|
||||||
|
// captions
|
||||||
|
const cap = (x, y, s, attrs = {}) => text(x, y, s, "sans", { "font-size": 14, fill: "#33536f", ...attrs });
|
||||||
|
cap(270, 286, "cache id, in the password manager", {});
|
||||||
|
cap(560, 120, "potluck plugin: /public/<user>, an h-feed;", {});
|
||||||
|
cap(560, 138, "reaches only the viewer", {});
|
||||||
|
cap(930, 118, "holds the instance id:", {});
|
||||||
|
cap(930, 136, "uses the cookie", {});
|
||||||
|
cap(280, 806, "setup(wiring) is one-shot: different values are refused", {});
|
||||||
|
cap(840, 806, "the cookie rides in init.headers, fixed at mint", {});
|
||||||
|
</script>
|
||||||
|
</body></html>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 125 KiB |
Reference in new issue
Block a user