Documentation ¶
Overview ¶
Example (FetchAllFindings) ¶
This example demonstrates how to fetch all findings for a given project.
client, _ := dtrack.NewClient("https://dtrack.example.com", dtrack.WithAPIKey("...")) projectUUID := uuid.MustParse("2d16089e-6d3a-437e-b334-f27eb2cbd7f4") _, err := dtrack.FetchAll(func(po dtrack.PageOptions) (dtrack.Page[dtrack.Finding], error) { return client.Finding.GetAll(context.TODO(), projectUUID, false, po) }) if err != nil { panic(err) }
Output:
Example (UploadBOM) ¶
This example demonstrates how to upload a Bill of Materials and wait for its processing to complete.
client, _ := dtrack.NewClient("https://dtrack.example.com", dtrack.WithAPIKey("...")) bomContent, err := os.ReadFile("bom.xml") if err != nil { panic(err) } uploadToken, err := client.BOM.Upload(context.TODO(), dtrack.BOMUploadRequest{ ProjectName: "acme-app", ProjectVersion: "1.0.0", AutoCreate: true, BOM: base64.StdEncoding.EncodeToString(bomContent), }) if err != nil { panic(err) } var ( doneChan = make(chan struct{}) errChan = make(chan error) ticker = time.NewTicker(1 * time.Second) timeout = time.After(30 * time.Second) ) go func() { defer func() { close(doneChan) close(errChan) }() for { select { case <-ticker.C: processing, err := client.BOM.IsBeingProcessed(context.TODO(), uploadToken) if err != nil { errChan <- err return } if !processing { doneChan <- struct{}{} return } case <-timeout: errChan <- fmt.Errorf("timeout exceeded") return } } }() select { case <-doneChan: fmt.Println("bom processing completed") case <-errChan: fmt.Printf("failed to wait for bom processing: %v\n", err) }
Output:
Index ¶
- Constants
- 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
- type APIKey
- type About
- type AboutFramework
- type AboutService
- type Analysis
- type AnalysisComment
- type AnalysisJustification
- type AnalysisRequest
- type AnalysisResponse
- type AnalysisService
- type AnalysisState
- type BOMFormat
- type BOMService
- 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
- type BOMUploadToken
- type BOMVariant
- type CWE
- type Client
- type ClientOption
- type Component
- type ComponentService
- 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
- type FindingAttribution
- type FindingService
- type License
- type LicenseService
- type MetricsService
- 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
- type PageOptions
- type Policy
- type PolicyCondition
- type PolicyService
- type PolicyViolation
- type PolicyViolationService
- 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
- type Project
- type ProjectCloneRequest
- type ProjectMetrics
- type ProjectProperty
- type ProjectPropertyService
- 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
- 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) 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
- type RepositoryService
- type Tag
- type Team
- type TeamService
- type UserService
- type VEXService
- type VEXUploadRequest
- type ViolationAnalysis
- type ViolationAnalysisComment
- type ViolationAnalysisRequest
- type ViolationAnalysisService
- type ViolationAnalysisState
- type Vulnerability
- type VulnerabilityService
- 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)
Examples ¶
Constants ¶
View Source
const ( DefaultTimeout = 10 * time.Second DefaultUserAgent = "github.com/nscuro/dtrack-client" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AboutFramework ¶
type AboutService ¶
type AboutService struct {
// contains filtered or unexported fields
}
type Analysis ¶
type Analysis struct { Comments []AnalysisComment `json:"analysisComments"` State AnalysisState `json:"analysisState"` Justification AnalysisJustification `json:"analysisJustification"` Response AnalysisResponse `json:"analysisResponse"` Details string `json:"analysisDetails"` Suppressed bool `json:"isSuppressed"` }
func (*Analysis) UnmarshalJSON ¶
type AnalysisComment ¶
type AnalysisJustification ¶ added in v0.6.0
type AnalysisJustification string
const ( AnalysisJustificationCodeNotPresent AnalysisJustification = "CODE_NOT_PRESENT" AnalysisJustificationCodeNotReachable AnalysisJustification = "CODE_NOT_REACHABLE" AnalysisJustificationNotSet AnalysisJustification = "NOT_SET" AnalysisJustificationProtectedAtPerimeter AnalysisJustification = "PROTECTED_AT_PERIMETER" AnalysisJustificationProtectedAtRuntime AnalysisJustification = "PROTECTED_AT_RUNTIME" AnalysisJustificationProtectedByCompiler AnalysisJustification = "PROTECTED_BY_COMPILER" AnalysisJustificationProtectedByMitigatingControl AnalysisJustification = "PROTECTED_BY_MITIGATING_CONTROL" AnalysisJustificationRequiresConfiguration AnalysisJustification = "REQUIRES_CONFIGURATION" AnalysisJustificationRequiresDependency AnalysisJustification = "REQUIRES_DEPENDENCY" AnalysisJustificationRequiresEnvironment AnalysisJustification = "REQUIRES_ENVIRONMENT" )
type AnalysisRequest ¶
type AnalysisRequest struct { Component uuid.UUID `json:"component"` Project uuid.UUID `json:"project"` Vulnerability uuid.UUID `json:"vulnerability"` Comment string `json:"comment,omitempty"` State AnalysisState `json:"analysisState,omitempty"` Justification AnalysisJustification `json:"analysisJustification,omitempty"` Response AnalysisResponse `json:"analysisResponse,omitempty"` Details string `json:"analysisDetails,omitempty"` Suppressed *bool `json:"isSuppressed,omitempty"` }
type AnalysisResponse ¶ added in v0.6.0
type AnalysisResponse string
const ( AnalysisResponseCanNotFix AnalysisResponse = "CAN_NOT_FIX" AnalysisResponseNotSet AnalysisResponse = "NOT_SET" AnalysisResponseRollback AnalysisResponse = "ROLLBACK" AnalysisResponseUpdate AnalysisResponse = "UPDATE" AnalysisResponseWillNotFix AnalysisResponse = "WILL_NOT_FIX" AnalysisResponseWorkaroundAvailable AnalysisResponse = "WORKAROUND_AVAILABLE" )
type AnalysisService ¶
type AnalysisService struct {
// contains filtered or unexported fields
}
func (AnalysisService) Create ¶
func (as AnalysisService) Create(ctx context.Context, analysisReq AnalysisRequest) (a Analysis, err error)
type AnalysisState ¶
type AnalysisState string
const ( AnalysisStateExploitable AnalysisState = "EXPLOITABLE" AnalysisStateFalsePositive AnalysisState = "FALSE_POSITIVE" AnalysisStateInTriage AnalysisState = "IN_TRIAGE" AnalysisStateNotAffected AnalysisState = "NOT_AFFECTED" AnalysisStateNotSet AnalysisState = "NOT_SET" AnalysisStateResolved AnalysisState = "RESOLVED" )
type BOMService ¶
type BOMService struct {
// contains filtered or unexported fields
}
func (BOMService) ExportComponent ¶ added in v0.6.0
func (BOMService) ExportProject ¶ added in v0.6.0
func (bs BOMService) ExportProject(ctx context.Context, projectUUID uuid.UUID, format BOMFormat, variant BOMVariant) (bom string, err error)
func (BOMService) IsBeingProcessed ¶
func (bs BOMService) IsBeingProcessed(ctx context.Context, token BOMUploadToken) (bool, error)
func (BOMService) Upload ¶
func (bs BOMService) Upload(ctx context.Context, uploadReq BOMUploadRequest) (token BOMUploadToken, err error)
type BOMUploadRequest ¶
type BOMUploadToken ¶
type BOMUploadToken string
type BOMVariant ¶ added in v0.6.0
type BOMVariant string
const ( BOMVariantInventory BOMVariant = "inventory" BOMVariantWithVulnerabilities BOMVariant = "withVulnerabilities" )
type Client ¶
type Client struct { About AboutService Analysis AnalysisService BOM BOMService Component ComponentService Finding FindingService License LicenseService Metrics MetricsService Policy PolicyService PolicyViolation PolicyViolationService Project ProjectService ProjectProperty ProjectPropertyService Repository RepositoryService Team TeamService User UserService VEX VEXService ViolationAnalysis ViolationAnalysisService Vulnerability VulnerabilityService // contains filtered or unexported fields }
type ClientOption ¶
func WithAPIKey ¶
func WithAPIKey(apiKey string) ClientOption
func WithBearerToken ¶ added in v0.4.0
func WithBearerToken(token string) ClientOption
func WithDebug ¶
func WithDebug(debug bool) ClientOption
WithDebug toggles the debug mode. When enabled, HTTP requests and responses will be logged to stderr. DO NOT USE IN PRODUCTION, authorization headers are not cleared!
func WithTimeout ¶
func WithTimeout(timeout time.Duration) ClientOption
WithTimeout overrides the default timeout.
func WithUserAgent ¶
func WithUserAgent(userAgent string) ClientOption
WithUserAgent overrides the default user agent.
type Component ¶
type Component struct { UUID uuid.UUID `json:"uuid,omitempty"` Author string `json:"author,omitempty"` Publisher string `json:"publisher,omitempty"` Group string `json:"group,omitempty"` Name string `json:"name"` Version string `json:"version"` Classifier string `json:"classifier,omitempty"` FileName string `json:"filename,omitempty"` Extension string `json:"extension,omitempty"` MD5 string `json:"md5,omitempty"` SHA1 string `json:"sha1,omitempty"` SHA256 string `json:"sha256,omitempty"` SHA384 string `json:"sha384,omitempty"` SHA512 string `json:"sha512,omitempty"` SHA3_256 string `json:"sha3_256,omitempty"` SHA3_384 string `json:"sha3_384,omitempty"` SHA3_512 string `json:"sha3_512,omitempty"` BLAKE2b_256 string `json:"blake2b_256,omitempty"` BLAKE2b_384 string `json:"blake2b_384,omitempty"` BLAKE2b_512 string `json:"blake2b_512,omitempty"` BLAKE3 string `json:"blake3,omitempty"` CPE string `json:"cpe,omitempty"` PURL string `json:"purl,omitempty"` SWIDTagID string `json:"swidTagId,omitempty"` Internal bool `json:"isInternal,omitempty"` Description string `json:"description,omitempty"` Copyright string `json:"copyright,omitempty"` License string `json:"license,omitempty"` ResolvedLicense *License `json:"resolvedLicense,omitempty"` DirectDependencies string `json:"directDependencies,omitempty"` Notes string `json:"notes,omitempty"` }
type ComponentService ¶
type ComponentService struct {
// contains filtered or unexported fields
}
type Finding ¶
type Finding struct { Attribution FindingAttribution `json:"attribution"` Analysis Analysis `json:"analysis"` Component Component `json:"component"` Matrix string `json:"matrix"` Vulnerability Vulnerability `json:"vulnerability"` }
type FindingAttribution ¶
type FindingService ¶
type FindingService struct {
// contains filtered or unexported fields
}
type License ¶ added in v0.2.0
type License struct { UUID uuid.UUID `json:"uuid"` Name string `json:"name"` Text string `json:"text"` Template string `json:"template"` Header string `json:"header"` Comment string `json:"comment"` LicenseID string `json:"licenseId"` OSIApproved bool `json:"isOsiApproved"` FSFLibre bool `json:"isFsfLibre"` DeprecatedLicenseID bool `json:"isDeprecatedLicenseId"` SeeAlso []string `json:"seeAlso"` }
type LicenseService ¶ added in v0.2.0
type LicenseService struct {
// contains filtered or unexported fields
}
func (LicenseService) GetAll ¶ added in v0.2.0
func (l LicenseService) GetAll(ctx context.Context, po PageOptions) (p Page[License], err error)
type MetricsService ¶ added in v0.5.0
type MetricsService struct {
// contains filtered or unexported fields
}
func (MetricsService) LatestPortfolioMetrics ¶ added in v0.5.0
func (ms MetricsService) LatestPortfolioMetrics(ctx context.Context) (m PortfolioMetrics, err error)
func (MetricsService) LatestProjectMetrics ¶ added in v0.7.0
func (ms MetricsService) LatestProjectMetrics(ctx context.Context, projectUUID uuid.UUID) (m ProjectMetrics, err error)
func (MetricsService) PortfolioMetricsSince ¶ added in v0.5.0
func (ms MetricsService) PortfolioMetricsSince(ctx context.Context, date time.Time) (m []PortfolioMetrics, err error)
func (MetricsService) PortfolioMetricsSinceDays ¶ added in v0.5.0
func (ms MetricsService) PortfolioMetricsSinceDays(ctx context.Context, days uint) (m []PortfolioMetrics, err error)
func (MetricsService) ProjectMetricsSince ¶ added in v0.7.0
func (ms MetricsService) ProjectMetricsSince(ctx context.Context, projectUUID uuid.UUID, date time.Time) (m []ProjectMetrics, err error)
func (MetricsService) ProjectMetricsSinceDays ¶ added in v0.7.0
func (ms MetricsService) ProjectMetricsSinceDays(ctx context.Context, projectUUID uuid.UUID, days uint) (m []ProjectMetrics, err error)
func (MetricsService) RefreshPortfolioMetrics ¶ added in v0.5.0
func (ms MetricsService) RefreshPortfolioMetrics(ctx context.Context) (err error)
func (MetricsService) RefreshProjectMetrics ¶ added in v0.7.0
type PageOptions ¶
type PolicyCondition ¶ added in v0.6.0
type PolicyService ¶ added in v0.6.0
type PolicyService struct {
// contains filtered or unexported fields
}
func (PolicyService) GetAll ¶ added in v0.6.0
func (ps PolicyService) GetAll(ctx context.Context, po PageOptions) (p Page[Policy], err error)
type PolicyViolation ¶ added in v0.6.0
type PolicyViolation struct { UUID uuid.UUID Component Component `json:"component"` Project Project `json:"project"` PolicyCondition *PolicyCondition `json:"policyCondition,omitempty"` Type string `json:"type"` Text string `json:"text"` Analysis *ViolationAnalysis `json:"analysis,omitempty"` }
type PolicyViolationService ¶ added in v0.6.0
type PolicyViolationService struct {
// contains filtered or unexported fields
}
func (PolicyViolationService) GetAll ¶ added in v0.7.0
func (pvs PolicyViolationService) GetAll(ctx context.Context, suppressed bool, po PageOptions) (p Page[PolicyViolation], err error)
func (PolicyViolationService) GetAllForComponent ¶ added in v0.6.0
func (pvs PolicyViolationService) GetAllForComponent(ctx context.Context, componentUUID uuid.UUID, suppressed bool, po PageOptions) (p Page[PolicyViolation], err error)
func (PolicyViolationService) GetAllForProject ¶ added in v0.6.0
func (pvs PolicyViolationService) GetAllForProject(ctx context.Context, projectUUID uuid.UUID, suppressed bool, po PageOptions) (p Page[PolicyViolation], err error)
type PortfolioMetrics ¶ added in v0.5.0
type PortfolioMetrics struct { FirstOccurrence int `json:"firstOccurrence"` LastOccurrence int `json:"lastOccurrence"` InheritedRiskScore float64 `json:"inheritedRiskScore"` Vulnerabilities int `json:"vulnerabilities"` VulnerableProjects int `json:"vulnerableProjects"` VulnerableComponents int `json:"vulnerableComponents"` Projects int `json:"projects"` Components int `json:"components"` Suppressed int `json:"suppressed"` Critical int `json:"critical"` High int `json:"high"` Medium int `json:"medium"` Low int `json:"low"` Unassigned int `json:"unassigned"` FindingsTotal int `json:"findingsTotal"` FindingsAudited int `json:"findingsAudited"` FindingsUnaudited int `json:"findingsUnaudited"` PolicyViolationsTotal int `json:"policyViolationsTotal"` PolicyViolationsFail int `json:"policyViolationsFail"` PolicyViolationsWarn int `json:"policyViolationsWarn"` PolicyViolationsInfo int `json:"policyViolationsInfo"` PolicyViolationsAudited int `json:"policyViolationsAudited"` PolicyViolationsUnaudited int `json:"policyViolationsUnaudited"` PolicyViolationsSecurityTotal int `json:"policyViolationsSecurityTotal"` PolicyViolationsSecurityAudited int `json:"policyViolationsSecurityAudited"` PolicyViolationsSecurityUnaudited int `json:"policyViolationsSecurityUnaudited"` PolicyViolationsLicenseTotal int `json:"policyViolationsLicenseTotal"` PolicyViolationsLicenseAudited int `json:"policyViolationsLicenseAudited"` PolicyViolationsLicenseUnaudited int `json:"policyViolationsLicenseUnaudited"` PolicyViolationsOperationalTotal int `json:"policyViolationsOperationalTotal"` PolicyViolationsOperationalAudited int `json:"policyViolationsOperationalAudited"` PolicyViolationsOperationalUnaudited int `json:"policyViolationsOperationalUnaudited"` }
type Project ¶
type Project struct { UUID uuid.UUID `json:"uuid,omitempty"` Author string `json:"author,omitempty"` Publisher string `json:"publisher,omitempty"` Group string `json:"group,omitempty"` Name string `json:"name,omitempty"` Description string `json:"description,omitempty"` Version string `json:"version,omitempty"` Classifier string `json:"classifier,omitempty"` CPE string `json:"cpe,omitempty"` PURL string `json:"purl,omitempty"` SWIDTagID string `json:"swidTagId,omitempty"` DirectDependencies string `json:"directDependencies,omitempty"` Properties []ProjectProperty `json:"properties,omitempty"` Tags []Tag `json:"tags,omitempty"` Active bool `json:"active"` Metrics ProjectMetrics `json:"metrics"` LastBOMImport int `json:"lastBomImport"` }
type ProjectCloneRequest ¶
type ProjectCloneRequest struct { ProjectUUID uuid.UUID `json:"project"` Version string `json:"version"` IncludeAuditHistory bool `json:"includeAuditHistory"` IncludeComponents bool `json:"includeComponents"` IncludeProperties bool `json:"includeProperties"` IncludeServices bool `json:"includeServices"` IncludeTags bool `json:"includeTags"` }
type ProjectMetrics ¶ added in v0.7.0
type ProjectMetrics struct { FirstOccurrence int `json:"firstOccurrence"` LastOccurrence int `json:"lastOccurrence"` InheritedRiskScore float64 `json:"inheritedRiskScore"` Vulnerabilities int `json:"vulnerabilities"` VulnerableComponents int `json:"vulnerableComponents"` Components int `json:"components"` Suppressed int `json:"suppressed"` Critical int `json:"critical"` High int `json:"high"` Medium int `json:"medium"` Low int `json:"low"` Unassigned int `json:"unassigned"` FindingsTotal int `json:"findingsTotal"` FindingsAudited int `json:"findingsAudited"` FindingsUnaudited int `json:"findingsUnaudited"` PolicyViolationsTotal int `json:"policyViolationsTotal"` PolicyViolationsFail int `json:"policyViolationsFail"` PolicyViolationsWarn int `json:"policyViolationsWarn"` PolicyViolationsInfo int `json:"policyViolationsInfo"` PolicyViolationsAudited int `json:"policyViolationsAudited"` PolicyViolationsUnaudited int `json:"policyViolationsUnaudited"` PolicyViolationsSecurityTotal int `json:"policyViolationsSecurityTotal"` PolicyViolationsSecurityAudited int `json:"policyViolationsSecurityAudited"` PolicyViolationsSecurityUnaudited int `json:"policyViolationsSecurityUnaudited"` PolicyViolationsLicenseTotal int `json:"policyViolationsLicenseTotal"` PolicyViolationsLicenseAudited int `json:"policyViolationsLicenseAudited"` PolicyViolationsLicenseUnaudited int `json:"policyViolationsLicenseUnaudited"` PolicyViolationsOperationalTotal int `json:"policyViolationsOperationalTotal"` PolicyViolationsOperationalAudited int `json:"policyViolationsOperationalAudited"` PolicyViolationsOperationalUnaudited int `json:"policyViolationsOperationalUnaudited"` }
type ProjectProperty ¶ added in v0.2.0
type ProjectPropertyService ¶ added in v0.3.0
type ProjectPropertyService struct {
// contains filtered or unexported fields
}
func (ProjectPropertyService) Create ¶ added in v0.3.0
func (ps ProjectPropertyService) Create(ctx context.Context, projectUUID uuid.UUID, property ProjectProperty) (p ProjectProperty, err error)
func (ProjectPropertyService) GetAll ¶ added in v0.3.0
func (ps ProjectPropertyService) GetAll(ctx context.Context, projectUUID uuid.UUID, po PageOptions) (p Page[ProjectProperty], err error)
func (ProjectPropertyService) Update ¶ added in v0.3.0
func (ps ProjectPropertyService) Update(ctx context.Context, projectUUID uuid.UUID, property ProjectProperty) (p ProjectProperty, err error)
type ProjectService ¶
type ProjectService struct {
// contains filtered or unexported fields
}
func (ProjectService) Clone ¶
func (ps ProjectService) Clone(ctx context.Context, cloneReq ProjectCloneRequest) (err error)
func (ProjectService) GetAll ¶
func (ps ProjectService) GetAll(ctx context.Context, po PageOptions) (p Page[Project], err error)
type RepositoryMetaComponent ¶
type RepositoryMetaComponent struct {
LatestVersion string `json:"latestVersion"`
}
type RepositoryService ¶
type RepositoryService struct {
// contains filtered or unexported fields
}
func (RepositoryService) GetMetaComponent ¶
func (rs RepositoryService) GetMetaComponent(ctx context.Context, purl string) (r RepositoryMetaComponent, err error)
type TeamService ¶ added in v0.7.0
type TeamService struct {
// contains filtered or unexported fields
}
func (TeamService) GenerateAPIKey ¶ added in v0.7.0
func (TeamService) GetAll ¶ added in v0.7.0
func (ts TeamService) GetAll(ctx context.Context, po PageOptions) (p Page[Team], err error)
type UserService ¶
type UserService struct {
// contains filtered or unexported fields
}
func (UserService) ForceChangePassword ¶
func (us UserService) ForceChangePassword(ctx context.Context, username, password, newPassword string) (err error)
type VEXService ¶ added in v0.6.0
type VEXService struct {
// contains filtered or unexported fields
}
func (VEXService) ExportCycloneDX ¶ added in v0.6.0
func (VEXService) Upload ¶ added in v0.6.0
func (vs VEXService) Upload(ctx context.Context, uploadReq VEXUploadRequest) (err error)
type VEXUploadRequest ¶ added in v0.6.0
type ViolationAnalysis ¶ added in v0.6.0
type ViolationAnalysis struct { Comments []ViolationAnalysisComment `json:"analysisComments"` State ViolationAnalysisState `json:"analysisState"` Suppressed bool `json:"isSuppressed"` }
type ViolationAnalysisComment ¶ added in v0.6.0
type ViolationAnalysisRequest ¶ added in v0.6.0
type ViolationAnalysisService ¶ added in v0.6.0
type ViolationAnalysisService struct {
// contains filtered or unexported fields
}
func (ViolationAnalysisService) Get ¶ added in v0.6.0
func (vas ViolationAnalysisService) Get(ctx context.Context, componentUUID, policyViolationUUID uuid.UUID) (va ViolationAnalysis, err error)
func (ViolationAnalysisService) Update ¶ added in v0.6.0
func (vas ViolationAnalysisService) Update(ctx context.Context, analysisReq ViolationAnalysisRequest) (va ViolationAnalysis, err error)
type ViolationAnalysisState ¶ added in v0.6.0
type ViolationAnalysisState string
const ( ViolationAnalysisStateNotSet ViolationAnalysisState = "NOT_SET" ViolationAnalysisStateApproved ViolationAnalysisState = "APPROVED" ViolationAnalysisStateRejected ViolationAnalysisState = "REJECTED" )
type Vulnerability ¶
type Vulnerability struct { UUID uuid.UUID `json:"uuid"` VulnID string `json:"vulnId"` Source string `json:"source"` Title string `json:"title"` SubTitle string `json:"subTitle"` Description string `json:"description"` Recommendation string `json:"recommendation"` References string `json:"references"` Credits string `json:"credits"` Created string `json:"created"` Published string `json:"published"` Updated string `json:"updated"` CWE CWE `json:"cwe"` CWEs []CWE `json:"cwes"` CVSSV2BaseScore float64 `json:"cvssV2BaseScore"` CVSSV2ImpactSubScore float64 `json:"cvssV2ImpactSubScore"` CVSSV2ExploitabilitySubScore float64 `json:"cvssV2ExploitabilitySubScore"` CVSSV2Vector string `json:"cvssV2Vector"` CVSSV3BaseScore float64 `json:"cvssV3BaseScore"` CVSSV3ImpactSubScore float64 `json:"cvssV3ImpactSubScore"` CVSSV3ExploitabilitySubScore float64 `json:"cvssV3ExploitabilitySubScore"` CVSSV3Vector string `json:"cvssV3Vector"` Severity string `json:"severity"` VulnerableVersions string `json:"vulnerableVersions"` PatchedVersions string `json:"patchedVersions"` }
type VulnerabilityService ¶ added in v0.2.0
type VulnerabilityService struct {
// contains filtered or unexported fields
}
func (VulnerabilityService) Get ¶ added in v0.2.0
func (vs VulnerabilityService) Get(ctx context.Context, vulnUUID uuid.UUID) (v Vulnerability, err error)
func (VulnerabilityService) GetAllForComponent ¶ added in v0.2.0
func (vs VulnerabilityService) GetAllForComponent(ctx context.Context, componentUUID uuid.UUID, po PageOptions) (p Page[Vulnerability], err error)
func (VulnerabilityService) GetAllForProject ¶ added in v0.2.0
func (vs VulnerabilityService) GetAllForProject(ctx context.Context, projectUUID uuid.UUID, po PageOptions) (p Page[Vulnerability], err error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package notification provides the functionality to process notifications sent by Dependency-Track.
|
Package notification provides the functionality to process notifications sent by Dependency-Track. |
Click to show internal directories.
Click to hide internal directories.