porttoken

package
v0.8.35 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

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

func Ensure(island string) (string, error)

Ensure returns the island's token, minting and persisting a fresh one if none exists yet. Idempotent.

func IslandForToken

func IslandForToken(token string) (island string, ok bool)

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.

func Load

func Load(island string) (string, error)

Load returns the island's stored token, or "" if none is set.

Types

This section is empty.

Jump to

Keyboard shortcuts

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