onboarding

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2026 License: MIT Imports: 21 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 onboarding owns the manager's portable display enrollment state.

Index

Constants

This section is empty.

Variables

View Source
var ErrEnrollment = errors.New("enrollment unavailable")

Functions

func MigrateV03

func MigrateV03(data, source, mobile, address string) error

MigrateV03 publishes a complete private state directory in one rename. A failed import never makes partial state visible to serve.

Types

type Device

type Device struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Enrolled bool   `json:"enrolled"`
	Timezone string `json:"timezone,omitempty"`
}

type OfferDevice

type OfferDevice func(context.Context, [16]byte, [32]byte, net.Conn) error

OfferDevice takes ownership of a successfully authenticated EPN2 connection.

type Registry

type Registry struct {
	// contains filtered or unexported fields
}

Registry serializes issue and redeem operations for a single manager volume. Each atomic record transitions from a pending bootstrap to a durable device key.

func OpenRegistry

func OpenRegistry(directory string) (*Registry, error)

func (*Registry) AcceptDevice

func (r *Registry) AcceptDevice(ctx context.Context, conn *tls.Conn, offer OfferDevice) error

AcceptDevice accepts an optional EPQ1 bootstrap exchange before the existing EPN2 handshake. The caller retains ownership on error. Enrollment is complete only after Redeem durably commits; an ACK lost there is safe to retry.

func (*Registry) Device

func (r *Registry) Device(id [16]byte) (Device, error)

func (*Registry) DeviceKey

func (r *Registry) DeviceKey(id [16]byte) ([32]byte, error)

func (*Registry) Issue

func (r *Registry) Issue(name, endpoint string) (Device, bootstrap.Record, error)

func (*Registry) List

func (r *Registry) List() ([]Device, error)

List returns only public display metadata in a stable order.

func (*Registry) OnlyEnrolled

func (r *Registry) OnlyEnrolled() ([16]byte, error)

OnlyEnrolled resolves the legacy single-screen API without guessing a target.

func (*Registry) Pending

func (r *Registry) Pending(id [16]byte) (bootstrap.Record, error)

func (*Registry) Redeem

func (r *Registry) Redeem(id [16]byte, code, key [32]byte) error

Redeem runs only after server-authenticated TLS. The receiver persists its fresh key before requesting redemption, so a lost reply can be recovered by authenticating with that key. A second redemption always fails.

type Settings

type Settings struct {
	// contains filtered or unexported fields
}

Settings owns one manager's device endpoint and pinned TLS identity. A single manager process owns the volume. Readers see a complete generation.

func OpenSettings

func OpenSettings(directory, initialAddress string) (*Settings, error)

func (*Settings) Address

func (s *Settings) Address() string

func (*Settings) PinnedEndpoint

func (s *Settings) PinnedEndpoint() (string, error)

func (*Settings) SetAddress

func (s *Settings) SetAddress(address string) error

SetAddress keeps existing pins valid. A certificate for a different host requires explicit trust migration, never an implicit identity replacement.

func (*Settings) TLSCertificate

func (s *Settings) TLSCertificate(_ *tls.ClientHelloInfo) (*tls.Certificate, error)

TLSCertificate can be installed as tls.Config.GetCertificate before the operator sets an address.

Jump to

Keyboard shortcuts

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