Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add flag for publish results to board #693

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion ssllabs-scan-v3.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ var globalMaxAge = 0

var globalInsecure = false

var globalPublish = false

var httpClient *http.Client

type LabsError struct {
Expand Down Expand Up @@ -635,6 +637,10 @@ func invokeAnalyze(host string, startNew bool, fromCache bool) (*LabsReport, err
command = command + "&ignoreMismatch=on"
}

if globalPublish {
command = command + "&publish=on"
}

resp, body, err := invokeApi(command)
if err != nil {
return nil, err
Expand Down Expand Up @@ -1043,9 +1049,14 @@ func main() {
var conf_maxage = flag.Int("maxage", 0, "Maximum acceptable age of cached results, in hours. A zero value is ignored.")
var conf_verbosity = flag.String("verbosity", "info", "Configure log verbosity: error, notice, info, debug, or trace.")
var conf_version = flag.Bool("version", false, "Print version and API location information and exit")
var conf_publish = flag.Bool("publish", false, "If assessment results should be published on the public results boards.")

flag.Parse()

if *conf_publish {
globalPublish = *conf_publish
}

if *conf_version {
fmt.Println(USER_AGENT)
fmt.Println("API location: " + apiLocation)
Expand Down Expand Up @@ -1173,7 +1184,7 @@ func main() {
fmt.Println(",")
}
fmt.Println(results)

}
fmt.Println("]")
}
Expand Down