Versions in this module Expand all Collapse all v0 v0.15.2 Apr 17, 2024 v0.15.1 Apr 17, 2024 v0.15.0 Apr 17, 2024 v0.14.1 Apr 17, 2024 Changes in this version type ProjectService + func (ps ProjectService) GetChildrenOf(ctx context.Context, projectUUID uuid.UUID) (p []Project, err error) v0.14.0 Apr 12, 2024 Changes in this version + const DefaultTimeout + const DefaultUserAgent + const RepositoryTypeCargo + const RepositoryTypeComposer + const RepositoryTypeCpan + const RepositoryTypeGem + const RepositoryTypeGoModules + const RepositoryTypeHex + const RepositoryTypeMaven + const RepositoryTypeNpm + const RepositoryTypeNuget + const RepositoryTypePypi + const RepositoryTypeUnsupported + func FetchAll[T any](pageFetchFunc func(po PageOptions) (Page[T], error)) (items []T, err error) + func ForEach[T any](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 + 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) PostBom(ctx context.Context, uploadReq BOMUploadRequest) (token BOMUploadToken, err error) + func (bs BOMService) Upload(ctx context.Context, uploadReq BOMUploadRequest) (token BOMUploadToken, err error) + type BOMUploadRequest struct + AutoCreate bool + BOM string + ParentName string + ParentUUID *uuid.UUID + ParentVersion string + ProjectName string + ProjectUUID *uuid.UUID + ProjectVersion string + type BOMUploadToken string + type BOMVariant string + const BOMVariantInventory + const BOMVariantVDR + 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 + OIDC OIDCService + Permission PermissionService + Policy PolicyService + PolicyCondition PolicyConditionService + 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 WithHttpClient(client *http.Client) ClientOption + func WithMTLS(caCertFile string, clientCertFile string, clientKeyFile string) 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 + ExternalReferences []ExternalReference + 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) + func (cs ComponentService) Update(ctx context.Context, component Component) (c Component, err error) + type ExternalReference struct + Comment string + Type string + URL string + type Finding struct + Analysis FindingAnalysis + Attribution FindingAttribution + Component FindingComponent + Matrix string + Vulnerability FindingVulnerability + type FindingAnalysis struct + State string + Suppressed bool + type FindingAttribution struct + AlternateIdentifier string + AnalyzerIdentity string + AttributedOn int + ReferenceURL string + UUID uuid.UUID + type FindingComponent struct + CPE string + Group string + LatestVersion string + Name string + PURL string + Project uuid.UUID + UUID uuid.UUID + Version string + type FindingService struct + func (f FindingService) AnalyzeProject(ctx context.Context, projectUUID uuid.UUID) (token BOMUploadToken, err error) + func (f FindingService) ExportFPF(ctx context.Context, projectUUID uuid.UUID) (d []byte, err error) + func (f FindingService) GetAll(ctx context.Context, projectUUID uuid.UUID, suppressed bool, po PageOptions) (p Page[Finding], err error) + type FindingVulnerability struct + Aliases []VulnerabilityAlias + CVSSV2BaseScore float64 + CVSSV3BaseScore float64 + CWEs []CWE + Description string + EPSSPercentile float64 + EPSSScore float64 + OWASPRRBusinessImpactScore float64 + OWASPRRLikelihoodScore float64 + OWASPRRTechnicalImpactScore float64 + Recommendation string + Severity string + SeverityRank int + Source string + SubTitle string + Title string + UUID uuid.UUID + VulnID string + 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 OIDCGroup struct + Name string + UUID uuid.UUID + type OIDCMapping struct + Group OIDCGroup + UUID uuid.UUID + type OIDCMappingRequest struct + Group uuid.UUID + Team uuid.UUID + type OIDCService struct + func (s OIDCService) AddTeamMapping(ctx context.Context, mapping OIDCMappingRequest) (m OIDCMapping, err error) + func (s OIDCService) Available(ctx context.Context) (available bool, err error) + func (s OIDCService) CreateGroup(ctx context.Context, name string) (g OIDCGroup, err error) + func (s OIDCService) DeleteGroup(ctx context.Context, groupUUID uuid.UUID) (err error) + func (s OIDCService) GetAllGroups(ctx context.Context, po PageOptions) (p Page[OIDCGroup], err error) + func (s OIDCService) GetAllTeamsOf(ctx context.Context, group OIDCGroup, po PageOptions) (p Page[Team], err error) + func (s OIDCService) RemoveTeamMapping(ctx context.Context, mappingID uuid.UUID) (err error) + func (s OIDCService) UpdateGroup(ctx context.Context, group OIDCGroup) (g OIDCGroup, 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) + func (ps PermissionService) RemovePermissionFromTeam(ctx context.Context, permission Permission, team uuid.UUID) (t Team, err error) + type Policy struct + Global bool + IncludeChildren bool + Name string + Operator PolicyOperator + PolicyConditions []PolicyCondition + Projects []Project + Tags []Tag + UUID uuid.UUID + ViolationState PolicyViolationState + type PolicyCondition struct + Operator PolicyConditionOperator + Policy *Policy + Subject PolicyConditionSubject + UUID uuid.UUID + Value string + type PolicyConditionOperator string + const PolicyConditionOperatorContainsAll + const PolicyConditionOperatorContainsAny + const PolicyConditionOperatorIs + const PolicyConditionOperatorIsNot + const PolicyConditionOperatorMatches + const PolicyConditionOperatorNoMatch + const PolicyConditionOperatorNumericEqual + const PolicyConditionOperatorNumericGreaterThan + const PolicyConditionOperatorNumericGreaterThanOrEqual + const PolicyConditionOperatorNumericLessThan + const PolicyConditionOperatorNumericLesserThanOrEqual + const PolicyConditionOperatorNumericNotEqual + type PolicyConditionService struct + func (pcs PolicyConditionService) Create(ctx context.Context, policyUUID uuid.UUID, policyCondition PolicyCondition) (p PolicyCondition, err error) + func (pcs PolicyConditionService) Delete(ctx context.Context, policyConditionUUID uuid.UUID) (err error) + func (pcs PolicyConditionService) Update(ctx context.Context, policyCondition PolicyCondition) (p PolicyCondition, err error) + type PolicyConditionSubject string + const PolicyConditionSubjectAge + const PolicyConditionSubjectCPE + const PolicyConditionSubjectCWE + const PolicyConditionSubjectComponentHash + const PolicyConditionSubjectCoordinates + const PolicyConditionSubjectLicense + const PolicyConditionSubjectLicenseGroup + const PolicyConditionSubjectPackageURL + const PolicyConditionSubjectSWIDTagID + const PolicyConditionSubjectSeverity + const PolicyConditionSubjectVersion + const PolicyConditionSubjectVulnerabilityID + type PolicyOperator string + const PolicyOperatorAll + const PolicyOperatorAny + type PolicyService struct + func (ps PolicyService) AddProject(ctx context.Context, policyUUID, projectUUID uuid.UUID) (p Policy, err error) + func (ps PolicyService) AddTag(ctx context.Context, policyUUID uuid.UUID, tagName string) (p Policy, err error) + func (ps PolicyService) Create(ctx context.Context, policy Policy) (p Policy, err error) + func (ps PolicyService) Delete(ctx context.Context, policyUUID uuid.UUID) (err error) + func (ps PolicyService) DeleteProject(ctx context.Context, policyUUID, projectUUID uuid.UUID) (p Policy, err error) + func (ps PolicyService) DeleteTag(ctx context.Context, policyUUID uuid.UUID, tagName string) (p Policy, err error) + 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) + func (ps PolicyService) Update(ctx context.Context, policy Policy) (p 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 PolicyViolationState string + const PolicyViolationStateFail + const PolicyViolationStateInfo + const PolicyViolationStateWarn + 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) GetAllByTag(ctx context.Context, tag string, excludeInactive, onlyRoot bool, ...) (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 Repository struct + Enabled bool + Identifier string + Internal bool + Password string + ResolutionOrder int + Type RepositoryType + UUID uuid.UUID + Url string + Username string + type RepositoryMetaComponent struct + LatestVersion string + type RepositoryService struct + func (rs RepositoryService) Create(ctx context.Context, repo Repository) (r Repository, err error) + func (rs RepositoryService) Delete(ctx context.Context, reposUUID uuid.UUID) (err error) + func (rs RepositoryService) GetAll(ctx context.Context, po PageOptions) (p Page[Repository], err error) + func (rs RepositoryService) GetByType(ctx context.Context, repoType RepositoryType, po PageOptions) (p Page[Repository], err error) + func (rs RepositoryService) GetMetaComponent(ctx context.Context, purl string) (r RepositoryMetaComponent, err error) + func (rs RepositoryService) Update(ctx context.Context, repo Repository) (r Repository, err error) + type RepositoryType string + type Tag struct + Name string + type Team struct + APIKeys []APIKey + MappedOIDCGroups []OIDCMapping + 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) + func (ts TeamService) Update(ctx context.Context, team Team) (t 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 + Aliases []VulnerabilityAlias + CVSSV2BaseScore float64 + CVSSV2ExploitabilitySubScore float64 + CVSSV2ImpactSubScore float64 + CVSSV2Vector string + CVSSV3BaseScore float64 + CVSSV3ExploitabilitySubScore float64 + CVSSV3ImpactSubScore float64 + CVSSV3Vector string + CWE CWE + CWEs []CWE + Components *[]Component + Created string + Credits string + Description string + EPSSPercentile float64 + EPSSScore float64 + OWASPRRBusinessImpactScore float64 + OWASPRRLikelihoodScore float64 + OWASPRRTechnicalImpactScore float64 + OWASPRRVector 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 VulnerabilityAlias struct + CveID string + GhsaID string + GsdID string + InternalID string + OsvID string + SnykID string + SonatypeId string + VulnDbID 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) GetAffectedProjects(ctx context.Context, source string, vulnID string, po PageOptions) (p Page[Project], err error) + func (vs VulnerabilityService) GetAllForComponent(ctx context.Context, componentUUID uuid.UUID, suppressed bool, po PageOptions) (p Page[Vulnerability], err error) + func (vs VulnerabilityService) GetAllForProject(ctx context.Context, projectUUID uuid.UUID, suppressed bool, po PageOptions) (p Page[Vulnerability], err error) + func (vs VulnerabilityService) Unassign(ctx context.Context, vulnUUID, componentUUID uuid.UUID) (err error)