Improve struct and field comments and incorporate into json schema (#4252)

* improve struct and field comments and incorporate into json schema

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

* address review feedback

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>

---------

Signed-off-by: Alex Goodman <wagoodman@users.noreply.github.com>
This commit is contained in:
Alex Goodman
2025-10-03 17:01:56 +00:00
committed by GitHub
parent b96d3d20af
commit a77d24e379
57 changed files with 4241 additions and 1676 deletions
+22 -6
View File
@@ -1,15 +1,31 @@
package pkg
// RustCargoLockEntry represents a locked dependency from a Cargo.lock file with precise version and checksum information.
type RustCargoLockEntry struct {
Name string `toml:"name" json:"name"`
Version string `toml:"version" json:"version"`
Source string `toml:"source" json:"source"`
Checksum string `toml:"checksum" json:"checksum"`
// Name is crate name as specified in Cargo.toml
Name string `toml:"name" json:"name"`
// Version is crate version as specified in Cargo.toml
Version string `toml:"version" json:"version"`
// Source is the source registry or repository URL in format "registry+https://github.com/rust-lang/crates.io-index" for registry packages
Source string `toml:"source" json:"source"`
// Checksum is content checksum for registry packages only (hexadecimal string). Cargo doesn't require or include checksums for git dependencies. Used to detect MITM attacks by verifying downloaded crate matches lockfile checksum.
Checksum string `toml:"checksum" json:"checksum"`
// Dependencies are the list of dependencies with version constraints
Dependencies []string `toml:"dependencies" json:"dependencies"`
}
// RustBinaryAuditEntry represents Rust crate metadata extracted from a compiled binary using cargo-auditable format.
type RustBinaryAuditEntry struct {
Name string `toml:"name" json:"name"`
// Name is crate name as specified in audit section of the build binary
Name string `toml:"name" json:"name"`
// Version is crate version as specified in audit section of the build binary
Version string `toml:"version" json:"version"`
Source string `toml:"source" json:"source"`
// Source is the source registry or repository where this crate came from
Source string `toml:"source" json:"source"`
}