verify

package
v0.1.0-dev.20260819172655 Latest Latest
Warning

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

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package verify implements `writ verify` — publisher-signature verification for graph and trace documents (phase-8 step 46).

Each document is decoded (a graph loads through op.LoadGraph, whose integrity check also validates the checksum; a trace decodes directly), re-canonicalized, and verified under the settled model: a raw ssh-ed25519 signature over the namespace-prefixed canonical bytes, the publisher resolved against the verifier's `allowed_signers`. What happens to each outcome is the signing.Policy ladder — the command reports every verdict and exits non-zero only when the policy rejects a document.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(ctx context.Context, cfg *Config) error

Execute verifies every document and presents the reports.

Parameters:

  • `ctx`: the context for graph loading.
  • `cfg`: the resolved verify configuration.

Returns:

  • `error`: non-nil when a document cannot be read/decoded, or when the policy rejects any document.

Types

type Config

type Config struct {

	// Paths are the documents to verify.
	Paths []string

	// Policy governs what each verdict does to the exit status.
	Policy signing.Policy

	// AllowedSigners overrides the trust-list path; "" uses the default (`<config>/devlore/allowed_signers`).
	AllowedSigners string

	// JSON emits the reports as JSON instead of human-readable text.
	JSON bool
}

Config carries the resolved settings for one verify invocation.

type Report

type Report struct {

	// Path is the document as given.
	Path string `json:"path"`

	// Kind is "graph" or "trace".
	Kind string `json:"kind"`

	// Outcome is the verification classification.
	Outcome string `json:"outcome"`

	// Principal is the trusted publisher identity when valid.
	Principal string `json:"principal,omitempty"`

	// External marks a document from outside this machine's own store.
	External bool `json:"external"`

	// Detail elaborates non-valid outcomes.
	Detail string `json:"detail,omitempty"`

	// Rejected marks a document the policy refused.
	Rejected bool `json:"rejected,omitempty"`
}

Report is one document's verification report.

Jump to

Keyboard shortcuts

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