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
- type AdapterCapability
- type ControlMode
- type Definition
- type PayloadBinding
- type PrivacyClass
- type Profile
- func (profile Profile) AppliesTo(registry *Registry, action string) bool
- func (profile Profile) Enforces(registry *Registry, action string) bool
- func (profile Profile) Observes(registry *Registry, action string) bool
- func (profile Profile) RequiresGovernedReceive(registry *Registry, action string) bool
- func (profile Profile) Validate(registry *Registry) error
- type Registry
Constants ¶
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) RequiresGovernedReceive ¶
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func New ¶
func New(definitions []Definition) (*Registry, error)
func (*Registry) CanonicalName ¶
func (*Registry) Definitions ¶
func (registry *Registry) Definitions() []Definition