20
20
License related things
21
21
"""
22
22
23
-
23
+ from enum import Enum
24
24
from typing import TYPE_CHECKING , Any , Optional , Union
25
25
from warnings import warn
26
26
29
29
30
30
from .._internal .compare import ComparableTuple as _ComparableTuple
31
31
from ..exception .model import MutuallyExclusivePropertiesException
32
+ from ..schema .schema import SchemaVersion1Dot6
32
33
from . import AttachedText , XsUri
33
34
34
35
@@ -159,6 +160,24 @@ def __repr__(self) -> str:
159
160
return f'<License id={ self ._id !r} , name={ self ._name !r} >'
160
161
161
162
163
+ @serializable .serializable_enum
164
+ class LicenseExpressionAcknowledgement (str , Enum ):
165
+ """
166
+ This is our internal representation of the `type_licenseAcknowledgementEnumerationType` ENUM type
167
+ within the CycloneDX standard.
168
+
169
+ .. note::
170
+ Introduced in CycloneDX v1.6
171
+
172
+ .. note::
173
+ See the CycloneDX Schema for hashType:
174
+ https://cyclonedx.org/docs/1.6/#type_licenseAcknowledgementEnumerationType
175
+ """
176
+
177
+ CONCLUDED = 'concluded'
178
+ DECLARED = 'declared'
179
+
180
+
162
181
@serializable .serializable_class (name = 'expression' )
163
182
class LicenseExpression :
164
183
"""
@@ -170,8 +189,35 @@ class LicenseExpression:
170
189
https://cyclonedx.org/docs/1.4/json/#components_items_licenses_items_expression
171
190
"""
172
191
173
- def __init__ (self , value : str ) -> None :
192
+ def __init__ (self , value : str ,
193
+ acknowledgement : Optional [LicenseExpressionAcknowledgement ] = None ) -> None :
174
194
self ._value = value
195
+ self .acknowledgement = acknowledgement
196
+
197
+ @property
198
+ @serializable .view (SchemaVersion1Dot6 )
199
+ @serializable .xml_attribute ()
200
+ def acknowledgement (self ) -> Optional [LicenseExpressionAcknowledgement ]:
201
+ """
202
+ Declared licenses and concluded licenses represent two different stages in the licensing process within
203
+ software development.
204
+
205
+ Declared licenses refer to the initial intention of the software authors regarding the
206
+ licensing terms under which their code is released. On the other hand, concluded licenses are the result of a
207
+ comprehensive analysis of the project's codebase to identify and confirm the actual licenses of the components
208
+ used, which may differ from the initially declared licenses. While declared licenses provide an upfront
209
+ indication of the licensing intentions, concluded licenses offer a more thorough understanding of the actual
210
+ licensing within a project, facilitating proper compliance and risk management. Observed licenses are defined
211
+ in evidence.licenses. Observed licenses form the evidence necessary to substantiate a concluded license.
212
+
213
+ Returns:
214
+ `LicenseExpressionAcknowledgement` or `None`
215
+ """
216
+ return self ._acknowledgement
217
+
218
+ @acknowledgement .setter
219
+ def acknowledgement (self , acknowledgement : Optional [LicenseExpressionAcknowledgement ]) -> None :
220
+ self ._acknowledgement = acknowledgement
175
221
176
222
@property
177
223
@serializable .xml_name ('.' )
0 commit comments