Documentation
¶
Overview ¶
Package workload resolves a service-owned declarative release against platform-owned capabilities. A manifest is data, never Go, shell, an executor ID or a credential.
Index ¶
- func Bind(raw []byte, p Policy, steps map[Capability][]workflow.Step) ([]workflow.Step, error)
- type Call
- type Capability
- type Declaration
- type EntryKey
- type Policy
- type Registration
- type Registry
- type Release
- type Step
- type TenantContext
- func (t TenantContext) BindRelease(raw []byte) ([]Step, error)
- func (t TenantContext) Call(op Capability) (Call, error)
- func (t TenantContext) ID() TenantID
- func (t TenantContext) NewPipeline(s *core.Stack, name string, p workflow.PipelineProps, workers Workers, ...) (*workflow.Pipeline, error)
- func (t TenantContext) NewReleaseEntry(s *core.Stack, p workflow.EntryProps) (*workflow.Pipeline, error)
- type TenantID
- type Workers
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Call ¶
type Call struct {
// contains filtered or unexported fields
}
Call is a logical invocation, independent of worker placement. It carries its tenant even when the worker calls another worker. There is no override argument.
func (Call) Call ¶
func (c Call) Call(op Capability) (Call, error)
Call invokes another worker under the same tenant and its own operation grant.
func (Call) Operation ¶
func (c Call) Operation() Capability
type Capability ¶
type Capability string
const ( GetState Capability = "get_state" RecordSuccess Capability = "record_success" SourceFetch Capability = "source_fetch" WorkflowDeploy Capability = "workflow_deploy" )
const ( LXC Capability = "deploy_lxc" Compose Capability = "deploy_compose" Docker Capability = "deploy_docker" Native Capability = "deploy_native" Routes Capability = "route_deploy" // OIDC provisions the service's identity-provider client before its // application step. Version 2 (tenant) releases only. OIDC Capability = "oidc_client" )
type Declaration ¶
type Declaration struct {
Version int `json:"version"`
Service string `json:"service"`
Steps []Capability `json:"steps"`
}
Declaration is the repository-owned, target-free v2 service manifest. Platform-owned source, plan, approval and verification cannot be supplied or removed by this document.
func NewDeclaration ¶
func NewDeclaration(service string, steps ...Capability) (Declaration, error)
type EntryKey ¶
EntryKey identifies a registered release entry for a verified source repository. The runtime adapter obtains both fields from authoritative records, never job data.
type Policy ¶
type Policy struct {
Service, Target string
Allowed []Capability
}
Policy is set by arch, not the service. Only known hosts and capabilities may bind.
type Registration ¶
type Registration struct {
EntryKey
PipelineID, Environment, Service string
Grants []Capability
}
Registration is platform-owned. PipelineID and Environment are immutable logical identity components; neither an executor, event ID, release SHA nor job ID belongs here.
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
Registry is an immutable snapshot. Instantiate once for all pipeline environments.
func NewRegistry ¶
func NewRegistry(registrations ...Registration) (Registry, error)
func (Registry) Admit ¶
func (r Registry) Admit(verified EntryKey) (TenantContext, error)
Admit looks up a verified release entry. This is policy lookup, not OIDC verification.
func (Registry) Authorize ¶
func (r Registry) Authorize(verified EntryKey, expected Capability, hints map[string]string) (Call, error)
Authorize checks the hints on a concrete graph edge against trusted job ancestry and the receiving worker's configured operation. A direct start (no verified entry), foreign tenant, ungranted operation or relabelled edge returns no call. The adapter must verify the actual invoking graph/node as well as the entry; this library does not authenticate xyOps job records.
type Release ¶
type Release struct {
Version int `json:"version"`
Service string `json:"service"`
Target string `json:"target"`
Steps []Capability `json:"steps"`
}
type Step ¶
type Step struct {
// contains filtered or unexported fields
}
Step is either a checked application worker call or a local orchestration step. Worker event references are resolved only when lowering to xyOps.
type TenantContext ¶
type TenantContext struct {
// contains filtered or unexported fields
}
TenantContext can only be obtained from an admitted registration or inherited from a call. It is not a serializable bearer credential.
func (TenantContext) BindRelease ¶
func (t TenantContext) BindRelease(raw []byte) ([]Step, error)
BindRelease admits the portable v2 service manifest, which has no target, tenant, worker IDs, state paths or credentials. Source verification and plan/approval are still the caller's responsibility. As with legacy Bind, an invalid release returns no partial steps.
func (TenantContext) Call ¶
func (t TenantContext) Call(op Capability) (Call, error)
func (TenantContext) ID ¶
func (t TenantContext) ID() TenantID
func (TenantContext) NewPipeline ¶
func (t TenantContext) NewPipeline(s *core.Stack, name string, p workflow.PipelineProps, workers Workers, graph ...Step) (*workflow.Pipeline, error)
NewPipeline compiles graph steps under one admitted tenant. It refuses foreign calls, unbound events and legacy/unscoped steps before creating any resources.
func (TenantContext) NewReleaseEntry ¶
func (t TenantContext) NewReleaseEntry(s *core.Stack, p workflow.EntryProps) (*workflow.Pipeline, error)
NewReleaseEntry builds the usual success-only definitions -> body admission graph. Both edges carry the admitted tenant; the installer requires its own grant.
type TenantID ¶
type TenantID struct {
// contains filtered or unexported fields
}
TenantID is a comparable, portable key for platform resource and state lookup. Its zero value is not a tenant. Identifiers are validated before admission.
func (TenantID) Environment ¶
func (TenantID) PipelineID ¶
type Workers ¶
type Workers map[Capability]xyops.EventRef
Workers is the reviewed, site-specific operation dispatch table. Relocating a worker does not change a tenant, a release, or the logical call graph.