federationcontrol

package
v0.39.9 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Overview

Package federationcontrol binds the existing StackKits server to Home-issued Federation actions. It owns no fabric, provider lifecycle or identity issuer.

Index

Constants

View Source
const ActionPath = "/api/v1/federation/control/actions"
View Source
const ActionSchema = "stackkit.federation-remote-action/v1"
View Source
const StatusPath = "/api/v1/federation/control/status"

Variables

This section is empty.

Functions

func BindReceiver

func BindReceiver(root string, c ReceiverCustody) error

func Handler

func Handler(root string) http.Handler

Handler never substitutes forwarded certificates or ordinary API credentials for live TLS proof. Its journal is durable before dispatch and survives a server restart; an interrupted command remains consumed and fails closed.

func NewServer

func NewServer(root, address string) (*http.Server, error)

NewServer is mounted by the existing stackkit-server process. It is a Cloud receiver for Home-initiated requests, not a Cloud-to-Home management tunnel.

func WithdrawReceiver

func WithdrawReceiver(root string) error

Types

type Action

type Action struct {
	Schema              string                                  `json:"schema"`
	Action              string                                  `json:"action"`
	Nonce               string                                  `json:"nonce"`
	IdempotencyKey      string                                  `json:"idempotencyKey"`
	PlanHash            string                                  `json:"planHash"`
	OwnerRef            string                                  `json:"ownerRef"`
	HomeSiteRef         string                                  `json:"homeSiteRef"`
	TargetSiteRef       string                                  `json:"targetSiteRef"`
	TargetNodeRef       string                                  `json:"targetNodeRef"`
	ExecutionChannelRef string                                  `json:"executionChannelRef"`
	IssuedAt            time.Time                               `json:"issuedAt"`
	ExpiresAt           time.Time                               `json:"expiresAt"`
	Approval            json.RawMessage                         `json:"approval,omitempty"`
	Signature           localevidence.OwnerPolicyStateSignature `json:"signature"`
}

Action is the closed CUE remote-action envelope. Approval is preserved for the separate Home human-authentication verifier; this slice admits no mutation.

func DecodeAction

func DecodeAction(raw []byte) (Action, error)

func SignAction

func SignAction(root string, a Action) (Action, error)

func (Action) Digest

func (a Action) Digest() string

Digest excludes the approval and signature so human approval binds the action independently of its receipt. The action signature includes the approval.

type Denial

type Denial struct {
	ErrorCode    string `json:"error_code"`
	ReasonCode   string `json:"reason_code"`
	Retryable    bool   `json:"retryable"`
	UserGuidance string `json:"user_guidance"`
}

func (*Denial) Error

func (d *Denial) Error() string

type Endpoint

type Endpoint struct {
	URL                     string `json:"url"`
	ServerCertificateSHA256 string `json:"serverCertificateSHA256"`
	RootCertificatePath     string `json:"rootCertificatePath"`
	CertificatePath         string `json:"certificatePath"`
	PrivateKeyPath          string `json:"privateKeyPath"`
}

Endpoint is selected locally by Home, never accepted in a remote Action.

type HomeTrust

type HomeTrust struct {
	OwnerRef                string    `json:"ownerRef"`
	KeyID                   string    `json:"keyId"`
	PublicKey               string    `json:"publicKey"`
	HomeSiteRef             string    `json:"homeSiteRef"`
	ClientCertificateSHA256 string    `json:"clientCertificateSHA256"`
	RootCertificatePEM      string    `json:"rootCertificatePEM"`
	ValidUntil              time.Time `json:"validUntil"`
}

HomeTrust is explicit public custody admitted at Cloud. Withdrawing or replacing it takes effect on every request, including an existing TLS socket.

type ReceiverCustody

type ReceiverCustody struct {
	Trust             HomeTrust                                              `json:"trust"`
	Policy            runtimeexecutorlocal.FederationControlAgentApplyPolicy `json:"policy"`
	PlanPath          string                                                 `json:"planPath"`
	PlanHash          string                                                 `json:"planHash"`
	Executable        string                                                 `json:"executable"`
	ExecutableSHA256  string                                                 `json:"executableSHA256"`
	ExecutableVersion string                                                 `json:"executableVersion"`
	ServerName        string                                                 `json:"serverName"`
	CertificatePath   string                                                 `json:"certificatePath"`
	PrivateKeyPath    string                                                 `json:"privateKeyPath"`
	Active            bool                                                   `json:"active"`
}

ReceiverCustody supplies local handles only. It is never an Action payload. TLS keys are externally issued and held in confined files, not transported in this record or in an action. Only the selected Cloud node may receive.

type Result

type Result struct {
	Schema             string          `json:"schema"`
	ActionDigest       string          `json:"actionDigest"`
	Action             string          `json:"action"`
	PlanHash           string          `json:"planHash"`
	Status             string          `json:"status"`
	ObservedAt         time.Time       `json:"observedAt"`
	Output             json.RawMessage `json:"output,omitempty"`
	ReasonCode         string          `json:"reasonCode,omitempty"`
	MutateCapabilities string          `json:"mutateCapabilities"`
}

func SendAction

func SendAction(ctx context.Context, root string, e Endpoint, a Action) (Result, error)

Jump to

Keyboard shortcuts

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