Documentation
¶
Overview ¶
Package exercise verifies observations of Beacon's deliberately failing drill endpoint. An observation is evidence that a location saw the deliberate response, independent of alert origin.
Index ¶
- Constants
- func Assignment(labels map[string]string) string
- func Endpoint(publicURL string) string
- type Authority
- func (a *Authority) Accept(run Run, token string, target Target, location, credential string, ...) (Observation, bool)
- func (a *Authority) Issue(run Run, target Target, location, credential string, now time.Time) *Challenge
- func (a *Authority) Respond(run Run, token, host, sample string, now time.Time) string
- type Challenge
- type Observation
- type Run
- type Target
Constants ¶
const ( Path = "/drill/healthz" ChallengeHeader = "X-Beacon-Exercise-Challenge" SampleHeader = "X-Beacon-Exercise-Sample" ReceiptHeader = "X-Beacon-Exercise-Receipt" ObservationPath = "/api/v1/agent/exercise-observations" ActiveAtAnnotation = "beacon_rule_active_at" MaxToken = 2048 // upper bound for an exercise token in either direction )
Variables ¶
This section is empty.
Functions ¶
func Assignment ¶
Assignment identifies the observation's label set as stored by Prometheus-compatible metrics. Empty label values and absent labels identify the same series.
Types ¶
type Authority ¶
type Authority struct {
// contains filtered or unexported fields
}
Authority signs narrowly purposed challenges and receipts with the centre's own key.
func (*Authority) Accept ¶
func (a *Authority) Accept(run Run, token string, target Target, location, credential string, now time.Time) (Observation, bool)
Accept verifies a response under the same authenticated credential and current assignment. The store checks the run again while recording this proof.
type Challenge ¶
type Challenge struct {
Target string `json:"target"`
Module string `json:"module"`
Token string `json:"challenge"`
}
Challenge is an optional addition to the enrolled probe's settings.
type Observation ¶
type Observation struct {
Target
Run string `json:"run"`
Location string `json:"location"`
Sampled time.Time `json:"sample_at"`
Served time.Time `json:"served_at"`
Recorded time.Time `json:"recorded_at"`
}
Observation is a verified report through an enrolled location.