Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 3 additions & 28 deletions binary/cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,27 +27,23 @@ import (
"github.com/google/go-containerregistry/pkg/authn"
v1 "github.com/google/go-containerregistry/pkg/v1"
"github.com/google/go-containerregistry/pkg/v1/remote"
scalibr "github.com/google/osv-scalibr"
scalibrimage "github.com/google/osv-scalibr/artifact/image"
"github.com/google/osv-scalibr/binary/cdx"
"github.com/google/osv-scalibr/binary/platform"
"github.com/google/osv-scalibr/binary/proto"
cpb "github.com/google/osv-scalibr/binary/proto/config_go_proto"
binspdx "github.com/google/osv-scalibr/binary/spdx"
"github.com/google/osv-scalibr/clients/resolution"
"github.com/google/osv-scalibr/converter"
convspdx "github.com/google/osv-scalibr/converter/spdx"
"github.com/google/osv-scalibr/detector"
"github.com/spdx/tools-golang/spdx/v2/common"
"google.golang.org/protobuf/encoding/prototext"

scalibr "github.com/google/osv-scalibr"
"github.com/google/osv-scalibr/enricher/transitivedependency/requirements"
"github.com/google/osv-scalibr/extractor/filesystem"
"github.com/google/osv-scalibr/extractor/filesystem/language/java/pomxmlnet"
scalibrfs "github.com/google/osv-scalibr/fs"
"github.com/google/osv-scalibr/log"
"github.com/google/osv-scalibr/plugin"
pl "github.com/google/osv-scalibr/plugin/list"
"github.com/spdx/tools-golang/spdx/v2/common"
"google.golang.org/protobuf/encoding/prototext"
)

// Array is a type to be passed to flag.Var that supports arrays passed as repeated flags,
Expand Down Expand Up @@ -154,8 +150,6 @@ type Flags struct {
StoreAbsolutePath bool
WindowsAllDrives bool
Offline bool
LocalRegistry string
DisableGoogleAuth bool
}

var supportedOutputFormats = []string{
Expand Down Expand Up @@ -553,25 +547,6 @@ func (f *Flags) pluginsToRun() ([]plugin.Plugin, *cpb.PluginConfig, error) {
if err != nil {
return nil, nil, err
}

// Apply plugin-specific config.
for _, p := range plugins {
if f.LocalRegistry != "" {
switch p.Name() {
case pomxmlnet.Name:
p.(*pomxmlnet.Extractor).MavenClient.SetLocalRegistry(f.LocalRegistry)
case requirements.Name:
if client, ok := p.(*requirements.Enricher).Client.(*resolution.PyPIRegistryClient); ok {
// The resolution client is the native PyPI registry client.
client.SetLocalRegistry(f.LocalRegistry)
}
}
}
if f.DisableGoogleAuth && p.Name() == pomxmlnet.Name {
p.(*pomxmlnet.Extractor).MavenClient.DisableGoogleAuth()
}
}

result = append(result, plugins...)
}

Expand Down
19 changes: 19 additions & 0 deletions binary/proto/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ message PluginConfig {

// The maximum file size the plugin will process.
int64 max_file_size_bytes = 1;
// The local directory to store the downloaded manifests during dependency
// resolution.
string local_registry = 3;
// If true, do not try to create google.DefaultClient for Artifact Registry
// during dependency resolution.
bool disable_google_auth = 4;

// Config values that only apply to a single plugin.
repeated PluginSpecificConfig plugin_specific = 2;
Expand All @@ -45,6 +51,8 @@ message PluginSpecificConfig {
VDIConfig vdi = 5;
VMDKConfig vmdk = 6;
HashiCorpVaultValidatorConfig hashicorp_vault_validator = 7;
SDPInspectConfig sdp_inspect = 8;
POMXMLNetConfig pom_xml_net = 9;
}
}

Expand Down Expand Up @@ -92,3 +100,14 @@ message HashiCorpVaultValidatorConfig {
// https://developer.hashicorp.com/vault
string vault_url = 1;
}

message SDPInspectConfig {
// The GCP project id to use for Sensitive Data Protection InspectContent API
// calls.
string project_id = 1;
}

message POMXMLNetConfig {
// The URL of the upstream Maven registry.
string upstream_registry = 1;
}
Loading
Loading