engine

package
v0.1.0-beta Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package engine owns scan execution.

Commands parse and render. Discovery acquires facts. Providers construct plans. This package is the only place that validates, authorises, runs and merges those plans, so a backend cannot take a quieter execution path merely because it was found through a different channel.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Validate

func Validate(req Request) error

Validate checks every statically constructible workload without running it. Commands use this before creating a network client; dynamically detected providers are checked by Run immediately before their first stage.

Types

type ApplicationTarget

type ApplicationTarget struct {
	Site            string
	HARFiles        []string
	AllowedOrigins  []string
	Web             *client.Client
	Limiter         *client.Limiter
	Timeout         time.Duration
	Concurrency     int
	MaxBundles      int
	MaxRoutes       int
	MaxBypassRoutes int
	UserAgent       string
	Redact          bool
	AllowPOST       bool
	WriteConsent    bool
	NoResidue       bool
	SkipRoutes      bool
	RouteParams     []string
	Principals      []string
}

ApplicationTarget is provider-neutral application route configuration. engine owns the backend/application adapter so commands do not construct a second kind of scan plan beside provider plans.

type ProviderTarget

type ProviderTarget struct {
	Detection provider.Detection
	Inputs    scan.Inputs
	Consent   scan.Consent
}

ProviderTarget asks the registry to construct a workload for a detection. Inputs carry the shared transport, discovered vocabulary and operator controls; no command package needs to know which stages result.

type Report

type Report struct {
	Findings []finding.Finding
	Access   scan.Access
	// Coverage is keyed by workload id. Absence means the workload published no
	// coverage statement; it must never be interpreted as zero coverage.
	Coverage    map[string]scan.Coverage
	Spending    []scan.StageSpend
	Requests    int
	Ran         []string
	Application scan.ApplicationCoverage
	Interrupted bool
	Worst       finding.Severity
	Blind       []string
}

Report is the provider-neutral result of execution.

func Finalize

func Finalize(r Report, add ...finding.Finding) Report

Finalize applies the report contract after any caller-owned summary facts have been added. Rendering remains an edge concern; ordering, deduplication, exit severity and coverage blindness do not.

func Run

func Run(ctx context.Context, req Request) Report

Run validates, authorises and executes every requested surface.

A broken workload does not discard valid findings from its siblings. Its failure becomes a not-assessed finding and execution continues, matching the scanner's central rule that silence must never masquerade as a clean result.

type Request

type Request struct {
	Target string
	// Findings are acquisition or lifecycle facts produced before execution.
	// Including them here gives interruption attribution, sorting and dedup one
	// owner instead of leaving early command paths with different semantics.
	Findings    []finding.Finding
	Intent      *intent.Manifest
	Application *ApplicationTarget
	Workloads   []Workload
	Providers   []ProviderTarget
	OnNote      func(scan.Note)
}

Request is a complete execution request. Workloads cover provider-neutral surfaces; Providers cover registered backends. Both pass through the same validation and merge path.

type Workload

type Workload struct {
	ID       string
	Target   string
	Stages   []scan.Stage
	Consent  scan.Consent
	Findings []finding.Finding
	Stopped  bool
}

Workload is one independently planned surface, such as application routes or one detected backend instance.

Jump to

Keyboard shortcuts

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