Documentation
¶
Overview ¶
Package connector defines the SPI for execution connectors.
A connector bridges the control plane to an external system — a payment processor, a git provider, a calendar service, etc. When the policy engine allows an action (or a human approves it), the control plane selects the appropriate connector and calls Execute.
Each connector implementation is responsible for one external system. The SPI is intentionally narrow: connectors receive a bounded execution request and return a result. Credential injection and parameter bounding happen in the control plane before the connector is called.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connector ¶
type Connector interface {
// Type returns the connector type identifier (e.g. "payments", "git",
// "calendar"). Used by the registry to route execution requests.
Type() string
// Provider returns the specific provider name (e.g. "stripe", "github",
// "google_calendar"). Multiple connectors may share a Type.
Provider() string
// Execute runs the action described by the request.
Execute(ctx context.Context, req ExecutionRequest) (ExecutionResult, error)
}
Connector executes an approved action against an external system.
type ExecutionRequest ¶
type ExecutionRequest struct {
GrantID string
IntentID string
ConnectorID string
// ActionType is the dot-namespaced action, e.g. "payment.charge".
ActionType string
// Parameters are the bounded, approved parameters for execution.
// These are constrained by the execution grant and may differ from
// the original intent if a human modified them during approval.
Parameters map[string]any
// Credential is the injected secret for this connector, resolved from
// the vault. Connectors must not store or log this value.
Credential *InjectedCredential
}
ExecutionRequest is passed to a connector when executing an approved action.
type ExecutionResult ¶
type ExecutionResult struct {
Status ExecutionStatus
Output map[string]any
ReceiptRef string
Error string
}
ExecutionResult is returned by a connector after execution.
type ExecutionStatus ¶
type ExecutionStatus string
ExecutionStatus is the outcome of a connector execution.
const ( ExecutionStatusSucceeded ExecutionStatus = "succeeded" ExecutionStatusFailed ExecutionStatus = "failed" ExecutionStatusCancelled ExecutionStatus = "cancelled" )
type InjectedCredential ¶
InjectedCredential carries a resolved secret for use during execution. Connectors receive this transiently and must not persist it.