Documentation
¶
Overview ¶
Package invite encodes and decodes Dejima team invites — a single paste-safe blob that carries everything a teammate needs to connect to a daemon (host:port + bearer secret + role/scope). The owner issues one in the TUI Team view at token-mint time; the teammate pastes it on the join side and is connected with no env vars or manual flags.
Wire format: "dejima-invite:" + base64url(no-pad) of the JSON Payload. The base64url alphabet (RFC 4648 §5) is URL/filename-safe, so the blob survives copy/paste, chat, QR, and shell args without "+", "/", or "=" being mangled.
The blob is ENCODED, not encrypted: it contains the bearer secret in the clear (post-base64). It is therefore a credential — treat it like a password, send it over a trusted channel, and revoke the underlying token to kill a leaked invite (DELETE /v1/tokens/{id}).
Index ¶
Constants ¶
const Scheme = "dejima-invite:"
Scheme prefixes every invite blob; it makes an invite recognisable to a paste handler and greppable in logs/chat.
const Version = 1
Version is the current payload schema version. Decode rejects anything else, so an older client fails loudly on a newer invite instead of misreading it.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Payload ¶
type Payload struct {
V int `json:"v"`
Host string `json:"host"` // daemon host:port the teammate dials (operator-supplied)
Token string `json:"token"` // bearer secret (the credential)
Role string `json:"role"` // owner|operator|viewer (echo; daemon enforces real scope)
Islands []string `json:"islands,omitempty"` // scope echo; empty = all islands
Name string `json:"name,omitempty"` // suggested profile name
Label string `json:"label,omitempty"` // token label / who it's for (display)
}
Payload is the decoded invite. Keys are short to keep the blob compact (a typical invite is ~120–180 chars). Host/Token/Role are required; the rest are display/UX hints.