policy

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Edit

func Edit(raw string, want Desired, prune bool) (string, error)

Edit applies the catalog policy to a HuJSON policy file. Comments and keys other than tagOwners, autoApprovers, and grants stay. Replacing a grant's dst drops comments on that value. prune rewrites the first grant whose destinations are all svc: names and whose ports are only 443, setting dst to the catalog's published services. tagOwners stay a union: owners already on the tag are not removed. The input string is returned unchanged when nothing was edited.

func Merge

func Merge(have *tailscale.ACL, want Desired) *tailscale.ACL

Merge copies have and applies catalog policy without removing existing rules.

Types

type Change

type Change struct {
	Name   string
	Action string // create, update, unchanged
	Detail string
}

type Desired

type Desired struct {
	HostTag      string   // e.g. tag:server; empty skips host/tag mutations
	TagOwners    []string // owners of HostTag; default autogroup:admin
	GrantSrc     []string
	GrantDst     []string // svc:name entries
	GrantIP      []string // always 443
	SrcDefaulted bool     // GrantSrc was filled because access.src was empty
}

Desired is the catalog-driven slice of the tailnet policy.

func FromCatalog

func FromCatalog(f *catalog.File) Desired

type Plan

type Plan struct {
	Changes []Change
}

func ComputePlan

func ComputePlan(want Desired, have *tailscale.ACL) Plan

func (Plan) NeedsApply

func (p Plan) NeedsApply() bool

Jump to

Keyboard shortcuts

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