Versions in this module Expand all Collapse all v0 v0.8.2 Apr 18, 2023 v0.8.1 Apr 12, 2023 Changes in this version + const DefaultTimeout + const DefaultUserAgent + func FetchAll(pageFetchFunc func(po PageOptions) (Page[T], error)) (items []T, err error) + func ForEach(pageFetchFunc func(po PageOptions) (Page[T], error), ...) (err error) + type APIError struct + Message string + StatusCode int + func (e APIError) Error() string + type APIKey struct + Key string + type About struct + Application string + Framework AboutFramework + SystemUUID uuid.UUID + Timestamp string + UUID uuid.UUID + Version string + type AboutFramework struct + Name string + Timestamp string + UUID uuid.UUID + Version string + type AboutService struct + func (as AboutService) Get(ctx context.Context) (a About, err error) + type Analysis struct + Comments []AnalysisComment + Details string + Justification AnalysisJustification + Response AnalysisResponse + State AnalysisState + Suppressed bool + func (a *Analysis) UnmarshalJSON(bytes []byte) error + type AnalysisComment struct + Comment string + Commenter string + Timestamp int + type AnalysisJustification string + const AnalysisJustificationCodeNotPresent + const AnalysisJustificationCodeNotReachable + const AnalysisJustificationNotSet + const AnalysisJustificationProtectedAtPerimeter + const AnalysisJustificationProtectedAtRuntime + const AnalysisJustificationProtectedByCompiler + const AnalysisJustificationProtectedByMitigatingControl + const AnalysisJustificationRequiresConfiguration + const AnalysisJustificationRequiresDependency + const AnalysisJustificationRequiresEnvironment + type AnalysisRequest struct + Comment string + Component uuid.UUID + Details string + Justification AnalysisJustification + Project uuid.UUID + Response AnalysisResponse + State AnalysisState + Suppressed *bool + Vulnerability uuid.UUID + type AnalysisResponse string + const AnalysisResponseCanNotFix + const AnalysisResponseNotSet + const AnalysisResponseRollback + const AnalysisResponseUpdate + const AnalysisResponseWillNotFix + const AnalysisResponseWorkaroundAvailable + type AnalysisService struct + func (as AnalysisService) Create(ctx context.Context, analysisReq AnalysisRequest) (a Analysis, err error) + func (as AnalysisService) Get(ctx context.Context, component, project, vulnerability uuid.UUID) (a Analysis, err error) + type AnalysisState string + const AnalysisStateExploitable + const AnalysisStateFalsePositive + const AnalysisStateInTriage + const AnalysisStateNotAffected + const AnalysisStateNotSet + const AnalysisStateResolved + type BOMFormat string + const BOMFormatJSON + const BOMFormatXML + type BOMService struct + func (bs BOMService) ExportComponent(ctx context.Context, componentUUID uuid.UUID, format BOMFormat) (bom string, err error) + func (bs BOMService) ExportProject(ctx context.Context, projectUUID uuid.UUID, format BOMFormat, ...) (bom string, err error) + func (bs BOMService) IsBeingProcessed(ctx context.Context, token BOMUploadToken) (bool, error) + func (bs BOMService) Upload(ctx context.Context, uploadReq BOMUploadRequest) (token BOMUploadToken, err error) + type BOMUploadRequest struct + AutoCreate bool + BOM string + ProjectName string + ProjectUUID *uuid.UUID + ProjectVersion string + type BOMUploadToken string + type BOMVariant string + const BOMVariantInventory + const BOMVariantWithVulnerabilities + type CWE struct + ID int + Name string + type Client struct + About AboutService + Analysis AnalysisService + BOM BOMService + Component ComponentService + Finding FindingService + License LicenseService + Metrics MetricsService + Permission PermissionService + Policy PolicyService + PolicyViolation PolicyViolationService + Project ProjectService + ProjectProperty ProjectPropertyService + Repository RepositoryService + Team TeamService + User UserService + VEX VEXService + ViolationAnalysis ViolationAnalysisService + Vulnerability VulnerabilityService + func NewClient(baseURL string, options ...ClientOption) (*Client, error) + func (c Client) BaseURL() *url.URL + type ClientOption func(*Client) error + func WithAPIKey(apiKey string) ClientOption + func WithBearerToken(token string) ClientOption + func WithDebug(debug bool) ClientOption + func WithTimeout(timeout time.Duration) ClientOption + func WithUserAgent(userAgent string) ClientOption + type Component struct + Author string + BLAKE2b_256 string + BLAKE2b_384 string + BLAKE2b_512 string + BLAKE3 string + CPE string + Classifier string + Copyright string + Description string + DirectDependencies string + Extension string + FileName string + Group string + Internal bool + License string + MD5 string + Name string + Notes string + PURL string + Publisher string + ResolvedLicense *License + SHA1 string + SHA256 string + SHA384 string + SHA3_256 string + SHA3_384 string + SHA3_512 string + SHA512 string + SWIDTagID string + UUID uuid.UUID + Version string + type ComponentService struct + func (cs ComponentService) Create(ctx context.Context, projectUUID string, component Component) (c Component, err error) + func (cs ComponentService) Get(ctx context.Context, componentUUID uuid.UUID) (c Component, err error) + func (cs ComponentService) GetAll(ctx context.Context, projectUUID uuid.UUID, po PageOptions) (p Page[Component], err error) + type Finding struct + Analysis Analysis + Attribution FindingAttribution + Component Component + Matrix string + Vulnerability Vulnerability + type FindingAttribution struct + AlternateIdentifier string + AnalyzerIdentity string + AttributedOn int + ReferenceURL string + UUID uuid.UUID + type FindingService struct + func (f FindingService) GetAll(ctx context.Context, projectUUID uuid.UUID, suppressed bool, po PageOptions) (p Page[Finding], err error) + type License struct + Comment string + DeprecatedLicenseID bool + FSFLibre bool + Header string + LicenseID string + Name string + OSIApproved bool + SeeAlso []string + Template string + Text string + UUID uuid.UUID + type LicenseService struct + func (l LicenseService) GetAll(ctx context.Context, po PageOptions) (p Page[License], err error) + type MetricsService struct + func (ms MetricsService) LatestPortfolioMetrics(ctx context.Context) (m PortfolioMetrics, err error) + func (ms MetricsService) LatestProjectMetrics(ctx context.Context, projectUUID uuid.UUID) (m ProjectMetrics, err error) + func (ms MetricsService) PortfolioMetricsSince(ctx context.Context, date time.Time) (m []PortfolioMetrics, err error) + func (ms MetricsService) PortfolioMetricsSinceDays(ctx context.Context, days uint) (m []PortfolioMetrics, err error) + func (ms MetricsService) ProjectMetricsSince(ctx context.Context, projectUUID uuid.UUID, date time.Time) (m []ProjectMetrics, err error) + func (ms MetricsService) ProjectMetricsSinceDays(ctx context.Context, projectUUID uuid.UUID, days uint) (m []ProjectMetrics, err error) + func (ms MetricsService) RefreshPortfolioMetrics(ctx context.Context) (err error) + func (ms MetricsService) RefreshProjectMetrics(ctx context.Context, projectUUID uuid.UUID) (err error) + type Page struct + Items []T + TotalCount int + type PageOptions struct + Offset int + PageNumber int + PageSize int + type ParentRef struct + UUID uuid.UUID + type Permission struct + Description string + Name string + type PermissionService struct + func (ps PermissionService) AddPermissionToTeam(ctx context.Context, permission Permission, team uuid.UUID) (t Team, err error) + func (ps PermissionService) GetAll(ctx context.Context, po PageOptions) (p Page[Permission], err error) + type Policy struct + Name string + Operator string + PolicyConditions []PolicyCondition + UUID uuid.UUID + ViolationState string + type PolicyCondition struct + Operator string + Policy *Policy + Subject string + UUID uuid.UUID + Value string + type PolicyService struct + func (ps PolicyService) Get(ctx context.Context, policyUUID uuid.UUID) (p Policy, err error) + func (ps PolicyService) GetAll(ctx context.Context, po PageOptions) (p Page[Policy], err error) + type PolicyViolation struct + Analysis *ViolationAnalysis + Component Component + PolicyCondition *PolicyCondition + Project Project + Text string + Type string + UUID uuid.UUID + type PolicyViolationService struct + func (pvs PolicyViolationService) GetAll(ctx context.Context, suppressed bool, po PageOptions) (p Page[PolicyViolation], err error) + func (pvs PolicyViolationService) GetAllForComponent(ctx context.Context, componentUUID uuid.UUID, suppressed bool, po PageOptions) (p Page[PolicyViolation], err error) + func (pvs PolicyViolationService) GetAllForProject(ctx context.Context, projectUUID uuid.UUID, suppressed bool, po PageOptions) (p Page[PolicyViolation], err error) + type PortfolioMetrics struct + Components int + Critical int + FindingsAudited int + FindingsTotal int + FindingsUnaudited int + FirstOccurrence int + High int + InheritedRiskScore float64 + LastOccurrence int + Low int + Medium int + PolicyViolationsAudited int + PolicyViolationsFail int + PolicyViolationsInfo int + PolicyViolationsLicenseAudited int + PolicyViolationsLicenseTotal int + PolicyViolationsLicenseUnaudited int + PolicyViolationsOperationalAudited int + PolicyViolationsOperationalTotal int + PolicyViolationsOperationalUnaudited int + PolicyViolationsSecurityAudited int + PolicyViolationsSecurityTotal int + PolicyViolationsSecurityUnaudited int + PolicyViolationsTotal int + PolicyViolationsUnaudited int + PolicyViolationsWarn int + Projects int + Suppressed int + Unassigned int + Vulnerabilities int + VulnerableComponents int + VulnerableProjects int + type Project struct + Active bool + Author string + CPE string + Classifier string + Description string + DirectDependencies string + Group string + LastBOMImport int + Metrics ProjectMetrics + Name string + PURL string + ParentRef *ParentRef + Properties []ProjectProperty + Publisher string + SWIDTagID string + Tags []Tag + UUID uuid.UUID + Version string + type ProjectCloneRequest struct + IncludeAuditHistory bool + IncludeComponents bool + IncludeProperties bool + IncludeServices bool + IncludeTags bool + ProjectUUID uuid.UUID + Version string + type ProjectMetrics struct + Components int + Critical int + FindingsAudited int + FindingsTotal int + FindingsUnaudited int + FirstOccurrence int + High int + InheritedRiskScore float64 + LastOccurrence int + Low int + Medium int + PolicyViolationsAudited int + PolicyViolationsFail int + PolicyViolationsInfo int + PolicyViolationsLicenseAudited int + PolicyViolationsLicenseTotal int + PolicyViolationsLicenseUnaudited int + PolicyViolationsOperationalAudited int + PolicyViolationsOperationalTotal int + PolicyViolationsOperationalUnaudited int + PolicyViolationsSecurityAudited int + PolicyViolationsSecurityTotal int + PolicyViolationsSecurityUnaudited int + PolicyViolationsTotal int + PolicyViolationsUnaudited int + PolicyViolationsWarn int + Suppressed int + Unassigned int + Vulnerabilities int + VulnerableComponents int + type ProjectProperty struct + Description string + Group string + Name string + Type string + Value string + type ProjectPropertyService struct + func (ps ProjectPropertyService) Create(ctx context.Context, projectUUID uuid.UUID, property ProjectProperty) (p ProjectProperty, err error) + func (ps ProjectPropertyService) Delete(ctx context.Context, projectUUID uuid.UUID, groupName, propertyName string) (err error) + func (ps ProjectPropertyService) GetAll(ctx context.Context, projectUUID uuid.UUID, po PageOptions) (p Page[ProjectProperty], err error) + func (ps ProjectPropertyService) Update(ctx context.Context, projectUUID uuid.UUID, property ProjectProperty) (p ProjectProperty, err error) + type ProjectService struct + func (ps ProjectService) Clone(ctx context.Context, cloneReq ProjectCloneRequest) (err error) + func (ps ProjectService) Create(ctx context.Context, project Project) (p Project, err error) + func (ps ProjectService) Delete(ctx context.Context, projectUUID uuid.UUID) (err error) + func (ps ProjectService) Get(ctx context.Context, projectUUID uuid.UUID) (p Project, err error) + func (ps ProjectService) GetAll(ctx context.Context, po PageOptions) (p Page[Project], err error) + func (ps ProjectService) GetProjectsForName(ctx context.Context, name string, excludeInactive, onlyRoot bool) (p []Project, err error) + func (ps ProjectService) Lookup(ctx context.Context, name, version string) (p Project, err error) + func (ps ProjectService) Patch(ctx context.Context, projectUUID uuid.UUID, project Project) (p Project, err error) + func (ps ProjectService) Update(ctx context.Context, project Project) (p Project, err error) + type RepositoryMetaComponent struct + LatestVersion string + type RepositoryService struct + func (rs RepositoryService) GetMetaComponent(ctx context.Context, purl string) (r RepositoryMetaComponent, err error) + type Tag struct + Name string + type Team struct + APIKeys []APIKey + Name string + Permissions []Permission + UUID uuid.UUID + type TeamService struct + func (ts TeamService) Create(ctx context.Context, team Team) (t Team, err error) + func (ts TeamService) Delete(ctx context.Context, team Team) (err error) + func (ts TeamService) GenerateAPIKey(ctx context.Context, teamUUID uuid.UUID) (key string, err error) + func (ts TeamService) Get(ctx context.Context, teamUUID uuid.UUID) (t Team, err error) + func (ts TeamService) GetAll(ctx context.Context, po PageOptions) (p Page[Team], err error) + type UserService struct + func (us UserService) ForceChangePassword(ctx context.Context, username, password, newPassword string) (err error) + func (us UserService) Login(ctx context.Context, username, password string) (token string, err error) + type VEXService struct + func (vs VEXService) ExportCycloneDX(ctx context.Context, projectUUID uuid.UUID) (vex string, err error) + func (vs VEXService) Upload(ctx context.Context, uploadReq VEXUploadRequest) (err error) + type VEXUploadRequest struct + ProjectName string + ProjectUUID *uuid.UUID + ProjectVersion string + VEX string + type ViolationAnalysis struct + Comments []ViolationAnalysisComment + State ViolationAnalysisState + Suppressed bool + type ViolationAnalysisComment struct + Comment string + Commenter string + Timestamp int + type ViolationAnalysisRequest struct + Comment string + Component uuid.UUID + PolicyViolation uuid.UUID + State ViolationAnalysisState + Suppressed *bool + type ViolationAnalysisService struct + func (vas ViolationAnalysisService) Get(ctx context.Context, componentUUID, policyViolationUUID uuid.UUID) (va ViolationAnalysis, err error) + func (vas ViolationAnalysisService) Update(ctx context.Context, analysisReq ViolationAnalysisRequest) (va ViolationAnalysis, err error) + type ViolationAnalysisState string + const ViolationAnalysisStateApproved + const ViolationAnalysisStateNotSet + const ViolationAnalysisStateRejected + type Vulnerability struct + CVSSV2BaseScore float64 + CVSSV2ExploitabilitySubScore float64 + CVSSV2ImpactSubScore float64 + CVSSV2Vector string + CVSSV3BaseScore float64 + CVSSV3ExploitabilitySubScore float64 + CVSSV3ImpactSubScore float64 + CVSSV3Vector string + CWE CWE + CWEs []CWE + Created string + Credits string + Description string + PatchedVersions string + Published string + Recommendation string + References string + Severity string + Source string + SubTitle string + Title string + UUID uuid.UUID + Updated string + VulnID string + VulnerableVersions string + type VulnerabilityService struct + func (vs VulnerabilityService) Assign(ctx context.Context, vulnUUID, componentUUID uuid.UUID) (err error) + func (vs VulnerabilityService) Get(ctx context.Context, vulnUUID uuid.UUID) (v Vulnerability, err error) + func (vs VulnerabilityService) GetAllForComponent(ctx context.Context, componentUUID uuid.UUID, po PageOptions) (p Page[Vulnerability], err error) + func (vs VulnerabilityService) GetAllForProject(ctx context.Context, projectUUID uuid.UUID, po PageOptions) (p Page[Vulnerability], err error) + func (vs VulnerabilityService) Unassign(ctx context.Context, vulnUUID, componentUUID uuid.UUID) (err error)