- 10 test cases covering live/dead/rate-limited/unknown/error classification
- Key substitution in header/body/URL via {{KEY}} template
- JSON metadata extraction via gjson paths
- HTTPS-only enforcement and per-call timeout
30 lines
905 B
Go
30 lines
905 B
Go
// Package verify provides active API key verification by calling provider
|
|
// verify endpoints (driven by the YAML VerifySpec) and classifying the
|
|
// response into live/dead/rate_limited/error/unknown states.
|
|
package verify
|
|
|
|
import "time"
|
|
|
|
// Status constants for Result.Status.
|
|
const (
|
|
StatusLive = "live"
|
|
StatusDead = "dead"
|
|
StatusRateLimited = "rate_limited"
|
|
StatusError = "error"
|
|
StatusUnknown = "unknown"
|
|
)
|
|
|
|
// Result is the outcome of verifying a single finding against its provider's
|
|
// verify endpoint. Verify never returns a Go error — transport, timeout, and
|
|
// classification failures are all encoded into the Result.
|
|
type Result struct {
|
|
ProviderName string
|
|
KeyMasked string
|
|
Status string // one of the Status* constants
|
|
HTTPCode int
|
|
Metadata map[string]string
|
|
RetryAfter time.Duration
|
|
ResponseTime time.Duration
|
|
Error string
|
|
}
|