secondorigin

command
v0.104.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 10, 2026 License: BSD-3-Clause Imports: 20 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL