Documentation
¶
Index ¶
- Constants
- type DependencyRefreshResponse
- type GraphActiveGeneration
- type GraphBoundary
- type GraphCandidate
- type GraphCapabilitiesRequest
- type GraphContextRequest
- type GraphContextResponse
- type GraphDiscoverRequest
- type GraphDiscoveryConfig
- type GraphExploreConfig
- type GraphExploreRequest
- type GraphFilesRequest
- type GraphImpactRequest
- type GraphImpactResponse
- type GraphJobState
- type GraphPosition
- type GraphPublication
- type GraphPublicationResult
- type GraphReference
- type GraphRepositorySelector
- type GraphSource
- type GraphState
- type GraphStatus
- type GraphSymbol
- type GraphSymbolCallsRequest
- type GraphSymbolImpactRequest
- type GraphSymbolSelector
- type GraphTraceRequest
- type GraphTraceResponse
- type ReadFileRequest
- type ReadFileResponse
- type Repository
- type RepositoryPackages
- type RepositorySummary
- type SCIPFallbackStatus
- type SCIPLocation
- type SCIPNavigationRequest
- type SCIPNavigationResponse
- type SearchConsistency
- type SearchMatch
- type SearchRequest
- type SearchResponse
- type SupplyChainChecksum
- type SupplyChainCollection
- type SupplyChainCollectionList
- type SupplyChainComponent
- type SupplyChainComponentCounts
- type SupplyChainComponentDetail
- type SupplyChainComponentList
- type SupplyChainConcludeRequest
- type SupplyChainConclusion
- type SupplyChainCoordinates
- type SupplyChainCreatePolicyRequest
- type SupplyChainDecideRequest
- type SupplyChainDecision
- type SupplyChainDependencyGraph
- type SupplyChainDocumentRef
- type SupplyChainFacet
- type SupplyChainFacets
- type SupplyChainGraphDependency
- type SupplyChainImportResponse
- type SupplyChainJob
- type SupplyChainLicenseAssessment
- type SupplyChainLicenseChange
- type SupplyChainLicenseEvidence
- type SupplyChainOverview
- type SupplyChainPolicy
- type SupplyChainPolicyResult
- type SupplyChainPortfolioComponent
- type SupplyChainPortfolioComponentDetail
- type SupplyChainPortfolioComponentList
- type SupplyChainPortfolioOccurrence
- type SupplyChainRefreshResponse
- type SupplyChainRelationship
- type SupplyChainRepositoryCounts
- type SupplyChainRepositoryRef
- type SupplyChainRepositoryStatus
- type SupplyChainReviewEvent
- type SupplyChainReviewHistory
- type SupplyChainReviewItem
- type SupplyChainReviewQueue
- type SupplyChainSnapshot
- type SupplyChainSnapshotComparison
- type SupplyChainStreamRef
- type SupplyChainWarning
Constants ¶
const ( GraphArtifactV1ContentType = "application/vnd.graphnest.graph.v1+protobuf" GraphArtifactV2ContentType = "application/vnd.graphnest.graph.v2+protobuf" )
Content types of the graph artifact upload body.
const ( SCIPStatusCurrent = "current" SCIPStatusStale = "stale" SCIPStatusAbsent = "absent" SCIPStatusUnknown = "unknown" )
const ( GraphStatusCurrent = "current" GraphStatusStale = "stale" GraphStatusAbsent = "absent" GraphStatusUnknown = "unknown" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GraphActiveGeneration ¶ added in v0.7.0
type GraphBoundary ¶
type GraphCandidate ¶
type GraphCapabilitiesRequest ¶ added in v0.5.0
type GraphCapabilitiesRequest struct {
Repo GraphRepositorySelector `json:"repo,omitzero"`
Branch string `json:"branch,omitempty"`
}
type GraphContextRequest ¶
type GraphContextRequest struct {
Repo GraphRepositorySelector `json:"repo,omitzero"`
GraphSymbolSelector
Branch string `json:"branch,omitempty"`
Relations []string `json:"relations,omitempty"`
PerCategoryLimit int `json:"per_category_limit,omitempty"`
PerCategoryOffset int `json:"per_category_offset,omitempty"`
IncludeContent bool `json:"include_content,omitempty"`
}
type GraphContextResponse ¶
type GraphContextResponse struct {
Status string `json:"status"`
Symbol *GraphSymbol `json:"symbol,omitempty"`
Candidates []GraphCandidate `json:"candidates,omitempty"`
Incoming map[string][]GraphReference `json:"incoming,omitempty"`
Outgoing map[string][]GraphReference `json:"outgoing,omitempty"`
Boundaries []GraphBoundary `json:"boundaries,omitempty"`
Commits map[string]string `json:"commits"`
}
type GraphDiscoverRequest ¶ added in v0.5.0
type GraphDiscoverRequest struct {
Repo GraphRepositorySelector `json:"repo,omitzero"`
Branch string `json:"branch,omitempty"`
Query string `json:"query"`
Limit int `json:"limit,omitempty"`
CandidateLimit int `json:"candidate_limit,omitempty"`
Symbols []string `json:"symbols,omitempty"`
Files []string `json:"files,omitempty"`
Config GraphDiscoveryConfig `json:"config,omitempty"`
}
type GraphDiscoveryConfig ¶ added in v0.5.0
type GraphExploreConfig ¶ added in v0.5.0
type GraphExploreConfig struct {
GraphDiscoveryConfig
LineNumbers *bool `json:"line_numbers,omitempty"`
Adaptive *bool `json:"adaptive,omitempty"`
Dedup *bool `json:"dedup,omitempty"`
}
type GraphExploreRequest ¶ added in v0.5.0
type GraphExploreRequest struct {
Repo GraphRepositorySelector `json:"repo,omitzero"`
Branch string `json:"branch,omitempty"`
Query string `json:"query"`
Symbols []string `json:"symbols,omitempty"`
Files []string `json:"files,omitempty"`
RequiredOccurrences []string `json:"required_occurrences,omitempty"`
Limit int `json:"limit,omitempty"`
CandidateLimit int `json:"candidate_limit,omitempty"`
MaxFiles int `json:"max_files,omitempty"`
SourceUnits int `json:"source_utf16_units,omitempty"`
SourceBytes int `json:"source_bytes,omitempty"`
Config GraphExploreConfig `json:"config,omitempty"`
}
type GraphFilesRequest ¶ added in v0.5.0
type GraphImpactRequest ¶
type GraphImpactRequest struct {
Repo GraphRepositorySelector `json:"repo,omitzero"`
Branch string `json:"branch,omitempty"`
TargetUID string `json:"target_uid"`
Direction string `json:"direction"`
Relations []string `json:"relations,omitempty"`
MinConfidence float64 `json:"min_confidence,omitempty"`
IncludeTests bool `json:"include_tests,omitempty"`
MaxDepth int `json:"max_depth,omitempty"`
Limit int `json:"limit,omitempty"`
Offset int `json:"offset,omitempty"`
SummaryOnly bool `json:"summary_only,omitempty"`
}
type GraphImpactResponse ¶
type GraphImpactResponse struct {
Status string `json:"status"`
Candidates []GraphCandidate `json:"candidates,omitempty"`
ByDepth map[int][]GraphSymbol `json:"by_depth"`
Relations []GraphReference `json:"relations,omitempty"`
Boundaries []GraphBoundary `json:"boundaries,omitempty"`
Commits map[string]string `json:"commits"`
Partial bool `json:"partial"`
}
type GraphJobState ¶
type GraphJobState string
const ( GraphJobStateQueued GraphJobState = "queued" GraphJobStateRunning GraphJobState = "running" GraphJobStateSucceeded GraphJobState = "succeeded" GraphJobStateFailed GraphJobState = "failed" GraphJobStateSuperseded GraphJobState = "superseded" )
type GraphPosition ¶
type GraphPublication ¶ added in v0.7.0
type GraphPublication struct {
UploadArtifactVersions []int `json:"upload_artifact_versions"`
MaxUploadBytes int64 `json:"max_upload_bytes"`
Permitted bool `json:"permitted"`
ActiveGeneration *GraphActiveGeneration `json:"active_generation,omitempty"`
}
GraphPublication is the preflight a publisher reads before uploading: the accepted artifact versions and size, whether this caller may publish, and the active generation to name as expected_generation (absent means 0).
type GraphPublicationResult ¶ added in v0.7.0
type GraphPublicationResult struct {
RepositoryID int64 `json:"repository_id"`
Commit string `json:"commit"`
Generation int64 `json:"generation"`
ReplacedGeneration int64 `json:"replaced_generation,omitempty"`
ContentHash string `json:"content_hash"`
Deduplicated bool `json:"deduplicated"`
}
GraphPublicationResult reports a v2 publication. Deduplicated means the active generation already held this exact content, so nothing changed.
type GraphReference ¶
type GraphReference struct {
SourceRepositoryID int64 `json:"source_repository_id"`
TargetRepositoryID int64 `json:"target_repository_id"`
SourceUID string `json:"source_uid"`
TargetUID string `json:"target_uid"`
Kind string `json:"kind"`
Path string `json:"path,omitempty"`
Range GraphPosition `json:"range"`
Confidence float64 `json:"confidence"`
ResolutionReason string `json:"resolution_reason,omitempty"`
}
type GraphRepositorySelector ¶
func (GraphRepositorySelector) IsZero ¶
func (selector GraphRepositorySelector) IsZero() bool
func (GraphRepositorySelector) MarshalJSON ¶
func (selector GraphRepositorySelector) MarshalJSON() ([]byte, error)
func (*GraphRepositorySelector) UnmarshalJSON ¶
func (selector *GraphRepositorySelector) UnmarshalJSON(data []byte) error
type GraphSource ¶
type GraphSource string
const ( GraphSourceManaged GraphSource = "managed" GraphSourceExternal GraphSource = "external" // GraphSourceSCIP marks a generation GraphNest derived from a SCIP upload. GraphSourceSCIP GraphSource = "scip" )
type GraphState ¶
type GraphState string
const ( GraphStateNotIndexed GraphState = "not_indexed" GraphStatePending GraphState = "pending" GraphStateFallback GraphState = "fallback" GraphStateDegraded GraphState = "degraded" GraphStateReady GraphState = "ready" )
type GraphStatus ¶
type GraphStatus struct {
RepositoryID int64 `json:"repository_id"`
Commit string `json:"commit,omitempty"`
State GraphState `json:"state"`
Source GraphSource `json:"source,omitempty"`
JobState GraphJobState `json:"job_state,omitempty"`
ErrorCode string `json:"error_code,omitempty"`
SCIPFallback *SCIPFallbackStatus `json:"scip_fallback,omitempty"`
Publication *GraphPublication `json:"publication,omitempty"`
}
type GraphSymbol ¶
type GraphSymbol struct {
UID string `json:"uid"`
Name string `json:"name"`
Kind string `json:"kind"`
FilePath string `json:"file_path"`
Language string `json:"language"`
Signature string `json:"signature,omitempty"`
RepositoryID int64 `json:"repository_id"`
Range GraphPosition `json:"range"`
Test bool `json:"test"`
Content string `json:"content,omitempty"`
}
type GraphSymbolCallsRequest ¶ added in v0.7.0
type GraphSymbolCallsRequest struct {
Repo GraphRepositorySelector `json:"repo,omitzero"`
Branch string `json:"branch,omitempty"`
Symbol string `json:"symbol"`
File string `json:"file,omitempty"`
Limit int `json:"limit,omitempty"`
}
GraphSymbolCallsRequest lists the callers or callees of every definition of a symbol name. File narrows same-named definitions by path or path suffix. Limit bounds each definition's list (default 20, clamped to 1-100).
type GraphSymbolImpactRequest ¶ added in v0.7.0
type GraphSymbolImpactRequest struct {
Repo GraphRepositorySelector `json:"repo,omitzero"`
Branch string `json:"branch,omitempty"`
Symbol string `json:"symbol"`
File string `json:"file,omitempty"`
Depth int `json:"depth,omitempty"`
}
GraphSymbolImpactRequest is the impact radius of every definition of a symbol name. Depth defaults to 2 and is clamped to 1-10.
type GraphSymbolSelector ¶
type GraphTraceRequest ¶
type GraphTraceRequest struct {
Repo GraphRepositorySelector `json:"repo,omitzero"`
Branch string `json:"branch,omitempty"`
SourceUID string `json:"source_uid"`
TargetUID string `json:"target_uid"`
MaxDepth int `json:"max_depth,omitempty"`
}
type GraphTraceResponse ¶
type GraphTraceResponse struct {
Status string `json:"status"`
Candidates []GraphCandidate `json:"candidates,omitempty"`
Nodes []GraphSymbol `json:"nodes,omitempty"`
Relations []GraphReference `json:"relations,omitempty"`
Boundaries []GraphBoundary `json:"boundaries,omitempty"`
Commits map[string]string `json:"commits"`
}
type ReadFileRequest ¶
type ReadFileResponse ¶
type ReadFileResponse struct {
RepositoryID int64 `json:"repository_id"`
Path string `json:"path"`
IndexedSHA string `json:"indexed_sha"`
BlobSHA string `json:"blob_sha"`
Content string `json:"content"`
StartLine int `json:"start_line"`
EndLine int `json:"end_line"`
Truncated bool `json:"truncated"`
}
type Repository ¶
type RepositoryPackages ¶
type RepositorySummary ¶
type RepositorySummary struct {
ID int64 `json:"id"`
GitHubID int64 `json:"github_id"`
Name string `json:"name"`
Branch string `json:"branch"`
DesiredSHA string `json:"desired_sha"`
IndexedSHA string `json:"indexed_sha"`
WebURL string `json:"web_url"`
Status string `json:"status"`
ErrorCode string `json:"error_code"`
SearchNode string `json:"search_node"`
LastIndexedAt *time.Time `json:"last_indexed_at,omitempty"`
// SizeBytes is the repository size GitHub last reported, for ordering work
// by size; omitted while it is unknown or zero.
SizeBytes int64 `json:"size_bytes,omitempty"`
// SCIPStatus reports whether code navigation is usable: "current", "stale",
// "absent", or "unknown". Search being healthy says nothing about SCIP, so
// callers need this to tell why navigation tools fail on an indexed repository.
SCIPStatus string `json:"scip_status"`
SCIPCommit string `json:"scip_commit,omitempty"`
// GraphStatus reports whether the v2 graph generation the tools would use (the
// current published one, else the current SCIP-derived one) is usable:
// "current", "stale", "absent", or "unknown". The graph tools fail unless it
// is "current", so callers need this to tell why they fail on an indexed repository.
GraphStatus string `json:"graph_status"`
GraphCommit string `json:"graph_commit,omitempty"`
GraphProducer string `json:"graph_producer,omitempty"`
}
type SCIPFallbackStatus ¶
type SCIPFallbackStatus struct {
Commit string `json:"commit"`
}
type SCIPLocation ¶
type SCIPLocation struct {
RepositoryID int64 `json:"repository_id"`
RepositoryName string `json:"repository_name"`
Branch string `json:"branch"`
WebURL string `json:"web_url"`
Commit string `json:"commit"`
Path string `json:"path"`
Symbol string `json:"symbol"`
StartLine int `json:"start_line"`
StartCharacter int `json:"start_character"`
EndLine int `json:"end_line"`
EndCharacter int `json:"end_character"`
PositionEncoding string `json:"position_encoding"`
Roles int32 `json:"roles"`
Approximate bool `json:"approximate"`
}
type SCIPNavigationRequest ¶
type SCIPNavigationRequest struct {
}
type SCIPNavigationResponse ¶
type SCIPNavigationResponse struct {
}
type SearchConsistency ¶
type SearchConsistency struct {
Backend string `json:"backend"`
Exact bool `json:"exact"`
Revision string `json:"revision,omitempty"`
Partial bool `json:"partial"`
}
SearchConsistency states what the selected backend can prove about results.
type SearchMatch ¶
type SearchMatch struct {
Repository Repository `json:"repository"`
Path string `json:"path"`
SHA string `json:"sha"`
LineNumber int `json:"line_number"`
LineStart int `json:"line_start"`
LineEnd int `json:"line_end"`
Preview string `json:"preview"`
Score float64 `json:"score"`
ZoektID uint32 `json:"-"`
Branches []string `json:"-"`
}
type SearchRequest ¶
type SearchRequest struct {
Query string `json:"query"`
Repositories []string `json:"repositories,omitempty"`
Limit int `json:"limit,omitempty"`
ContextLines int `json:"context_lines,omitempty"`
Timeout time.Duration `json:"timeout,omitempty"`
MaxResponseBytes int64 `json:"max_response_bytes,omitempty"`
}
type SearchResponse ¶
type SearchResponse struct {
Matches []SearchMatch `json:"matches"`
Truncated bool `json:"truncated"`
Consistency *SearchConsistency `json:"consistency,omitempty"`
}
type SupplyChainChecksum ¶ added in v0.6.0
type SupplyChainCollection ¶ added in v0.6.0
type SupplyChainCollection struct {
ID int64 `json:"id"`
JobID *int64 `json:"job_id"`
Producer string `json:"producer"`
Stream string `json:"stream"`
StartedAt time.Time `json:"started_at"`
FinishedAt time.Time `json:"finished_at"`
Outcome string `json:"outcome"`
HTTPStatus *int `json:"http_status"`
RetryAfterSeconds *int `json:"retry_after_seconds,omitempty"`
SnapshotID *int64 `json:"snapshot_id"`
ErrorCode string `json:"error_code,omitempty"`
Message string `json:"message,omitempty"`
ProjectionError string `json:"projection_error,omitempty"`
}
type SupplyChainCollectionList ¶ added in v0.6.0
type SupplyChainCollectionList struct {
Collections []SupplyChainCollection `json:"collections"`
Truncated bool `json:"truncated"`
NextCursor string `json:"next_cursor,omitempty"`
}
type SupplyChainComponent ¶ added in v0.6.0
type SupplyChainComponent struct {
ElementID string `json:"element_id"`
Ordinal int `json:"ordinal"`
Name string `json:"name"`
Version *string `json:"version"`
PURL *string `json:"purl"`
Ecosystem string `json:"ecosystem,omitempty"`
Namespace string `json:"namespace,omitempty"`
PackageName string `json:"package_name,omitempty"`
Qualifiers map[string]string `json:"qualifiers,omitempty"`
LicenseDeclaredRaw *string `json:"license_declared_raw"`
LicenseConcludedRaw *string `json:"license_concluded_raw"`
DownloadLocation *string `json:"download_location,omitempty"`
Supplier *string `json:"supplier,omitempty"`
Checksums []SupplyChainChecksum `json:"checksums,omitempty"`
IsRoot bool `json:"is_root"`
// Scope is "root", "direct", "transitive", or "unknown" and is derived only
// from resolved DEPENDS_ON edges from a root; a flattened list yields unknown.
Scope string `json:"scope"`
// License is the derived assessment for this occurrence; nil until an
// assessment exists (enrichment disabled or pending).
License *SupplyChainLicenseAssessment `json:"license"`
}
type SupplyChainComponentCounts ¶ added in v0.6.0
type SupplyChainComponentDetail ¶ added in v0.6.0
type SupplyChainComponentDetail struct {
Component SupplyChainComponent `json:"component"`
Snapshot SupplyChainSnapshot `json:"snapshot"`
Declarations []SupplyChainLicenseEvidence `json:"declarations"`
Evidence []SupplyChainLicenseEvidence `json:"evidence"`
Relationships []SupplyChainRelationship `json:"relationships"`
Notes []string `json:"notes"`
Truncated bool `json:"truncated"`
}
SupplyChainComponentDetail is the evidence detail view for one occurrence.
type SupplyChainComponentList ¶ added in v0.6.0
type SupplyChainComponentList struct {
SnapshotID int64 `json:"snapshot_id"`
Components []SupplyChainComponent `json:"components"`
Truncated bool `json:"truncated"`
NextCursor string `json:"next_cursor,omitempty"`
}
type SupplyChainConcludeRequest ¶ added in v0.6.0
type SupplyChainConcludeRequest struct {
RepositoryID int64 `json:"repository_id"`
Coordinates SupplyChainCoordinates `json:"coordinates"`
Expression string `json:"expression"`
Reason string `json:"reason"`
BasisFingerprint string `json:"basis"`
}
type SupplyChainConclusion ¶ added in v0.6.0
type SupplyChainConclusion struct {
ID int64 `json:"id"`
Coordinates SupplyChainCoordinates `json:"coordinates"`
EvidenceID int64 `json:"evidence_id"`
Basis string `json:"basis"`
Reviewer string `json:"reviewer"`
Reason string `json:"reason"`
CreatedAt time.Time `json:"created_at"`
SupersededBy *int64 `json:"superseded_by"`
}
type SupplyChainCoordinates ¶ added in v0.6.0
type SupplyChainCoordinates struct {
Ecosystem string `json:"ecosystem"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
}
Review workflow models. Conclusions correct evidence, policy results apply a policy version, and decisions approve/reject usage in one repository.
type SupplyChainCreatePolicyRequest ¶ added in v0.6.0
type SupplyChainCreatePolicyRequest struct {
Name string `json:"name,omitempty"`
Description string `json:"description,omitempty"`
// Rules is the JSON policy body (approved/review_required/prohibited lists).
Rules json.RawMessage `json:"rules,omitempty"`
UnknownHandling string `json:"unknown_handling,omitempty"`
Activate bool `json:"activate"`
InstallExample bool `json:"install_example,omitempty"`
}
type SupplyChainDecideRequest ¶ added in v0.6.0
type SupplyChainDecideRequest struct {
RepositoryID int64 `json:"repository_id"`
Coordinates SupplyChainCoordinates `json:"coordinates"`
Kind string `json:"kind"`
Reason string `json:"reason"`
UsageContext string `json:"usage_context,omitempty"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
BasisFingerprint string `json:"basis"`
}
type SupplyChainDecision ¶ added in v0.6.0
type SupplyChainDecision struct {
ID int64 `json:"id"`
Coordinates SupplyChainCoordinates `json:"coordinates"`
Kind string `json:"kind"`
PolicyID *int64 `json:"policy_id"`
PolicyVerdict string `json:"policy_verdict,omitempty"`
Basis string `json:"basis"`
Reviewer string `json:"reviewer"`
Reason string `json:"reason"`
UsageContext string `json:"usage_context,omitempty"`
ExpiresAt *time.Time `json:"expires_at"`
CreatedAt time.Time `json:"created_at"`
SupersededBy *int64 `json:"superseded_by"`
}
type SupplyChainDependencyGraph ¶ added in v0.14.0
type SupplyChainDependencyGraph struct {
Stream string `json:"stream"`
RepositoriesInScope int `json:"repositories_in_scope"`
MinRepositories int `json:"min_repositories"`
Matching int `json:"matching"`
Truncated bool `json:"truncated"`
Dependencies []SupplyChainGraphDependency `json:"dependencies"`
// Repositories names every repository a dependency lists.
Repositories []SupplyChainRepositoryRef `json:"repositories"`
}
SupplyChainDependencyGraph is the dependencies shared across the caller's authorized repositories, most shared first, with the repositories using each. Matching counts the dependencies that passed the filters and min_repositories; Truncated says more of them matched than are returned.
type SupplyChainDocumentRef ¶ added in v0.6.0
type SupplyChainDocumentRef struct {
SnapshotID int64 `json:"snapshot_id"`
SHA256 string `json:"sha256"`
Format string `json:"format"`
Bytes int64 `json:"bytes"`
Path string `json:"path"`
}
SupplyChainDocumentRef points at a downloadable original document.
type SupplyChainFacet ¶ added in v0.6.0
type SupplyChainFacets ¶ added in v0.6.0
type SupplyChainFacets struct {
Stream string `json:"stream"`
Ecosystems []SupplyChainFacet `json:"ecosystems"`
Assessments []SupplyChainFacet `json:"assessments"`
Licenses []SupplyChainFacet `json:"licenses"`
}
type SupplyChainGraphDependency ¶ added in v0.14.0
type SupplyChainGraphDependency struct {
Ecosystem string `json:"ecosystem"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name"`
VersionCount int `json:"version_count"`
Versions []string `json:"versions"`
Assessments []string `json:"assessments"`
Expressions []string `json:"expressions"`
RepositoryCount int `json:"repository_count"`
RepositoryIDs []int64 `json:"repository_ids"`
}
SupplyChainGraphDependency is one package across its versions. The counts are exact; versions, expressions and repository_ids are bounded lists that can hold fewer entries than their count.
type SupplyChainImportResponse ¶ added in v0.6.0
type SupplyChainImportResponse struct {
ImportID int64 `json:"import_id"`
Outcome string `json:"outcome"`
Repeated bool `json:"repeated"`
SnapshotID *int64 `json:"snapshot_id"`
Stream string `json:"stream"`
Format string `json:"format"`
ComponentCount int `json:"component_count"`
EdgeCount int `json:"edge_count"`
WarningCount int `json:"warning_count"`
Warnings []SupplyChainWarning `json:"warnings"`
SubjectAssurance string `json:"subject_assurance,omitempty"`
Notes []string `json:"notes"`
}
SupplyChainImportResponse reports an accepted upload.
type SupplyChainJob ¶ added in v0.6.0
type SupplyChainJob struct {
ID int64 `json:"id"`
RepositoryID int64 `json:"repository_id"`
Stream string `json:"stream"`
Reason string `json:"reason"`
State string `json:"state"`
Attempt int `json:"attempt"`
MaxAttempts int `json:"max_attempts"`
RunAfter time.Time `json:"run_after"`
ErrorCode string `json:"error_code,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
LeaseExpires *time.Time `json:"lease_expires_at,omitempty"`
}
type SupplyChainLicenseAssessment ¶ added in v0.6.0
type SupplyChainLicenseAssessment struct {
// Status is unknown, declared, resolved, conflict, unlicensed, not_applicable, or pending.
Status string `json:"status"`
// Expression is the normalized SPDX expression when status is declared or resolved.
Expression string `json:"expression,omitempty"`
// ConflictDetail lists the disagreeing sources when status is conflict.
ConflictDetail string `json:"conflict_detail,omitempty"`
EvidenceCount int `json:"evidence_count"`
AssessedAt time.Time `json:"assessed_at"`
// EvidenceFingerprint (hex) changes when any considered evidence changes;
// reviews record it to detect stale bases.
EvidenceFingerprint string `json:"evidence_fingerprint"`
}
SupplyChainLicenseAssessment is the derived view over declarations and registry evidence for one occurrence. It is not an approval.
type SupplyChainLicenseChange ¶ added in v0.6.0
type SupplyChainLicenseEvidence ¶ added in v0.6.0
type SupplyChainLicenseEvidence struct {
ID int64 `json:"id"`
Source string `json:"source"`
Route string `json:"route,omitempty"`
Ecosystem string `json:"ecosystem"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
ArtifactSHA256 string `json:"artifact_sha256,omitempty"`
RawValue string `json:"raw_value"`
RawKind string `json:"raw_kind"`
ParseStatus string `json:"parse_status"`
Expression string `json:"expression,omitempty"`
UnknownTerms []string `json:"unknown_terms,omitempty"`
LicenseURL string `json:"license_url,omitempty"`
LicenseFileName string `json:"license_file_name,omitempty"`
Detail map[string]any `json:"detail,omitempty"`
ResolverVersion int `json:"resolver_version"`
LicenseListVersion string `json:"license_list_version"`
ContentSHA256 string `json:"content_sha256,omitempty"`
FetchedAt time.Time `json:"fetched_at"`
ExpiresAt *time.Time `json:"expires_at,omitempty"`
Outcome string `json:"outcome"`
HTTPStatus *int `json:"http_status,omitempty"`
Message string `json:"message,omitempty"`
}
SupplyChainLicenseEvidence is one immutable evidence row as shown in the evidence detail view. Raw values are verbatim; nothing is mapped.
type SupplyChainOverview ¶ added in v0.6.0
type SupplyChainOverview struct {
Stream string `json:"stream"`
GeneratedAt time.Time `json:"generated_at"`
Repositories SupplyChainRepositoryCounts `json:"repositories"`
Components SupplyChainComponentCounts `json:"components"`
WarningTotal int `json:"warning_total"`
OldestCollectedAt *time.Time `json:"oldest_collected_at"`
NewestCollectedAt *time.Time `json:"newest_collected_at"`
Ecosystems []SupplyChainFacet `json:"ecosystems"`
Denominators []string `json:"denominators"`
}
SupplyChainOverview is the portfolio summary across the caller's authorized repositories. Every count names its denominator in Denominators; none is a compliance percentage.
type SupplyChainPolicy ¶ added in v0.6.0
type SupplyChainPolicy struct {
ID int64 `json:"id"`
Name string `json:"name"`
Version int `json:"version"`
Kind string `json:"kind"`
Active bool `json:"active"`
UnknownHandling string `json:"unknown_handling"`
Description string `json:"description"`
CreatedBy string `json:"created_by"`
Approved []string `json:"approved"`
ReviewRequired []string `json:"review_required"`
Prohibited []string `json:"prohibited"`
AllowOrLater bool `json:"allow_or_later"`
}
type SupplyChainPolicyResult ¶ added in v0.6.0
type SupplyChainPortfolioComponent ¶ added in v0.6.0
type SupplyChainPortfolioComponent struct {
Key string `json:"key"`
Ecosystem string `json:"ecosystem"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
PURL string `json:"purl,omitempty"`
RepositoryCount int `json:"repository_count"`
OccurrenceCount int `json:"occurrence_count"`
Assessment string `json:"assessment"`
AssessmentStatuses []string `json:"assessment_statuses"`
Expression string `json:"expression,omitempty"`
DeclaredRaw []string `json:"declared_raw"`
NewestCollectedAt time.Time `json:"newest_collected_at"`
OldestCollectedAt time.Time `json:"oldest_collected_at"`
Repositories []SupplyChainRepositoryRef `json:"repositories"`
}
SupplyChainPortfolioComponent is one unique coordinate across repositories.
type SupplyChainPortfolioComponentDetail ¶ added in v0.6.0
type SupplyChainPortfolioComponentDetail struct {
Key string `json:"key"`
Stream string `json:"stream"`
Ecosystem string `json:"ecosystem"`
Namespace string `json:"namespace,omitempty"`
Name string `json:"name"`
Version string `json:"version"`
Occurrences []SupplyChainPortfolioOccurrence `json:"occurrences"`
Truncated bool `json:"truncated"`
Notes []string `json:"notes"`
}
type SupplyChainPortfolioComponentList ¶ added in v0.6.0
type SupplyChainPortfolioComponentList struct {
Stream string `json:"stream"`
RepositoriesInScope int `json:"repositories_in_scope"`
Components []SupplyChainPortfolioComponent `json:"components"`
Truncated bool `json:"truncated"`
NextCursor string `json:"next_cursor,omitempty"`
}
type SupplyChainPortfolioOccurrence ¶ added in v0.6.0
type SupplyChainPortfolioOccurrence struct {
RepositoryID int64 `json:"repository_id"`
Repository string `json:"repository"`
SnapshotID int64 `json:"snapshot_id"`
CollectedAt time.Time `json:"collected_at"`
ElementID string `json:"element_id"`
Root bool `json:"root"`
DeclaredRaw *string `json:"declared_raw"`
Assessment string `json:"assessment,omitempty"`
Expression string `json:"expression,omitempty"`
DetailPath string `json:"detail_path"`
}
type SupplyChainRefreshResponse ¶ added in v0.6.0
type SupplyChainRefreshResponse struct {
Job SupplyChainJob `json:"job"`
Created bool `json:"created"`
}
type SupplyChainRelationship ¶ added in v0.6.0
type SupplyChainRepositoryCounts ¶ added in v0.6.0
type SupplyChainRepositoryRef ¶ added in v0.6.0
type SupplyChainRepositoryStatus ¶ added in v0.6.0
type SupplyChainRepositoryStatus struct {
RepositoryID int64 `json:"repository_id"`
Repository string `json:"repository"`
Stream string `json:"stream"`
Producer string `json:"producer"`
Subject string `json:"subject"`
// Collection is "never", "current", "stale", or "failed".
Collection string `json:"collection"`
// Freshness is the age of the latest successful observation in seconds, or
// null when there is none.
FreshnessSeconds *int64 `json:"freshness_seconds"`
LatestSnapshot *SupplyChainSnapshot `json:"latest_snapshot"`
LastCollection *SupplyChainCollection `json:"last_collection"`
ActiveJob *SupplyChainJob `json:"active_job"`
// Enrichment is "not_configured" (no registry routes), or "configured".
Enrichment string `json:"enrichment"`
// EnrichmentEcosystems lists ecosystems with a configured registry route.
EnrichmentEcosystems []string `json:"enrichment_ecosystems"`
// LicenseSummary counts the latest snapshot's assessments by status.
LicenseSummary map[string]int `json:"license_summary"`
OptOut bool `json:"opt_out"`
Notes []string `json:"notes"`
Documents []SupplyChainDocumentRef `json:"documents"`
// Streams lists every stream known for the repository (GitHub and imports).
Streams []SupplyChainStreamRef `json:"streams"`
}
SupplyChainRepositoryStatus describes one repository stream: what GraphNest currently serves, when it was observed, and how the latest attempt went. Collection, freshness, parsing coverage, and enrichment are reported as independent states so a retained older inventory behind a failed refresh is obvious.
type SupplyChainReviewEvent ¶ added in v0.6.0
type SupplyChainReviewHistory ¶ added in v0.6.0
type SupplyChainReviewHistory struct {
Basis string `json:"basis,omitempty"`
Current *SupplyChainDecision `json:"current"`
CurrentStale bool `json:"current_stale"`
StaleReason string `json:"stale_reason,omitempty"`
Conclusions []SupplyChainConclusion `json:"conclusions"`
Decisions []SupplyChainDecision `json:"decisions"`
PolicyResults []SupplyChainPolicyResult `json:"policy_results"`
}
type SupplyChainReviewItem ¶ added in v0.6.0
type SupplyChainReviewItem struct {
ComponentID int64 `json:"component_id"`
SnapshotID int64 `json:"snapshot_id"`
RepositoryID int64 `json:"repository_id"`
Repository string `json:"repository"`
ElementID string `json:"element_id"`
Name string `json:"name"`
Version string `json:"version"`
PURL string `json:"purl,omitempty"`
Coordinates SupplyChainCoordinates `json:"coordinates"`
Assessment string `json:"assessment"`
Expression string `json:"expression,omitempty"`
Basis string `json:"basis,omitempty"`
Verdict string `json:"verdict"`
Explanation string `json:"explanation"`
PolicyID *int64 `json:"policy_id"`
StaleDecisionID *int64 `json:"stale_decision_id"`
Reason string `json:"reason"`
}
type SupplyChainReviewQueue ¶ added in v0.6.0
type SupplyChainReviewQueue struct {
Items []SupplyChainReviewItem `json:"items"`
Truncated bool `json:"truncated"`
NextCursor string `json:"next_cursor,omitempty"`
}
type SupplyChainSnapshot ¶ added in v0.6.0
type SupplyChainSnapshot struct {
ID int64 `json:"id"`
RepositoryID int64 `json:"repository_id"`
Stream string `json:"stream"`
Producer string `json:"producer"`
Subject string `json:"subject"`
CollectedAt time.Time `json:"collected_at"`
CreatedAtClaimed *time.Time `json:"created_at_claimed"`
ProducerTool string `json:"producer_tool"`
DocumentName string `json:"document_name"`
DocumentNS string `json:"document_namespace"`
SPDXVersion string `json:"spdx_version"`
DataLicense string `json:"data_license"`
SubjectRevision string `json:"subject_revision,omitempty"`
SubjectAssurance string `json:"subject_assurance"`
RootElementIDs []string `json:"root_element_ids"`
ParserVersion int `json:"parser_version"`
ComponentCount int `json:"component_count"`
EdgeCount int `json:"edge_count"`
WarningCount int `json:"warning_count"`
Warnings []SupplyChainWarning `json:"warnings"`
PublishedAt time.Time `json:"published_at"`
DocumentSHA256 string `json:"document_sha256"`
DocumentFormat string `json:"document_format"`
DocumentBytes int64 `json:"document_bytes"`
// UploadedBy is the authenticated uploader of an imported document,
// recorded separately from the producer the document claims.
UploadedBy string `json:"uploaded_by,omitempty"`
UploadLabel string `json:"upload_label,omitempty"`
}
type SupplyChainSnapshotComparison ¶ added in v0.6.0
type SupplyChainSnapshotComparison struct {
RepositoryID int64 `json:"repository_id"`
Base SupplyChainSnapshot `json:"base"`
Head SupplyChainSnapshot `json:"head"`
AddedComponents []string `json:"added_components"`
RemovedComponents []string `json:"removed_components"`
LicenseChanges []SupplyChainLicenseChange `json:"license_changes"`
EdgesAdded int `json:"edges_added"`
EdgesRemoved int `json:"edges_removed"`
MetadataChanges []string `json:"metadata_changes"`
Notes []string `json:"notes"`
}