Documentation
¶
Overview ¶
Package verify implements attestation verification orchestration, extracted from cmd/teep for testability. Run is the primary entry point.
Index ¶
- Variables
- func CompareReports(captured, reverify string) error
- func FormatReport(r *attestation.VerificationReport) string
- func PrintReportDiff(a, b string)
- func Replay(ctx context.Context, captureDir string, cfgLoader CfgLoader) (report *attestation.VerificationReport, reportText string, err error)
- func Run(ctx context.Context, opts *Options) (report *attestation.VerificationReport, retErr error)
- type CfgLoader
- type Options
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 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.