Documentation
¶
Index ¶
- Constants
- func AddQueryParameters(baseURL string, queryParams map[string]string) string
- func Version() string
- type Analyze
- type Client
- func (c *Client) GetGrade(site string) (grade string, err error)
- func (c *Client) GetHostHistory(site string) ([]HostHistory, error)
- func (c *Client) GetScanID(site string) (int, error)
- func (c *Client) GetScanReport(scanID int) ([]byte, error)
- func (c *Client) GetScanResults(scanID int) ([]byte, error)
- func (c *Client) GetScore(site string) (score int, err error)
- func (c *Client) IsHTTPSonly(site string) (bool, error)
- type Config
- type HostHistory
- type Result
- type Scan
Constants ¶
View Source
const ( // DefaultWait is the timeout DefaultWait = 10 * time.Second // DefaultRetry is the number of retries we allow DefaultRetry = 5 // MyVersion is the API version MyVersion = "1.3.1" // MyName is the name used for the configuration MyName = "observatory" )
Variables ¶
This section is empty.
Functions ¶
func AddQueryParameters ¶
AddQueryParameters adds query parameters to the URL.
Types ¶
type Analyze ¶
type Analyze struct {
AlgorithmVersion int `json:"algorithm_version"`
Grade string `json:"grade"`
Score int `json:"score"`
ScanID int `json:"scan_id"`
StartTime string `json:"start_time"`
EndTime string `json:"end_time"`
State string `json:"state"`
StatusCode int `json:"status_code"`
Hidden bool `json:"hidden"`
LikelihoodIndicator string `json:"likelihood_indicator"`
TestsFailed int `json:"tests_failed"`
TestsPassed int `json:"tests_passed"`
TestsQuantity int `json:"tests_quantity"`
ResponseHeaders map[string]string `json:"response_headers"`
}
Analyze is for one run
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is used to store proxyauth & other internal state
func (*Client) GetHostHistory ¶
func (c *Client) GetHostHistory(site string) ([]HostHistory, error)
GetHostHistory returns the list of recent scans
func (*Client) GetScanReport ¶
GetScanReport returns the full scan report
func (*Client) GetScanResults ¶ added in v1.2.0
GetScanResults returns the full scan report
type HostHistory ¶
type HostHistory struct {
EndTime string `json:"end_time"`
EndTimeUnixTimestamp int64 `json:"end_time_unix_timestamp"`
Grade string
ScanID int `json:"scan_id"`
Score int
}
HostHistory for a given site
type Result ¶ added in v1.2.4
type Result struct {
ContentSecurityPolicy Scan
Contribute Scan
Cookies Scan
CrossOriginResourceSharing Scan
PublicKeyPinning Scan
Redirection Scan
ReferrerPolicy Scan
StrictTransportSecurity Scan
SubresourceIntegrity Scan
XContentTypeOptions Scan
XFrameOptions Scan
XXSSProtection Scan
}
Result is all the test results.
type Scan ¶
type Scan struct {
Expectation string `json:"expectation"`
Name string `json:"name"`
Output []byte `json:"-"`
Pass bool `json:"pass"`
Result string `json:"result"`
ScoreDescription string `json:"score_description"`
ScoreModifier int `json:"score_modifier"`
}
Scan for each individual tests
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
observatory
command
This is just a very short example.
|
This is just a very short example. |
Click to show internal directories.
Click to hide internal directories.
