Fix some lint and vet issues
This commit is contained in:
@@ -95,6 +95,7 @@ const htmlTemplate = `<!DOCTYPE html>
|
|||||||
</html>
|
</html>
|
||||||
`
|
`
|
||||||
|
|
||||||
|
// LogV3JSON represents the Certificate Transparency log v3 JSON metadata format
|
||||||
type LogV3JSON struct {
|
type LogV3JSON struct {
|
||||||
Description string `json:"description"`
|
Description string `json:"description"`
|
||||||
SubmissionURL string `json:"submission_url"`
|
SubmissionURL string `json:"submission_url"`
|
||||||
@@ -105,6 +106,7 @@ type LogV3JSON struct {
|
|||||||
MMD int `json:"mmd"`
|
MMD int `json:"mmd"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TemporalInterval represents the time range for a Certificate Transparency log
|
||||||
type TemporalInterval struct {
|
type TemporalInterval struct {
|
||||||
StartInclusive string `json:"start_inclusive"`
|
StartInclusive string `json:"start_inclusive"`
|
||||||
EndExclusive string `json:"end_exclusive"`
|
EndExclusive string `json:"end_exclusive"`
|
||||||
|
@@ -246,13 +246,13 @@ func TestGenerateLogJSONWithStatus(t *testing.T) {
|
|||||||
testTime2, _ := time.Parse("2006-01-02T15:04:05Z", "2025-01-01T00:00:00Z")
|
testTime2, _ := time.Parse("2006-01-02T15:04:05Z", "2025-01-01T00:00:00Z")
|
||||||
|
|
||||||
logEntry := Log{
|
logEntry := Log{
|
||||||
Origin: "test.example.com",
|
Origin: "test.example.com",
|
||||||
SubmissionPrefix: "https://test.example.com/submit",
|
SubmissionPrefix: "https://test.example.com/submit",
|
||||||
MonitoringPrefix: "https://test.example.com/monitor",
|
MonitoringPrefix: "https://test.example.com/monitor",
|
||||||
NotAfterStart: testTime1,
|
NotAfterStart: testTime1,
|
||||||
NotAfterLimit: testTime2,
|
NotAfterLimit: testTime2,
|
||||||
LogID: "dGVzdC1sb2ctaWQ=", // base64 encoded "test-log-id"
|
LogID: "dGVzdC1sb2ctaWQ=", // base64 encoded "test-log-id"
|
||||||
PublicKeyBase64: "dGVzdC1wdWJsaWMta2V5", // base64 encoded "test-public-key"
|
PublicKeyBase64: "dGVzdC1wdWJsaWMta2V5", // base64 encoded "test-public-key"
|
||||||
}
|
}
|
||||||
|
|
||||||
err := generateLogJSONWithStatus(logEntry, outputFile, false, true, false)
|
err := generateLogJSONWithStatus(logEntry, outputFile, false, true, false)
|
||||||
|
@@ -14,6 +14,7 @@ import (
|
|||||||
"gopkg.in/yaml.v3"
|
"gopkg.in/yaml.v3"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Config represents the main YAML configuration structure for tesseract
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Listen []string `yaml:"listen"`
|
Listen []string `yaml:"listen"`
|
||||||
Checkpoints string `yaml:"checkpoints"`
|
Checkpoints string `yaml:"checkpoints"`
|
||||||
@@ -21,6 +22,7 @@ type Config struct {
|
|||||||
Logs []Log `yaml:"logs"`
|
Logs []Log `yaml:"logs"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Log represents a single Certificate Transparency log configuration
|
||||||
type Log struct {
|
type Log struct {
|
||||||
ShortName string `yaml:"shortname"`
|
ShortName string `yaml:"shortname"`
|
||||||
Inception string `yaml:"inception"`
|
Inception string `yaml:"inception"`
|
||||||
|
@@ -70,6 +70,7 @@ const nginxTemplate = `server {
|
|||||||
}
|
}
|
||||||
`
|
`
|
||||||
|
|
||||||
|
// NginxTemplateData contains the data needed to generate nginx configuration files
|
||||||
type NginxTemplateData struct {
|
type NginxTemplateData struct {
|
||||||
MonitoringHost string
|
MonitoringHost string
|
||||||
LocalDirectory string
|
LocalDirectory string
|
||||||
|
@@ -12,6 +12,7 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// CTLogRootsResponse represents the JSON response from a CT log's get-roots endpoint
|
||||||
type CTLogRootsResponse struct {
|
type CTLogRootsResponse struct {
|
||||||
Certificates []string `json:"certificates"`
|
Certificates []string `json:"certificates"`
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user