hubapi

package
v0.9.13 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 4, 2024 License: Apache-2.0 Imports: 7 Imported by: 6

Documentation

Index

Constants

View Source
const (
	ContentTypeBdComponentDetailV4 = "application/vnd.blackducksoftware.component-detail-4+json"
	ContentTypeBdComponentDetailV5 = "application/vnd.blackducksoftware.component-detail-5+json"
)
View Source
const (
	ContentTypeBdAdminV4 = "application/vnd.blackducksoftware.admin-4+json"
	ContentTypeBdAdminV5 = "application/vnd.blackducksoftware.admin-5+json"
)
View Source
const (
	ProjectVersionPhasePlanning    = "PLANNING"
	ProjectVersionPhaseDevelopment = "DEVELOPMENT"
	ProjectVersionPhaseReleased    = "RELEASED"
	ProjectVersionPhaseDeprecated  = "DEPRECATED"
	ProjectVersionPhaseArchived    = "ARCHIVED"
)
View Source
const (
	ProjectVersionDistributionExternal   = "EXTERNAL"
	ProjectVersionDistributionSaaS       = "SAAS"
	ProjectVersionDistributionInternal   = "INTERNAL"
	ProjectVersionDistributionOpenSource = "OPENSOURCE"
)
View Source
const (
	ContentTypeRapidScanRequest = "application/vnd.blackducksoftware.developer-scan-1-ld-2+json"
	ContentTypeRapidScanResults = "application/vnd.blackducksoftware.scan-6+json"
)
View Source
const (
	AuthenticateApi      = "/api/tokens/authenticate"
	CodeLocationsApi     = "/api/codelocations"
	ComponentsApi        = "/api/components"
	CurrentUserApi       = "/api/current-user"
	CurrentUserTokensApi = "/api/current-user/tokens"
	CurrentVersionApi    = "/api/current-version"
	DetectUriApi         = "/api/external-config/detect-uri"
	PolicyRulesApi       = "/api/policy-rules"
	ProjectsApi          = "/api/projects"
	DeveloperScansApi    = "/api/developer-scans"
	SsoStatusApi         = "/api/sso/status"
	MfaStatusApi         = "/api/mfa/status"
	UsersApi             = "/api/users"
	VulnerabilitiesApi   = "/api/vulnerabilities"
	ReadinessApi         = "/api/health-checks/readiness"
	LivenessApi          = "/api/health-checks/liveness"
	FullResultsApi       = "/full-result"
	SecurityApi          = "/j_spring_security_check"
	RemediatingApi       = "/remediating"
	UpgradeGuidanceApi   = "/upgrade-guidance"
	SnippetMatchingApi   = "/api/snippet-matching"
)
View Source
const ContentTypeBdBomV6 = "application/vnd.blackducksoftware.bill-of-materials-6+json"
View Source
const ContentTypeBdPolicyV5 = "application/vnd.blackducksoftware.policy-5+json"
View Source
const ContentTypeBdProjectDetailV4 = "application/vnd.blackducksoftware.project-detail-4+json"
View Source
const ContentTypeBdProjectDetailV5 = "application/vnd.blackducksoftware.project-detail-5+json"
View Source
const ContentTypeBdVulnerabilityV4 = "application/vnd.blackducksoftware.vulnerability-4+json"
View Source
const (
	ContentTypeExtensionJSON = "application/vnd.blackducksoftware.externalextension-1+json"
)
View Source
const ContentTypeHealthStatus = "application/vnd.blackducksoftware.status-4+json"

Variables

This section is empty.

Functions

func AddParameters added in v0.9.7

func AddParameters(urlBase string, params map[string]string) string

func BuildUrl added in v0.9.7

func BuildUrl(urlBase string, api string) string

func GetMimeType added in v0.9.5

func GetMimeType(v interface{}) string

GetMimeType extracts a MIME type for the "Accept" header for requests The ways to embed a mime type First method type bdJsonCoolV7 struct {} func (bdJsonV7) GetMimeType() string { return "application/vnd.blackducksoftware.cool-7+json" }

type SomeTypeWeRetrieve struct {
   bdJsonCoolV7
   ... // rest of the fields
}

2.

type bdJsonHackyCoolV4 struct {
  __mimetype struct{} `mimetype:"application/vnd.blackducksoftware.hackycool-4+json"`
}
type SomeTypeWeRetrieve struct {
   bdJsonHackyCoolV4
   ... // rest of the fields
}

3. use both :) Note: known so far are

"application/vnd.blackducksoftware.admin-4+json",
"application/vnd.blackducksoftware.admin-5+json",
"application/vnd.blackducksoftware.bill-of-materials-4+json",
"application/vnd.blackducksoftware.bill-of-materials-5+json",
"application/vnd.blackducksoftware.bill-of-materials-6+json",
"application/vnd.blackducksoftware.component-detail-4+json",
"application/vnd.blackducksoftware.component-detail-5+json",
"application/vnd.blackducksoftware.journal-4+json",
"application/vnd.blackducksoftware.notification-4+json",
"application/vnd.blackducksoftware.policy-4+json",
"application/vnd.blackducksoftware.policy-5+json",
"application/vnd.blackducksoftware.project-detail-4+json",
"application/vnd.blackducksoftware.project-detail-5+json",
"application/vnd.blackducksoftware.report-4+json",
"application/vnd.blackducksoftware.scan-4+json",
"application/vnd.blackducksoftware.status-4+json",
"application/vnd.blackducksoftware.user-4+json",
"application/vnd.blackducksoftware.vulnerability-4+json",

func GetMimeTypeFromTag added in v0.9.5

func GetMimeTypeFromTag(v interface{}) string

func ParameterString

func ParameterString(params URLParameters) string

ParameterString takes a URLParameters object and converts it to a string which can be added to a URL. The resulting string starts from "?" if there were any parameters. If params was empty, it will return an empty string

Types

type ApiToken added in v0.9.5

type ApiToken struct {
	Name        string   `json:"name"`
	Description string   `json:"description"`
	Scopes      []string `json:"scopes"`
}

type ApiTokenList added in v0.9.5

type ApiTokenList struct {
	ItemsListBase
	Items []ApiTokenWithMeta `json:"items"`
}

type ApiTokenWithMeta added in v0.9.5

type ApiTokenWithMeta struct {
	ApiToken
	Meta Meta `json:"_meta"`
}

type BomActivityData

type BomActivityData struct {
	ContributorCount int        `json:"contributorCount12Month"`
	CommitCount      int        `json:"commitCount12Month"`
	LastCommitDate   *time.Time `json:"lastCommitDate"`
	Trend            string     `json:"trending"` // [DECREASING, STABLE, INCREASING, UNKNOWN]
	NewerReleases    *int       `json:"newerReleases,omitempty"`
}

type BomComponent

type BomComponent struct {
	ComponentName          string               `json:"componentName"`
	ComponentVersionName   string               `json:"componentVersionName,omitempty"`
	Component              string               `json:"component"`
	ComponentVersion       string               `json:"componentVersion,omitempty"`
	ComponentPurpose       string               `json:"componentPurpose"`
	ComponentModified      bool                 `json:"componentModified"`
	ComponentModification  string               `json:"componentModification"`
	ReleasedOn             *time.Time           `json:"releasedOn"`
	ReviewStatus           string               `json:"reviewStatus"`
	ReviewedDetails        *BomReviewDetails    `json:"reviewedDetails,omitempty"`
	PolicyStatus           string               `json:"policyStatus"`
	ApprovalStatus         string               `json:"approvalStatus"`
	Ignored                bool                 `json:"ignored"`
	ManuallyAdjusted       bool                 `json:"manuallyAdjusted"`
	Licenses               []ComplexLicense     `json:"licenses"`
	Usages                 []string             `json:"usages"`
	Origins                []BomComponentOrigin `json:"origins"`
	LicenseRiskProfile     BomRiskProfile       `json:"licenseRiskProfile"`
	VersionRiskProfile     BomRiskProfile       `json:"versionRiskProfile"`
	SecurityRiskProfile    BomRiskProfile       `json:"securityRiskProfile"`
	ActivityRiskProfile    BomRiskProfile       `json:"activityRiskProfile"`
	OperationalRiskProfile BomRiskProfile       `json:"operationalRiskProfile"`
	ActivityData           BomActivityData      `json:"activityData"`
	TotalFileMatchCount    int                  `json:"totalFileMatchCount"`
	MatchTypes             []string             `json:"matchTypes"`
	InAttributionReport    bool                 `json:"inAttributionReport"`
	AttributionStatement   string               `json:"attributionStatement"`
	Meta                   Meta                 `json:"_meta"`
	// contains filtered or unexported fields
}

BomComponent represents "application/vnd.blackducksoftware.bill-of-materials-6+json" We need to figure out what to do with content type here

func (BomComponent) GetMimeType added in v0.9.5

func (BomComponent) GetMimeType() string

type BomComponentList

type BomComponentList struct {
	ItemsListBase

	Items []BomComponent `json:"items"`
	// contains filtered or unexported fields
}

func (BomComponentList) GetMimeType added in v0.9.5

func (BomComponentList) GetMimeType() string

type BomComponentOrigin

type BomComponentOrigin struct {
	Name                          string `json:"name"`
	ExternalNamespace             string `json:"externalNamespace"`
	ExternalID                    string `json:"externalId"`
	ExternalNamespaceDistribution bool   `json:"externalNamespaceDistribution"`
	Meta                          Meta   `json:"_meta"`
}

type BomComponentPolicyRule added in v0.9.5

type BomComponentPolicyRule struct {
	PolicyRule
	PolicyApprovalStatus string `json:"policyApprovalStatus"`
	Comment              string `json:"comment"`
	// contains filtered or unexported fields
}

func (BomComponentPolicyRule) GetMimeType added in v0.9.5

func (BomComponentPolicyRule) GetMimeType() string

type BomComponentPolicyRulesList added in v0.9.5

type BomComponentPolicyRulesList struct {
	ItemsListBase
	Items []BomComponentPolicyRule `json:"items"`
	// contains filtered or unexported fields
}

result of bom policy-rules link under project's component version

func (BomComponentPolicyRulesList) GetMimeType added in v0.9.5

func (BomComponentPolicyRulesList) GetMimeType() string

type BomComponentPolicyStatus added in v0.9.5

type BomComponentPolicyStatus struct {
	ApprovalStatus string `json:"approvalStatus"`
	Meta           Meta   `json:"_meta"`
	// contains filtered or unexported fields
}

result of bom policy-status link under project's component version

func (BomComponentPolicyStatus) GetMimeType added in v0.9.5

func (BomComponentPolicyStatus) GetMimeType() string

type BomReviewDetails added in v0.9.5

type BomReviewDetails struct {
	ReviewedAt    *time.Time       `json:"reviewedAt,omitempty"`
	ReviewedBy    string           `json:"reviewedBy,omitempty"`
	ReviewingUser BomReviewingUser `json:"reviewingUser"`
}

type BomReviewingUser added in v0.9.5

type BomReviewingUser struct {
	Username  string `json:"username"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	User      string `json:"user"`
}

type BomRiskProfile

type BomRiskProfile struct {
	Counts []BomRiskProfileItem `json:"counts"`
}

type BomRiskProfileItem

type BomRiskProfileItem struct {
	CountType string `json:"countType"`
	Count     int    `json:"count"`
}

type BomVulnerableComponent

type BomVulnerableComponent struct {
	ComponentName              string                       `json:"componentName"`
	ComponentVersionName       string                       `json:"componentVersionName"`
	ComponentVersion           string                       `json:"componentVersion"`
	ComponentVersionOriginName string                       `json:"componentVersionOriginName"`
	ComponentVersionOriginID   string                       `json:"componentVersionOriginId"`
	License                    ComplexLicense               `json:"license"`
	Vulnerability              VulnerabilityWithRemediation `json:"vulnerabilityWithRemediation"`
	Meta                       Meta                         `json:"_meta"`
	// contains filtered or unexported fields
}

func (BomVulnerableComponent) GetMimeType added in v0.9.5

func (BomVulnerableComponent) GetMimeType() string

type BomVulnerableComponentList

type BomVulnerableComponentList struct {
	ItemsListBase
	Items []BomVulnerableComponent `json:"items"`
	// contains filtered or unexported fields
}

"vulnerable-components" link under projects api, link ends with "/vulnerable-bom-components" GET /api/projects/{projectId}/versions/{projectVersionId}/vulnerable-bom-components

func (BomVulnerableComponentList) GetMimeType added in v0.9.5

func (BomVulnerableComponentList) GetMimeType() string

type CVSS added in v0.9.5

type CVSS struct {
	BaseScore              float32               `json:"baseScore"`
	ImpactSubscore         float32               `json:"impactSubscore"`
	ExploitabilitySubscore float32               `json:"exploitabilitySubscore"`
	AccessVector           string                `json:"accessVector"` // [LOCAL, ADJACENT_NETWORK, NETWORK]
	AccessComplexity       string                `json:"accessComplexity"`
	Authentication         string                `json:"authentication"`
	ConfidentialityImpact  string                `json:"confidentialityImpact"`
	IntegrityImpact        string                `json:"integrityImpact"`
	AvailabilityImpact     string                `json:"availabilityImpact"`
	PrivilegesRequired     string                `json:"privilegesRequired"`
	Scope                  string                `json:"scope"`
	UserInteraction        string                `json:"userInteraction"`
	TemporalMetrics        *VulnerabilityMetrics `json:"temporalMetrics,omitempty"`
	Vector                 string                `json:"vector"`
}

type CodeLocation

type CodeLocation struct {
	Name                 string     `json:"name"`
	Type                 string     `json:"type"`
	URL                  string     `json:"url"`
	ScanSize             int        `json:"scanSize"`
	MappedProjectVersion string     `json:"mappedProjectVersion"`
	CreatedAt            *time.Time `json:"createdAt"`
	UpdatedAt            *time.Time `json:"updatedAt"`
	Meta                 Meta       `json:"_meta"`
}
func (c *CodeLocation) GetProjectVersionLink() (*ResourceLink, error)
func (c *CodeLocation) GetScanSummariesLink() (*ResourceLink, error)

type CodeLocationList

type CodeLocationList struct {
	ItemsListBase
	Items []CodeLocation `json:"items"`
}

type CommonConsequence added in v0.9.5

type CommonConsequence struct {
	Note             string   `json:"note"`
	Scopes           []string `json:"scopes"`
	TechnicalImpacts []string `json:"technicalImpacts"`
}

type ComplexLicense

type ComplexLicense struct {
	Name                 string           `json:"name,omitempty"`
	Ownership            string           `json:"ownership,omitempty"`
	LicenseType          string           `json:"type,omitempty"`
	LicenseDisplay       string           `json:"licenseDisplay"`
	Licenses             []ComplexLicense `json:"licenses"`
	License              string           `json:"license,omitempty"` // License URL
	SpdxId               string           `json:"spdxId,omitempty"`  // The ID of the license in the SPDX project’s database, if available
	LicenseFamilySummary *ResourceLink    `json:"licenseFamilySummary,omitempty"`
}

type Component added in v0.9.5

type Component struct {
	Name                string   `json:"name"`
	Description         string   `json:"description,omitempty"`
	ApprovalStatus      string   `json:"approvalStatus"`
	Homepage            string   `json:"url,omitempty"`
	AdditionalHomepages []string `json:"additionalHomepages"`
	PrimaryLanguage     string   `json:"primaryLanguage,omitempty"`
	Source              string   `json:"source"`
	Type                string   `json:"type"`
	Notes               string   `json:"notes,omitempty"`
	Meta                Meta     `json:"_meta"`
	// contains filtered or unexported fields
}

func (Component) GetMimeType added in v0.9.5

func (Component) GetMimeType() string

type ComponentLicenceV2 added in v0.9.12

type ComponentLicenceV2 struct {
	LicenseDisplay string               `json:"licenseDisplay"`
	LicenseType    *string              `json:"licenseType"`
	License        string               `json:"license"`
	SpdxId         *string              `json:"spdxId"`
	Licenses       []ComponentLicenceV2 `json:"licenses"`
	Ownership      string               `json:"ownership"`
	FamilyName     string               `json:"licenseFamilyName"`
}

type ComponentLicense added in v0.9.7

type ComponentLicense struct {
	Name       string `json:"name"`
	FamilyName string `json:"licenseFamilyName"`
	Meta       Meta   `json:"_meta"`
}

type ComponentList added in v0.9.5

type ComponentList struct {
	ItemsListBase
	Items []ComponentVariant `json:"items"`
	// contains filtered or unexported fields
}

func (ComponentList) GetMimeType added in v0.9.5

func (ComponentList) GetMimeType() string

type ComponentProjectReference added in v0.9.5

type ComponentProjectReference struct {
	Distribution      string `json:"distribution"`
	Phase             string `json:"phase"`
	ProjectName       string `json:"projectName"`
	ProjectTier       int    `json:"projectTier"`
	ProjectUrl        string `json:"projectUrl"`
	ProjectVersionUrl string `json:"projectVersionUrl"`
	VersionName       string `json:"versionName"`
}

type ComponentProjectReferenceList added in v0.9.5

type ComponentProjectReferenceList struct {
	ItemsListBase
	Items []ComponentProjectReference
	// contains filtered or unexported fields
}

returned by "references" component meta link

func (ComponentProjectReferenceList) GetMimeType added in v0.9.5

func (ComponentProjectReferenceList) GetMimeType() string

type ComponentRemediation added in v0.9.5

type ComponentRemediation struct {
	FixesPreviousVulnerabilities *RemediationInfo `json:"fixesPreviousVulnerabilities,omitempty"`
	NoVulnerabilities            *RemediationInfo `json:"noVulnerabilities,omitempty"`
	LatestAfterCurrent           *RemediationInfo `json:"latestAfterCurrent,omitempty"`
	Meta                         Meta             `json:"_meta"`
	// contains filtered or unexported fields
}

func (ComponentRemediation) GetMimeType added in v0.9.5

func (ComponentRemediation) GetMimeType() string

type ComponentRequest added in v0.9.5

type ComponentRequest struct {
	Name                string   `json:"name"`
	Description         string   `json:"description"`
	Homepage            string   `json:"url,omitempty"`
	AdditionalHomepages []string `json:"additionalHomepages"`
	ApprovalStatus      string   `json:"approvalStatus"` // [UNREVIEWED, IN_REVIEW, REVIEWED, APPROVED, LIMITED_APPROVAL, REJECTED, DEPRECATED]
	Type                string   `json:"type"`
	// contains filtered or unexported fields
}

func (ComponentRequest) GetMimeType added in v0.9.5

func (ComponentRequest) GetMimeType() string

type ComponentUpgradeGuidance added in v0.9.7

type ComponentUpgradeGuidance struct {
	Component               string           `json:"component"`
	ComponentName           string           `json:"componentName"`
	Version                 string           `json:"version"`
	VersionName             string           `json:"versionName"`
	Origin                  string           `json:"origin"`
	OriginName              string           `json:"originName"`
	OriginExternalNamespace string           `json:"originExternalNamespace"`
	OriginExternalId        string           `json:"originExternalId"`
	ShortTerm               *UpgradeGuidance `json:"shortTerm,omitempty"`
	LongTerm                *UpgradeGuidance `json:"longTerm,omitempty"`
	Meta                    Meta             `json:"_meta"`
	// contains filtered or unexported fields
}

func (ComponentUpgradeGuidance) GetMimeType added in v0.9.7

func (ComponentUpgradeGuidance) GetMimeType() string

type ComponentVariant added in v0.9.5

type ComponentVariant struct {
	ComponentName string `json:"componentName"`
	VersionName   string `json:"versionName,omitempty"`
	OriginID      string `json:"originId,omitempty"`
	Component     string `json:"component"`
	Version       string `json:"version,omitempty"`
	Variant       string `json:"variant,omitempty"`
	// contains filtered or unexported fields
}

func (ComponentVariant) GetMimeType added in v0.9.5

func (ComponentVariant) GetMimeType() string

type ComponentVersion added in v0.9.5

type ComponentVersion struct {
	VersionName         string         `json:"versionName,omitempty"`
	ReleasedOn          time.Time      `json:"releasedOn,omitempty"`
	License             ComplexLicense `json:"license"`
	Source              string         `json:"source"`
	Type                string         `json:"type"`
	AdditionalHomepages []string       `json:"additionalHomepages"`
	ApprovalStatus      string         `json:"approvalStatus"`
	Notes               string         `json:"notes,omitempty"`
	Meta                Meta           `json:"_meta"`
	// contains filtered or unexported fields
}

func (ComponentVersion) GetMimeType added in v0.9.5

func (ComponentVersion) GetMimeType() string

type ComponentVersionList added in v0.9.5

type ComponentVersionList struct {
	ItemsListBase
	Items []ComponentVersion `json:"items"`
	// contains filtered or unexported fields
}

func (ComponentVersionList) GetMimeType added in v0.9.5

func (ComponentVersionList) GetMimeType() string

type ComponentVersionOrigin added in v0.9.5

type ComponentVersionOrigin struct {
	ComponentVersion
	Origin   string `json:"originName"`
	OriginID string `json:"originId"`
}

func (ComponentVersionOrigin) GetMimeType added in v0.9.5

func (ComponentVersionOrigin) GetMimeType() string

type ComponentVersionOriginList added in v0.9.5

type ComponentVersionOriginList struct {
	ItemsListBase
	Items []ComponentVersionOrigin `json:"items"`
	// contains filtered or unexported fields
}

func (ComponentVersionOriginList) GetMimeType added in v0.9.5

func (ComponentVersionOriginList) GetMimeType() string

type ComponentVulnerability added in v0.9.7

type ComponentVulnerability struct {
	Name              string     `json:"name"`
	Source            string     `json:"source"`
	Description       string     `json:"description"`
	Severity          string     `json:"vulnSeverity"`
	OverallScore      float32    `json:"overallScore"`
	ViolatingPolicies []Policy   `json:"violatingPolicies"`
	PublishedDate     *time.Time `json:"publishedDate"`
	VendorFixDate     *time.Time `json:"vendorFixDate,omitempty"`
	Solution          string     `json:"solution"`
	Workaround        string     `json:"workaround,omitempty"`
	CWEIds            []string   `json:"cweIds"`
	Meta              Meta       `json:"_meta"`
}

type CreateApiTokenResponse added in v0.9.5

type CreateApiTokenResponse struct {
	ApiTokenWithMeta
	Token string `json:"token"`
}

type CurrentUserResponse added in v0.9.5

type CurrentUserResponse struct {
	UserName         string `json:"userName"`
	ExternalUserName string `json:"externalUserName"`
	FirstName        string `json:"firstName"`
	LastName         string `json:"lastName"`
	Email            string `json:"email"`
	Type             string `json:"type"`
	Active           bool   `json:"active"`
	User             string `json:"user"`
	Meta             Meta   `json:"_meta"`
}

type CurrentVersion added in v0.9.1

type CurrentVersion struct {
	Version string `json:"version"`
	Meta    Meta   `json:"_meta"`
}

type CweDetails added in v0.9.5

type CweDetails struct {
	CweId               string              `json:"id"`
	Name                string              `json:"name"`
	Description         string              `json:"description"`
	ExtendedDescription string              `json:"extendedDescription"`
	CommonConsequences  []CommonConsequence `json:"commonConsequences"`
	Meta                Meta                `json:"_meta"`
	// contains filtered or unexported fields
}

Common Weakness Enumeration endpoint result -- retrieved from /api/cwes/{cweId} Links: "sources"

func (CweDetails) GetMimeType added in v0.9.5

func (CweDetails) GetMimeType() string

type DetectURI added in v0.9.7

type DetectURI struct {
	Category  string `json:"category"`
	DetectURI string `json:"value"`
	Meta      Meta   `json:"_meta"`
	// contains filtered or unexported fields
}

func (DetectURI) GetMimeType added in v0.9.7

func (DetectURI) GetMimeType() string

type Expression added in v0.9.5

type Expression struct {
	Name       string              `json:"name"`
	Operation  string              `json:"operation"`
	Parameters ExpressionParameter `json:"parameters"`
}

type ExpressionParameter added in v0.9.5

type ExpressionParameter struct {
	Values []string                 `json:"values"`
	Data   []map[string]interface{} `json:"data"`
}

type ExternalExtension

type ExternalExtension struct {
	Name          string `json:"name"`
	Description   string `json:"description"`
	InfoURL       string `json:"infoUrl"`
	Authenticated bool   `json:"authenticated"`
	Meta          Meta   `json:"_meta"`
}

type GetListOptions

type GetListOptions struct {
	Limit  *int
	Offset *int
	Sort   *string
	Q      *string
}

GetListOptions describes the parameter model for the list GET endpoints.

func EnsureLimits added in v0.9.5

func EnsureLimits(glo *GetListOptions) *GetListOptions

func FirstPageOptions added in v0.9.5

func FirstPageOptions() *GetListOptions

func (*GetListOptions) EnsureLimits added in v0.9.5

func (glo *GetListOptions) EnsureLimits() *GetListOptions

func (*GetListOptions) NextPage added in v0.9.5

func (glo *GetListOptions) NextPage() *GetListOptions

func (*GetListOptions) Parameters

func (glo *GetListOptions) Parameters() map[string]string

Parameters implements the URLParameters interface.

type HasMimeType added in v0.9.5

type HasMimeType interface {
	GetMimeType() string
}

type HealthCheckStatus added in v0.9.8

type HealthCheckStatus struct {
	Healthy bool `json:"healthy"`
}

type ItemsListBase added in v0.9.5

type ItemsListBase struct {
	TotalCount     int           `json:"totalCount"`
	AppliedFilters []interface{} `json:"appliedFilters,omitempty"`
	Meta           Meta          `json:"_meta"`
}

func (ItemsListBase) Total added in v0.9.5

func (b ItemsListBase) Total() int

type License

type License struct {
	Name          string `json:"name"`
	Ownership     string `json:"ownership"`
	CodeSharing   string `json:"codeSharing"`
	LicenseSource string `json:"licenseSource,omitempty"`
	LicenseStatus string `json:"licenseStatus,omitempty"`
	Meta          Meta   `json:"_meta"`
}

type LicenseDetails added in v0.9.6

type LicenseDetails struct {
	Name           string       `json:"name"`
	LicenseFamily  ResourceLink `json:"licenseFamily"`
	Ownership      string       `json:"ownership"`
	Notes          string       `json:"notes"`
	ExpirationDate *time.Time   `json:"expirationDate"`

	CreatedAt *time.Time `json:"createdAt"`
	CreatedBy *User      `json:"createdBy"`

	UpdatedAt *time.Time `json:"updatedAt"`
	UpdatedBy *User      `json:"updatedBy"`

	LicenseSource string `json:"licenseSource"`
	SpdxId        string `json:"spdxId,omitempty"` // The ID of the license in the SPDX project’s database, if available

	LicenseStatus   string     `json:"licenseStatus"`
	StatusUpdatedAt *time.Time `json:"statusUpdatedAt"`
	StatusUpdatedBy *User      `json:"statusUpdatedBy"`
	// contains filtered or unexported fields
}

func (LicenseDetails) GetMimeType added in v0.9.6

func (LicenseDetails) GetMimeType() string

type Meta

type Meta struct {
	Allow []string       `json:"allow"`
	Href  string         `json:"href"`
	Links []ResourceLink `json:"links"`
}

func (*Meta) FindLinkByRel

func (m *Meta) FindLinkByRel(rel string) (*ResourceLink, error)

Returns the first link with the corresponding relation value. However, there may be additional matches not returned

func (*Meta) GetLinksByRel added in v0.9.5

func (m *Meta) GetLinksByRel(rel string) ([]*ResourceLink, error)

Returns all links with the corresponding relation value

type MfaStatus added in v0.9.12

type MfaStatus struct {
	MfaEnabled bool `json:"mfaEnabled"`
	Meta       Meta `json:"_meta"`
	// contains filtered or unexported fields
}

func (MfaStatus) GetMimeType added in v0.9.12

func (MfaStatus) GetMimeType() string

type Policy added in v0.9.7

type Policy struct {
	Name        string `json:"policyName"`
	Description string `json:"description"`
	Severity    string `json:"policySeverity"`
}

type PolicyExpression added in v0.9.5

type PolicyExpression struct {
	Operator    string       `json:"operator"`
	Expressions []Expression `json:"expressions"`
}

type PolicyRule added in v0.9.5

type PolicyRule struct {
	Name          string           `json:"name"`
	Description   string           `json:"description"`
	Enabled       bool             `json:"enabled"`
	Overridable   bool             `json:"overridable"`
	Severity      string           `json:"severity"`
	Expression    PolicyExpression `json:"expression"`
	CreatedAt     *time.Time       `json:"createdAt"`
	CreatedBy     string           `json:"createdBy"`
	CreatedByUser string           `json:"createdByUser"`
	UpdatedAt     *time.Time       `json:"updatedAt"`
	UpdatedBy     string           `json:"updatedBy"`
	UpdatedByUser string           `json:"updatedByUser"`
	Meta          Meta             `json:"_meta"`
	// contains filtered or unexported fields
}

func (PolicyRule) GetMimeType added in v0.9.5

func (PolicyRule) GetMimeType() string

func (*PolicyRule) IsEqual added in v0.9.5

func (pr *PolicyRule) IsEqual(obj *PolicyRule) bool

type PolicyRuleList added in v0.9.5

type PolicyRuleList struct {
	ItemsListBase
	Items []PolicyRule `json:"items"`
	// contains filtered or unexported fields
}

func (PolicyRuleList) GetMimeType added in v0.9.5

func (PolicyRuleList) GetMimeType() string

type PolicyRuleRequest added in v0.9.5

type PolicyRuleRequest struct {
	Name        string           `json:"name"`
	Description string           `json:"description"`
	Enabled     bool             `json:"enabled"`
	Overridable bool             `json:"overridable"`
	Expression  PolicyExpression `json:"expression"`
	Severity    string           `json:"severity"`
	// contains filtered or unexported fields
}

func (PolicyRuleRequest) GetMimeType added in v0.9.5

func (PolicyRuleRequest) GetMimeType() string

type PolicyViolationDetails added in v0.9.5

type PolicyViolationDetails struct {
	Name           string        `json:"name"` // [ IN_VIOLATION_OVERRIDDEN, NOT_IN_VIOLATION, IN_VIOLATION ]
	SeverityLevels []StatusCount `json:"severityLevels"`
}

type Project

type Project struct {
	Name                    string     `json:"name"`
	Description             string     `json:"description"`
	Source                  string     `json:"source"`
	ProjectTier             uint32     `json:"projectTier"`
	ProjectLevelAdjustments bool       `json:"projectLevelAdjustments"`
	ProjectOwner            string     `json:"projectOwner"`
	CreatedAt               *time.Time `json:"createdAt,omitempty"`
	CreatedBy               string     `json:"createdBy,omitempty"`
	CreatedByUser           string     `json:"createdByUser,omitempty"`
	UpdatedAt               *time.Time `json:"updatedAt,omitempty"`
	UpdatedBy               string     `json:"updatedBy,omitempty"`
	UpdatedByUser           string     `json:"updatedByUser,omitempty"`
	Meta                    Meta       `json:"_meta"`
	// contains filtered or unexported fields
}

func (Project) GetMimeType added in v0.9.5

func (Project) GetMimeType() string
func (p *Project) GetProjectUsersLink() (*ResourceLink, error)
func (p *Project) GetProjectVersionsLink() (*ResourceLink, error)

type ProjectList

type ProjectList struct {
	ItemsListBase
	Items []Project `json:"items"`
	// contains filtered or unexported fields
}

func (ProjectList) GetMimeType added in v0.9.5

func (ProjectList) GetMimeType() string

type ProjectRequest

type ProjectRequest struct {
	Name                    string                 `json:"name"`
	Description             string                 `json:"description"`
	ProjectTier             *int                   `json:"projectTier,omitempty"`
	ProjectOwner            *string                `json:"projectOwner,omitempty"`
	ProjectLevelAdjustments bool                   `json:"projectLevelAdjustments"`
	VersionRequest          *ProjectVersionRequest `json:"versionRequest,omitempty"`
	CloneCategories         []string               `json:"cloneCategories,omitempty"` // [COMPONENT_DATA, VULN_DATA, LICENSE_TERM_FULFILLMENT]
	CustomSignatureEnabled  *bool                  `json:"customSignatureEnabled,omitempty"`
	CustomSignatureDepth    *int                   `json:"customSignatureDepth,omitempty"`
	// contains filtered or unexported fields
}

func (ProjectRequest) GetMimeType added in v0.9.5

func (ProjectRequest) GetMimeType() string

type ProjectVersion

type ProjectVersion struct {
	VersionName          string          `json:"versionName"`
	Nickname             string          `json:"nickname,omitempty"`
	ReleaseComments      string          `json:"releaseComments,omitempty"`
	ReleasedOn           *time.Time      `json:"releasedOn,omitempty"`
	Phase                string          `json:"phase"`
	Distribution         string          `json:"distribution"`
	License              *ComplexLicense `json:"license,omitempty"`
	CreatedAt            *time.Time      `json:"createdAt"`
	CreatedBy            string          `json:"createdBy"`
	CreatedByUser        string          `json:"createdByUser"`
	SettingUpdatedAt     *time.Time      `json:"settingUpdatedAt"`
	SettingUpdatedBy     string          `json:"settingUpdatedBy"`
	SettingUpdatedByUser string          `json:"settingUpdatedByUser"`
	Source               string          `json:"source"`
	Meta                 Meta            `json:"_meta"`
	// contains filtered or unexported fields
}
func (v *ProjectVersion) GetCodeLocationsLink() (*ResourceLink, error)
func (v *ProjectVersion) GetComponentsLink() (*ResourceLink, error)

func (ProjectVersion) GetMimeType added in v0.9.5

func (ProjectVersion) GetMimeType() string
func (v *ProjectVersion) GetProjectLink() (*ResourceLink, error)
func (v *ProjectVersion) GetProjectVersionPolicyStatusLink() (*ResourceLink, error)
func (v *ProjectVersion) GetProjectVersionRiskProfileLink() (*ResourceLink, error)
func (v *ProjectVersion) GetVulnerableComponentsLink() (*ResourceLink, error)

type ProjectVersionList

type ProjectVersionList struct {
	ItemsListBase
	Items []ProjectVersion `json:"items"`
	// contains filtered or unexported fields
}

func (ProjectVersionList) GetMimeType added in v0.9.5

func (ProjectVersionList) GetMimeType() string

type ProjectVersionPolicyStatus

type ProjectVersionPolicyStatus struct {
	OverallStatus          string                  `json:"overallStatus"`
	UpdatedAt              *time.Time              `json:"updatedAt"`
	StatusCounts           []StatusCount           `json:"componentVersionStatusCounts"`
	PolicyViolationDetails *PolicyViolationDetails `json:"componentVersionPolicyViolationDetails"`
	Meta                   Meta                    `json:"_meta"`
	// contains filtered or unexported fields
}

func (ProjectVersionPolicyStatus) GetMimeType added in v0.9.5

func (ProjectVersionPolicyStatus) GetMimeType() string

type ProjectVersionRequest

type ProjectVersionRequest struct {
	VersionName         string           `json:"versionName"`
	Nickname            string           `json:"nickname,omitempty"`
	ReleaseComments     string           `json:"releaseComments,omitempty"`
	ReleasedOn          *time.Time       `json:"releasedOn,omitempty"`
	Phase               string           `json:"phase"`
	Distribution        string           `json:"distribution"`
	License             []ComplexLicense `json:"license,omitempty"`
	CloneFromReleaseUrl string           `json:"cloneFromReleaseUrl,omitempty"`
	// contains filtered or unexported fields
}

func (ProjectVersionRequest) GetMimeType added in v0.9.5

func (ProjectVersionRequest) GetMimeType() string

type ProjectVersionRiskProfile

type ProjectVersionRiskProfile struct {
	Categories       map[string]map[string]int `json:"categories"`
	BomLastUpdatedAt *time.Time                `json:"bomLastUpdatedAt"`
	Meta             Meta                      `json:"_meta"`
	// contains filtered or unexported fields
}

TODO: This is horrible, we need to fix up this API

func (ProjectVersionRiskProfile) GetMimeType added in v0.9.5

func (ProjectVersionRiskProfile) GetMimeType() string

type RapidScanComponent added in v0.9.7

type RapidScanComponent struct {
	Name                           string                        `json:"componentName"`
	Version                        string                        `json:"versionName"`
	Identifier                     string                        `json:"componentIdentifier"`
	ReleaseDate                    string                        `json:"releaseDate"`
	ExternalId                     string                        `json:"externalId"`
	ExternalNamespace              string                        `json:"externalNamespace"`
	PackageUrl                     *string                       `json:"packageUrl"`
	OriginId                       string                        `json:"originId"`
	MatchTypes                     []string                      `json:"matchTypes"`
	ComponentDescription           *string                       `json:"componentDescription"`
	ViolatingPolicies              []Policy                      `json:"violatingPolicies"`
	ComponentViolatingPolicies     []Policy                      `json:"componentViolatingPolicies"`
	Vulnerabilities                []ComponentVulnerability      `json:"allVulnerabilities"`
	Licenses                       []ComponentLicense            `json:"allLicenses"`
	LicenceV2                      ComponentLicenceV2            `json:"licenses"`
	PolicyViolationVulnerabilities []ComponentVulnerability      `json:"policyViolationVulnerabilities"`
	PolicyViolationLicenses        []ComponentLicense            `json:"policyViolationLicenses"`
	PartiallyEvaluatedPolicies     []string                      `json:"partiallyEvaluatedPolicies"`
	NonEvaluatedPolicies           []string                      `json:"nonEvaluatedPolicies"`
	DependencyTrees                [][]string                    `json:"dependencyTrees"`
	ShortTermUpgradeGuidance       UpgradeSuggestion             `json:"shortTermUpgradeGuidance"`
	LongTermUpgradeGuidance        UpgradeSuggestion             `json:"longTermUpgradeGuidance"`
	TransitiveUpgradeGuidance      []TransitiveUpgradeSuggestion `json:"transitiveUpgradeGuidance"`
	Meta                           Meta                          `json:"_meta"`
}

type RapidScanResult added in v0.9.7

type RapidScanResult struct {
	Count          int                  `json:"totalCount"`
	Components     []RapidScanComponent `json:"items"`
	AppliedFilters []interface{}        `json:"appliedFilters"`
	Meta           Meta                 `json:"_meta"`
}

type Regions added in v0.9.13

type Regions struct {
	SourceStartLines  []int `json:"sourceStartLines,omitempty"`
	SourceEndLines    []int `json:"sourceEndLines,omitempty"`
	MatchedStartLines []int `json:"matchedStartLines,omitempty"`
	MatchedEndLines   []int `json:"matchedEndLines,omitempty"`
}

func (Regions) GetMatchedEndLine added in v0.9.13

func (r Regions) GetMatchedEndLine() int32

func (Regions) GetMatchedStartLine added in v0.9.13

func (r Regions) GetMatchedStartLine() int32

func (Regions) GetSourceEndLine added in v0.9.13

func (r Regions) GetSourceEndLine() int32

func (Regions) GetSourceStartLine added in v0.9.13

func (r Regions) GetSourceStartLine() int32

type RemediationInfo added in v0.9.5

type RemediationInfo struct {
	Name               string     `json:"name"`
	ComponentVersion   string     `json:"componentVersion"`
	ReleasedOn         *time.Time `json:"releasedOn"`
	VulnerabilityCount int        `json:"vulnerabilityCount"`
}
type ResourceLink struct {
	Rel   string `json:"rel,omitempty"`
	Href  string `json:"href,omitempty"`
	Label string `json:"label,omitempty"`
	Name  string `json:"name,omitempty"`
}

type Risk added in v0.9.11

type Risk struct {
	Critical int `json:"critical"`
	High     int `json:"high"`
	Medimum  int `json:"medium"`
	Low      int `json:"low"`
	Unscored int `json:"unscored"`
}

type ScanSummary

type ScanSummary struct {
	Status    string     `json:"status"`
	CreatedAt *time.Time `json:"createdAt"`
	UpdatedAt *time.Time `json:"updatedAt"`
	Meta      Meta       `json:"_meta"`
}
func (s *ScanSummary) GetCodeLocationLink() (*ResourceLink, error)

type ScanSummaryList

type ScanSummaryList struct {
	ItemsListBase
	Items []ScanSummary `json:"items"`
}

type Snippet added in v0.9.13

type Snippet struct {
	ProjectName       string            `json:"projectName,omitempty"`
	ReleaseVersion    string            `json:"releaseVersion,omitempty"`
	LicenseDefinition licenseDefinition `json:"licenseDefinition,omitempty"`
	MatchedFilePath   string            `json:"matchedFilePath,omitempty"`
	Regions           Regions           `json:"regions,omitempty"`
}

type SnippetMatch added in v0.9.13

type SnippetMatch struct {
	Unknown               []Snippet `json:"UNKNOWN,omitempty"`
	Reciprocal            []Snippet `json:"RECIPROCAL,omitempty"`
	ReciprocalAGPL        []Snippet `json:"RECIPROCAL_AGPL,omitempty"`
	WeakReciprocal        []Snippet `json:"WEAK_RECIPROCAL,omitempty"`
	RestrictedProprietary []Snippet `json:"RESTRICTED_PROPRIETARY,omitempty"`
	InternalProprietary   []Snippet `json:"INTERNAL_PROPRIETARY,omitempty"`
	Permissive            []Snippet `json:"PERMISSIVE,omitempty"`
}

type SnippetMatchResponse added in v0.9.13

type SnippetMatchResponse struct {
	SnippetMatches SnippetMatch   `json:"snippetMatches,omitempty"`
	Meta           meta           `json:"_meta,omitempty"`
	LogRef         string         `json:"logRef,omitempty"`
	ErrorMessage   string         `json:"errorMessage,omitempty"`
	Arguments      arguments      `json:"arguments,omitempty"`
	ErrorCode      string         `json:"errorCode,omitempty"`
	Errors         []snippetError `json:"errors,omitempty"`
}

base type that matches json response from api/snippet-matching

type SsoStatus added in v0.9.7

type SsoStatus struct {
	SsoEnabled bool `json:"ssoEnabled"`
	Meta       Meta `json:"_meta"`
	// contains filtered or unexported fields
}

func (SsoStatus) GetMimeType added in v0.9.7

func (SsoStatus) GetMimeType() string

type StatusCount added in v0.9.5

type StatusCount struct {
	Name  string `json:"name"` // [ IN_VIOLATION_OVERRIDDEN, NOT_IN_VIOLATION, IN_VIOLATION ]
	Value int    `json:"value"`
}

TODO could the names and values be from an enumeration?

type TotalCountable added in v0.9.5

type TotalCountable interface {
	Total() int
}

type TransitiveUpgradeSuggestion added in v0.9.12

type TransitiveUpgradeSuggestion struct {
	Component                string            `json:"component"`
	ComponentName            string            `json:"componentName"`
	ExternalId               string            `json:"externalId"`
	VersionName              string            `json:"versionName"`
	OriginExternalNamespace  string            `json:"originExternalNamespace"`
	OriginExternalId         string            `json:"originExternalId"`
	ShortTermUpgradeGuidance UpgradeSuggestion `json:"shortTermUpgradeGuidance"`
	LongTermUpgradeGuidance  UpgradeSuggestion `json:"longTermUpgradeGuidance"`
}

type Type added in v0.9.5

type Type int
const (
	Int    Type = iota // The IntOrString holds an int.
	String             // The IntOrString holds a string.
)

type URLParameters

type URLParameters interface {
	Parameters() map[string]string
}

URLParameters describes types used as parameter models for GET endpoints.

type UpgradeGuidance added in v0.9.7

type UpgradeGuidance struct {
	Version                 string             `json:"version"`
	VersionName             string             `json:"versionName"`
	Origin                  string             `json:"origin"`
	OriginName              string             `json:"originName"`
	OriginExternalNamespace string             `json:"originExternalNamespace"`
	OriginExternalId        string             `json:"originExternalId"`
	VulnerabilityRisk       *VulnerabilityRisk `json:"vulnerabilityRisk,omitempty"`
}

type UpgradeSuggestion added in v0.9.11

type UpgradeSuggestion struct {
	Version           string `json:"version"`
	VersionName       string `json:"versionName"`
	Origin            string `json:"origin"`
	ExternalId        string `json:"externalId"`
	VulnerabilityRisk Risk   `json:"vulnerabilityRisk"`
}

type User added in v0.9.3

type User struct {
	User      string `json:"user"`
	UserName  string `json:"userName"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Email     string `json:"email"`
	Active    bool   `json:"active"`
	Meta      Meta   `json:"_meta"`
}

type UserAssignmentRequest added in v0.9.3

type UserAssignmentRequest struct {
	User string `json:"user"`
}

type UserList added in v0.9.3

type UserList struct {
	ItemsListBase
	Items []User `json:"items"`
}

type UserRequest added in v0.9.3

type UserRequest struct {
	UserName  string `json:"userName"`
	FirstName string `json:"firstName"`
	LastName  string `json:"lastName"`
	Email     string `json:"email"`
	Password  string `json:"password"`
	Active    bool   `json:"active"`
}

type VulnerabilitiesList added in v0.9.6

type VulnerabilitiesList struct {
	ItemsListBase
	Items []Vulnerability `json:"items"`
	// contains filtered or unexported fields
}

returned by (what I saw so far --tandr) /api/component/xxx/version/yyy/vulnerabilities

func (VulnerabilitiesList) GetMimeType added in v0.9.6

func (VulnerabilitiesList) GetMimeType() string

type Vulnerability added in v0.9.5

type Vulnerability struct {
	Source                 string     `json:"source"`
	Name                   string     `json:"name"`
	Title                  string     `json:"title"`
	Description            string     `json:"description"`
	TechnicalDescription   string     `json:"technicalDescription"`
	PublishedDate          *time.Time `json:"publishedDate"`
	UpdatedDate            *time.Time `json:"updatedDate"`
	DisclosureDate         *time.Time `json:"disclosureDate"`
	ExploitPublishDate     *time.Time `json:"exploitPublishDate"`
	SolutionDate           *time.Time `json:"solutionDate"`
	Solution               string     `json:"solution"`
	Severity               string     `json:"severity"` //  [LOW, MEDIUM, HIGH, CRITICAL]
	CVSS2                  *CVSS      `json:"cvss2,omitempty"`
	CVSS3                  *CVSS      `json:"cvss3,omitempty"`
	UseCVSS3               bool       `json:"useCvss3"`
	OverallScore           float32    `json:"overallScore"`
	Classifications        []string   `json:"classifications"`
	Workaround             string     `json:"workaround,omitempty"`
	VendorFixDate          *time.Time `json:"vendorFixDate,omitempty"`
	Credit                 string     `json:"credit,omitempty"`
	DiscoveryDate          *time.Time `json:"discoveryDate,omitempty"`
	VendorNotificationDate *time.Time `json:"vendorNotificationDate,omitempty"`
	ZeroDay                bool       `json:"zeroDay,omitempty"`
	UnderReview            bool       `json:"underReview,omitempty"`
	ParentAdvisory         bool       `json:"parentAdvisory,omitempty"`
	BDSATags               []string   `json:"bdsaTags,omitempty"`
	Meta                   Meta       `json:"_meta"`
	// contains filtered or unexported fields
}

Data representation of the values returned by /api/vulnerabilities/$vulnerability

func (Vulnerability) GetMimeType added in v0.9.5

func (Vulnerability) GetMimeType() string

type VulnerabilityMetrics added in v0.9.5

type VulnerabilityMetrics struct {
	Exploitability   string  `json:"exploitability"`
	RemediationLevel string  `json:"remediationLevel"`
	ReportConfidence string  `json:"reportConfidence"`
	Score            float32 `json:"score"`
}

type VulnerabilityRisk added in v0.9.7

type VulnerabilityRisk struct {
	Critical uint `json:"critical"`
	High     uint `json:"high"`
	Medium   uint `json:"medium"`
	Low      uint `json:"low"`
}

type VulnerabilityWithRemediation

type VulnerabilityWithRemediation struct {
	VulnerabilityName          string     `json:"vulnerabilityName"`
	Description                string     `json:"description"`
	VulnerabilityPublishedDate *time.Time `json:"vulnerabilityPublishedDate"`
	VulnerabilityUpdatedDate   *time.Time `json:"vulnerabilityUpdatedDate"`
	BaseScore                  float32    `json:"baseScore"`
	ExploitabilitySubscore     float32    `json:"exploitabilitySubscore"`
	ImpactSubscore             float32    `json:"impactSubscore"`
	Source                     string     `json:"source"`
	Severity                   string     `json:"severity"`
	CweId                      string     `json:"cweId,omitempty"`
	RemediationStatus          string     `json:"remediationStatus"`
	RemediationTargetAt        *time.Time `json:"remediationTargetAt"`
	RemediationActualAt        *time.Time `json:"remediationActualAt"`
	RemediationCreatedAt       *time.Time `json:"remediationCreatedAt"`
	RemediationUpdatedAt       *time.Time `json:"remediationUpdatedAt"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL