Documentation
¶
Index ¶
- Constants
- func CreateAndPersistToolRecord(utils piperutils.FileUtils, appInfo *ApplicationInfo, modulePath string) (string, error)
- func SaveReportFile(utils piperutils.FileUtils, fileName, displayName string, data []byte) ([]piperutils.Path, error)
- type ApplicationInfo
- type ApplicationResponse
- type AsyncReportConfig
- type Client
- func (c *Client) DownloadReport(downloadUrl, reportType string) ([]byte, error)
- func (c *Client) GeneratePdfReport(appUuid string) ([]byte, error)
- func (c *Client) GenerateSarifReport(appUuid string) ([]byte, error)
- func (c *Client) GetAppInfo(appUIUrl, server string) (*ApplicationInfo, error)
- func (c *Client) GetVulnerabilities() ([]ContrastFindings, error)
- func (c *Client) PollReportStatus(reportUuid, reportType string) (*ReportStatusResponse, error)
- func (c *Client) StartAsyncPdfGeneration(appUuid string) (string, error)
- func (c *Client) StartAsyncSarifGeneration(appUuid string) (string, error)
- type Contrast
- type ContrastAudit
- type ContrastFindings
- type ContrastHttpClient
- type ContrastHttpClientInstance
- type ReportStatusResponse
- type VulnerabilitiesResponse
- type Vulnerability
Constants ¶
const ( StatusReported = "REPORTED" Critical = "CRITICAL" High = "HIGH" Medium = "MEDIUM" AuditAll = "Audit All" Optional = "Optional" ContentType = "Content-Type" JSONContentType = "application/json" )
Variables ¶
This section is empty.
Functions ¶
func CreateAndPersistToolRecord ¶
func CreateAndPersistToolRecord(utils piperutils.FileUtils, appInfo *ApplicationInfo, modulePath string) (string, error)
func SaveReportFile ¶ added in v1.490.0
func SaveReportFile(utils piperutils.FileUtils, fileName, displayName string, data []byte) ([]piperutils.Path, error)
SaveReportFile saves report data to the contrast reports directory
Types ¶
type ApplicationInfo ¶
type ApplicationResponse ¶
type AsyncReportConfig ¶ added in v1.490.0
type AsyncReportConfig struct {
ReportType string // "SARIF" or "PDF"
URLPattern string // URL pattern for starting async generation
Payload map[string]interface{}
DownloadURLPattern string // Pattern for building download URL
}
AsyncReportConfig contains configuration for async report generation
type Client ¶ added in v1.490.0
type Client struct {
ApiKey string
ServiceKey string
Username string
OrgID string
BaseURL string
AppURL string
Auth string
HttpClient *http.Client
}
Client is the unified Contrast API client for both sync and async operations
func (*Client) DownloadReport ¶ added in v1.490.0
DownloadReport downloads a report from the given URL
func (*Client) GeneratePdfReport ¶ added in v1.490.0
GeneratePdfReport generates a PDF attestation report for the given application (start, poll, download)
func (*Client) GenerateSarifReport ¶ added in v1.490.0
GenerateSarifReport generates a SARIF report for the given application (start, poll, download)
func (*Client) GetAppInfo ¶ added in v1.490.0
func (c *Client) GetAppInfo(appUIUrl, server string) (*ApplicationInfo, error)
GetAppInfo gets application information (synchronous)
func (*Client) GetVulnerabilities ¶ added in v1.490.0
func (c *Client) GetVulnerabilities() ([]ContrastFindings, error)
GetVulnerabilities gets vulnerabilities for the application (synchronous)
func (*Client) PollReportStatus ¶ added in v1.490.0
func (c *Client) PollReportStatus(reportUuid, reportType string) (*ReportStatusResponse, error)
PollReportStatus polls for report generation completion and returns the status response
func (*Client) StartAsyncPdfGeneration ¶ added in v1.490.0
StartAsyncPdfGeneration initiates async PDF report generation (wrapper for testing compatibility)
type ContrastAudit ¶
type ContrastAudit struct {
ToolName string `json:"toolName"`
ApplicationUrl string `json:"applicationUrl"`
ScanResults []ContrastFindings `json:"findings"`
}
type ContrastFindings ¶
type ContrastHttpClient ¶
type ContrastHttpClientInstance ¶
type ContrastHttpClientInstance struct {
// contains filtered or unexported fields
}
func NewContrastHttpClient ¶
func NewContrastHttpClient(apiKey, auth string) *ContrastHttpClientInstance
func (*ContrastHttpClientInstance) ExecuteRequest ¶
func (c *ContrastHttpClientInstance) ExecuteRequest(url string, params map[string]string, dest interface{}) error
type ReportStatusResponse ¶ added in v1.490.0
type ReportStatusResponse struct {
Messages []string `json:"messages"`
Success bool `json:"success"`
Status string `json:"status"`
DownloadUrl string `json:"downloadUrl,omitempty"`
}
ReportStatusResponse represents the response from the report status endpoint