actionregistry

package
v1.13.10 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: AGPL-3.0 Imports: 4 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 actionregistry defines the canonical action vocabulary shared by management policy, node capability reports, and real side-effect adapters.

Importing this package does not enable governance. The zero-value Profile is explicitly unmanaged, so existing nodes and protocols retain their current behavior until an operator selects actions and a non-off mode.

Index

Constants

View Source
const SchemaVersion uint16 = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type AdapterCapability

type AdapterCapability struct {
	Action         string `json:"action"`
	AdapterID      string `json:"adapter_id"`
	AdapterVersion string `json:"adapter_version"`
	Observe        bool   `json:"observe"`
	Enforce        bool   `json:"enforce"`
	Suspend        bool   `json:"suspend"`
	Resume         bool   `json:"resume"`
	Receipt        bool   `json:"receipt"`
}

AdapterCapability is a node's signed/reportable assertion that a concrete adapter can observe or enforce an action. Management must not infer this from the registry alone.

func (AdapterCapability) Validate

func (capability AdapterCapability) Validate(registry *Registry) error

Validate checks a concrete adapter claim against the canonical registry. It is exported because signed fleet capability reports are validated in the authority package rather than trusting browser or adapter-supplied labels.

type ControlMode

type ControlMode string
const (
	ModeOff            ControlMode = "off"
	ModeObserve        ControlMode = "observe"
	ModeLocalEnforce   ControlMode = "local_enforce"
	ModeManagedEnforce ControlMode = "managed_enforce"
)

func (ControlMode) Enforces

func (mode ControlMode) Enforces() bool

func (ControlMode) Managed

func (mode ControlMode) Managed() bool

func (ControlMode) Normalize

func (mode ControlMode) Normalize() ControlMode

func (ControlMode) Validate

func (mode ControlMode) Validate() error

type Definition

type Definition struct {
	Version        uint16         `json:"version"`
	Name           string         `json:"name"`
	Aliases        []string       `json:"aliases,omitempty"`
	ResourceKind   string         `json:"resource_kind"`
	PayloadBinding PayloadBinding `json:"payload_binding"`
	Privacy        PrivacyClass   `json:"privacy"`
	Suspendable    bool           `json:"suspendable"`
	Resumable      bool           `json:"resumable"`
	Constraints    []string       `json:"constraints,omitempty"`
	Description    string         `json:"description"`
}

Definition is the product contract for one canonical action. An action is not considered enforced merely because it appears here: a node must also report a matching, enforceable adapter capability.

func (Definition) Validate

func (definition Definition) Validate() error

type PayloadBinding

type PayloadBinding string
const (
	PayloadHash          PayloadBinding = "sha256"
	PayloadCanonicalHash PayloadBinding = "canonical_sha256"
)

type PrivacyClass

type PrivacyClass string
const (
	PrivacyMetadataOnly     PrivacyClass = "metadata_only"
	PrivacyTypedMetadata    PrivacyClass = "typed_metadata"
	PrivacyLocalOnly        PrivacyClass = "local_only"
	PrivacyPayloadOptIn     PrivacyClass = "payload_opt_in"
	PrivacyFederatedContent PrivacyClass = "federated_content"
)

type Profile

type Profile struct {
	Version       uint16      `json:"version,omitempty"`
	Mode          ControlMode `json:"mode,omitempty"`
	Actions       []string    `json:"actions,omitempty"`
	StrictReceive []string    `json:"strict_receive,omitempty"`
}

Profile is an explicitly selected node policy posture. Empty mode is a compatibility alias for off. Every non-off profile must name actions (or the explicit "*" selector), preventing an upgrade from silently governing newly added actions.

func (Profile) AppliesTo

func (profile Profile) AppliesTo(registry *Registry, action string) bool

func (Profile) Enforces

func (profile Profile) Enforces(registry *Registry, action string) bool

func (Profile) Observes

func (profile Profile) Observes(registry *Registry, action string) bool

func (Profile) RequiresGovernedReceive

func (profile Profile) RequiresGovernedReceive(registry *Registry, action string) bool

func (Profile) Validate

func (profile Profile) Validate(registry *Registry) error

type Registry

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

func Builtins

func Builtins() *Registry

func New

func New(definitions []Definition) (*Registry, error)

func (*Registry) CanonicalName

func (registry *Registry) CanonicalName(name string) (string, bool)

func (*Registry) Definitions

func (registry *Registry) Definitions() []Definition

func (*Registry) Resolve

func (registry *Registry) Resolve(name string) (Definition, bool)

Jump to

Keyboard shortcuts

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