Skip to content

RedHatProductSecurity/deplist

This branch is 42 commits ahead of, 3 commits behind mcoops/deplist:main.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

5a82c76 · Jan 16, 2025
Dec 9, 2024
Jan 16, 2025
Jan 16, 2025
Aug 16, 2022
Nov 18, 2021
Feb 24, 2021
Aug 16, 2022
Jun 16, 2021
Apr 19, 2021
Jan 16, 2025
Dec 9, 2024
Jan 16, 2025
Dec 9, 2024
Dec 9, 2024
Nov 18, 2021

Repository files navigation

Tests

deplist

Scan and list the dependencies in a source code repository.

Supports:

  • Go
  • NodeJS
  • Python
  • Ruby
  • Java

Dependencies are printed in PackageURL format.

Requirements

On Fedora:

$ dnf install golang-bin yarnpkg maven rubygem-bundler ruby-devel gcc gcc-c++ npm

Command Line

Build from source

$ make
go build cmd/deplist/deplist.go

Run

$ ./deplist test/testRepo
pkg:npm/[email protected]
pkg:npm/[email protected]
pkg:npm/[email protected]
pkg:npm/[email protected]
...

Verbose/debug output:

 deplist -debug ./test/testRepo/
DEBU[0000] Checking ./test/testRepo/
DEBU[0000] GetRubyDeps test/testRepo/Gemfile
DEBU[0000] Running env [--chdir=test/testRepo ruby /tmp/gemfile-parser.rb927489446 .]
DEBU[0000] GetGoPkgDeps test/testRepo/Gopkg.lock
DEBU[0000] GetGlideDeps test/testRepo/glide.lock
DEBU[0000] GetGolangDeps test/testRepo/go.mod
...

API

The api functions as follows:

func GetDeps(fullPath string, ignoreDirs ...string) ([]Dependency, Bitmask, error) {

Parameters

  • fullPath:

    Path to directory with source code.

Returns

  • Dependency:

    Array of Dependency structs from dependencies.go

  • Bitmask:

    A bitmask of found languages:

const (
	LangGolang = 1 << iota
	LangNodeJS
	LangPython
	LangRuby
)
  • error:

    Standard Go error handling

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 90.9%
  • Ruby 7.1%
  • Other 2.0%