@@ -46,6 +46,7 @@ class Options: # type: ignore
46
46
svc_keys : List = field (default_factory = list )
47
47
doc_num : int = 1
48
48
include_empty : bool = False
49
+ bom_profile : str = ""
49
50
50
51
def __post_init__ (self ):
51
52
if self .config :
@@ -60,9 +61,9 @@ def __post_init__(self):
60
61
self .include = toml_data .get ("settings" , {}).get ("include_extra" , [])
61
62
self .include_empty = toml_data .get ("settings" , {}).get ("include_empty" , False )
62
63
if self .preconfig_type == "bom" :
63
- tmp_exclude , tmp_bom_key_fields , tmp_service_key_fields , self .do_advanced = (
64
- get_cdxgen_excludes (self .include , self .allow_new_versions , self . allow_new_data ))
65
- self .comp_keys .extend (tmp_bom_key_fields )
64
+ tmp_exclude , tmp_service_key_fields , self .do_advanced = (
65
+ get_cdxgen_excludes (self .include , self .allow_new_data ))
66
+ # self.comp_keys.extend(tmp_bom_key_fields)
66
67
self .svc_keys .extend (tmp_service_key_fields )
67
68
self .exclude .extend (tmp_exclude )
68
69
self .sort_keys .extend (["purl" , "bom-ref" , "content" , "cve" , "id" , "url" , "text" , "ref" , "name" , "value" , "location" ])
@@ -71,6 +72,7 @@ def __post_init__(self):
71
72
self .sort_keys .extend (["text" , "title" , "product_id" , "url" ])
72
73
self .exclude = list (set (self .exclude ))
73
74
self .include = list (set (self .include ))
75
+ # deprecated
74
76
self .comp_keys = list (set (self .comp_keys ))
75
77
self .svc_keys = list (set (self .svc_keys ))
76
78
self .sort_keys = list (set (self .sort_keys ))
@@ -980,7 +982,7 @@ def create_search_key(key: str, value: str) -> str:
980
982
return combined_key
981
983
982
984
983
- def get_cdxgen_excludes (includes : List [str ], allow_new_versions : bool , allow_new_data : bool ) -> Tuple [List [ str ], List [str ], List [str ], bool ]:
985
+ def get_cdxgen_excludes (includes : List [str ], allow_new_data : bool ) -> Tuple [List [str ], List [str ], bool ]:
984
986
excludes = {'metadata.timestamp' : 'metadata.timestamp' , 'serialNumber' : 'serialNumber' ,
985
987
'metadata.tools.components.[].version' : 'metadata.tools.components.[].version' ,
986
988
'metadata.tools.components.[].purl' : 'metadata.tools.components.[].purl' ,
@@ -990,17 +992,12 @@ def get_cdxgen_excludes(includes: List[str], allow_new_versions: bool, allow_new
990
992
'externalReferences' : 'components.[].externalReferences' ,
991
993
'externalreferences' : 'components.[].externalReferences' }
992
994
if allow_new_data :
993
- component_keys = []
994
995
service_keys = []
995
996
else :
996
- component_keys = ['name' , 'author' , 'publisher' , 'group' , 'type' , 'scope' , 'description' ]
997
997
service_keys = ['name' , 'authenticated' , 'x-trust-boundary' , 'endpoints' ]
998
- if not allow_new_versions :
999
- component_keys .extend ([i for i in ('version' , 'purl' , 'bom-ref' , 'version' ) if i not in excludes ])
1000
998
1001
999
return (
1002
1000
[v for k , v in excludes .items () if k not in includes ],
1003
- [v for v in component_keys if v not in excludes ],
1004
1001
[v for v in service_keys if v not in excludes ],
1005
1002
allow_new_data ,
1006
1003
)
0 commit comments