otupy.profiles.xbom.data.bom_ref.generate_bom_ref
- generate_bom_ref(prefix: str) str
Generate a unique bom_ref for CycloneDX components or services.
This centralized function ensures consistent bom_ref generation across all XBOM profile data types. Modify this function to change the bom_ref format globally.
- Args:
prefix: The type prefix for the bom_ref (e.g., ‘container’, ‘service’, ‘vm’).
- Returns:
str: A unique bom_ref string in the format “{prefix}-{uuid}”.
- Examples:
>>> generate_bom_ref("container") # Returns "container-<uuid>" >>> generate_bom_ref("service") # Returns "service-<uuid>"