test(05-03): add failing tests for HTTPVerifier single-key verification
- 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
This commit is contained in:
29
pkg/verify/result.go
Normal file
29
pkg/verify/result.go
Normal file
@@ -0,0 +1,29 @@
|
||||
// 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
|
||||
}
|
||||
Reference in New Issue
Block a user