verify

package
v0.39.9 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

Package verify implements post-deployment StackKit verification.

Index

Constants

View Source
const (
	HTTPProbeVantage = "verifier-host"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AccessService

type AccessService struct {
	Key         string `json:"key"`
	URL         string `json:"url"`
	ServiceRef  string `json:"serviceRef,omitempty"`
	RouteRef    string `json:"routeRef,omitempty"`
	WorkloadRef string `json:"workloadRef,omitempty"`
}

AccessService is a routable service endpoint.

type AccessSummary

type AccessSummary struct {
	Services []AccessService `json:"services"`
}

AccessSummary is the subset of command access metadata needed by verify.

type Check

type Check struct {
	Name    string `json:"name"`
	Status  Status `json:"status"`
	Target  string `json:"target,omitempty"`
	Message string `json:"message"`
}

Check is one post-deployment verification assertion.

type DockerClient

type DockerClient interface {
	IsInstalled() bool
	IsRunning(context.Context) bool
	GetStackKitContainers(context.Context) ([]docker.ContainerInfo, error)
	GetContainerHealth(context.Context, string) (models.HealthStatus, error)
}

DockerClient is the Docker surface needed by the verifier.

type HTTPRouteProbe

type HTTPRouteProbe struct {
	Vantage      string    `json:"vantage"`
	Key          string    `json:"key"`
	ServiceRef   string    `json:"serviceRef,omitempty"`
	RouteRef     string    `json:"routeRef,omitempty"`
	WorkloadRef  string    `json:"workloadRef,omitempty"`
	URL          string    `json:"url"`
	Method       string    `json:"method"`
	Reached      bool      `json:"reached"`
	StatusCode   int       `json:"statusCode,omitempty"`
	ObservedAt   time.Time `json:"observedAt"`
	FailureClass string    `json:"failureClass,omitempty"`
	Error        string    `json:"error,omitempty"`
}

HTTPRouteProbe is the reusable transport result consumed by both the legacy verify report and the native runtime-observation projection. The caller supplies only access-manifest targets; this package never discovers or invents routes.

func ProbeHTTPRoutes

func ProbeHTTPRoutes(ctx context.Context, access *AccessSummary, client *http.Client) ([]HTTPRouteProbe, error)

ProbeHTTPRoutes performs bounded GET requests using the verifier host as the sole vantage. Redirects must remain on the same authority and HTTPS cannot be downgraded. A per-request result preserves failed probes so a caller can expose an honest unverified/blocked projection for each route.

type Input

type Input struct {
	Spec    *models.StackSpec
	State   *models.DeploymentState
	Docker  DockerClient
	Access  *AccessSummary
	Options Options
	HTTP    *http.Client
}

Input holds all dependencies and state for a local verification run.

type Options

type Options struct {
	Strict bool
	HTTP   bool
}

Options controls optional verification surfaces.

type Report

type Report struct {
	Status      Status    `json:"status"`
	StackKit    string    `json:"stackkit,omitempty"`
	Mode        string    `json:"mode,omitempty"`
	Remote      bool      `json:"remote,omitempty"`
	TargetHost  string    `json:"targetHost,omitempty"`
	GeneratedAt time.Time `json:"generatedAt"`
	Checks      []Check   `json:"checks"`
}

Report is the machine-readable output of a verify run.

func RunLocal

func RunLocal(ctx context.Context, input Input) Report

RunLocal verifies a StackKit deployment from the host where the deployment runs.

type Status

type Status string

Status is the verification result for a report or individual check.

const (
	StatusPass Status = "pass"
	StatusWarn Status = "warn"
	StatusFail Status = "fail"
)

Jump to

Keyboard shortcuts

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