-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: support complete model for
bom.metadata
(#162)
* feat: support complete model for `bom.metadata` fix: JSON comparison in unit tests was broken chore: corrected some source license headers Signed-off-by: Paul Horton <[email protected]>
- Loading branch information
Showing
12 changed files
with
446 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,9 +117,7 @@ def get_bom_with_component_setuptools_with_vulnerability() -> Bom: | |
organizations=[ | ||
get_org_entity_1() | ||
], | ||
individuals=[ | ||
OrganizationalContact(name='A N Other', email='[email protected]', phone='+44 (0)1234 567890'), | ||
] | ||
individuals=[get_org_contact_2()] | ||
), | ||
tools=[ | ||
Tool(vendor='CycloneDX', name='cyclonedx-python-lib') | ||
|
@@ -148,9 +146,14 @@ def get_bom_with_component_toml_1() -> Bom: | |
|
||
def get_bom_just_complete_metadata() -> Bom: | ||
bom = Bom() | ||
bom.metadata.authors = [get_org_contact_1(), get_org_contact_2()] | ||
bom.metadata.component = Component( | ||
name='cyclonedx-python-lib', version='1.0.0', component_type=ComponentType.LIBRARY | ||
) | ||
bom.metadata.manufacture = get_org_entity_1() | ||
bom.metadata.supplier = get_org_entity_2() | ||
bom.metadata.licenses = [LicenseChoice(license_expression='Commercial')] | ||
bom.metadata.properties = get_properties_1() | ||
return bom | ||
|
||
|
||
|
@@ -326,13 +329,23 @@ def get_issue_2() -> IssueType: | |
) | ||
|
||
|
||
def get_org_contact_1() -> OrganizationalContact: | ||
return OrganizationalContact(name='Paul Horton', email='[email protected]') | ||
|
||
|
||
def get_org_contact_2() -> OrganizationalContact: | ||
return OrganizationalContact(name='A N Other', email='[email protected]', phone='+44 (0)1234 567890') | ||
|
||
|
||
def get_org_entity_1() -> OrganizationalEntity: | ||
return OrganizationalEntity( | ||
name='CycloneDX', urls=[XsUri('https://cyclonedx.org')], contacts=[ | ||
OrganizationalContact(name='Paul Horton', email='[email protected]'), | ||
OrganizationalContact(name='A N Other', email='[email protected]', | ||
phone='+44 (0)1234 567890') | ||
] | ||
name='CycloneDX', urls=[XsUri('https://cyclonedx.org')], contacts=[get_org_contact_1(), get_org_contact_2()] | ||
) | ||
|
||
|
||
def get_org_entity_2() -> OrganizationalEntity: | ||
return OrganizationalEntity( | ||
name='Cyclone DX', urls=[XsUri('https://cyclonedx.org/')], contacts=[get_org_contact_2()] | ||
) | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,11 +13,52 @@ | |
"version": "VERSION" | ||
} | ||
], | ||
"authors": [ | ||
{ | ||
"name": "Paul Horton", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "A N Other", | ||
"email": "[email protected]", | ||
"phone": "+44 (0)1234 567890" | ||
} | ||
], | ||
"component": { | ||
"bom-ref": "0b049d09-64c0-4490-a0f5-c84d9aacf857", | ||
"type": "library", | ||
"name": "cyclonedx-python-lib", | ||
"version": "1.0.0" | ||
}, | ||
"manufacture": { | ||
"name": "CycloneDX", | ||
"url": [ | ||
"https://cyclonedx.org" | ||
], | ||
"contact": [ | ||
{ | ||
"name": "Paul Horton", | ||
"email": "[email protected]" | ||
}, | ||
{ | ||
"name": "A N Other", | ||
"email": "[email protected]", | ||
"phone": "+44 (0)1234 567890" | ||
} | ||
] | ||
}, | ||
"supplier": { | ||
"name": "Cyclone DX", | ||
"url": [ | ||
"https://cyclonedx.org/" | ||
], | ||
"contact": [ | ||
{ | ||
"name": "A N Other", | ||
"email": "[email protected]", | ||
"phone": "+44 (0)1234 567890" | ||
} | ||
] | ||
} | ||
}, | ||
"components": [] | ||
|
Oops, something went wrong.