pub struct SbomConfig {
pub id: Option<String>,
pub cmd: Option<String>,
pub env: Option<Vec<String>>,
pub args: Option<Vec<String>>,
pub documents: Option<Vec<String>>,
pub artifacts: Option<String>,
pub ids: Option<Vec<String>>,
pub skip: Option<StringOrBool>,
}Fields§
§id: Option<String>Unique identifier for this SBOM config (default: “default”).
cmd: Option<String>Command to run for SBOM generation (default: “syft”).
env: Option<Vec<String>>Environment variables to pass to the command, as KEY=VALUE strings.
Order is preserved. Values are template-rendered before being set.
args: Option<Vec<String>>Command-line arguments (supports templates and $artifact, $document vars).
documents: Option<Vec<String>>Output document path templates (supports templates).
artifacts: Option<String>Which artifacts to catalog: “source”, “archive”, “binary”, “package”, “diskimage”, “installer”, “any” (default: “archive”).
ids: Option<Vec<String>>Filter by artifact IDs (ignored if artifacts=“source”).
skip: Option<StringOrBool>Skip this SBOM config. Accepts bool or template string.
Implementations§
Source§impl SbomConfig
impl SbomConfig
Sourcepub const DEFAULT_ID: &'static str = "default"
pub const DEFAULT_ID: &'static str = "default"
Default id when an SBOM config has none. Mirrors GoReleaser
internal/pipe/sbom/sbom.go (cfg.ID = "default").
Sourcepub const DEFAULT_CMD: &'static str = "syft"
pub const DEFAULT_CMD: &'static str = "syft"
Default SBOM-generation command. Mirrors GoReleaser sbom.go
(cfg.Cmd = "syft").
Sourcepub const DEFAULT_ARTIFACTS: &'static str = "archive"
pub const DEFAULT_ARTIFACTS: &'static str = "archive"
Default artifacts filter. Mirrors GoReleaser sbom.go
(cfg.Artifacts = "archive").
Sourcepub const DEFAULT_DOCUMENT_BINARY: &'static str = "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.sbom.json"
pub const DEFAULT_DOCUMENT_BINARY: &'static str = "{{ .Binary }}_{{ .Version }}_{{ .Os }}_{{ .Arch }}.sbom.json"
Default document-path template when artifacts: binary. Includes
per-target Os/Arch suffix so per-arch SBOMs don’t collide.
Mirrors GoReleaser sbom.go.
Sourcepub const DEFAULT_DOCUMENT_OTHER: &'static str = "{{ .ArtifactName }}.sbom.json"
pub const DEFAULT_DOCUMENT_OTHER: &'static str = "{{ .ArtifactName }}.sbom.json"
Default document-path template for any non-binary, non-any
artifacts: filter. Mirrors GoReleaser sbom.go.
Sourcepub const DEFAULT_SYFT_ARGS: &[&'static str]
pub const DEFAULT_SYFT_ARGS: &[&'static str]
Default args for the syft command. Mirrors GoReleaser
sbom.go. Anodize matches GR’s shell-style $artifact /
$document placeholders verbatim — the arg-renderer rewrites
these to per-artifact values at execution time.
Sourcepub const DEFAULT_SYFT_ENV_KEY: &'static str = "SYFT_FILE_METADATA_CATALOGER_ENABLED"
pub const DEFAULT_SYFT_ENV_KEY: &'static str = "SYFT_FILE_METADATA_CATALOGER_ENABLED"
Env entry that syft requires to emit file paths in the SBOM
when cataloging archives or source. Mirrors GoReleaser sbom.go.
pub const DEFAULT_SYFT_ENV_VAL: &'static str = "true"
Sourcepub fn resolved_id(&self) -> &str
pub fn resolved_id(&self) -> &str
Resolve the SBOM-config id, falling back to "default".
Sourcepub fn resolved_cmd(&self) -> &str
pub fn resolved_cmd(&self) -> &str
Resolve the SBOM command, falling back to "syft".
Sourcepub fn resolved_artifacts(&self) -> &str
pub fn resolved_artifacts(&self) -> &str
Resolve the artifacts: filter, falling back to "archive".
Sourcepub fn resolved_documents(&self, artifacts: &str) -> Vec<String>
pub fn resolved_documents(&self, artifacts: &str) -> Vec<String>
Resolve documents, falling back to the artifact-type-specific
default when unset. Caller should pass the result of
Self::resolved_artifacts for artifacts.
Sourcepub fn resolved_args(&self, cmd: &str) -> Vec<String>
pub fn resolved_args(&self, cmd: &str) -> Vec<String>
Resolve args, falling back to Self::DEFAULT_SYFT_ARGS when
cmd is "syft"; empty vec otherwise (matches GoReleaser:
sbom.go only initializes args when cmd is syft, and leaves
args empty for other cmds).
Sourcepub fn default_syft_env_for(cmd: &str, artifacts: &str) -> Vec<(String, String)>
pub fn default_syft_env_for(cmd: &str, artifacts: &str) -> Vec<(String, String)>
Default env additions for the syft sub-process. Empty unless cmd
is syft AND artifacts is source/archive — in which case syft
needs the file-metadata cataloger enabled to produce file paths
in the SBOM. Mirrors GoReleaser sbom.go.
Trait Implementations§
Source§impl Clone for SbomConfig
impl Clone for SbomConfig
Source§fn clone(&self) -> SbomConfig
fn clone(&self) -> SbomConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SbomConfig
impl Debug for SbomConfig
Source§impl Default for SbomConfig
impl Default for SbomConfig
Source§fn default() -> SbomConfig
fn default() -> SbomConfig
Source§impl<'de> Deserialize<'de> for SbomConfigwhere
SbomConfig: Default,
impl<'de> Deserialize<'de> for SbomConfigwhere
SbomConfig: Default,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for SbomConfig
impl JsonSchema for SbomConfig
Source§fn schema_name() -> String
fn schema_name() -> String
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref keyword. Read more