Documentation
¶
Overview ¶
Package verify is the fifth pipeline stage: it checks keys with read-only, registry-declared requests through netx and sets status, status_reason and verify_evidence. It never calls a generation, revoke or rotate endpoint.
Index ¶
Constants ¶
const ( // ReasonSuppressed: the finding is suppressed, so it is not verified. ReasonSuppressed = "suppressed" // ReasonVerificationOff: verification is not available or turned off. ReasonVerificationOff = "verification_off" // ReasonUnpaired: the primary part of a multi-part credential was found without // its partners, so it cannot be verified. ReasonUnpaired = "unpaired" // ReasonNoVerifySpec: the provider or pattern has no verify block. ReasonNoVerifySpec = "no_verify_spec" // ReasonUnexpectedResponse: the response status matched neither live_when nor // dead_when, or the request could not be built from the registry block. ReasonUnexpectedResponse = "unexpected_response" // ReasonRedirect: the provider answered with a redirect, which is never followed. ReasonRedirect = "redirect" // ReasonTimeout: the call did not finish within the verify timeout. ReasonTimeout = "timeout" // ReasonNetworkError: any other transport failure. ReasonNetworkError = "network_error" // ReasonRateLimited: the provider kept answering 429 after every retry. ReasonRateLimited = "rate_limited" )
Status reasons set by the verify adapters.
const Live = "live"
Live is the name of the adapter that verifies keys with read-only calls.
const Off = "off"
Off is the name of the adapter used while verification is off.
Variables ¶
This section is empty.
Functions ¶
func Describe ¶
Describe returns the host and a short note that tell a reader how the provider's keys are checked, for Report providers.<id>.verify_host and verify_note. It uses the provider verify block, else the first pattern block, and reports ok false for a provider without one. A templated host is shown with a "*" label (for example "*.openai.azure.com"). The note is "read-only <METHOD> call to <host> (<words of the last URL path segment>)".
Types ¶
type Options ¶
type Options struct {
// Registry supplies the verify blocks (nil: the embedded registry).
Registry *registry.Registry
// Network configures the netx client of purpose verify (proxy, CA bundle and the
// DialAddrs test hook). Its Timeout is replaced by Timeout.
Network netx.Config
// AllowHosts are extra allowlist entries; entries that are not valid netx host
// patterns are skipped. Requests are still built only from the registry.
AllowHosts []string
// Timeout bounds one verify call (default 10s).
Timeout time.Duration
// MaxConcurrency caps concurrent verify calls (default 8).
MaxConcurrency int
// Clock replaces time.Now for rate limiting and SigV4 signing (tests).
Clock func() time.Time
// Sleeper replaces the context-aware sleep used by backoff and rate limiting
// (tests). It returns the context error when ctx ends first.
Sleeper func(ctx context.Context, d time.Duration) error
}
Options configures a verifier. The zero value is valid for the off adapter; the live adapter needs only Registry (nil means the embedded snapshot).