plugin

package
v0.4.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 27, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package depsdev implements a Bomly license matcher backed by the deps.dev API.

Index

Constants

View Source
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.

View Source
const (
	// SourceType identifies deps.dev license provenance in sdk.PackageLicense.Type.
	SourceType = "external-depsdev"
)

Variables

This section is empty.

Functions

func Module

func Module() sdkplugin.Module

Module packages the matcher for both execution modes: Bomly can embed it in-process or serve it as a managed plugin subprocess (see cmd/bomly-plugin-depsdev-license-matcher).

Types

type Checker

type Checker struct {
	// contains filtered or unexported fields
}

Checker enriches package licenses from deps.dev.

func New

func New(config Config) (*Checker, error)

New creates a deps.dev license matcher.

func (*Checker) Applicable

func (c *Checker) Applicable(_ context.Context, req sdkplugin.MatchRequest) (bool, error)

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

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.

func (*Checker) Ready

Ready reports whether the checker can run.

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL