Documentation
¶
Overview ¶
Package depsdev implements a Bomly license matcher backed by the deps.dev API.
Index ¶
- Constants
- func Module() sdkplugin.Module
- type Checker
- func (c *Checker) Applicable(_ context.Context, req sdkplugin.MatchRequest) (bool, error)
- func (c *Checker) Descriptor() sdkplugin.MatcherDescriptor
- func (c *Checker) Match(ctx context.Context, req sdkplugin.MatchRequest) (sdkplugin.MatchResult, error)
- func (c *Checker) Ready(context.Context, sdkplugin.MatchRequest) error
- type Config
Constants ¶
const Name = "depsdev-license-matcher"
Name is the plugin's identity. It MUST equal the "id" field in bomly-plugin.json — Bomly refuses to load a plugin whose manifest id and runtime descriptor name disagree. It is also the descriptor name the Bomly CLI composition keys on when it embeds this matcher.
const (
// SourceType identifies deps.dev license provenance in sdk.PackageLicense.Type.
SourceType = "external-depsdev"
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Checker ¶
type Checker struct {
// contains filtered or unexported fields
}
Checker enriches package licenses from deps.dev.
func (*Checker) Applicable ¶
Applicable reports whether the checker applies to the request.
func (*Checker) Descriptor ¶
func (c *Checker) Descriptor() sdkplugin.MatcherDescriptor
Descriptor returns the matcher registration metadata.
func (*Checker) Match ¶
func (c *Checker) Match(ctx context.Context, req sdkplugin.MatchRequest) (sdkplugin.MatchResult, error)
Match enriches missing package licenses via deps.dev.
Two response shapes exist. Legacy hosts get the request registry back, enriched in place (the protocol v1 baseline). When the request sets AcceptPackageUpdates, the registry is left untouched and the result carries PackageUpdates instead: one delta per enriched package holding only the PURL, Matched, and the license list. Package.MergeFrom fills Licenses only when the target package has none — the same fill-when-empty rule this matcher applies in place — so applying the deltas reproduces the in-place enrichment.
type Config ¶
type Config struct {
APIBase string
CacheDir string
CacheTTL time.Duration
Logger *zap.Logger
Client *http.Client
HTTPClientProvider *httpkit.ClientProvider
}
Config configures the deps.dev license matcher.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns a production-ready deps.dev matcher config.