-
-
Notifications
You must be signed in to change notification settings - Fork 67
feat: add support for Service.trustZone #980
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -67,6 +67,7 @@ def __init__( | |
| endpoints: Optional[Iterable[XsUri]] = None, | ||
| authenticated: Optional[bool] = None, | ||
| x_trust_boundary: Optional[bool] = None, | ||
| trust_zone: Optional[str] = None, | ||
| data: Optional[Iterable[DataClassification]] = None, | ||
| licenses: Optional[Iterable[License]] = None, | ||
| external_references: Optional[Iterable[ExternalReference]] = None, | ||
|
|
@@ -83,6 +84,7 @@ def __init__( | |
| self.endpoints = endpoints or [] | ||
| self.authenticated = authenticated | ||
| self.x_trust_boundary = x_trust_boundary | ||
| self.trust_zone = trust_zone | ||
| self.data = data or [] | ||
| self.licenses = licenses or [] | ||
| self.external_references = external_references or [] | ||
|
|
@@ -239,16 +241,25 @@ def x_trust_boundary(self) -> Optional[bool]: | |
| def x_trust_boundary(self, x_trust_boundary: Optional[bool]) -> None: | ||
| self._x_trust_boundary = x_trust_boundary | ||
|
|
||
| # @property | ||
| # ... | ||
| # @serializable.view(SchemaVersion1Dot5) | ||
| # @serializable.xml_sequence(9) | ||
| # def trust_zone(self) -> ...: | ||
| # ... # since CDX1.5 | ||
| # | ||
| # @trust_zone.setter | ||
| # def trust_zone(self, ...) -> None: | ||
| # ... # since CDX1.5 | ||
| @property | ||
| @serializable.view(SchemaVersion1Dot5) | ||
| @serializable.view(SchemaVersion1Dot6) | ||
| @serializable.view(SchemaVersion1Dot7) | ||
| @serializable.xml_sequence(9) | ||
| def trust_zone(self) -> Optional[str]: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The The CycloneDX schema defines @property
@serializable.view(SchemaVersion1Dot5)
@serializable.view(SchemaVersion1Dot6)
@serializable.view(SchemaVersion1Dot7)
@serializable.xml_string(serializable.XmlStringSerializationType.NORMALIZED_STRING) # ← add this
@serializable.xml_sequence(9)
def trust_zone(self) -> Optional[str]:After adding the decorator, the XML snapshot fixtures ( |
||
| """ | ||
| The name of the trust zone the service resides in. | ||
|
|
||
| Supported from CycloneDX v1.5 onwards. | ||
|
|
||
| Returns: | ||
| `str` if set else `None` | ||
| """ | ||
| return self._trust_zone | ||
|
|
||
| @trust_zone.setter | ||
| def trust_zone(self, trust_zone: Optional[str]) -> None: | ||
| self._trust_zone = trust_zone | ||
|
|
||
| @property | ||
| @serializable.xml_array(serializable.XmlArraySerializationType.NESTED, 'classification') | ||
|
|
@@ -369,7 +380,7 @@ def __comparable_tuple(self) -> _ComparableTuple: | |
| self.authenticated, _ComparableTuple(self.data), _ComparableTuple(self.endpoints), | ||
| _ComparableTuple(self.external_references), _ComparableTuple(self.licenses), | ||
| _ComparableTuple(self.properties), self.release_notes, _ComparableTuple(self.services), | ||
| self.x_trust_boundary | ||
| self.x_trust_boundary, self.trust_zone | ||
| )) | ||
|
|
||
| def __eq__(self, other: object) -> bool: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,7 @@ | |
| </endpoints> | ||
| <authenticated>false</authenticated> | ||
| <x-trust-boundary>true</x-trust-boundary> | ||
| <trustZone>internal vpc</trustZone> | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The XML snapshot contains a raw tab character ( Since |
||
| <data> | ||
| <classification flow="outbound">public</classification> | ||
| </data> | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.