Documentation
¶
Overview ¶
Package hrtest is a fake HostRepute (API and OAuth server) for tests. It answers with the demo data and checks what ReputeCast sends: the bearer token, the PKCE verifier, and that only domains and IPs are submitted.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fake ¶
type Fake struct {
*httptest.Server
// Token is the API key or access token the fake accepts.
Token string
// Monitored assets and the plan's limit (0 = unlimited).
Monitored []string
Limit int
// Down answers 503 to every call; Revoked answers 401.
Down, Revoked bool
// Alerts are returned by /alerts (the demo's when nil).
Alerts []hostrepute.Alert
// Revocations counts token revocations (disconnect).
Revocations int
// Requests logs "METHOD path" of every call.
Requests []string
// Bodies logs request bodies of POST calls.
Bodies []string
// contains filtered or unexported fields
}
Fake is a running fake HostRepute.
Click to show internal directories.
Click to hide internal directories.