|
97 | 97 | ImpactAnalysisState, |
98 | 98 | ) |
99 | 99 | from cyclonedx.model.issue import IssueClassification, IssueType, IssueTypeSource |
100 | | -from cyclonedx.model.license import DisjunctiveLicense, License, LicenseAcknowledgement, LicenseExpression |
| 100 | +from cyclonedx.model.license import ( |
| 101 | + DisjunctiveLicense, |
| 102 | + License, |
| 103 | + LicenseAcknowledgement, |
| 104 | + LicenseEntity, |
| 105 | + LicenseExpression, |
| 106 | + LicenseType, |
| 107 | + Licensing, |
| 108 | +) |
101 | 109 | from cyclonedx.model.lifecycle import LifecyclePhase, NamedLifecycle, PredefinedLifecycle |
102 | 110 | from cyclonedx.model.release_note import ReleaseNotes |
103 | 111 | from cyclonedx.model.service import Service |
@@ -1078,9 +1086,45 @@ def get_bom_with_licenses() -> Bom: |
1078 | 1086 | Component(name='c-with-name', type=ComponentType.LIBRARY, bom_ref='C3', |
1079 | 1087 | licenses=[ |
1080 | 1088 | DisjunctiveLicense(name='some commercial license', |
1081 | | - text=AttachedText(content='this is a license text')), |
| 1089 | + text=AttachedText(content='this is a license text'), |
| 1090 | + licensing=Licensing( |
| 1091 | + alt_ids=['LicenseRef-1', 'LicenseRef-commercial'], |
| 1092 | + licensor=LicenseEntity( |
| 1093 | + organization=OrganizationalEntity(name='Acme Inc') |
| 1094 | + ), |
| 1095 | + licensee=LicenseEntity( |
| 1096 | + organization=OrganizationalEntity(name='My Company') |
| 1097 | + ), |
| 1098 | + purchaser=LicenseEntity( |
| 1099 | + individual=OrganizationalContact(name='John Doe', |
| 1100 | + email='john.doe@example.com') |
| 1101 | + ), |
| 1102 | + purchase_order='PO-12345', |
| 1103 | + license_types=[LicenseType.PERPETUAL, |
| 1104 | + LicenseType.NAMED_USER], |
| 1105 | + last_renewal=datetime(2024, 1, 1, 0, 0, 0, tzinfo=timezone.utc), |
| 1106 | + expiration=datetime(2025, 1, 1, 0, 0, 0, tzinfo=timezone.utc), |
| 1107 | + )), |
1082 | 1108 | DisjunctiveLicense(name='some additional', |
1083 | | - text=AttachedText(content='this is additional license text')), |
| 1109 | + text=AttachedText(content='this is additional license text'), |
| 1110 | + licensing=Licensing( |
| 1111 | + alt_ids=['LicenseRef-2', 'LicenseRef-academic'], |
| 1112 | + licensor=LicenseEntity( |
| 1113 | + organization=OrganizationalEntity(name='Acme Inc') |
| 1114 | + ), |
| 1115 | + licensee=LicenseEntity( |
| 1116 | + organization=OrganizationalEntity(name='My Company') |
| 1117 | + ), |
| 1118 | + purchaser=LicenseEntity( |
| 1119 | + individual=OrganizationalContact(name='Jane Doe', |
| 1120 | + email='jane.doe@example.com') |
| 1121 | + ), |
| 1122 | + purchase_order='PO-54321', |
| 1123 | + license_types=[LicenseType.ACADEMIC, |
| 1124 | + LicenseType.CONCURRENT_USER], |
| 1125 | + last_renewal=datetime(2025, 1, 1, 0, 0, 0, tzinfo=timezone.utc), |
| 1126 | + expiration=datetime(2026, 1, 1, 0, 0, 0, tzinfo=timezone.utc), |
| 1127 | + )), |
1084 | 1128 | ]), |
1085 | 1129 | ], |
1086 | 1130 | services=[ |
|
0 commit comments