|
22 | 22 | from decimal import Decimal
|
23 | 23 | from enum import Enum
|
24 | 24 | from typing import Iterable, Optional, Set, Tuple, Union
|
25 |
| -from uuid import uuid4 |
26 | 25 |
|
27 | 26 | from . import OrganizationalContact, OrganizationalEntity, Tool, XsUri
|
| 27 | +from .bom_ref import BomRef |
28 | 28 | from .impact_analysis import ImpactAnalysisAffectedStatus, ImpactAnalysisJustification, ImpactAnalysisResponse, \
|
29 | 29 | ImpactAnalysisState
|
30 | 30 | from ..exception.model import MutuallyExclusivePropertiesException, NoPropertiesProvidedException
|
@@ -745,7 +745,7 @@ def __init__(self, *, bom_ref: Optional[str] = None, id: Optional[str] = None,
|
745 | 745 | # Deprecated Parameters kept for backwards compatibility
|
746 | 746 | source_name: Optional[str] = None, source_url: Optional[str] = None,
|
747 | 747 | recommendations: Optional[Iterable[str]] = None) -> None:
|
748 |
| - self.bom_ref = bom_ref or str(uuid4()) |
| 748 | + self._bom_ref = BomRef(value=bom_ref) |
749 | 749 | self.id = id
|
750 | 750 | self.source = source
|
751 | 751 | self.references = set(references or [])
|
@@ -774,21 +774,17 @@ def __init__(self, *, bom_ref: Optional[str] = None, id: Optional[str] = None,
|
774 | 774 | self.recommendation = next(iter(recommendations))
|
775 | 775 |
|
776 | 776 | @property
|
777 |
| - def bom_ref(self) -> Optional[str]: |
| 777 | + def bom_ref(self) -> BomRef: |
778 | 778 | """
|
779 | 779 | Get the unique reference for this Vulnerability in this BOM.
|
780 | 780 |
|
781 | 781 | If a value was not provided in the constructor, a UUIDv4 will have been assigned.
|
782 | 782 |
|
783 | 783 | Returns:
|
784 |
| - `str` if set else `None` |
| 784 | + `BomRef` |
785 | 785 | """
|
786 | 786 | return self._bom_ref
|
787 | 787 |
|
788 |
| - @bom_ref.setter |
789 |
| - def bom_ref(self, bom_ref: Optional[str]) -> None: |
790 |
| - self._bom_ref = bom_ref |
791 |
| - |
792 | 788 | @property
|
793 | 789 | def id(self) -> Optional[str]:
|
794 | 790 | """
|
|
0 commit comments