rustaudit

package module
v0.0.0-...-204dfee Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2022 License: MIT Imports: 9 Imported by: 15

README

go-rustaudit

Go library for extracting Rust dependency information from Rust binaries built with cargo-auditable (previously named rust-audit).

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.

When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.

Trademarks

This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// Returned if an executable is not a known format
	ErrUnknownFileFormat = errors.New("unknown file format")
	// errNoRustDepInfo is returned when an executable file doesn't contain Rust dependency information
	ErrNoRustDepInfo = errors.New("rust dependency information not found")
)

Functions

This section is empty.

Types

type DependencyKind

type DependencyKind string
const (
	Build   DependencyKind = "build"
	Runtime DependencyKind = "runtime"
)

type Package

type Package struct {
	Name         string         `json:"name"`
	Version      string         `json:"version"`
	Source       string         `json:"source"`
	Kind         DependencyKind `json:"kind"`
	Dependencies []uint         `json:"dependencies"`
	Features     []string       `json:"features"` // Removed in cargo-auditable 0.5.0
	Root         bool           `json:"root"`
}

func (*Package) UnmarshalJSON

func (p *Package) UnmarshalJSON(text []byte) error

Default the Kind to Runtime during unmarshalling

type VersionInfo

type VersionInfo struct {
	Packages []Package `json:"packages"`
}

This struct is embedded in dependencies produced with rust-audit: https://github.com/Shnatsel/rust-audit/blob/bc805a8fdd1492494179bd01a598a26ec22d44fe/auditable-serde/src/lib.rs#L89

func GetDependencyInfo

func GetDependencyInfo(r io.ReaderAt) (VersionInfo, error)

Jump to

Keyboard shortcuts

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