Documentation
¶
Overview ¶
Command secondorigin keeps a "second origin" honest.
A second origin is an `<org>-usercontent` GitHub organisation whose Pages site (`<org>-usercontent.github.io`) gives a playground a SEPARATE ORIGIN: github.io is on the Public Suffix List, so the two are different sites with isolated storage, and what runs on the second one cannot read the first's IndexedDB, cookies or tokens. The first page embeds the second one's shell and talks to it by postMessage, each side checking the other's origin.
The parent repository DECLARES its second origin in `.second-origin.json`:
{
"org": "go-wasmcontainers-usercontent",
"repo": "go-wasmcontainers-usercontent.github.io",
"parents": ["https://go-wasmcontainers.github.io"],
"shells": ["/shell.html"],
"csp": "default-src 'none'; script-src 'self'; ..."
}
`secondorigin verify` reads the PUBLISHED thing and compares it with the declaration; `secondorigin init` prepares the Pages repository of an organisation that already exists. It never creates an organisation: GitHub asks a human for that.
⛔ THE VERDICT HAS THREE VALUES, because a gate that cannot tell "I could not read it" from "it is fine" is the one that reports a disappeared origin as a pass: exit 0 verified, 1 the origin DRIFTED (or is gone), 2 NOT VERIFIED (an unreadable answer, a rate limit, a 5xx, a declaration that is not one).