Check if component has missing or hash-based license.
(comp: dict)
| 340 | |
| 341 | |
| 342 | def needs_fix(comp: dict) -> bool: |
| 343 | """Check if component has missing or hash-based license.""" |
| 344 | licenses = comp.get("licenses", []) |
| 345 | if not licenses: |
| 346 | return True |
| 347 | for entry in licenses: |
| 348 | lic = entry.get("license", {}) |
| 349 | lid = lic.get("id", "") |
| 350 | lname = lic.get("name", "") |
| 351 | if lid.startswith("sha256:") or lname.startswith("sha256:"): |
| 352 | return True |
| 353 | return False |
| 354 | |
| 355 | |
| 356 | def _find_sbom_files() -> list[Path]: |