Documentation
¶
Overview ¶
Package submit builds and validates the anonymous result files that feed the public map (results/AS<asn>/<date>-<id>.json).
A submission contains only: tool version, date (day precision), ASN, provider name, country, coarse region, connection type and per-target verdicts. No IP addresses, hostnames of the user, timings or raw data.
Index ¶
Constants ¶
const MaxSize = 64 << 10
MaxSize bounds a submission file.
const Schema = "prosvet.submission/v1"
Schema identifies the submission format.
Variables ¶
var ( ErrNoASN = errors.New("the provider (ASN) is unknown: run the scan with network detection or pass --asn") ErrVPN = errors.New("a VPN or proxy seems active: the result would describe the VPN exit, not your provider") ErrDemo = errors.New("demo reports cannot be submitted") ErrEmpty = errors.New("the report contains no results") )
Errors returned by Build.
Functions ¶
func IssueURL ¶
func IssueURL() string
IssueURL is the GitHub form for submitting a result file without git.
func Marshal ¶
func Marshal(s *Submission) ([]byte, error)
Marshal encodes the submission canonically.
func Path ¶
func Path(dir string, s *Submission) string
Path returns the repository path for s, e.g. results/AS12389/2026-10-11-1a2b3c.json.
Types ¶
type DNSSummary ¶
type DNSSummary struct {
Findings []string `json:"findings,omitempty"`
}
DNSSummary lists DNS finding kinds.
type Network ¶
type Network struct {
ASN int `json:"asn"`
ISP string `json:"isp,omitempty"`
Country string `json:"country,omitempty"`
Region string `json:"region,omitempty"`
Conn string `json:"conn"`
}
Network is the anonymised network description.
type Result ¶
type Result struct {
Target string `json:"target"`
Category string `json:"category"`
Status model.Status `json:"status"`
Kind model.Kind `json:"kind"`
Subtype string `json:"subtype,omitempty"`
Confidence model.Confidence `json:"confidence"`
Secondary []model.Kind `json:"secondary,omitempty"`
StallKB float64 `json:"stall_kb,omitempty"`
}
Result is the verdict for one target.
type Submission ¶
type Submission struct {
Schema string `json:"schema"`
Tool Tool `json:"tool"`
Date string `json:"date"`
Network Network `json:"network"`
Results []Result `json:"results"`
Whitelist *Whitelist `json:"whitelist,omitempty"`
DNS *DNSSummary `json:"dns,omitempty"`
}
Submission is the anonymous result file.
type Whitelist ¶
type Whitelist struct {
Verdict string `json:"verdict"`
DomesticOK int `json:"domestic_ok"`
DomesticTotal int `json:"domestic_total"`
ForeignOK int `json:"foreign_ok"`
ForeignTotal int `json:"foreign_total"`
Level string `json:"level,omitempty"`
}
Whitelist is the whitelist-mode summary.