Documentation
¶
Index ¶
- func CSVToJSON(t *testing.T, filename string) []byte
- func CheckLine(t *testing.T, expec, want string, line int)
- func Contains(list []string, searchTerm string) bool
- func FileCheck(t *testing.T, actualPayloadName, expectPayloadName, location string)
- func GetKICSDockerImageName() string
- func GetKICSLocalBin() string
- func HTMLValidation(t *testing.T, file string)
- func JSONSchemaCompare(t *testing.T, schema, report gojsonschema.JSONLoader)
- func JSONSchemaValidationFromData(t *testing.T, data []byte, schema string)
- func JSONSchemaValidationFromFile(t *testing.T, file, schema string)
- func KicsDevPathAdapter(path string) string
- func PrepareExpected(path, folder string) ([]string, error)
- func ReadFixture(testName, folder string) (string, error)
- func XMLToJSON(t *testing.T, filename, model string) []byte
- type CmdOutput
- type CycloneSchema
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetKICSDockerImageName ¶ added in v1.5.4
func GetKICSDockerImageName() string
GetKICSDockerImageName gets the kics docker image name
func GetKICSLocalBin ¶ added in v1.5.7
func GetKICSLocalBin() string
GetKICSLocalBin returns the kics local bin path
func HTMLValidation ¶
HTMLValidation executes many asserts to validate the HTML Report
func JSONSchemaCompare ¶ added in v1.4.9
func JSONSchemaCompare(t *testing.T, schema, report gojsonschema.JSONLoader)
JSONSchemaCompare executes schema assertions to validate the content of a JSON file
func JSONSchemaValidationFromData ¶ added in v1.4.9
JSONSchemaValidationFromData loads a json data and validates it against a schema
func JSONSchemaValidationFromFile ¶ added in v1.4.9
JSONSchemaValidationFromFile loads a json file and validates it against a schema
func KicsDevPathAdapter ¶ added in v1.5.7
KicsDevPathAdapter adapts the path to enable kics locally execution
func PrepareExpected ¶
PrepareExpected prepares the files for validation tests
func ReadFixture ¶
ReadFixture reads a file based on a provided path and filename
Types ¶
type CycloneSchema ¶ added in v1.4.9
type CycloneSchema struct {
XMLName xml.Name `xml:"bom"`
XMLNS string `xml:"xmlns,attr"`
XMLNSV string `xml:"v,attr"`
SerialNumber string `xml:"serialNumber,attr"`
Version string `xml:"version,attr"`
Metadata struct {
Timestamp string `xml:"timestamp"`
Tools []struct {
Vendor string `xml:"vendor"`
Name string `xml:"name"`
Version string `xml:"version"`
} `xml:"tools>tool"`
} `xml:"metadata"`
Components struct {
Components []struct {
Type string `xml:"type,attr"`
BomRef string `xml:"bom-ref,attr"`
Name string `xml:"name"`
Version string `xml:"version"`
Hashes []struct {
Alg string `xml:"alg,attr"`
Content string `xml:",chardata"`
} `xml:"hashes>hash"`
Purl string `xml:"purl"`
Vulnerabilities []struct {
Ref string `xml:"ref,attr"`
ID string `xml:"id"`
CWE string `xml:"cwe"`
Source struct {
Name string `xml:"name"`
URL string `xml:"url"`
} `xml:"source"`
Ratings []struct {
Severity string `xml:"severity"`
Method string `xml:"method"`
} `xml:"ratings>rating"`
Description string `xml:"description"`
Recommendations []struct {
Recommendation string `xml:"Recommendation"`
} `xml:"recommendations>recommendation"`
} `xml:"vulnerabilities>vulnerability"`
} `xml:"component"`
} `xml:"components"`
}
CycloneSchema is the struct used to unmarshal the cyclonedx xml