33
33
if TYPE_CHECKING : # pragma: no cover
34
34
from ..model .bom import Bom
35
35
from ..model .bom_ref import BomRef
36
- from ..model .contact import OrganizationalEntity
36
+ from ..model .contact import OrganizationalContact , OrganizationalEntity
37
37
from ..model .license import License
38
38
from .json import Json as JsonOutputter
39
39
from .xml import Xml as XmlOutputter
@@ -175,12 +175,18 @@ def from_bom(cls, bom: 'Bom', prefix: str = 'BomRef') -> 'BomRefDiscriminator':
175
175
components = tuple (bom ._get_all_components ())
176
176
services = tuple (bom .services )
177
177
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]
179
179
(bom .metadata .manufacture , bom .metadata .manufacturer , bom .metadata .supplier ),
180
180
chain .from_iterable ((c .manufacturer , c .supplier ,) for c in components ),
181
181
(s .provider for s in services ),
182
182
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
+ )
184
190
licenses : Iterable ['License' ] = chain (
185
191
bom .metadata .licenses ,
186
192
chain .from_iterable (c .licenses for c in components ),
@@ -193,6 +199,7 @@ def from_bom(cls, bom: 'Bom', prefix: str = 'BomRef') -> 'BomRefDiscriminator':
193
199
services ,
194
200
vulnerabilities ,
195
201
orgs ,
202
+ contacts ,
196
203
(o .address for o in orgs if o .address is not None ),
197
204
licenses ,
198
205
)),
0 commit comments