Documentation
¶
Index ¶
- func AggregateChecks(ctx context.Context, dag *executiondag.DAG[dag_impl.Input]) ([]checks.Output, error)
- func BuildCheckCategoryMap(builder DagBuilder) map[string][]category.RiskCategory
- func BuildDag(dag *executiondag.DAG[dag_impl.Input], input *dag_impl.Input, ...)
- func BuildGitDag(dag *executiondag.DAG[dag_impl.Input], input dag_impl.Input, ...) error
- func CollectEntries(ctx context.Context, dag *executiondag.DAG[dag_impl.Input], ...) []executiondag.Entry
- func InstallScriptExtractors(languages map[string]language.Language) map[string]registry.ArtifactInstallScriptExtractor
- func IsDeprecated(underlying any) bool
- func WriteSummary(ctx context.Context, input dag_impl.Input, summary AnalysisSummary) error
- type AnalysisSummary
- type CheckInfo
- type CheckMetadata
- type CheckSummary
- type DagBuilder
- type DeprecatedCheckMetadata
- type DocumentedCheckMetadata
- type ExtendedCheckMetadata
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AggregateChecks ¶
func BuildCheckCategoryMap ¶
func BuildCheckCategoryMap(builder DagBuilder) map[string][]category.RiskCategory
func BuildDag ¶
func BuildDag(dag *executiondag.DAG[dag_impl.Input], input *dag_impl.Input, languages map[string]language.Language, artifactFetcher artifactfetcher.Fetcher, ctx context.Context)
BuildDag adds language-specific package registry nodes to the DAG. This includes: - fetcher: Fetches raw package data from language registries - transformer: Transforms raw data into standardized package metadata - version_transformer: Transforms raw data into version history metadata
Parameters: - dag: The DAG to add nodes to - input: The input containing source URL and packages - languages: Map of ecosystem name to Language implementation
Behavior: - If input has SourceURL: fetcher depends on package_detector - If input has packages but no SourceURL: fetcher has no git dependency - Both transformer and version_transformer depend on fetcher (run in parallel)
func BuildGitDag ¶
func CollectEntries ¶
func CollectEntries(ctx context.Context, dag *executiondag.DAG[dag_impl.Input], input dag_impl.Input) []executiondag.Entry
CollectEntries collects entries from executed nodes in the DAG. For outputs implementing Persistable, creates an Entry with PersistKey() as key and the output itself as data. In write-fetch-only mode, only collects entries from fetch nodes.
func InstallScriptExtractors ¶
func InstallScriptExtractors(languages map[string]language.Language) map[string]registry.ArtifactInstallScriptExtractor
InstallScriptExtractors builds the per-ecosystem extractor map used by the package_install_scripts check.
func IsDeprecated ¶
func WriteSummary ¶
WriteSummary writes the analysis summary to a file
Types ¶
type AnalysisSummary ¶
type AnalysisSummary struct {
AnalyzedAt time.Time `json:"analyzed_at"`
CheckSummary CheckSummary `json:"check_summary"`
NodeSummaries []executiondag.NodeSummary `json:"node_summaries"`
}
AnalysisSummary contains the complete summary of an analysis run
func AggregateSummary ¶
func AggregateSummary(ctx context.Context, dag *executiondag.DAG[dag_impl.Input], checkOutputs []checks.Output, outputDir string) AnalysisSummary
AggregateSummary collects summaries from all nodes and checks
type CheckInfo ¶
type CheckInfo struct {
Code string `json:"code"`
Description string `json:"description"`
WhyThisMatters string `json:"why_this_matters,omitempty"`
Categories map[category.RiskCategory]string `json:"categories,omitempty"`
Outcomes storage.Outcomes `json:"outcomes,omitempty"`
Disclaimers []string `json:"disclaimers,omitempty"`
Thresholds map[string]any `json:"thresholds,omitempty"`
Deprecated bool `json:"deprecated,omitempty"`
DataSources []string `json:"data_sources,omitempty"`
}
func GetAllCheckMetadata ¶
func GetAllCheckMetadata(builder DagBuilder) ([]CheckInfo, map[string]executiondag.Source)
type CheckMetadata ¶
type CheckSummary ¶
type CheckSummary struct {
Total int `json:"total"`
Compliant int `json:"compliant"`
Violations int `json:"violations"`
Skipped int `json:"skipped"`
ViolationCodes []string `json:"violation_codes,omitempty"`
}
CheckSummary summarizes check results
type DagBuilder ¶
type DeprecatedCheckMetadata ¶
type DeprecatedCheckMetadata interface {
GetDeprecated() bool
}
type DocumentedCheckMetadata ¶
type ExtendedCheckMetadata ¶
type ExtendedCheckMetadata interface {
CheckMetadata
GetCategories() map[category.RiskCategory]string
}