Skip to content

Commit ab21684

Browse files
committed
wip
Signed-off-by: Jan Kowalleck <[email protected]>
1 parent 1069f1c commit ab21684

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

cyclonedx/output/__init__.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
if TYPE_CHECKING: # pragma: no cover
3434
from ..model.bom import Bom
3535
from ..model.bom_ref import BomRef
36-
from ..model.contact import OrganizationalEntity
36+
from ..model.contact import OrganizationalContact, OrganizationalEntity
3737
from ..model.license import License
3838
from .json import Json as JsonOutputter
3939
from .xml import Xml as XmlOutputter
@@ -175,12 +175,18 @@ def from_bom(cls, bom: 'Bom', prefix: str = 'BomRef') -> 'BomRefDiscriminator':
175175
components = tuple(bom._get_all_components())
176176
services = tuple(bom.services)
177177
vulnerabilities = tuple(bom.vulnerabilities)
178-
orgs: Iterable['OrganizationalEntity'] = filter(lambda o: o is not None, chain( # type:ignore[arg-type]
178+
orgs: list['OrganizationalEntity'] = list(filter(lambda o: o is not None, chain( # type:ignore[arg-type]
179179
(bom.metadata.manufacture, bom.metadata.manufacturer, bom.metadata.supplier),
180180
chain.from_iterable((c.manufacturer, c.supplier,) for c in components),
181181
(s.provider for s in services),
182182
chain.from_iterable(v.credits.organizations for v in vulnerabilities if v.credits),
183-
))
183+
)))
184+
contacts: Iterable['OrganizationalContact'] = chain(
185+
bom.metadata.authors,
186+
chain.from_iterable(c.authors for c in components),
187+
chain.from_iterable(v.credits.individuals for v in vulnerabilities if v.credits),
188+
chain.from_iterable(o.contacts for o in orgs),
189+
)
184190
licenses: Iterable['License'] = chain(
185191
bom.metadata.licenses,
186192
chain.from_iterable(c.licenses for c in components),
@@ -193,6 +199,7 @@ def from_bom(cls, bom: 'Bom', prefix: str = 'BomRef') -> 'BomRefDiscriminator':
193199
services,
194200
vulnerabilities,
195201
orgs,
202+
contacts,
196203
(o.address for o in orgs if o.address is not None),
197204
licenses,
198205
)),

0 commit comments

Comments
 (0)