Documentation
¶
Overview ¶
Package admission is CTO's side of cto.admission/v1: it runs a consumer's selected runner, reads the sandbox report the runner sends before it executes guest code, decides with sandbox.Admit and approves or refuses. The consumer states what it accepts; it never reads the report before execution. See docs/adr-sandboxing.md, section 9.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // exited, or failed before admission). Its diagnostics are in the message. ErrUnavailable = errors.New("unavailable") // ErrTimeout: TimeoutMs ended the run before the runner was admitted. ErrTimeout = errors.New("timeout") // ErrCanceled: the caller canceled the run before the runner was admitted. ErrCanceled = errors.New("canceled") )
Functions ¶
func Code ¶
Code returns the stable code of an error from Run: a sandbox code (invalid, denied, unsupported), unavailable, timeout or canceled.
func Run ¶
func Run(ctx context.Context, request sandbox.AdmissionRequest) (sandbox.AdmissionResult, error)
Run runs request's command under admission. It returns the admitted report and the command's result, or an error whose Code says why nothing ran: no guest code runs unless Admit accepts the report. After approval the command's own failure is a result, not an error.
Types ¶
This section is empty.