appliance

package
v0.16.3 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2026 License: BSD-3-Clause, GPL-3.0 Imports: 20 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 appliance provisions operator-owned named network topologies.

Index

Constants

View Source
const MaxManifestBytes = 64 << 10

Variables

This section is empty.

Functions

func ApprovalDigest

func ApprovalDigest(planDigest, operation string) string

func AuthorizeProduction

func AuthorizeProduction(ctx context.Context, m Manifest) error

func Execute

func Execute(ctx context.Context, m Manifest, dir, action string) (any, error)

Execute requires bootstrap grants and reviewed digest for production; lab mode is Docker-only. The persisted topology is immutable for its lifetime.

func WithBootstrap

func WithBootstrap(ctx context.Context, b Bootstrap) context.Context

Types

type Bootstrap

type Bootstrap struct {
	Scope          firewallauth.Scope
	ReviewedDigest string
	Approvals      *firewallauth.Approvals
	Receipt        string
}

type Endpoint

type Endpoint struct {
	Namespace string   `json:"namespace" yaml:"namespace"`
	Interface string   `json:"interface" yaml:"interface"`
	CIDRs     []string `json:"cidrs" yaml:"cidrs"`
}
type Link struct {
	A Endpoint `json:"a" yaml:"a"`
	B Endpoint `json:"b" yaml:"b"`
}

type Manifest

type Manifest struct {
	TargetID   string   `json:"targetID,omitempty" yaml:"targetID,omitempty"`
	Version    string   `json:"version" yaml:"version"`
	Mode       string   `json:"mode" yaml:"mode"`
	Nonce      string   `json:"nonce" yaml:"nonce"`
	Namespaces []string `json:"namespaces" yaml:"namespaces"`
	Links      []Link   `json:"links" yaml:"links"`
	Routes     []Route  `json:"routes" yaml:"routes"`
	Forward    []string `json:"forward" yaml:"forward"`
	Packet     Packet   `json:"packet" yaml:"packet"`
}

func Parse

func Parse(b []byte) (Manifest, error)

func (Manifest) NetworkConfig

func (m Manifest) NetworkConfig() networkfirewall.Config

func (Manifest) Plan

func (m Manifest) Plan() (Plan, error)

func (Manifest) Validate

func (m Manifest) Validate() error

type Observation

type Observation struct {
	Namespace  string          `json:"namespace"`
	Exists     bool            `json:"exists"`
	Owned      bool            `json:"owned"`
	Error      string          `json:"error,omitempty"`
	Links      json.RawMessage `json:"links"`
	Addresses  json.RawMessage `json:"addresses"`
	IPv4Routes json.RawMessage `json:"ipv4Routes"`
	IPv6Routes json.RawMessage `json:"ipv6Routes"`
	Ruleset    json.RawMessage `json:"ruleset"`
}

type Operation

type Operation struct {
	ID        string   `json:"id"`
	Kind      string   `json:"kind"`
	Namespace string   `json:"namespace"`
	Arguments []string `json:"arguments"`
}

type Packet

type Packet struct {
	Namespace              string   `json:"namespace" yaml:"namespace"`
	Interface              string   `json:"interface" yaml:"interface"`
	ProtectedCIDRs         []string `json:"protectedCIDRs" yaml:"protectedCIDRs"`
	ManagementDestinations []string `json:"managementDestinations" yaml:"managementDestinations"`
	Queue                  uint16   `json:"queue" yaml:"queue"`
}

type Plan

type Plan struct {
	Version    string      `json:"version"`
	Digest     string      `json:"digest"`
	Nonce      string      `json:"nonce"`
	Operations []Operation `json:"operations"`
	Conntrack  string      `json:"conntrack"`
}

type Route

type Route struct {
	Namespace   string `json:"namespace" yaml:"namespace"`
	Destination string `json:"destination" yaml:"destination"`
	Via         string `json:"via" yaml:"via"`
	Interface   string `json:"interface" yaml:"interface"`
}

type Status

type Status struct {
	Plan      Plan            `json:"plan"`
	Pending   string          `json:"pending"`
	Completed map[string]bool `json:"completed"`
	Observed  []Observation   `json:"observed"`
	Removed   bool            `json:"removed"`
}

Jump to

Keyboard shortcuts

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