verify

package
v0.0.0-...-d3a3bb4 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2026 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Overview

Package verify implements attestation verification orchestration, extracted from cmd/teep for testability. Run is the primary entry point.

Index

Constants

This section is empty.

Variables

View Source
var ProviderEnvVars = map[string]string{
	"venice":     "VENICE_API_KEY",
	"neardirect": "NEARAI_API_KEY",
	"nearcloud":  "NEARAI_API_KEY",
	"nanogpt":    "NANOGPT_API_KEY",
	"phalacloud": "PHALA_API_KEY",
	"chutes":     "CHUTES_API_KEY",
}

ProviderEnvVars maps provider names to their API key environment variables.

Functions

func CompareReports

func CompareReports(captured, reverify string) error

CompareReports compares two formatted report strings exactly. On mismatch, prints a line-by-line diff to stderr and returns an error.

func FormatReport

func FormatReport(r *attestation.VerificationReport) string

FormatReport renders a VerificationReport as a human-readable string.

func PrintReportDiff

func PrintReportDiff(a, b string)

PrintReportDiff prints a positional line-by-line diff. This is correct because both reports are produced by FormatReport over the same factor list — lines cannot shift, only change in content.

func Replay

func Replay(ctx context.Context, captureDir string, cfgLoader CfgLoader) (report *attestation.VerificationReport, reportText string, err error)

Replay loads a capture directory, replays all HTTP traffic, and returns the verification report and formatted text.

func Run

func Run(ctx context.Context, opts *Options) (report *attestation.VerificationReport, retErr error)

Run loads the attester, fetches attestation, verifies TDX/NVIDIA/PoC, runs E2EE test, builds and returns the report.

When opts.CaptureDir is non-empty, all attestation HTTP traffic is recorded and saved there (the E2EE self-test uses its own transport and is not captured). When opts.Client is non-nil, it replaces the default attestation client (used for replay). When opts.Nonce is non-zero, it replaces the generated nonce.

Types

type CfgLoader

type CfgLoader func(providerName string) (*config.Config, *config.Provider, error)

CfgLoader loads config and provider for the named provider.

type Options

type Options struct {
	Config         *config.Config
	Provider       *config.Provider
	ProviderName   string
	ModelName      string
	CaptureDir     string
	Offline        bool
	Client         *http.Client                // nil = use default
	Nonce          attestation.Nonce           // zero = generate new
	CapturedE2EE   *attestation.E2EETestResult // nil = run live test
	NVIDIAVerifier *attestation.NVIDIAVerifier // nil = use default
}

Options holds all parameters for Run.

Jump to

Keyboard shortcuts

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