Documentation
¶
Overview ¶
Package porttoken mints and resolves per-island bearer tokens for the authenticated in-island → dejimad path — the macOS autonomy route, where the unix socket can't be bind-mounted into a container so the brain must reach the daemon over loopback TCP (docs/port-island-spec.md §11.3, runbook §5).
One token per island, stored host-side at ~/.dejima/projects/<name>/token (0600, outside every container's blast radius). A token authorizes actions scoped to *its* island only — the API middleware (a later slice) resolves the token to an island and rejects requests targeting any other. A Home Island additionally holds the tokens of the islands it spawns (the parent-child model — spawn returns the child's token — so there is no god-token).
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Ensure ¶
Ensure returns the island's token, minting and persisting a fresh one if none exists yet. Idempotent.
func IslandForToken ¶
IslandForToken returns the island a non-empty token authorizes, comparing against each island's stored token in constant time (no per-byte timing leak of the secret). Returns ok=false when no island matches.
Types ¶
This section is empty.