porttoken

package
v0.8.21 Latest Latest
Warning

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

Go to latest
Published: Jul 22, 2026 License: Apache-2.0 Imports: 7 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

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