
    ܖiK                     *   d Z ddlZddlZddlmZ ddlmZ ddlmZ ddlm	Z	 ddl
mZmZmZ ej                  dk\  rdd	lmZ ndd	lmZ ddlZdd
lmZ ddlmZ ddlmZ ddlmZmZ ddlm Z m!Z!m"Z"m#Z# ddl$m%Z%m&Z& ddl'm(Z( ddl)m*Z*m+Z+ ddl,m-Z-m.Z.m/Z/m0Z0 ddl1m2Z2m3Z3m4Z4  ejj                  d       G d d             Z6 ejj                  d       G d d             Z7 ejj                  d       G d d             Z8 ejj                  d       G d d             Z9 ejj                  d       G d  d!             Z: ejj                  d       G d" d#             Z;ejx                   G d$ d%e=e	             Z> G d& d'ej~                  j                        ZAejx                   G d( d)e=e	             ZB ejj                  d       G d* d+             ZC ejj                  d       G d, d-             ZD ejj                  d       G d. d/             ZEy)0a  
This set of classes represents the data that is possible about known Vulnerabilities.

Prior to CycloneDX schema version 1.4, vulnerabilities were possible in XML versions ONLY of the standard through
a schema extension: https://cyclonedx.org/ext/vulnerability.

Since CycloneDX schema version 1.4, this has become part of the core schema.

.. note::
    See the CycloneDX Schema extension definition https://cyclonedx.org/docs/1.7/xml/#type_vulnerabilitiesType
    N)Iterable)datetime)Decimal)Enum)AnyOptionalUnion)      )
deprecated)	SortedSet   )bom_ref_from_str)ComparableTuple)$MutuallyExclusivePropertiesExceptionNoPropertiesProvidedException)SchemaVersion1Dot4SchemaVersion1Dot5SchemaVersion1Dot6SchemaVersion1Dot7   )PropertyXsUri)BomRef)OrganizationalContactOrganizationalEntity)ImpactAnalysisAffectedStatusImpactAnalysisJustificationImpactAnalysisResponseImpactAnalysisState)ToolToolRepository_ToolRepositoryHelperT)%ignore_unknown_during_deserializationc            	       H   e Zd ZdZdddddee   dee   dee   ddfdZe e	j                  d	       e	j                  e	j                  j                        dee   fd
                     Zej                  dee   ddfd       Ze e	j                  d      dee   fd              Zej                  dee   ddfd       Ze e	j                  d      dee   fd              Zej                  dee   ddfd       ZdefdZdedefdZdedefdZdefdZdefdZy)BomTargetVersionRangea8  
    Class that represents either a version or version range and its affected status.

    `version` and `version_range` are mutually exclusive.

    .. note::
        See the CycloneDX schema:
        https://cyclonedx.org/docs/1.7/json/#tab-pane_vulnerabilities_items_affects_items_versions_items_oneOf_i0
    Nversionrangestatusr(   r)   r*   returnc                j    |s|st        d      |r|rt        d      || _        || _        || _        y )NzVOne of version or range must be provided for BomTargetVersionRange - neither provided.zUEither version or range should be provided for BomTargetVersionRange - both provided.)r   r   r(   r)   r*   )selfr(   r)   r*   s       a/var/www/html/content-pipeline/venv/lib/python3.12/site-packages/cyclonedx/model/vulnerability.py__init__zBomTargetVersionRange.__init__K   sG     u/h  u6g  
    r   c                     | j                   S )z=
        A single version of a component or service.
        _versionr-   s    r.   r(   zBomTargetVersionRange.version]   s     }}r0   c                     || _         y Nr2   )r-   r(   s     r.   r(   zBomTargetVersionRange.versionf   	    r0   r   c                     | j                   S )a  
        A version range specified in Package URL Version Range syntax (vers) which is defined at
        https://github.com/package-url/purl-spec/VERSION-RANGE-SPEC.rst

        .. note::
            The VERSION-RANGE-SPEC from Package URL is not a formalised standard at the time of writing and this no
            validation of conformance with this draft standard is performed.
        _ranger4   s    r.   r)   zBomTargetVersionRange.rangej   s     {{r0   c                     || _         y r6   r9   )r-   r)   s     r.   r)   zBomTargetVersionRange.rangew   	    r0   r
   c                     | j                   S )zP
        The vulnerability status for the version or range of versions.
        _statusr4   s    r.   r*   zBomTargetVersionRange.status{        ||r0   c                     || _         y r6   r>   )r-   r*   s     r.   r*   zBomTargetVersionRange.status   	    r0   c                 Z    t        | j                  | j                  | j                  f      S r6   )_ComparableTupler(   r)   r*   r4   s    r.   __comparable_tuplez(BomTargetVersionRange.__comparable_tuple   s'    LL$**dkk!
  	r0   otherc                 f    t        |t              r!| j                         |j                         k(  S yNF)
isinstancer&   (_BomTargetVersionRange__comparable_tupler-   rF   s     r.   __eq__zBomTargetVersionRange.__eq__   -    e23**,0H0H0JJJr0   c                 p    t        |t              r!| j                         |j                         k  S t        S r6   )rI   r&   rJ   NotImplementedrK   s     r.   __lt__zBomTargetVersionRange.__lt__   0    e23**,u/G/G/IIIr0   c                 4    t        | j                               S r6   )hashrJ   r4   s    r.   __hash__zBomTargetVersionRange.__hash__       D++-..r0   c                 V    d| j                    d| j                   d| j                   dS )Nz<BomTargetVersionRange version=z, version_range=z	, status=>r'   r4   s    r.   __repr__zBomTargetVersionRange.__repr__   s0    0>NtzzlZcdhdodocppqrrr0   )__name__
__module____qualname____doc__r   strr   r/   propertyserializablexml_sequence
xml_stringXmlStringSerializationTypeNORMALIZED_STRINGr(   setterr)   r*   rD   rJ   objectboolrL   r   rP   intrT   rX    r0   r.   r&   r&   ?   s    "&#9=	# } 56	
 
$ \q!\\DDVVW#  X "  ^^ x}       \q!	x} 	 " 	 \\8C= T   \q!!=>  "  ]]X&BC   $4 
F t 
C D 
/# /s# sr0   r&   c                      e Zd ZdZdddedeee      ddfdZe	 e
j                  d      defd	              Zej                  deddfd
       Ze	 e
j                  e
j                  j                   d       e
j                  d      dd                     Zej                  dee   ddfd       ZdefdZdedefdZdedefdZdefdZdefdZy)	BomTargeta  
    Class that represents referencing a Component or Service in a BOM.

    Aims to represent the sub-element `target` of the complex type `vulnerabilityType`.

    You can either create a `cyclonedx.model.bom.Bom` yourself programmatically, or generate a `cyclonedx.model.bom.Bom`
    from a `cyclonedx.parser.BaseParser` implementation.

    .. note::
        See the CycloneDX schema: https://cyclonedx.org/docs/1.7/json/#vulnerabilities_items_affects
    N)versionsrefrk   r+   c                (    || _         |xs g | _        y r6   )rl   rk   )r-   rl   rk   s      r.   r/   zBomTarget.__init__   s    
  Br0   r   c                     | j                   S )zO
        Reference to a component or service by the objects `bom-ref`.
        _refr4   s    r.   rl   zBomTarget.ref        yyr0   c                     || _         y r6   ro   )r-   rl   s     r.   rl   zBomTarget.ref   	    	r0   r(   r   c                     | j                   S )z
        Zero or more individual versions or range of versions.

        Returns:
            Set of `BomTargetVersionRange`
        )	_versionsr4   s    r.   rk   zBomTarget.versions   s     ~~r0   c                 $    t        |      | _        y r6   )r   ru   )r-   rk   s     r.   rk   zBomTarget.versions   s    "8,r0   c                 V    t        | j                  t        | j                        f      S r6   )rD   rl   rk   r4   s    r.   rE   zBomTarget.__comparable_tuple   s'    HHT]]+!
  	r0   rF   c                 f    t        |t              r!| j                         |j                         k(  S yrH   )rI   rj   _BomTarget__comparable_tuplerK   s     r.   rL   zBomTarget.__eq__   s,    eY'**,0H0H0JJJr0   c                 p    t        |t              r!| j                         |j                         k  S t        S r6   )rI   rj   ry   rO   rK   s     r.   rP   zBomTarget.__lt__   s/    eY'**,u/G/G/IIIr0   c                 4    t        | j                               S r6   )rS   ry   r4   s    r.   rT   zBomTarget.__hash__   rU   r0   c                 "    d| j                    dS )Nz<BomTarget ref=rW   )rl   r4   s    r.   rX   zBomTarget.__repr__   s     
!,,r0   )r+   z SortedSet[BomTargetVersionRange])rY   rZ   r[   r\   r]   r   r   r&   r/   r^   r_   r`   rl   rd   	xml_arrayXmlArraySerializationTypeNESTEDrk   rD   ry   re   rf   rL   r   rP   rg   rT   rX   rh   r0   r.   rj   rj      sS   
 ?C'' 8$9:;' 
	' \q!S  "  	ZZs t   \LBBII9U\q! " V  __-*?!@ -T - -$4 F t 
C D 
/# /-# -r0   rj   c                      e Zd ZdZddddddddee   dee   deee      dee	   dee
   d	ee
   d
dfdZe ej                  d      d
ee   fd              Zej                   dee   d
dfd       Ze ej                  d      d
ee   fd              Zej                   dee   d
dfd       Ze ej$                  d       ej&                  ej(                  j*                  d       ej                  d      d&d                            Zej                   dee   d
dfd       Ze ej                  d      d
ee	   fd              Zej                   dee	   d
dfd       Ze ej0                  e       ej0                  e       ej0                  e       ej8                  ej:                  j<                         ej                  d      d
ee
   fd                                          Zej                   dee
   d
dfd       Ze ej0                  e       ej0                  e       ej0                  e       ej8                  ej:                  j<                         ej                  d      d
ee
   fd                                          Z e j                   d	ee
   d
dfd       Z d
e!fd Z"d!e#d
e$fd"Z%d!e&d
e$fd#Z'd
e(fd$Z)d
e	fd%Z*y)'VulnerabilityAnalysisz
    Class that models the `analysis` sub-element of the `vulnerabilityType` complex type.

    .. note::
        See the CycloneDX schema: https://cyclonedx.org/docs/1.7/json/#vulnerabilities_items_analysis
    Nstatejustification	responsesdetailfirst_issuedlast_updatedr   r   r   r   r   r   r+   c                `    || _         || _        |xs g | _        || _        || _        || _        y r6   r   )r-   r   r   r   r   r   r   s          r.   r/   zVulnerabilityAnalysis.__init__   s5     
*"b((r0   r   c                     | j                   S )z
        The declared current state of an occurrence of a vulnerability, after automated or manual analysis.

        Returns:
            `ImpactAnalysisState` if set else `None`
        _stater4   s    r.   r   zVulnerabilityAnalysis.state   s     {{r0   c                     || _         y r6   r   )r-   r   s     r.   r   zVulnerabilityAnalysis.state
  r<   r0   r   c                     | j                   S )z
        The rationale of why the impact analysis state was asserted.

        Returns:
            `ImpactAnalysisJustification` if set else `None`
        _justificationr4   s    r.   r   z#VulnerabilityAnalysis.justification  s     """r0   c                     || _         y r6   r   r-   r   s     r.   r   z#VulnerabilityAnalysis.justification  
    +r0   responser
   c                     | j                   S )ag  
        A list of responses to the vulnerability by the manufacturer, supplier, or project responsible for the
        affected component or service. More than one response is allowed. Responses are strongly encouraged for
        vulnerabilities where the analysis state is exploitable.

        Returns:
            Set of `ImpactAnalysisResponse`
        )
_responsesr4   s    r.   r   zVulnerabilityAnalysis.responses  s     r0   c                 $    t        |      | _        y r6   )r   r   )r-   r   s     r.   r   zVulnerabilityAnalysis.responses,  s    #I.r0      c                     | j                   S )a@  
        A detailed description of the impact including methods used during assessment. If a vulnerability is not
        exploitable, this field should include specific details on why the component or service is not impacted by this
        vulnerability.

        Returns:
            `str` if set else `None`
        _detailr4   s    r.   r   zVulnerabilityAnalysis.detail0  s     ||r0   c                     || _         y r6   r   r-   r   s     r.   r   zVulnerabilityAnalysis.detail=  rB   r0      c                     | j                   S r6   _first_issuedr4   s    r.   r   z"VulnerabilityAnalysis.first_issuedA       !!!r0   first_issuec                     || _         y r6   r   )r-   r   s     r.   r   z"VulnerabilityAnalysis.first_issuedJ  s
    (r0      c                     | j                   S r6   _last_updatedr4   s    r.   r   z"VulnerabilityAnalysis.last_updatedN  r   r0   c                     || _         y r6   r   )r-   r   s     r.   r   z"VulnerabilityAnalysis.last_updatedW  s
    )r0   c                     t        | j                  | j                  t        | j                        | j                  | j
                  | j                  f      S r6   )rD   r   r   r   r   r   r   r4   s    r.   rE   z(VulnerabilityAnalysis.__comparable_tuple[  sG    JJ**T^^,KKt00	!
  	r0   rF   c                 f    t        |t              r!| j                         |j                         k(  S yrH   )rI   r   (_VulnerabilityAnalysis__comparable_tuplerK   s     r.   rL   zVulnerabilityAnalysis.__eq__c  rM   r0   c                 p    t        |t              r!| j                         |j                         k  S t        S r6   )rI   r   r   rO   rK   s     r.   rP   zVulnerabilityAnalysis.__lt__h  rQ   r0   c                 4    t        | j                               S r6   )rS   r   r4   s    r.   rT   zVulnerabilityAnalysis.__hash__m  rU   r0   c                 <    d| j                    d| j                   dS )Nz<VulnerabilityAnalysis state=z, justification=rW   )r   r   r4   s    r.   rX   zVulnerabilityAnalysis.__repr__p  s$    .tzzl:J4K]K]J^^_``r0   )r+   z!SortedSet[ImpactAnalysisResponse])+rY   rZ   r[   r\   r   r    r   r   r   r]   r   r/   r^   r_   r`   r   rd   r   	json_namer}   r~   r   r   r   viewr   r   r   type_mappinghelpersXsdDateTimer   r   rD   r   re   rf   rL   r   rP   rg   rT   rX   rh   r0   r.   r   r      s    04?C@D $+/+/)+,)   ;<) H%;<=	)
 ) x() x() 
)  \q!x 34  "  \\8$78 T   \q!#x(CD # " # ,84O+P ,UY , , \J'\LBBII:V\q!	 " W ( 	 /8,B#C / / / \q!	 	 " 	 ]]Xc] t   \)*\)*\)*\|33??@\q!"hx0 " " A + + + " )(: )t ) ) \)*\)*\)*\|33??@\q!"hx0 " " A + + + " *(); * * *$4 F t 
C D 
/# /a# ar0   r   c                      e Zd ZdZdddedee   ddfdZe e	j                  d       e	j                  e	j                  j                        dee   fd	                     Zej                  dee   ddfd
       Ze e	j                  d      defd              Zej                  deddfd       ZdefdZdedefdZdedefdZdefdZdefdZy)VulnerabilityAdvisoryz
    Class that models the `advisoryType` complex type.

    .. note::
        See the CycloneDX schema: https://cyclonedx.org/docs/1.7/json/#vulnerabilities_items_advisories
    N)titleurlr   r+   c                     || _         || _        y r6   )r   r   )r-   r   r   s      r.   r/   zVulnerabilityAdvisory.__init__}  s    
 
r0   r   c                     | j                   S )z-
        The title of this advisory.
        _titler4   s    r.   r   zVulnerabilityAdvisory.title       {{r0   c                     || _         y r6   r   )r-   r   s     r.   r   zVulnerabilityAdvisory.title  r<   r0   r   c                     | j                   S )z+
        The url of this advisory.
        _urlr4   s    r.   r   zVulnerabilityAdvisory.url  rq   r0   c                     || _         y r6   r   r-   r   s     r.   r   zVulnerabilityAdvisory.url  rs   r0   c                 D    t        | j                  | j                  f      S r6   )rD   r   r   r4   s    r.   rE   z(VulnerabilityAdvisory.__comparable_tuple  s!    JJ!
  	r0   rF   c                 f    t        |t              r!| j                         |j                         k(  S yrH   )rI   r   (_VulnerabilityAdvisory__comparable_tuplerK   s     r.   rL   zVulnerabilityAdvisory.__eq__  rM   r0   c                 p    t        |t              r!| j                         |j                         k  S t        S r6   )rI   r   r   rO   rK   s     r.   rP   zVulnerabilityAdvisory.__lt__  rQ   r0   c                 4    t        | j                               S r6   )rS   r   r4   s    r.   rT   zVulnerabilityAdvisory.__hash__  rU   r0   c                 <    d| j                    d| j                   dS )Nz<VulnerabilityAdvisory url=z, title=rW   )r   r   r4   s    r.   rX   zVulnerabilityAdvisory.__repr__  s    ,TXXJhtzzl!LLr0   )rY   rZ   r[   r\   r   r   r]   r/   r^   r_   r`   ra   rb   rc   r   rd   r   rD   r   re   rf   rL   r   rP   rg   rT   rX   rh   r0   r.   r   r   t  sT     $ } 
	 \q!\\DDVVWx}  X "  \\8C= T   \q!U  "  	ZZu   $4 
F t 
C D 
/# /M# Mr0   r   c                      e Zd ZdZddddee   dee   ddfdZe e	j                  d       e	j                  e	j                  j                        dee   fd	                     Zej                  dee   ddfd
       Ze e	j                  d      dee   fd              Zej                  dee   ddfd       ZdefdZdedefdZdedefdZdefdZdefdZy)VulnerabilitySourcea   
    Class that models the `vulnerabilitySourceType` complex type.

    This type is used for multiple purposes in the CycloneDX schema.

    .. note::
        See the CycloneDX schema: https://cyclonedx.org/docs/1.7/json/#vulnerabilities_items_source
    Nnamer   r   r   r+   c                     || _         || _        y r6   r   )r-   r   r   s      r.   r/   zVulnerabilitySource.__init__  s    
 	r0   r   c                     | j                   S )z&
        Name of this Source.
        _namer4   s    r.   r   zVulnerabilitySource.name  s     zzr0   c                     || _         y r6   r   )r-   r   s     r.   r   zVulnerabilitySource.name  s	    
r0   r   c                     | j                   S )z)
        The url of this Source.
        r   r4   s    r.   r   zVulnerabilitySource.url  rq   r0   c                     || _         y r6   r   r   s     r.   r   zVulnerabilitySource.url  rs   r0   c                 D    t        | j                  | j                  f      S r6   )rD   r   r   r4   s    r.   rE   z&VulnerabilitySource.__comparable_tuple  s!    IItxx!
  	r0   rF   c                 f    t        |t              r!| j                         |j                         k(  S yrH   )rI   r   &_VulnerabilitySource__comparable_tuplerK   s     r.   rL   zVulnerabilitySource.__eq__  -    e01**,0H0H0JJJr0   c                 p    t        |t              r!| j                         |j                         k  S t        S r6   )rI   r   r   rO   rK   s     r.   rP   zVulnerabilitySource.__lt__  0    e01**,u/G/G/IIIr0   c                 4    t        | j                               S r6   )rS   r   r4   s    r.   rT   zVulnerabilitySource.__hash__  rU   r0   c                 <    d| j                    d| j                   dS )Nz<VulnerabilityAdvisory name=z, url=rW   r   r4   s    r.   rX   zVulnerabilitySource.__repr__  s    -dii[txxjJJr0   )rY   rZ   r[   r\   r   r]   r   r/   r^   r_   r`   ra   rb   rc   r   rd   r   rD   r   re   rf   rL   r   rP   rg   rT   rX   rh   r0   r.   r   r     sc    ##sm e_ 
	 \q!\\DDVVWhsm  X "  
[[# 4   \q!Xe_  "  	ZZx 4  $4 
F t 
C D 
/# /K# Kr0   r   c                      e Zd ZdZdededdfdZe ej                  d       ej                  ej                  j                        defd                     Zej                  deddfd	       Ze ej                  d
      defd              Zej                  deddfd       ZdefdZdedefdZdedefdZdefdZdefdZy)VulnerabilityReferencea  
    Class that models the nested `reference` within the `vulnerabilityType` complex type.

    Vulnerabilities may benefit from pointers to vulnerabilities that are the equivalent of the vulnerability specified.
    Often times, the same vulnerability may exist in multiple sources of vulnerability intelligence, but have different
    identifiers. These references provide a way to correlate vulnerabilities across multiple sources of vulnerability
    intelligence.

    .. note::
        See the CycloneDX schema: https://cyclonedx.org/docs/1.7/json/#vulnerabilities_items_references

    .. note::
        Properties ``id`` and ``source`` are mandatory.

        History:
        * In v1.4 JSON scheme, both properties were mandatory
          https://github.com/CycloneDX/specification/blob/d570ffb8956d796585b9574e57598c42ee9de770/schema/bom-1.4.schema.json#L1455-L1474
        * In v1.4 XML schema, both properties were optional
          https://github.com/CycloneDX/specification/blob/d570ffb8956d796585b9574e57598c42ee9de770/schema/bom-1.4.xsd#L1788-L1797
        * In v1.5 XML schema, both were mandatory
          https://github.com/CycloneDX/specification/blob/d570ffb8956d796585b9574e57598c42ee9de770/schema/bom-1.5.xsd#L3364-L3374

        Decision:
        Since CycloneDXCoreWorkingGroup chose JSON schema as the dominant schema, the one that serves as first spec
        implementation, and since XML schema was "fixed" to work same as JSON schema, we'd consider it canon/spec that
        both properties were always mandatory.
    idsourcer+   Nc                     || _         || _        y r6   r   r   )r-   r   r   s      r.   r/   zVulnerabilityReference.__init__  s    
 r0   r   c                     | j                   S )z
        The identifier that uniquely identifies the vulnerability in the associated Source. For example: CVE-2021-39182.
        _idr4   s    r.   r   zVulnerabilityReference.id  s     xxr0   c                     || _         y r6   r   r-   r   s     r.   r   zVulnerabilityReference.id%  	    r0   r   c                     | j                   S z>
        The source that published the vulnerability.
        _sourcer4   s    r.   r   zVulnerabilityReference.source)  r@   r0   c                     || _         y r6   r   r-   r   s     r.   r   zVulnerabilityReference.source1  rB   r0   c                 D    t        | j                  | j                  f      S r6   )rD   r   r   r4   s    r.   rE   z)VulnerabilityReference.__comparable_tuple5  s!    GGT[[!
  	r0   rF   c                 f    t        |t              r!| j                         |j                         k(  S yrH   )rI   r   )_VulnerabilityReference__comparable_tuplerK   s     r.   rL   zVulnerabilityReference.__eq__:  s-    e34**,0H0H0JJJr0   c                 p    t        |t              r!| j                         |j                         k  S t        S r6   )rI   r   r   rO   rK   s     r.   rP   zVulnerabilityReference.__lt__?  s0    e34**,u/G/G/IIIr0   c                 4    t        | j                               S r6   )rS   r   r4   s    r.   rT   zVulnerabilityReference.__hash__D  rU   r0   c                 <    d| j                    d| j                   dS )Nz<VulnerabilityReference id=	, source=rW   r   r4   s    r.   rX   zVulnerabilityReference.__repr__G  s    ,TWWIYt{{m1MMr0   )rY   rZ   r[   r\   r]   r   r/   r^   r_   r`   ra   rb   rc   r   rd   r   rD   r   re   rf   rL   r   rP   rg   rT   rX   rh   r0   r.   r   r     sE   8 $ 
	 \q!\\DDVVWC  X "  YYS T   \q!+  "  ]]0 T  $4 
F t 
C D 
/# /N# Nr0   r   c                   b    e Zd ZdZdZdZdZdZdZdZ	dZ
ed	ed
d fd       Zd	ed
efdZd
efdZy)VulnerabilityScoreSourcea  
    Enum object that defines the permissible source types for a Vulnerability's score.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_scoreSourceType

    .. note::
        No explicit carry-over from the former schema extension:
         https://github.com/CycloneDX/specification/blob/master/schema/ext/vulnerability-1.0.xsd
    CVSSv2CVSSv3CVSSv31CVSSv4OWASPSSVCrF   vectorr+   c                 l   | j                  d      rt        j                  S | j                  d      r1| j                  d      rt        j                  S t        j                  S | j                  d      rt        j
                  S | j                  d      rt        j                  S t        j                  S )a  
        Attempt to derive the correct SourceType from an attack vector.

        For example, often attack vector strings are prefixed with the scheme in question - such
        that __CVSS:3.0/AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N__ would be the vector
        __AV:L/AC:L/PR:N/UI:R/S:C/C:L/I:N/A:N__ under the __CVSS 3__ scheme.

        Returns:
            Always returns an instance of `VulnerabilityScoreSource`. `VulnerabilityScoreSource.OTHER` is
            returned if the scheme is not obvious or known to us.
        CVSS:4.CVSS:3.zCVSS:3.1CVSS:2.r   )
startswithr   CVSS_V4	CVSS_V3_1CVSS_V3CVSS_V2r   OTHERr   s    r.   get_from_vectorz(VulnerabilityScoreSource.get_from_vectorb  s     Y'+333Y'  ,/999+333Y'+333W%+111'---r0   c                    | t         j                  u r(|j                  d      rt        j                  dd|      S | t         j
                  t         j                  fv r(|j                  d      rt        j                  dd|      S | t         j                  u r(|j                  d      rt        j                  dd|      S | t         j                  u r(|j                  d      rt        j                  d	d|      S |S )
a  
        This method will remove any Source Scheme type from the supplied vector, returning just the vector.

        .. Note::
            Currently supports CVSS 3.x, CVSS 2.x and OWASP schemes.

        Returns:
            The vector without any scheme prefix as a `str`.
        r   z^CVSS:4\.\d/? r  z^CVSS:3\.\d/?r  z^CVSS:2\.\d/?r   z^OWASP/?)	r   r  r  resubr  r  r  r   r-   r   s     r.   get_localised_vectorz-VulnerabilityScoreSource.get_localised_vector{  s     +3338I8I)8T66*B77-779Q9Y9YZZ	*66*B77+3338I8I)8T66*B77+111f6G6G6P66+r622r0   c                 @    | t         j                  u ry| j                  S )z
        Some of the enum values changed in 1.4 of the CycloneDX spec. This method allows us to
        backport some of the changes for pre-1.4.

        Returns:
            `str`
        z
OWASP Risk)r   r   valuer4   s    r.   get_value_pre_1_4z*VulnerabilityScoreSource.get_value_pre_1_4  s      +111zzr0   N)rY   rZ   r[   r\   r  r  r  r  r   r   r  staticmethodr]   r
  r  r  rh   r0   r.   r   r   K  sl    	 GGIGEDE. .(B . .03 3 ,
3 
r0   r   c            	          e Zd ZU dZ e       Zeeej                     e	e
   f   ed<    e	e
j                  e
j                  e
j                  e
j                  e
j                   h      ee<   ee   e
j$                  e
j&                  hz  ee<   ee   ee<   ee   ee<   ede
deej                     defd       Zededeeej                        dedefd	       Zededeeej                        dedefd
       Zedede
fd       Zy),_VulnerabilityScoreSourceSerializationHelperz   THIS CLASS IS NON-PUBLIC API  3_VulnerabilityScoreSourceSerializationHelper__CASESvssr   r+   c                     || j                   j                  |d      v r|j                  S t        j                  j                  S )Nrh   )r  getr   r  r  )clsr  r   s      r.   __normalizez8_VulnerabilityScoreSourceSerializationHelper.__normalize  sA     ckkoodB//  %		 *//
%		r0   o__c                .    |J | j                  ||      S r6   7_VulnerabilityScoreSourceSerializationHelper__normalizer  r  r   r  s       r.   json_normalizez;_VulnerabilityScoreSourceSerializationHelper.json_normalize  !     q$''r0   c                .    |J | j                  ||      S r6   r   r"  s       r.   xml_normalizez:_VulnerabilityScoreSourceSerializationHelper.xml_normalize  r$  r0   c                     t        |      S r6   )r   )r  r  s     r.   deserializez8_VulnerabilityScoreSourceSerializationHelper.deserialize  s    '**r0   N)rY   rZ   r[   r\   dictr  typer_   ViewType	frozensetr   __annotations__r  r  r  r   r  r   r  r   r   r   r   classmethodr]   r!  r   r   r#  r&  r(  rh   r0   r.   r  r    s   *VZV\GT$|,,-y9Q/RRS\"+ (( (( ** && &&- #G #**<"= (( %%A #G #**<"=G")*<"=G6 d<CXCX>Y ^a   (s (%d<+@+@&AB( (%(( ( (c ($T,*?*?%@A(($'( ( +C +$< + +r0   r  c                   r    e Zd ZdZdZdZdZdZdZdZ	dZ
e ed	      d
eeedf   edf   dd fd              Zy)VulnerabilitySeverityz
    Class that defines the permissible severities for a Vulnerability.

    .. note::
        See the CycloneDX schema: https://cyclonedx.org/docs/1.7/xml/#type_severityType
    noneinfolowmediumhighcriticalunknownzQDeprecated - use cyclonedx.contrib.vulnerability.cvss.vs_from_cvss_scores insteadscores.Nr+   c                     ddl m}  ||       S )u+  Deprecated — Alias of :func:`cyclonedx.contrib.vulnerability.cvss.vs_from_cvss_scores()`.

        Derives the Severity of a Vulnerability from it's declared CVSS scores.

        .. deprecated:: next
            Use ``cyclonedx.contrib.vulnerability.cvss.vs_from_cvss_scores()`` instead.
        r   )vs_from_cvss_scores)contrib.vulnerability.cvssr:  )r8  r:  s     r.   get_from_cvss_scoresz*VulnerabilitySeverity.get_from_cvss_scores  s     	E"6**r0   )rY   rZ   r[   r\   NONEINFOLOWMEDIUMHIGHCRITICALUNKNOWNr  r   r	   tuplefloatr<  rh   r0   r.   r0  r0    sq     DD
CFDHGcd
+U5+<eT+I%J 
+Of 
+ e 
+r0   r0  c                   .   e Zd ZdZddddddddee   dee   dee   dee   dee	   d	ee	   d
dfdZ
e ej                  d      d
ee   fd              Zej                  dee   d
dfd       Ze ej                   d       ej                  d      d
ee   fd                     Zej                  dee   d
dfd       Ze ej                  d      d
ee   fd              Zej                  dee   d
dfd       Ze ej&                  e       ej                  d      d
ee   fd                     Zej                  dee   d
dfd       Ze ej                  d       ej,                  ej.                  j0                        d
ee	   fd                     Zej                  dee	   d
dfd       Ze ej                  d      d
ee	   fd              Zej                  d	ee	   d
dfd       Zd
efd Zd!ed
efd"Zd!e d
efd#Z!d
e"fd$Z#d
e	fd%Z$y)&VulnerabilityRatingav  
    Class that models the `ratingType` complex element CycloneDX core schema.

    This class previously modelled the `scoreType` complexe type in the schema extension used prior to schema version
    1.4 - see https://github.com/CycloneDX/specification/blob/master/schema/ext/vulnerability-1.0.xsd.

    .. note::
        See the CycloneDX Schema definition: https://cyclonedx.org/docs/1.7/xml/#type_ratingType

    .. warning::
        As part of implementing support for CycloneDX schema version 1.4, the three score types defined in the schema
        extension used prior to 1.4 have been deprecated. The deprecated `score_base` should loosely be equivalent to
        the new `score` in 1.4 schema. Both `score_impact` and `score_exploitability` are deprecated and removed as
        they are redundant if you have the vector (the vector allows you to calculate the scores).
    N)r   scoreseveritymethodr   r   r   rH  rI  rJ  r   r   r+   c                    || _         || _        || _        || _        || _        || _        |r|r|j                  |      | _        y y y )Nr	  )r   rH  rI  rJ  r   r   r  )r-   r   rH  rI  rJ  r   r   s          r.   r/   zVulnerabilityRating.__init__  sP     
 *f 55V5DDK 6r0   r   c                     | j                   S r   r   r4   s    r.   r   zVulnerabilityRating.source  r@   r0   c                     || _         y r6   r   r   s     r.   r   zVulnerabilityRating.source  rB   r0   z.1fr   c                     | j                   S )z4
        The numerical score of the rating.
        _scorer4   s    r.   rH  zVulnerabilityRating.score  r   r0   c                     || _         y r6   rO  )r-   rH  s     r.   rH  zVulnerabilityRating.score$  r<   r0   r
   c                     | j                   S )zs
        The textual representation of the severity that corresponds to the numerical score of the rating.
        	_severityr4   s    r.   rI  zVulnerabilityRating.severity(  s     ~~r0   c                     || _         y r6   rS  )r-   rI  s     r.   rI  zVulnerabilityRating.severity0  	    !r0   r   c                     | j                   S )z=
        The risk scoring methodology/standard used.
        _methodr4   s    r.   rJ  zVulnerabilityRating.method4       ||r0   score_sourcec                     || _         y r6   rX  )r-   r[  s     r.   rJ  zVulnerabilityRating.method=  s	    #r0   r   c                     | j                   S )z}
        The textual representation of the metric values used to score the vulnerability - also known as the vector.
        _vectorr4   s    r.   r   zVulnerabilityRating.vectorA  rZ  r0   c                     || _         y r6   r^  r  s     r.   r   zVulnerabilityRating.vectorJ  rB   r0   r   c                     | j                   S )zL
        An optional reason for rating the vulnerability as it was.
        r   r4   s    r.   r   z!VulnerabilityRating.justificationN  s     """r0   c                     || _         y r6   r   r   s     r.   r   z!VulnerabilityRating.justificationV  r   r0   c                     t        | j                  | j                  xs d| j                  | j                  | j
                  | j                  f      S )Nr   )rD   rI  rH  r   rJ  r   r   r4   s    r.   rE   z&VulnerabilityRating.__comparable_tupleZ  sA    MM4::?KKdkk!
  	r0   rF   c                 f    t        |t              r!| j                         |j                         k(  S yrH   )rI   rG  &_VulnerabilityRating__comparable_tuplerK   s     r.   rL   zVulnerabilityRating.__eq__a  r   r0   c                 p    t        |t              r!| j                         |j                         k  S t        S r6   )rI   rG  re  rO   rK   s     r.   rP   zVulnerabilityRating.__lt__f  r   r0   c                 4    t        | j                               S r6   )rS   re  r4   s    r.   rT   zVulnerabilityRating.__hash__k  rU   r0   c                     d| j                    d| j                   d| j                   d| j                   d| j                   d| j
                   dS )Nz<VulnerabilityRating severity=z score=r   z method=z vector=zjustification=rW   )rI  rH  r   rJ  r   r   r4   s    r.   rX   zVulnerabilityRating.__repr__n  sT    /gdjj\ Rkk](4;;-x}T//03 	3r0   )%rY   rZ   r[   r\   r   r   r   r0  r   r]   r/   r^   r_   r`   r   rd   string_formatrH  rI  r   r  rJ  ra   rb   rc   r   r   rD   re  re   rf   rL   r   rP   rg   rT   rX   rh   r0   r.   rG  rG    sh   $ 15#'4859 $'+E,-E  E 01	E
 12E E  }E 
E& \q!!45  "  ]]X&9: t   \&\q!x(  " '  \\8G,    \q!(#89  "  __"*?!@ "T " " \KL\q!!9:  " M  ]]$8,D#E $$ $ $ \q!\\DDVVW  X "  ]]Xc] t   \q!#x} # " # ,8C= ,T , ,$4 F t 
C D 
/# /3# 3r0   rG  c                      e Zd ZdZddddeee      deee      ddfdZe	 e
j                  e
j                  j                  d       e
j                  d	      dd
                     Zej                   dee   ddfd       Ze	 e
j                  e
j                  j                  d       e
j                  d      dd                     Zej                   dee   ddfd       ZdefdZdedefdZdedefdZdefdZdefdZy)VulnerabilityCreditsa  
    Class that models the `credits` of `vulnerabilityType` complex type in the CycloneDX schema (version >= 1.4).

    This class also provides data support for schema versions < 1.4 where Vulnerabilites were possible through a schema
    extension (in XML only).

    .. note::
        See the CycloneDX schema: https://cyclonedx.org/docs/1.7/json/#vulnerabilities_items_credits
    Norganizationsindividualsrm  rn  r+   c                0    |xs g | _         |xs g | _        y r6   rl  )r-   rm  rn  s      r.   r/   zVulnerabilityCredits.__init__  s    
 +0b&,"r0   organizationr   c                     | j                   S )z
        The organizations credited with vulnerability discovery.

        Returns:
             Set of `OrganizationalEntity`
        )_organizationsr4   s    r.   rm  z"VulnerabilityCredits.organizations  s     """r0   c                 $    t        |      | _        y r6   )r   rr  )r-   rm  s     r.   rm  z"VulnerabilityCredits.organizations  s    '6r0   
individualr   c                     | j                   S )z
        The individuals, not associated with organizations, that are credited with vulnerability discovery.

        Returns:
            Set of `OrganizationalContact`
        )_individualsr4   s    r.   rn  z VulnerabilityCredits.individuals  s        r0   c                 $    t        |      | _        y r6   )r   rv  )r-   rn  s     r.   rn  z VulnerabilityCredits.individuals  s    %k2r0   c                 h    t        t        | j                        t        | j                        f      S r6   )rD   rm  rn  r4   s    r.   rE   z'VulnerabilityCredits.__comparable_tuple  s0    T//0T--.!
  	r0   rF   c                 f    t        |t              r!| j                         |j                         k(  S yrH   )rI   rk  '_VulnerabilityCredits__comparable_tuplerK   s     r.   rL   zVulnerabilityCredits.__eq__  s-    e12**,0H0H0JJJr0   c                 p    t        |t              r!| j                         |j                         k  S t        S r6   )rI   rk  rz  rO   rK   s     r.   rP   zVulnerabilityCredits.__lt__  s0    e12**,u/G/G/IIIr0   c                 4    t        | j                               S r6   )rS   rz  r4   s    r.   rT   zVulnerabilityCredits.__hash__  rU   r0   c                      dt        |        dS )Nz<VulnerabilityCredits id=rW   )r   r4   s    r.   rX   zVulnerabilityCredits.__repr__  s    *2d8*A66r0   )r+   zSortedSet[OrganizationalEntity])r+   z SortedSet[OrganizationalContact])rY   rZ   r[   r\   r   r   r   r   r/   r^   r_   r}   r~   r   r`   rm  rd   rn  rD   rz  re   rf   rL   r   rP   rg   rT   r]   rX   rh   r0   r.   rk  rk  t  s    CGAE-)= >?- h'<=>- 
	- \LBBII>Z\q!# " [ # 784H+I 7d 7 7 \LBBII<X\q!! " Y ! 3x0E'F 34 3 3$4 F t 
C D 
/# /7# 7r0   rk  c            )          e Zd ZdZdddddddddddddddddddddeeeef      dee   dee   dee	e
      dee	e      d	ee	e      d
ee   dee   dee   dee   dee	e      dee   dee   dee   dee   deee	e   ef      dee   dee	e      dee	e      ddf(dZe ej0                  d       ej2                  e       ej4                          ej6                  d      defd                                   Ze ej:                  d       ej<                  ej>                  j@                        dee   fd                     Z!e!jD                  dee   ddfd       Z!e ej:                  d      dee   fd              Z#e#jD                  dee   ddfd        Z#e ejH                  ejJ                  jL                  d!       ej:                  d"      d^d#                     Z'e'jD                  de	e
   ddfd$       Z'e ejH                  ejJ                  jL                  d%       ej:                  d&      d_d'                     Z(e(jD                  de	e   ddfd(       Z(e ejH                  ejJ                  jL                  d)       ej:                  d*      d`d+                     Z)e)jD                  d	e	e   ddfd,       Z)e ej:                  d-      dee   fd.              Z*e*jD                  d
ee   ddfd/       Z*e ej:                  d0      dee   fd1              Z+e+jD                  dee   ddfd2       Z+e ej:                  d3      dee   fd4              Z,e,jD                  dee   ddfd5       Z,e ejZ                  e.       ejZ                  e/       ejZ                  e0       ej:                  d6      dee   fd7                                   Z1e1jD                  dee   ddfd8       Z1e ejH                  ejJ                  jL                  d9       ej:                  d:      dad;                     Z2e2jD                  de	e   ddfd<       Z2e ej2                  ejf                  jh                         ej:                  d=      dee   fd>                     Z5e5jD                  dee   ddfd?       Z5e ej2                  ejf                  jh                         ej:                  d@      dee   fdA                     Z6e6jD                  dee   ddfdB       Z6e ej2                  ejf                  jh                         ej:                  dC      dee   fdD                     Z7e7jD                  dee   ddfdE       Z7e ej:                  dF      dee   fdG              Z8e8jD                  dee   ddfdH       Z8e ej2                  e9       ej:                  dI      defdJ                     Z:e:jD                  dee	e   ef   ddfdK       Z:e ej:                  dL      dee   fdM              Z;e;jD                  dee   ddfdN       Z;e ejH                  ejJ                  jL                  dO       ej:                  dP      dbdQ                     Z<e<jD                  dRe	e   ddfdS       Z<e ejH                  ejJ                  jL                  dT       ej:                  dU      dcdV                     Z=e=jD                  de	e   ddfdW       Z=de>fdXZ?dYe@deAfdZZBdYeCdeAfd[ZDdefd\ZEdefd]ZFy)dVulnerabilityal  
    Class that models the `vulnerabilityType` complex type in the CycloneDX schema (version >= 1.4).

    This class also provides data support for schema versions < 1.4 where Vulnerabilites were possible through a schema
    extension (in XML only).

    .. note::
        See the CycloneDX schema: https://cyclonedx.org/docs/1.7/xml/#type_vulnerabilityType
    N)bom_refr   r   
referencesratingscwesdescriptionr   recommendation
workaround
advisoriescreated	publishedupdatedcreditstoolsanalysisaffects
propertiesr  r   r   r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r+   c                X   t        |      | _        || _        || _        |xs g | _        |xs g | _        |xs g | _        || _        || _        |	| _	        |
| _
        |xs g | _        || _        || _        || _        || _        |xs g | _        || _        |xs g | _        |xs g | _        y r6   )_bom_ref_from_str_bom_refr   r   r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  )r-   r  r   r   r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  s                       r.   r/   zVulnerability.__init__  s    , *'2$*}"JB	&,$$*"[b
 }"$*r0   zbom-refc                     | j                   S )zt
        Get the unique reference for this Vulnerability in this BOM.

        Returns:
           `BomRef`
        )r  r4   s    r.   r  zVulnerability.bom_ref  s     }}r0   r   c                     | j                   S )z
        The identifier that uniquely identifies the vulnerability. For example: CVE-2021-39182.

        Returns:
            `str` if set else `None`
        r   r4   s    r.   r   zVulnerability.id  s     xxr0   c                     || _         y r6   r   r   s     r.   r   zVulnerability.id  r   r0   r   c                     | j                   S )z
        The source that published the vulnerability.

        Returns:
            `VulnerabilitySource` if set else `None`
        r   r4   s    r.   r   zVulnerability.source  s     ||r0   c                     || _         y r6   r   r   s     r.   r   zVulnerability.source  rB   r0   	referencer
   c                     | j                   S )a  
        Zero or more pointers to vulnerabilities that are the equivalent of the vulnerability specified. Often times,
        the same vulnerability may exist in multiple sources of vulnerability intelligence, but have different
        identifiers. References provides a way to correlate vulnerabilities across multiple sources of vulnerability
        intelligence.

        Returns:
            Set of `VulnerabilityReference`
        )_referencesr4   s    r.   r  zVulnerability.references"       r0   c                 $    t        |      | _        y r6   )r   r  )r-   r  s     r.   r  zVulnerability.references1      $Z0r0   ratingr   c                     | j                   S )zk
        List of vulnerability ratings.

        Returns:
            Set of `VulnerabilityRating`
        )_ratingsr4   s    r.   r  zVulnerability.ratings5       }}r0   c                 $    t        |      | _        y r6   )r   r  )r-   r  s     r.   r  zVulnerability.ratingsA  s    !'*r0   cwer   c                     | j                   S )z
        A list of CWE (Common Weakness Enumeration) identifiers.

        .. note::
            See https://cwe.mitre.org/

        Returns:
            Set of `int`
        )_cwesr4   s    r.   r  zVulnerability.cwesE  s     zzr0   c                 $    t        |      | _        y r6   )r   r  )r-   r  s     r.   r  zVulnerability.cwesT  s    t_
r0   r   c                     | j                   S )z
        A description of the vulnerability as provided by the source.

        Returns:
            `str` if set else `None`
        _descriptionr4   s    r.   r  zVulnerability.descriptionX  s        r0   c                     || _         y r6   r  )r-   r  s     r.   r  zVulnerability.descriptionc  s
    'r0      c                     | j                   S )a   
        If available, an in-depth description of the vulnerability as provided by the source organization. Details
        often include examples, proof-of-concepts, and other information useful in understanding root cause.

        Returns:
            `str` if set else `None`
        r   r4   s    r.   r   zVulnerability.detailg  s     ||r0   c                     || _         y r6   r   r   s     r.   r   zVulnerability.details  rB   r0      c                     | j                   S )z
        Recommendations of how the vulnerability can be remediated or mitigated.

        Returns:
            `str` if set else `None`
        _recommendationr4   s    r.   r  zVulnerability.recommendationw  s     ###r0   c                     || _         y r6   r  )r-   r  s     r.   r  zVulnerability.recommendation  s
    -r0   	   c                     | j                   S )z
        A bypass, usually temporary, of the vulnerability that reduces its likelihood and/or impact.
        Workarounds often involve changes to configuration or deployments.

        Returns:
            `str` if set else `None`
        _workaroundr4   s    r.   r  zVulnerability.workaround  r  r0   c                     || _         y r6   r  )r-   r  s     r.   r  zVulnerability.workaround  s
    %r0   advisory   c                     | j                   S )zx
        Advisories relating to the Vulnerability.

        Returns:
            Set of `VulnerabilityAdvisory`
        )_advisoriesr4   s    r.   r  zVulnerability.advisories  s     r0   c                 $    t        |      | _        y r6   )r   r  )r-   r  s     r.   r  zVulnerability.advisories  r  r0      c                     | j                   S )z
        The date and time (timestamp) when the vulnerability record was created in the vulnerability database.

        Returns:
            `datetime` if set else `None`
        _createdr4   s    r.   r  zVulnerability.created  r  r0   c                     || _         y r6   r  )r-   r  s     r.   r  zVulnerability.created  r7   r0   r   c                     | j                   S )z
        The date and time (timestamp) when the vulnerability record was first published.

        Returns:
            `datetime` if set else `None`
        
_publishedr4   s    r.   r  zVulnerability.published  s     r0   c                     || _         y r6   r  )r-   r  s     r.   r  zVulnerability.published  s	    #r0      c                     | j                   S )z
        The date and time (timestamp) when the vulnerability record was last updated.

        Returns:
            `datetime` if set else `None`
        _updatedr4   s    r.   r  zVulnerability.updated  r  r0   c                     || _         y r6   r  )r-   r  s     r.   r  zVulnerability.updated  r7   r0      c                     | j                   S )z
        Individuals or organizations credited with the discovery of the vulnerability.

        Returns:
            `VulnerabilityCredits` if set else `None`
        _creditsr4   s    r.   r  zVulnerability.credits  s     }}r0   c                     || _         y r6   r  )r-   r  s     r.   r  zVulnerability.credits  r7   r0      c                     | j                   S )zn
        Tools used to create this BOM.

        Returns:
            :class:`ToolRepository` object.
        )_toolsr4   s    r.   r  zVulnerability.tools  s     {{r0   c                 V    t        |t              r|| _        y t        |      | _        y )N)r  )rI   r"   r  )r-   r  s     r.   r  zVulnerability.tools  s&     %0 e, 	r0      c                     | j                   S )z
        Analysis of the Vulnerability in your context.

        Returns:
            `VulnerabilityAnalysis` if set else `None`
        	_analysisr4   s    r.   r  zVulnerability.analysis  s     ~~r0   c                     || _         y r6   r  )r-   r  s     r.   r  zVulnerability.analysis  rV  r0   target   c                     | j                   S )z
        The components or services that are affected by the vulnerability.

        Returns:
            Set of `BomTarget`
        )_affectsr4   s    r.   r  zVulnerability.affects  r  r0   affects_targetsc                 $    t        |      | _        y r6   )r   r  )r-   r  s     r.   r  zVulnerability.affects)  s    !/2r0   r^      c                     | j                   S )a  
        Provides the ability to document properties in a key/value store. This provides flexibility to include data not
        officially supported in the standard without having to use additional namespaces or create extensions.

        Return:
            Set of `Property`
        )_propertiesr4   s    r.   r  zVulnerability.properties-  s     r0   c                 $    t        |      | _        y r6   )r   r  )r-   r  s     r.   r  zVulnerability.properties:  r  r0   c                 :   t        | j                  | j                  j                  | j                  t        | j
                        t        | j                        t        | j                        | j                  | j                  | j                  | j                  t        | j                        | j                  | j                  | j                  | j                   | j"                  | j$                  t        | j&                        t        | j(                        f      S r6   )rD   r   r  r  r   r  r  r  r  r   r  r  r  r  r  r  r  r  r  r  r  r4   s    r.   rE   z Vulnerability.__comparable_tuple>  s    GGT\\''KK)$//:T\\*,<TYY,GIYIYKK,,doo?OPTP_P_?`LL$..$,,LL$**dmmT\\*T__-	!
 	 		r0   rF   c                 f    t        |t              r!| j                         |j                         k(  S yrH   )rI   r   _Vulnerability__comparable_tuplerK   s     r.   rL   zVulnerability.__eq__J  s,    e]+**,0H0H0JJJr0   c                 p    t        |t              r!| j                         |j                         k  S t        S r6   )rI   r  r  rO   rK   s     r.   rP   zVulnerability.__lt__O  s/    e]+**,u/G/G/IIIr0   c                 4    t        | j                               S r6   )rS   r  r4   s    r.   rT   zVulnerability.__hash__T  rU   r0   c                 P    d| j                   j                   d| j                   dS )Nz<Vulnerability bom-ref=z, id=rW   )r  r  r   r4   s    r.   rX   zVulnerability.__repr__W  s&    (););(<E$''!LLr0   )r+   z!SortedSet[VulnerabilityReference])r+   zSortedSet[VulnerabilityRating])r+   zSortedSet[int])r+   z SortedSet[VulnerabilityAdvisory])r+   zSortedSet[BomTarget])r+   zSortedSet[Property])GrY   rZ   r[   r\   r   r	   r]   r   r   r   r   rG  rg   r   r   rk  r!   r"   r   rj   r   r/   r^   r_   r   r   xml_attributexml_namer  r`   ra   rb   rc   r   rd   r   r}   r~   r   r  r  r  r  r   r  r   r   r   r   r  r  r   r   r  r  r  r  r#   r  r  r  r  rD   r  re   rf   rL   r   rP   rT   rX   rh   r0   r.   r  r    s
    15 04AE;?(,%) $(,$(@D&*(,&*26AE481537)(+%V,-(+ SM(+ ,-	(+
 X&<=>(+ (#678(+ x}%(+ c](+ (+ !(+ SM(+ X&;<=(+ (#(+ H%(+ (#(+  ./!(+" htnn<=>#(+$ 01%(+& (9-.'(+( Xh/0)(+* 
+(+T \I&\v&\!\9%  & " ' ' 
 \q!\\DDVVWHSM  X "  YYXc] t   \q!!45  "  ]]X&9: t   \LBBII;W\q!
  " X 
  1X.D%E 1$ 1 1 \LBBII8T\q! " U  ^^+x(;< + + + \LBBII5Q\q!
 " R 
 
[[%# %4 % % \q!!Xc] ! " ! (x} ( ( ( \q!  "  ]]Xc] t   \q!$ $ " $ .Xc] .t . . \)*\)*\)*\q! HSM   " + + + 
  &Xc] &t & & \LBBII:V\r"  # W   1X.C%D 1 1 1 \|33??@\r"(+  # A  ^^ x1  d     \|33??@\r"8H-  # A  $8H#5 $$ $ $ \|33??@\r"(+  # A  ^^ x1  d     \r""67  #  ^^ x(<=  $     \45\r"~  # 6  \\-5$!?@ -T - -
 \r"(#89  #  __"*?!@ "T " " \LBBII8T\r" # U  ^^3x	': 3t 3 3 \LBBII:V\r"  # W   1Xh%7 1D 1 1
$4 
F t 
C D 
/# /M# Mr0   r  )Fr\   r  syscollections.abcr   r   decimalr   enumr   typingr   r   r	   version_infowarningsr   typing_extensionspy_serializabler_   sortedcontainersr   _internal.bom_refr   r  _internal.comparer   rD   exception.modelr   r   schema.schemar   r   r   r   r  r   r   r  r   contactr   r   impact_analysisr   r   r   r    toolr!   r"   r#   serializable_classr&   rj   r   r   r   r   serializable_enumr]   r   r   
BaseHelperr  r0  rG  rk  r  rh   r0   r.   <module>r     sY  &
 
 
 $    ' 'w#, & & E C a j j   @  > = !  tLZs Zs MZsz !  tLE- E- ME-P !  tLJa Ja MJaZ !  tL<M <M M<M~ !  tL>K >K M>KB !  tLQN QN MQNh OsD O  Od*+<3G3G3R3R *+Z +C +  +< !  tLF3 F3 MF3R !  tLG7 G7 MG7T !  tLXM XM MXMr0   