Documentation
¶
Index ¶
- Constants
- Variables
- func Approved(p Profile, now time.Time) bool
- func ValidDigest(value string) bool
- func Validate(p Profile) error
- type Authorized
- type Dispatcher
- type Event
- type Executor
- type Input
- type Launcher
- type Profile
- type ProfileSpec
- type ReportInput
- type Result
- type SandboxLauncher
- type Service
- func (s *Service) Approve(ctx context.Context, session auth.Session, org, id, evidence string, ...) (Profile, error)
- func (s *Service) Bind(ctx context.Context, tx pgx.Tx, org, id string, version int64) (Profile, error)
- func (s *Service) Create(ctx context.Context, session auth.Session, org string, in Profile, ...) (Profile, error)
- func (s *Service) Get(ctx context.Context, session auth.Session, org, id string) (Profile, error)
- func (s *Service) List(ctx context.Context, session auth.Session, org, cursor string, limit int) (domain.Page[Profile], error)
- func (s *Service) Revoke(ctx context.Context, session auth.Session, org, id string, expected int64, ...) (Profile, error)
- type Spec
- type Usage
Constants ¶
View Source
const ProtocolVersion = 1
Variables ¶
View Source
var ( ErrInvalid = errors.New("custom command profile is invalid") ErrNotApproved = errors.New("custom command profile is not approved") ErrProtocol = errors.New("custom command protocol violation") ErrCapacity = errors.New("custom command profile concurrency exhausted") ErrNoProfile = errors.New("task is not bound to a custom command profile") )
Functions ¶
func ValidDigest ¶
Types ¶
type Authorized ¶
type Authorized struct {
RunID string `json:"run_id"`
Profile ProfileSpec `json:"profile"`
}
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
func NewDispatcher ¶
func (*Dispatcher) Authorize ¶
func (d *Dispatcher) Authorize(ctx context.Context, credential string) (Authorized, error)
func (*Dispatcher) Report ¶
func (d *Dispatcher) Report(ctx context.Context, credential string, in ReportInput) (Authorized, error)
type Event ¶
type Event struct {
Type string `json:"type"`
Message string `json:"message,omitempty"`
Data json.RawMessage `json:"data,omitempty"`
}
type Executor ¶
type Executor struct {
// contains filtered or unexported fields
}
func NewExecutor ¶
type Profile ¶
type Profile struct {
ID string `json:"id"`
Name string `json:"name"`
Version int64 `json:"version"`
ImageDigest string `json:"image_digest"`
Executable string `json:"executable"`
Argv []string `json:"argv"`
ProtocolVersion int `json:"protocol_version"`
MaxWallSeconds int `json:"max_wall_seconds"`
MaxOutputBytes int64 `json:"max_output_bytes"`
MaxTurns int `json:"max_turns"`
Concurrency int `json:"concurrency"`
ApprovalEvidence string `json:"approval_evidence"`
ApprovedBy string `json:"approved_by,omitempty"`
ApprovedAt *time.Time `json:"approved_at,omitempty"`
RevokedAt *time.Time `json:"revoked_at,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
type ProfileSpec ¶
type ProfileSpec struct {
ID string `json:"id"`
Version int64 `json:"version"`
ImageDigest string `json:"image_digest"`
Executable string `json:"executable"`
Argv []string `json:"argv"`
ProtocolVersion int `json:"protocol_version"`
MaxWallSeconds int `json:"max_wall_seconds"`
MaxOutputBytes int64 `json:"max_output_bytes"`
MaxTurns int `json:"max_turns"`
Concurrency int `json:"concurrency"`
}
func SpecFromProfile ¶
func SpecFromProfile(p Profile) ProfileSpec
type ReportInput ¶
type SandboxLauncher ¶
type SandboxLauncher struct {
Runtime sandbox.SandboxRuntime
}
func (SandboxLauncher) Launch ¶
func (l SandboxLauncher) Launch(ctx context.Context, spec Spec) (sandbox.CommandResult, error)
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Click to show internal directories.
Click to hide internal directories.