Skip to content

Commit baaa977

Browse files
committed
Merge remote-tracking branch 'origin/main' into 9.0.0-dev
2 parents 8ef7e45 + 82e0bb1 commit baaa977

File tree

6 files changed

+35
-56
lines changed

6 files changed

+35
-56
lines changed

CHANGELOG.md

Lines changed: 4 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,64 +2,14 @@
22

33

44

5-
## v9.0.0-rc.1 (2025-02-12)
5+
## v8.8.0 (2025-02-12)
66

7-
### Breaking
8-
9-
* feat!: BomRef affect equality/comparisson (#754)
10-
11-
For some this is considered a bug-fix, for others this is a feature - it
12-
is a breaking change anyway since it modifies the order of things.
13-
14-
----
15-
16-
TODO:
17-
- [x] **every** symbol that has a property `bom-ref` MUST utilize it for
18-
dunder methods `hash`,`eq`,`gt`,`lt`,...
19-
- [x] add new test cases from #753
20-
- [x] add new test cases from #540
21-
- [x] add new test cases from #677
22-
- [x] create new tests snapshots (if applicable)
23-
24-
----
25-
26-
> [!important]
27-
> depends on #755
28-
29-
supersedes #678
30-
closes #678
31-
32-
fixes #753
33-
fixes #540
34-
fixes #677
35-
36-
---------
37-
38-
Signed-off-by: wkoot <[email protected]>
39-
Signed-off-by: Jan Kowalleck <[email protected]>
40-
Co-authored-by: wkoot <[email protected]> ([`46bc3f5`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/46bc3f53b9302159b7fa684d3cf78b08928ba731))
41-
42-
* chore(deps)!: `py-serializable==^1.1.1` -> `^2.0.0` (#775)
43-
44-
bump to `py-serializable` v2.0.0:
45-
<https://github.com/madpah/serializable/releases/tag/v2.0.0>
46-
This is considered a breaking change, as downstream users might rely on
47-
the same package's previous version.
48-
49-
Signed-off-by: Jan Kowalleck <[email protected]> ([`7c20c8e`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/7c20c8e44fbc3de2942dd2f2ad298be2bd17614b))
7+
### Feature
508

51-
* refactor!: streamline comparison/hashing functions (#755)
9+
* feat: add `cyclonedx.model.crypto.ProtocolProperties.crypto_refs` (#767)
5210

53-
we have different methods of object comparison here and there, some work
54-
on tuples, other on hashes, other on different structures.
55-
56-
this PR streamlines this.
57-
58-
these changes might cause breaking changes for downstream users.
59-
60-
---------
6111

62-
Signed-off-by: Jan Kowalleck <jan.kowalleck@gmail.com> ([`fd9b755`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/fd9b7559a49bdaf3f6d9fe9fea54db8a65958c01))
12+
Signed-off-by: Indivar Mishra <indimishra@gmail.com> ([`beb35f5`](https://github.com/CycloneDX/cyclonedx-python-lib/commit/beb35f55e3e75d625db45e4ff084dee02e919ef6))
6313

6414

6515
## v8.7.0 (2025-02-06)

cyclonedx/model/crypto.py

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1336,11 +1336,13 @@ def __init__(
13361336
version: Optional[str] = None,
13371337
cipher_suites: Optional[Iterable[ProtocolPropertiesCipherSuite]] = None,
13381338
ikev2_transform_types: Optional[Ikev2TransformTypes] = None,
1339+
crypto_refs: Optional[Iterable[BomRef]] = None,
13391340
) -> None:
13401341
self.type = type
13411342
self.version = version
13421343
self.cipher_suites = cipher_suites or [] # type:ignore[assignment]
13431344
self.ikev2_transform_types = ikev2_transform_types
1345+
self.crypto_refs = crypto_refs or [] # type:ignore[assignment]
13441346

13451347
@property
13461348
@serializable.xml_sequence(10)
@@ -1403,9 +1405,29 @@ def ikev2_transform_types(self) -> Optional[Ikev2TransformTypes]:
14031405
def ikev2_transform_types(self, ikev2_transform_types: Optional[Ikev2TransformTypes]) -> None:
14041406
self._ikev2_transform_types = ikev2_transform_types
14051407

1408+
@property
1409+
@serializable.xml_array(serializable.XmlArraySerializationType.FLAT, 'cryptoRef')
1410+
@serializable.json_name('cryptoRefArray')
1411+
def crypto_refs(self) -> 'SortedSet[BomRef]':
1412+
"""
1413+
A list of protocol-related cryptographic assets.
1414+
1415+
Returns:
1416+
`Iterable[BomRef]`
1417+
"""
1418+
return self._crypto_refs
1419+
1420+
@crypto_refs.setter
1421+
def crypto_refs(self, crypto_refs: Iterable[BomRef]) -> None:
1422+
self._crypto_refs = SortedSet(crypto_refs)
1423+
14061424
def __comparable_tuple(self) -> _ComparableTuple:
14071425
return _ComparableTuple((
1408-
self.type, self.version, _ComparableTuple(self.cipher_suites), self.ikev2_transform_types
1426+
self.type,
1427+
self.version,
1428+
_ComparableTuple(self.cipher_suites),
1429+
self.ikev2_transform_types,
1430+
_ComparableTuple(self.crypto_refs)
14091431
))
14101432

14111433
def __eq__(self, other: object) -> bool:

tests/_data/models.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@ def get_crypto_properties_protocol() -> CryptoProperties:
239239
]
240240
)
241241
],
242+
crypto_refs=[BomRef('for-test-2'), BomRef('for-test-1')],
242243
),
243244
oid='an-oid-here'
244245
)

tests/_data/snapshots/get_bom_v1_6_with_crypto_protocol-1.6.json.bin

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
"name": "TLS_CHACHA20_POLY1305_SHA256"
3939
}
4040
],
41+
"cryptoRefArray": [
42+
"for-test-1",
43+
"for-test-2"
44+
],
4145
"type": "tls",
4246
"version": "1.3"
4347
}

tests/_data/snapshots/get_bom_v1_6_with_crypto_protocol-1.6.xml.bin

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@
4444
</identifiers>
4545
</cipherSuite>
4646
</cipherSuites>
47+
<cryptoRef>for-test-1</cryptoRef>
48+
<cryptoRef>for-test-2</cryptoRef>
4749
</protocolProperties>
4850
<oid>an-oid-here</oid>
4951
</cryptoProperties>

tests/test_deserialize_json.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def test_regression_issue764(self) -> None:
116116

117117
def test_regression_issue690(self) -> None:
118118
"""
119-
regressio test for issue#690.
119+
regression test for issue#690.
120120
see https://github.com/CycloneDX/cyclonedx-python-lib/issues/690
121121
"""
122122
json_file = join(OWN_DATA_DIRECTORY, 'json',

0 commit comments

Comments
 (0)