sbom-cyclonedx 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (368) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +15 -0
  3. data/.gitlab-ci.yml +49 -0
  4. data/.rspec +3 -0
  5. data/.rubocop.yml +72 -0
  6. data/.vscode/settings.json +6 -0
  7. data/CHANGELOG.md +9 -0
  8. data/CODE_OF_CONDUCT.md +132 -0
  9. data/Gemfile +26 -0
  10. data/Gemfile.lock +179 -0
  11. data/LICENSE.txt +21 -0
  12. data/README.md +39 -0
  13. data/Rakefile +36 -0
  14. data/Steepfile +14 -0
  15. data/bin/console +11 -0
  16. data/bin/rbs_spec +9 -0
  17. data/bin/setup +8 -0
  18. data/bom-1.6.schema.json +7334 -0
  19. data/lib/email_address_extension.rb +26 -0
  20. data/lib/sbom/cyclone_dx/enum.rb +2178 -0
  21. data/lib/sbom/cyclone_dx/field.rb +404 -0
  22. data/lib/sbom/cyclone_dx/pattern.rb +43 -0
  23. data/lib/sbom/cyclone_dx/record/advisory.rb +17 -0
  24. data/lib/sbom/cyclone_dx/record/annotation.rb +46 -0
  25. data/lib/sbom/cyclone_dx/record/attachment.rb +21 -0
  26. data/lib/sbom/cyclone_dx/record/base.rb +244 -0
  27. data/lib/sbom/cyclone_dx/record/cipher_suite.rb +23 -0
  28. data/lib/sbom/cyclone_dx/record/co2_measure.rb +18 -0
  29. data/lib/sbom/cyclone_dx/record/command.rb +18 -0
  30. data/lib/sbom/cyclone_dx/record/commit.rb +25 -0
  31. data/lib/sbom/cyclone_dx/record/component.rb +126 -0
  32. data/lib/sbom/cyclone_dx/record/component_data.rb +46 -0
  33. data/lib/sbom/cyclone_dx/record/component_evidence.rb +68 -0
  34. data/lib/sbom/cyclone_dx/record/component_identity_evidence.rb +36 -0
  35. data/lib/sbom/cyclone_dx/record/composition.rb +33 -0
  36. data/lib/sbom/cyclone_dx/record/condition.rb +20 -0
  37. data/lib/sbom/cyclone_dx/record/copyright.rb +16 -0
  38. data/lib/sbom/cyclone_dx/record/crypto_properties.rb +137 -0
  39. data/lib/sbom/cyclone_dx/record/data_governance.rb +21 -0
  40. data/lib/sbom/cyclone_dx/record/data_governance_responsible_party.rb +22 -0
  41. data/lib/sbom/cyclone_dx/record/declarations.rb +193 -0
  42. data/lib/sbom/cyclone_dx/record/definitions.rb +17 -0
  43. data/lib/sbom/cyclone_dx/record/dependency.rb +21 -0
  44. data/lib/sbom/cyclone_dx/record/diff.rb +18 -0
  45. data/lib/sbom/cyclone_dx/record/energy_consumption.rb +31 -0
  46. data/lib/sbom/cyclone_dx/record/energy_measure.rb +18 -0
  47. data/lib/sbom/cyclone_dx/record/energy_provider.rb +31 -0
  48. data/lib/sbom/cyclone_dx/record/environmental_consideration.rb +20 -0
  49. data/lib/sbom/cyclone_dx/record/event.rb +31 -0
  50. data/lib/sbom/cyclone_dx/record/external_reference.rb +25 -0
  51. data/lib/sbom/cyclone_dx/record/fairness_assessment.rb +22 -0
  52. data/lib/sbom/cyclone_dx/record/formula.rb +29 -0
  53. data/lib/sbom/cyclone_dx/record/graphic.rb +19 -0
  54. data/lib/sbom/cyclone_dx/record/graphics_collection.rb +19 -0
  55. data/lib/sbom/cyclone_dx/record/hash_data.rb +18 -0
  56. data/lib/sbom/cyclone_dx/record/identifiable_action.rb +21 -0
  57. data/lib/sbom/cyclone_dx/record/input.rb +34 -0
  58. data/lib/sbom/cyclone_dx/record/input_output_ml_parameter.rb +17 -0
  59. data/lib/sbom/cyclone_dx/record/issue.rb +36 -0
  60. data/lib/sbom/cyclone_dx/record/license.rb +90 -0
  61. data/lib/sbom/cyclone_dx/record/license_choice.rb +35 -0
  62. data/lib/sbom/cyclone_dx/record/metadata.rb +55 -0
  63. data/lib/sbom/cyclone_dx/record/model_card.rb +89 -0
  64. data/lib/sbom/cyclone_dx/record/note.rb +20 -0
  65. data/lib/sbom/cyclone_dx/record/organizational_contact.rb +26 -0
  66. data/lib/sbom/cyclone_dx/record/organizational_entity.rb +28 -0
  67. data/lib/sbom/cyclone_dx/record/output.rb +34 -0
  68. data/lib/sbom/cyclone_dx/record/parameter.rb +20 -0
  69. data/lib/sbom/cyclone_dx/record/patch.rb +23 -0
  70. data/lib/sbom/cyclone_dx/record/performance_metric.rb +30 -0
  71. data/lib/sbom/cyclone_dx/record/postal_address.rb +34 -0
  72. data/lib/sbom/cyclone_dx/record/property.rb +18 -0
  73. data/lib/sbom/cyclone_dx/record/rating.rb +27 -0
  74. data/lib/sbom/cyclone_dx/record/release_notes.rb +44 -0
  75. data/lib/sbom/cyclone_dx/record/resource_reference_choice.rb +22 -0
  76. data/lib/sbom/cyclone_dx/record/risk.rb +18 -0
  77. data/lib/sbom/cyclone_dx/record/root.rb +63 -0
  78. data/lib/sbom/cyclone_dx/record/secured_by.rb +20 -0
  79. data/lib/sbom/cyclone_dx/record/service.rb +54 -0
  80. data/lib/sbom/cyclone_dx/record/service_data.rb +32 -0
  81. data/lib/sbom/cyclone_dx/record/signature.rb +85 -0
  82. data/lib/sbom/cyclone_dx/record/standard.rb +72 -0
  83. data/lib/sbom/cyclone_dx/record/step.rb +24 -0
  84. data/lib/sbom/cyclone_dx/record/swid.rb +29 -0
  85. data/lib/sbom/cyclone_dx/record/task.rb +56 -0
  86. data/lib/sbom/cyclone_dx/record/tools.rb +20 -0
  87. data/lib/sbom/cyclone_dx/record/trigger.rb +48 -0
  88. data/lib/sbom/cyclone_dx/record/version.rb +24 -0
  89. data/lib/sbom/cyclone_dx/record/volume.rb +33 -0
  90. data/lib/sbom/cyclone_dx/record/vulnerability.rb +119 -0
  91. data/lib/sbom/cyclone_dx/record/vulnerability_source.rb +20 -0
  92. data/lib/sbom/cyclone_dx/record/workflow.rb +59 -0
  93. data/lib/sbom/cyclone_dx/record/workspace.rb +45 -0
  94. data/lib/sbom/cyclone_dx/record.rb +12 -0
  95. data/lib/sbom/cyclone_dx/validator/array_validator.rb +66 -0
  96. data/lib/sbom/cyclone_dx/validator/base_validator.rb +43 -0
  97. data/lib/sbom/cyclone_dx/validator/boolean_validator.rb +16 -0
  98. data/lib/sbom/cyclone_dx/validator/date_time_validator.rb +29 -0
  99. data/lib/sbom/cyclone_dx/validator/email_address_validator.rb +31 -0
  100. data/lib/sbom/cyclone_dx/validator/float_validator.rb +30 -0
  101. data/lib/sbom/cyclone_dx/validator/integer_validator.rb +30 -0
  102. data/lib/sbom/cyclone_dx/validator/record_validator.rb +26 -0
  103. data/lib/sbom/cyclone_dx/validator/string_validator.rb +33 -0
  104. data/lib/sbom/cyclone_dx/validator/union_validator.rb +39 -0
  105. data/lib/sbom/cyclone_dx/validator/uri_validator.rb +32 -0
  106. data/lib/sbom/cyclone_dx/validator.rb +32 -0
  107. data/lib/sbom/cyclone_dx/version.rb +7 -0
  108. data/lib/sbom/cyclone_dx.rb +39 -0
  109. data/rbs_collection.lock.yaml +288 -0
  110. data/rbs_collection.yaml +31 -0
  111. data/sbom-cyclone_dx.gemspec +32 -0
  112. data/sig/email_address_extension.rbs +14 -0
  113. data/sig/sbom/cyclone_dx/enum.rbs +93 -0
  114. data/sig/sbom/cyclone_dx/field.rbs +434 -0
  115. data/sig/sbom/cyclone_dx/pattern.rbs +24 -0
  116. data/sig/sbom/cyclone_dx/record/advisory.rbs +19 -0
  117. data/sig/sbom/cyclone_dx/record/annotation.rbs +63 -0
  118. data/sig/sbom/cyclone_dx/record/attachment.rbs +24 -0
  119. data/sig/sbom/cyclone_dx/record/base.rbs +62 -0
  120. data/sig/sbom/cyclone_dx/record/cipher_suite.rbs +24 -0
  121. data/sig/sbom/cyclone_dx/record/co2_measure.rbs +14 -0
  122. data/sig/sbom/cyclone_dx/record/command.rbs +19 -0
  123. data/sig/sbom/cyclone_dx/record/commit.rbs +34 -0
  124. data/sig/sbom/cyclone_dx/record/component.rbs +203 -0
  125. data/sig/sbom/cyclone_dx/record/component_data.rbs +73 -0
  126. data/sig/sbom/cyclone_dx/record/component_evidence.rbs +115 -0
  127. data/sig/sbom/cyclone_dx/record/component_identity_evidence.rbs +53 -0
  128. data/sig/sbom/cyclone_dx/record/composition.rbs +39 -0
  129. data/sig/sbom/cyclone_dx/record/condition.rbs +24 -0
  130. data/sig/sbom/cyclone_dx/record/copyright.rbs +14 -0
  131. data/sig/sbom/cyclone_dx/record/crypto_properties.rbs +268 -0
  132. data/sig/sbom/cyclone_dx/record/data_governance.rbs +24 -0
  133. data/sig/sbom/cyclone_dx/record/data_governance_responsible_party.rbs +19 -0
  134. data/sig/sbom/cyclone_dx/record/declarations.rbs +352 -0
  135. data/sig/sbom/cyclone_dx/record/definitions.rbs +14 -0
  136. data/sig/sbom/cyclone_dx/record/dependency.rbs +24 -0
  137. data/sig/sbom/cyclone_dx/record/diff.rbs +19 -0
  138. data/sig/sbom/cyclone_dx/record/energy_consumption.rbs +39 -0
  139. data/sig/sbom/cyclone_dx/record/energy_measure.rbs +14 -0
  140. data/sig/sbom/cyclone_dx/record/energy_provider.rbs +39 -0
  141. data/sig/sbom/cyclone_dx/record/environmental_consideration.rbs +19 -0
  142. data/sig/sbom/cyclone_dx/record/event.rbs +44 -0
  143. data/sig/sbom/cyclone_dx/record/external_reference.rbs +29 -0
  144. data/sig/sbom/cyclone_dx/record/fairness_assessment.rbs +29 -0
  145. data/sig/sbom/cyclone_dx/record/formula.rbs +34 -0
  146. data/sig/sbom/cyclone_dx/record/graphic.rbs +19 -0
  147. data/sig/sbom/cyclone_dx/record/graphics_collection.rbs +19 -0
  148. data/sig/sbom/cyclone_dx/record/hash_data.rbs +19 -0
  149. data/sig/sbom/cyclone_dx/record/identifiable_action.rbs +24 -0
  150. data/sig/sbom/cyclone_dx/record/input.rbs +44 -0
  151. data/sig/sbom/cyclone_dx/record/input_output_ml_parameter.rbs +14 -0
  152. data/sig/sbom/cyclone_dx/record/issue.rbs +53 -0
  153. data/sig/sbom/cyclone_dx/record/license.rbs +134 -0
  154. data/sig/sbom/cyclone_dx/record/license_choice.rbs +39 -0
  155. data/sig/sbom/cyclone_dx/record/metadata.rbs +82 -0
  156. data/sig/sbom/cyclone_dx/record/model_card.rbs +143 -0
  157. data/sig/sbom/cyclone_dx/record/note.rbs +19 -0
  158. data/sig/sbom/cyclone_dx/record/organizational_contact.rbs +29 -0
  159. data/sig/sbom/cyclone_dx/record/organizational_entity.rbs +34 -0
  160. data/sig/sbom/cyclone_dx/record/output.rbs +44 -0
  161. data/sig/sbom/cyclone_dx/record/parameter.rbs +24 -0
  162. data/sig/sbom/cyclone_dx/record/patch.rbs +24 -0
  163. data/sig/sbom/cyclone_dx/record/performance_metric.rbs +43 -0
  164. data/sig/sbom/cyclone_dx/record/postal_address.rbs +44 -0
  165. data/sig/sbom/cyclone_dx/record/property.rbs +19 -0
  166. data/sig/sbom/cyclone_dx/record/rating.rbs +39 -0
  167. data/sig/sbom/cyclone_dx/record/release_notes.rbs +64 -0
  168. data/sig/sbom/cyclone_dx/record/resource_reference_choice.rbs +19 -0
  169. data/sig/sbom/cyclone_dx/record/risk.rbs +19 -0
  170. data/sig/sbom/cyclone_dx/record/root.rbs +84 -0
  171. data/sig/sbom/cyclone_dx/record/secured_by.rbs +19 -0
  172. data/sig/sbom/cyclone_dx/record/service.rbs +99 -0
  173. data/sig/sbom/cyclone_dx/record/service_data.rbs +44 -0
  174. data/sig/sbom/cyclone_dx/record/signature.rbs +130 -0
  175. data/sig/sbom/cyclone_dx/record/standard.rbs +132 -0
  176. data/sig/sbom/cyclone_dx/record/step.rbs +29 -0
  177. data/sig/sbom/cyclone_dx/record/swid.rbs +44 -0
  178. data/sig/sbom/cyclone_dx/record/task.rbs +84 -0
  179. data/sig/sbom/cyclone_dx/record/tools.rbs +19 -0
  180. data/sig/sbom/cyclone_dx/record/trigger.rbs +69 -0
  181. data/sig/sbom/cyclone_dx/record/version.rbs +24 -0
  182. data/sig/sbom/cyclone_dx/record/volume.rbs +49 -0
  183. data/sig/sbom/cyclone_dx/record/vulnerability.rbs +209 -0
  184. data/sig/sbom/cyclone_dx/record/vulnerability_source.rbs +19 -0
  185. data/sig/sbom/cyclone_dx/record/workflow.rbs +94 -0
  186. data/sig/sbom/cyclone_dx/record/workspace.rbs +69 -0
  187. data/sig/sbom/cyclone_dx/record.rbs +161 -0
  188. data/sig/sbom/cyclone_dx/type.rbs +16 -0
  189. data/sig/sbom/cyclone_dx/validator/array_validator.rbs +31 -0
  190. data/sig/sbom/cyclone_dx/validator/base_validator.rbs +21 -0
  191. data/sig/sbom/cyclone_dx/validator/boolean_validator.rbs +9 -0
  192. data/sig/sbom/cyclone_dx/validator/date_time_validator.rbs +10 -0
  193. data/sig/sbom/cyclone_dx/validator/email_address_validator.rbs +10 -0
  194. data/sig/sbom/cyclone_dx/validator/float_validator.rbs +12 -0
  195. data/sig/sbom/cyclone_dx/validator/integer_validator.rbs +12 -0
  196. data/sig/sbom/cyclone_dx/validator/record_validator.rbs +12 -0
  197. data/sig/sbom/cyclone_dx/validator/string_validator.rbs +14 -0
  198. data/sig/sbom/cyclone_dx/validator/union_validator.rbs +24 -0
  199. data/sig/sbom/cyclone_dx/validator/uri_validator.rbs +10 -0
  200. data/sig/sbom/cyclone_dx/validator.rbs +66 -0
  201. data/sig/sbom/cyclone_dx.rbs +13 -0
  202. data/sig/types.rbs +45 -0
  203. data/spec/email_address_extension_spec.rb +27 -0
  204. data/spec/factories/factory_helper.rb +78 -0
  205. data/spec/factories/record/advisory_factory.rb +11 -0
  206. data/spec/factories/record/annotation_factory.rb +63 -0
  207. data/spec/factories/record/attachment_factory.rb +9 -0
  208. data/spec/factories/record/cipher_suite_factory.rb +26 -0
  209. data/spec/factories/record/co2_measure_factory.rb +9 -0
  210. data/spec/factories/record/command_factory.rb +10 -0
  211. data/spec/factories/record/commit_factory.rb +13 -0
  212. data/spec/factories/record/component_data_factory.rb +28 -0
  213. data/spec/factories/record/component_evidence_factory.rb +44 -0
  214. data/spec/factories/record/component_factory.rb +102 -0
  215. data/spec/factories/record/component_identity_evidence_factory.rb +25 -0
  216. data/spec/factories/record/composition_factory.rb +20 -0
  217. data/spec/factories/record/condition_factory.rb +11 -0
  218. data/spec/factories/record/copyright_factory.rb +9 -0
  219. data/spec/factories/record/crypto_properties_factory.rb +191 -0
  220. data/spec/factories/record/data_governance_factory.rb +11 -0
  221. data/spec/factories/record/data_governance_responsible_party_factory.rb +31 -0
  222. data/spec/factories/record/declarations_factory.rb +145 -0
  223. data/spec/factories/record/definitions_factory.rb +9 -0
  224. data/spec/factories/record/dependency_factory.rb +12 -0
  225. data/spec/factories/record/diff_factory.rb +24 -0
  226. data/spec/factories/record/energy_consumption_factory.rb +15 -0
  227. data/spec/factories/record/energy_measure_factory.rb +9 -0
  228. data/spec/factories/record/energy_provider_factory.rb +15 -0
  229. data/spec/factories/record/environmental_consideration_factory.rb +10 -0
  230. data/spec/factories/record/event_factory.rb +15 -0
  231. data/spec/factories/record/external_reference_factory.rb +13 -0
  232. data/spec/factories/record/fairness_assessment_factory.rb +12 -0
  233. data/spec/factories/record/formula_factory.rb +13 -0
  234. data/spec/factories/record/graphic_factory.rb +10 -0
  235. data/spec/factories/record/graphics_collection_factory.rb +10 -0
  236. data/spec/factories/record/hash_data_factory.rb +10 -0
  237. data/spec/factories/record/identifiable_action_factory.rb +11 -0
  238. data/spec/factories/record/input_factory.rb +36 -0
  239. data/spec/factories/record/input_output_ml_parameter_factory.rb +9 -0
  240. data/spec/factories/record/issue_factory.rb +22 -0
  241. data/spec/factories/record/license_choice_factory.rb +23 -0
  242. data/spec/factories/record/license_factory.rb +99 -0
  243. data/spec/factories/record/metadata_factory.rb +38 -0
  244. data/spec/factories/record/model_card_factory.rb +59 -0
  245. data/spec/factories/record/note_factory.rb +11 -0
  246. data/spec/factories/record/organizational_contact_factory.rb +12 -0
  247. data/spec/factories/record/organizational_entity_factory.rb +13 -0
  248. data/spec/factories/record/output_factory.rb +32 -0
  249. data/spec/factories/record/parameter_factory.rb +11 -0
  250. data/spec/factories/record/patch_factory.rb +12 -0
  251. data/spec/factories/record/performance_metric_factory.rb +20 -0
  252. data/spec/factories/record/postal_address_factory.rb +14 -0
  253. data/spec/factories/record/property_factory.rb +11 -0
  254. data/spec/factories/record/rating_factory.rb +14 -0
  255. data/spec/factories/record/release_notes_factory.rb +20 -0
  256. data/spec/factories/record/resource_reference_choice_factory.rb +27 -0
  257. data/spec/factories/record/risk_factory.rb +10 -0
  258. data/spec/factories/record/root_factory.rb +23 -0
  259. data/spec/factories/record/secured_by_factory.rb +10 -0
  260. data/spec/factories/record/service_data_factory.rb +16 -0
  261. data/spec/factories/record/service_factory.rb +27 -0
  262. data/spec/factories/record/signature_factory.rb +50 -0
  263. data/spec/factories/record/standard_factory.rb +37 -0
  264. data/spec/factories/record/step_factory.rb +12 -0
  265. data/spec/factories/record/swid_factory.rb +16 -0
  266. data/spec/factories/record/task_factory.rb +24 -0
  267. data/spec/factories/record/tools_factory.rb +10 -0
  268. data/spec/factories/record/trigger_factory.rb +21 -0
  269. data/spec/factories/record/version_factory.rb +19 -0
  270. data/spec/factories/record/volume_factory.rb +16 -0
  271. data/spec/factories/record/vulnerability_factory.rb +70 -0
  272. data/spec/factories/record/vulnerability_source_factory.rb +10 -0
  273. data/spec/factories/record/workflow_factory.rb +26 -0
  274. data/spec/factories/record/workspace_factory.rb +21 -0
  275. data/spec/factories/record_factory.rb +159 -0
  276. data/spec/fixtures/cipher_info.yml +948 -0
  277. data/spec/fixtures/purl_data.yml +0 -0
  278. data/spec/sbom/cyclone_dx/enum_spec.rb +30 -0
  279. data/spec/sbom/cyclone_dx/field_spec.rb +104 -0
  280. data/spec/sbom/cyclone_dx/pattern_spec.rb +18 -0
  281. data/spec/sbom/cyclone_dx/record/advisory_spec.rb +14 -0
  282. data/spec/sbom/cyclone_dx/record/annotation_spec.rb +31 -0
  283. data/spec/sbom/cyclone_dx/record/attachment_spec.rb +14 -0
  284. data/spec/sbom/cyclone_dx/record/base_spec.rb +363 -0
  285. data/spec/sbom/cyclone_dx/record/cipher_suite_spec.rb +14 -0
  286. data/spec/sbom/cyclone_dx/record/co2_measure_spec.rb +14 -0
  287. data/spec/sbom/cyclone_dx/record/command_spec.rb +14 -0
  288. data/spec/sbom/cyclone_dx/record/commit_spec.rb +14 -0
  289. data/spec/sbom/cyclone_dx/record/component_data_spec.rb +14 -0
  290. data/spec/sbom/cyclone_dx/record/component_evidence_spec.rb +14 -0
  291. data/spec/sbom/cyclone_dx/record/component_identity_evidence_spec.rb +14 -0
  292. data/spec/sbom/cyclone_dx/record/component_spec.rb +14 -0
  293. data/spec/sbom/cyclone_dx/record/composition_spec.rb +14 -0
  294. data/spec/sbom/cyclone_dx/record/condition_spec.rb +14 -0
  295. data/spec/sbom/cyclone_dx/record/copyright_spec.rb +14 -0
  296. data/spec/sbom/cyclone_dx/record/crypto_properties_spec.rb +14 -0
  297. data/spec/sbom/cyclone_dx/record/data_governance_responsible_party_spec.rb +19 -0
  298. data/spec/sbom/cyclone_dx/record/data_governance_spec.rb +14 -0
  299. data/spec/sbom/cyclone_dx/record/declarations_spec.rb +14 -0
  300. data/spec/sbom/cyclone_dx/record/definitions_spec.rb +14 -0
  301. data/spec/sbom/cyclone_dx/record/dependency_spec.rb +14 -0
  302. data/spec/sbom/cyclone_dx/record/diff_spec.rb +14 -0
  303. data/spec/sbom/cyclone_dx/record/energy_consumption_spec.rb +14 -0
  304. data/spec/sbom/cyclone_dx/record/energy_measure_spec.rb +14 -0
  305. data/spec/sbom/cyclone_dx/record/energy_provider_spec.rb +14 -0
  306. data/spec/sbom/cyclone_dx/record/environmental_consideration_spec.rb +14 -0
  307. data/spec/sbom/cyclone_dx/record/event_spec.rb +14 -0
  308. data/spec/sbom/cyclone_dx/record/external_reference_spec.rb +14 -0
  309. data/spec/sbom/cyclone_dx/record/fairness_assessment_spec.rb +14 -0
  310. data/spec/sbom/cyclone_dx/record/formula_spec.rb +14 -0
  311. data/spec/sbom/cyclone_dx/record/graphic_spec.rb +14 -0
  312. data/spec/sbom/cyclone_dx/record/graphics_collection_spec.rb +14 -0
  313. data/spec/sbom/cyclone_dx/record/hash_data_spec.rb +14 -0
  314. data/spec/sbom/cyclone_dx/record/identifiable_action_spec.rb +14 -0
  315. data/spec/sbom/cyclone_dx/record/input_output_ml_parameter_spec.rb +14 -0
  316. data/spec/sbom/cyclone_dx/record/input_spec.rb +14 -0
  317. data/spec/sbom/cyclone_dx/record/issue_spec.rb +14 -0
  318. data/spec/sbom/cyclone_dx/record/license_choice_spec.rb +26 -0
  319. data/spec/sbom/cyclone_dx/record/license_spec.rb +14 -0
  320. data/spec/sbom/cyclone_dx/record/metadata_spec.rb +14 -0
  321. data/spec/sbom/cyclone_dx/record/model_card_spec.rb +14 -0
  322. data/spec/sbom/cyclone_dx/record/note_spec.rb +14 -0
  323. data/spec/sbom/cyclone_dx/record/organizational_contact_spec.rb +14 -0
  324. data/spec/sbom/cyclone_dx/record/organizational_entity_spec.rb +14 -0
  325. data/spec/sbom/cyclone_dx/record/output_spec.rb +14 -0
  326. data/spec/sbom/cyclone_dx/record/parameter_spec.rb +14 -0
  327. data/spec/sbom/cyclone_dx/record/patch_spec.rb +14 -0
  328. data/spec/sbom/cyclone_dx/record/performance_metric_spec.rb +14 -0
  329. data/spec/sbom/cyclone_dx/record/postal_address_spec.rb +14 -0
  330. data/spec/sbom/cyclone_dx/record/property_spec.rb +14 -0
  331. data/spec/sbom/cyclone_dx/record/rating_spec.rb +14 -0
  332. data/spec/sbom/cyclone_dx/record/release_notes_spec.rb +14 -0
  333. data/spec/sbom/cyclone_dx/record/resource_reference_choice_spec.rb +14 -0
  334. data/spec/sbom/cyclone_dx/record/risk_spec.rb +14 -0
  335. data/spec/sbom/cyclone_dx/record/root_spec.rb +14 -0
  336. data/spec/sbom/cyclone_dx/record/secured_by_spec.rb +14 -0
  337. data/spec/sbom/cyclone_dx/record/service_data_spec.rb +14 -0
  338. data/spec/sbom/cyclone_dx/record/service_spec.rb +14 -0
  339. data/spec/sbom/cyclone_dx/record/signature_spec.rb +26 -0
  340. data/spec/sbom/cyclone_dx/record/standard_spec.rb +14 -0
  341. data/spec/sbom/cyclone_dx/record/step_spec.rb +14 -0
  342. data/spec/sbom/cyclone_dx/record/swid_spec.rb +14 -0
  343. data/spec/sbom/cyclone_dx/record/task_spec.rb +14 -0
  344. data/spec/sbom/cyclone_dx/record/tools_spec.rb +14 -0
  345. data/spec/sbom/cyclone_dx/record/trigger_spec.rb +14 -0
  346. data/spec/sbom/cyclone_dx/record/version_spec.rb +14 -0
  347. data/spec/sbom/cyclone_dx/record/volume_spec.rb +14 -0
  348. data/spec/sbom/cyclone_dx/record/vulnerability_source_spec.rb +14 -0
  349. data/spec/sbom/cyclone_dx/record/vulnerability_spec.rb +14 -0
  350. data/spec/sbom/cyclone_dx/record/workflow_spec.rb +14 -0
  351. data/spec/sbom/cyclone_dx/record/workspace_spec.rb +14 -0
  352. data/spec/sbom/cyclone_dx/record_spec.rb +7 -0
  353. data/spec/sbom/cyclone_dx/validator/array_validator_spec.rb +184 -0
  354. data/spec/sbom/cyclone_dx/validator/base_validator_spec.rb +71 -0
  355. data/spec/sbom/cyclone_dx/validator/boolean_validator_spec.rb +26 -0
  356. data/spec/sbom/cyclone_dx/validator/date_time_validator_spec.rb +28 -0
  357. data/spec/sbom/cyclone_dx/validator/email_address_validator_spec.rb +23 -0
  358. data/spec/sbom/cyclone_dx/validator/float_validator_spec.rb +71 -0
  359. data/spec/sbom/cyclone_dx/validator/integer_validator_spec.rb +71 -0
  360. data/spec/sbom/cyclone_dx/validator/record_validator_spec.rb +35 -0
  361. data/spec/sbom/cyclone_dx/validator/string_validator_spec.rb +94 -0
  362. data/spec/sbom/cyclone_dx/validator/union_validator_spec.rb +65 -0
  363. data/spec/sbom/cyclone_dx/validator/uri_validator_spec.rb +21 -0
  364. data/spec/sbom/cyclone_dx/validator_spec.rb +38 -0
  365. data/spec/sbom/cyclone_dx/version_spec.rb +9 -0
  366. data/spec/sbom/cyclone_dx_spec.rb +7 -0
  367. data/spec/spec_helper.rb +39 -0
  368. metadata +377 -6
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+
5
+ # Fairness Assessment - Information about the benefits and harms of the model to an identified at risk group.
6
+ module SBOM
7
+ module CycloneDX
8
+ module Record
9
+ # Schema name: FairnessAssessment
10
+ class FairnessAssessment < Base
11
+ # Group at Risk - The groups or individuals at risk of being systematically disadvantaged by the model.
12
+ prop :group_at_risk, :string
13
+ # Benefits - Expected benefits to the identified groups.
14
+ prop :benefits, :string
15
+ # Harms - Expected harms to the identified groups.
16
+ prop :harms, :string
17
+ # Mitigation Strategy - With respect to the benefits and harms outlined, please describe any mitigation strategy implemented.
18
+ prop :mitigation_strategy, :string
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../pattern"
4
+ require_relative "base"
5
+ require_relative "component"
6
+ require_relative "property"
7
+ require_relative "service"
8
+ require_relative "workflow"
9
+
10
+ # Formula - Describes workflows and resources that captures rules and other aspects of how the associated BOM component or service was formed.
11
+ module SBOM
12
+ module CycloneDX
13
+ module Record
14
+ # Schema name: Formula
15
+ class Formula < Base
16
+ # BOM Reference - An optional identifier which can be used to reference the formula elsewhere in the BOM. Every bom-ref must be unique within the BOM. Value SHOULD not start with the BOM-Link intro 'urn:cdx:' to avoid conflicts with BOM-Links.
17
+ prop :bom_ref, :string, pattern: Pattern::REF_LINK, json_name: "bom-ref"
18
+ # Components - Transient components that are used in tasks that constitute one or more of this formula's workflows
19
+ prop :components, :array, items: Component, unique: true
20
+ # Services - Transient services that are used in tasks that constitute one or more of this formula's workflows
21
+ prop :services, :array, items: Service, unique: true
22
+ # Workflows - List of workflows that can be declared to accomplish specific orchestrated goals and independently triggered.
23
+ prop :workflows, :array, items: Workflow, unique: true
24
+ # Properties - Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is optional.
25
+ prop :properties, :array, items: Property, unique: true
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+ require_relative "attachment"
5
+
6
+ # Graphic
7
+ module SBOM
8
+ module CycloneDX
9
+ module Record
10
+ # Schema name: Graphic
11
+ class Graphic < Base
12
+ # Name - The name of the graphic.
13
+ prop :name, :string
14
+ # Graphic Image - The graphic (vector or raster). Base64 encoding must be specified for binary images.
15
+ prop :image, Attachment
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+ require_relative "graphic"
5
+
6
+ # Graphics Collection - A collection of graphics that represent various measurements.
7
+ module SBOM
8
+ module CycloneDX
9
+ module Record
10
+ # Schema name: GraphicsCollection
11
+ class GraphicsCollection < Base
12
+ # Description - A description of this collection of graphics.
13
+ prop :description, :string
14
+ # Collection - A collection of graphics.
15
+ prop :collection, :array, items: Graphic
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../enum"
4
+ require_relative "../pattern"
5
+ require_relative "base"
6
+
7
+ # Hash
8
+ module SBOM
9
+ module CycloneDX
10
+ module Record
11
+ # Schema name: HashData
12
+ class HashData < Base
13
+ prop :alg, :string, enum: Enum::HASH_ALG, required: true
14
+ prop :content, :string, pattern: Pattern::HASH_VALUE, required: true
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+ require_relative "../../../email_address_extension"
5
+
6
+ # Identifiable Action - Specifies an individual commit
7
+ module SBOM
8
+ module CycloneDX
9
+ module Record
10
+ # Schema name: IdentifiableAction
11
+ class IdentifiableAction < Base
12
+ # Timestamp - The timestamp in which the action occurred
13
+ prop :timestamp, :date_time
14
+ # Name - The name of the individual who performed the action
15
+ prop :name, :string
16
+ # E-mail - The email address of the individual who performed the action
17
+ prop :email, :email_address
18
+ end
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+ require_relative "resource_reference_choice"
5
+ require_relative "parameter"
6
+ require_relative "property"
7
+ require_relative "attachment"
8
+
9
+ # Input type - Type that represents various input data types and formats.
10
+ module SBOM
11
+ module CycloneDX
12
+ module Record
13
+ # Schema name: Input
14
+ class Input < Base
15
+ # Source - A reference to the component or service that provided the input to the task (e.g., reference to a service with data flow value of `inbound`)
16
+ prop :source, ResourceReferenceChoice
17
+ # Target - A reference to the component or service that received or stored the input if not the task itself (e.g., a local, named storage workspace)
18
+ prop :target, ResourceReferenceChoice
19
+ # Resource - A reference to an independent resource provided as an input to a task by the workflow runtime.
20
+ prop :resource, ResourceReferenceChoice
21
+ # Parameters - Inputs that have the form of parameters with names and values.
22
+ prop :parameters, :array, items: Parameter, unique: true
23
+ # Environment variables - Inputs that have the form of parameters with names and values.
24
+ prop :environment_vars, :array, items: [:union, of: [Property, :string]], unique: true
25
+ # Data - Inputs that have the form of data.
26
+ prop :data, Attachment
27
+ # Properties - Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is optional.
28
+ prop :properties, :array, items: Property
29
+
30
+ validate :resource, :parameters, :environment_vars, :data, presence: :any
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+
5
+ # Input and Output Parameters
6
+ module SBOM
7
+ module CycloneDX
8
+ module Record
9
+ # Schema name: InputOutputMLParameter
10
+ class InputOutputMLParameter < Base
11
+ # Input/Output Format - The data format for input/output to the model.
12
+ # Examples: "string", "image", "time-series"
13
+ prop :format, :string
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../enum"
4
+ require_relative "base"
5
+
6
+ # Issue - An individual issue that has been resolved.
7
+ module SBOM
8
+ module CycloneDX
9
+ module Record
10
+ # Schema name: Issue
11
+ class Issue < Base
12
+ # Schema name: Source
13
+ class Source < Base
14
+ # Name - The name of the source.
15
+ # Examples: "National Vulnerability Database", "NVD", "Apache"
16
+ prop :name, :string
17
+ # URL - The url of the issue documentation as provided by the source
18
+ prop :url, :uri
19
+ end
20
+
21
+ # Issue Type - Specifies the type of issue
22
+ prop :type, :string, enum: Enum::ISSUE_TYPE, required: true
23
+ # Issue ID - The identifier of the issue assigned by the source of the issue
24
+ prop :id, :string
25
+ # Issue Name - The name of the issue
26
+ prop :name, :string
27
+ # Issue Description - A description of the issue
28
+ prop :description, :string
29
+ # Source - The source of the issue where it is documented
30
+ prop :source, Source
31
+ # References - A collection of URL's for reference. Multiple URLs are allowed.
32
+ prop :references, :array, items: :uri
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,90 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../enum"
4
+ require_relative "../pattern"
5
+ require_relative "base"
6
+ require_relative "attachment"
7
+ require_relative "property"
8
+ require_relative "organizational_contact"
9
+ require_relative "organizational_entity"
10
+
11
+ # License - Specifies the details and attributes related to a software license. It can either include a valid SPDX license identifier or a named license, along with additional properties such as license acknowledgment, comprehensive commercial licensing information, and the full text of the license.
12
+ module SBOM
13
+ module CycloneDX
14
+ module Record
15
+ # Schema name: License
16
+ class License < Base
17
+ # Schema name: Licensing
18
+ class Licensing < Base
19
+ # Schema name: Licensee
20
+ class Licensee < Base
21
+ # Licensee (Organization) - The organization that was granted the license
22
+ prop :organization, OrganizationalEntity
23
+ # Licensee (Individual) - The individual, not associated with an organization, that was granted the license
24
+ prop :individual, OrganizationalContact
25
+
26
+ validate :organization, :individual, presence: :any
27
+ end
28
+
29
+ # Schema name: Licensor
30
+ class Licensor < Base
31
+ # Licensor (Organization) - The organization that granted the license
32
+ prop :organization, OrganizationalEntity
33
+ # Licensor (Individual) - The individual, not associated with an organization, that granted the license
34
+ prop :individual, OrganizationalContact
35
+
36
+ validate :organization, :individual, presence: :any
37
+ end
38
+
39
+ # Schema name: Purchaser
40
+ class Purchaser < Base
41
+ # Purchaser (Organization) - The organization that purchased the license
42
+ prop :organization, OrganizationalEntity
43
+ # Purchaser (Individual) - The individual, not associated with an organization, that purchased the license
44
+ prop :individual, OrganizationalContact
45
+
46
+ validate :organization, :individual, presence: :any
47
+ end
48
+
49
+ # Alternate License Identifiers - License identifiers that may be used to manage licenses and their lifecycle
50
+ prop :alt_ids, :array, items: :string
51
+ # Licensor - The individual or organization that grants a license to another individual or organization
52
+ prop :licensor, Licensor
53
+ # Licensee - The individual or organization for which a license was granted to
54
+ prop :licensee, Licensee
55
+ # Purchaser - The individual or organization that purchased the license
56
+ prop :purchaser, Purchaser
57
+ # Purchase Order - The purchase order identifier the purchaser sent to a supplier or vendor to authorize a purchase
58
+ prop :purchase_order, :string
59
+ # License Type - The type of license(s) that was granted to the licensee.
60
+ prop :license_types, :array, items: [:string, enum: Enum::LICENSE_TYPE]
61
+ # Last Renewal - The timestamp indicating when the license was last renewed. For new purchases, this is often the purchase or acquisition date. For non-perpetual licenses or subscriptions, this is the timestamp of when the license was last renewed.
62
+ prop :last_renewal, :date_time
63
+ # Expiration - The timestamp indicating when the current license expires (if applicable).
64
+ prop :expiration, :date_time
65
+ end
66
+
67
+ # BOM Reference - An optional identifier which can be used to reference the license elsewhere in the BOM. Every bom-ref must be unique within the BOM. Value SHOULD not start with the BOM-Link intro 'urn:cdx:' to avoid conflicts with BOM-Links.
68
+ prop :bom_ref, :string, pattern: Pattern::REF_LINK, json_name: "bom-ref"
69
+ # License ID (SPDX) - A valid SPDX license identifier. If specified, this value must be one of the enumeration of valid SPDX license identifiers defined in the spdx.schema.json (or spdx.xml) subschema which is synchronized with the official SPDX license list.
70
+ # Example: "Apache-2.0"
71
+ prop :id, :string, enum: Enum::LICENSE_ID
72
+ # License Name - The name of the license. This may include the name of a commercial or proprietary license or an open source license that may not be defined by SPDX.
73
+ # Example: "Acme Software License"
74
+ prop :name, :string
75
+ prop :acknowledgement, :string, enum: Enum::LICENSE_ACKNOWLEDGEMENT
76
+ # License text - An optional way to include the textual content of a license.
77
+ prop :text, Attachment
78
+ # License URL - The URL to the license file. If specified, a 'license' externalReference should also be specified for completeness
79
+ # Example: ["https://www.apache.org/licenses/LICENSE-2.0.txt"]
80
+ prop :url, :uri
81
+ # Licensing information - Licensing details describing the licensor/licensee, license type, renewal and expiration dates, and other important metadata
82
+ prop :licensing, Licensing
83
+ # Properties - Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is optional.
84
+ prop :properties, :array, items: Property
85
+
86
+ validate :id, :name, presence: :any
87
+ end
88
+ end
89
+ end
90
+ end
@@ -0,0 +1,35 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../enum"
4
+ require_relative "../pattern"
5
+ require_relative "base"
6
+ require_relative "license"
7
+
8
+ module SBOM
9
+ module CycloneDX
10
+ module Record
11
+ module LicenseChoice
12
+ # Schema name: LicenseExpression
13
+ class LicenseExpression < Base
14
+ # SPDX License Expression - A valid SPDX license expression Refer to https://spdx.org/specifications for syntax requirements
15
+ # Examples:
16
+ # "Apache-2.0 AND (MIT OR GPL-2.0-only)"
17
+ # "GPL-3.0-only WITH Classpath-exception-2.0"
18
+ # TODO: Validate syntax
19
+ prop :expression, :string, required: true
20
+ prop :acknowledgement, :string, enum: Enum::LICENSE_ACKNOWLEDGEMENT
21
+ # BOM Reference - An optional identifier which can be used to reference the license elsewhere in the BOM. Every bom-ref must be unique within the BOM Value SHOULD not start with the BOM-Link intro 'urn:cdx:' to avoid conflicts with BOM-Links.
22
+ prop :bom_ref, :string, pattern: Pattern::REF_LINK, json_name: "bom-ref"
23
+ end
24
+
25
+ # Schema name: WrappedLicense
26
+ class WrappedLicense < Base
27
+ # License - The license information for the BOM document. This may be different from the license(s) of the component(s) that the BOM describes.
28
+ prop :license, License, required: true
29
+ end
30
+
31
+ UNION_TYPE = [LicenseExpression, WrappedLicense].freeze #: [singleton(LicenseExpression), singleton(WrappedLicense)]
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../enum"
4
+ require_relative "base"
5
+ require_relative "component"
6
+ require_relative "license_choice"
7
+ require_relative "organizational_contact"
8
+ require_relative "organizational_entity"
9
+ require_relative "property"
10
+ require_relative "tools"
11
+
12
+ # BOM Metadata
13
+ module SBOM
14
+ module CycloneDX
15
+ module Record
16
+ # Schema name: Metadata
17
+ class Metadata < Base
18
+ # Schema name: CustomPhase
19
+ class CustomPhase < Base
20
+ # Name - The name of the lifecycle phase
21
+ prop :name, :string, required: true
22
+ # Description - The description of the lifecycle phase
23
+ prop :description, :string
24
+ end
25
+
26
+ # Schema name: PreDefinedPhase
27
+ class PreDefinedPhase < Base
28
+ # Phase - A pre-defined phase in the product lifecycle.
29
+ prop :phase, :string, enum: Enum::PHASE, required: true
30
+ end
31
+
32
+ # Timestamp - The date and time (timestamp) when the BOM was created.
33
+ prop :timestamp, :date_time
34
+ # Lifecycles - Lifecycles communicate the stage(s) in which data in the BOM was captured. Different types of data may be available at various phases of a lifecycle, such as the Software Development Lifecycle (SDLC), IT Asset Management (ITAM), and Software Asset Management (SAM). Thus, a BOM may include data specific to or only obtainable in a given lifecycle.
35
+ prop :lifecycles, :array, items: [:union, of: [PreDefinedPhase, CustomPhase]]
36
+ # Tools - The tool(s) used in the creation, enrichment, and validation of the BOM.
37
+ prop :tools, Tools
38
+ # BOM Manufacturer - The organization that created the BOM. Manufacturer is common in BOMs created through automated processes. BOMs created through manual means may have `@.authors` instead.
39
+ prop :manufacturer, OrganizationalEntity
40
+ # BOM Authors - The person(s) who created the BOM. Authors are common in BOMs created through manual processes. BOMs created through automated means may have `@.manufacturer` instead.
41
+ prop :authors, :array, items: OrganizationalContact
42
+ # Component - The component that the BOM describes.
43
+ prop :component, Component
44
+ # Component Manufacture (legacy) - [Deprecated] This will be removed in a future version. Use the `@.component.manufacturer` instead. The organization that manufactured the component that the BOM describes.
45
+ prop :manufacture, OrganizationalEntity
46
+ # Supplier - The organization that supplied the component that the BOM describes. The supplier may often be the manufacturer, but may also be a distributor or repackager.
47
+ prop :supplier, OrganizationalEntity
48
+ # BOM License(s) - The license information for the BOM document. This may be different from the license(s) of the component(s) that the BOM describes.
49
+ prop :licenses, :array, items: [:union, of: LicenseChoice::UNION_TYPE]
50
+ # Properties - Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is optional.
51
+ prop :properties, :array, items: Property
52
+ end
53
+ end
54
+ end
55
+ end
@@ -0,0 +1,89 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../enum"
4
+ require_relative "../pattern"
5
+ require_relative "base"
6
+ require_relative "property"
7
+ require_relative "risk"
8
+ require_relative "fairness_assessment"
9
+ require_relative "input_output_ml_parameter"
10
+ require_relative "performance_metric"
11
+ require_relative "graphics_collection"
12
+ require_relative "environmental_consideration"
13
+ require_relative "component_data"
14
+
15
+ # Model Card - A model card describes the intended uses of a machine learning model and potential limitations, including biases and ethical considerations. Model cards typically contain the training parameters, which datasets were used to train the model, performance metrics, and other relevant data useful for ML transparency. This object SHOULD be specified for any component of type `machine-learning-model` and must not be specified for other component types.
16
+ module SBOM
17
+ module CycloneDX
18
+ module Record
19
+ # Schema name: ModelCard
20
+ class ModelCard < Base
21
+ # Schema name: Considerations
22
+ class Considerations < Base
23
+ # Users - Who are the intended users of the model?
24
+ prop :users, :array, items: :string
25
+ # Use Cases - What are the intended use cases of the model?
26
+ prop :use_cases, :array, items: :string
27
+ # Technical Limitations - What are the known technical limitations of the model? E.g. What kind(s) of data should the model be expected not to perform well on? What are the factors that might degrade model performance?
28
+ prop :technical_limitations, :array, items: :string
29
+ # Performance Tradeoffs - What are the known tradeoffs in accuracy/performance of the model?
30
+ prop :performance_tradeoffs, :array, items: :string
31
+ # Ethical Considerations - What are the ethical risks involved in the application of this model?
32
+ prop :ethical_considerations, :array, items: Risk
33
+ # Environmental Considerations - What are the various environmental impacts the corresponding machine learning model has exhibited across its lifecycle?
34
+ prop :environmental_considerations, EnvironmentalConsideration
35
+ # Fairness Assessments - How does the model affect groups at risk of being systematically disadvantaged? What are the harms and benefits to the various affected groups?
36
+ prop :fairness_assessments, :array, items: FairnessAssessment
37
+ end
38
+
39
+ # Schema name: ModelParameters
40
+ class ModelParameters < Base
41
+ # Schema name: Approach
42
+ class Approach < Base
43
+ # Learning Type - Learning types describing the learning problem or hybrid learning problem.
44
+ prop :type, :string, enum: Enum::LEARNING_TYPE
45
+ end
46
+
47
+ # Schema name: DataReference
48
+ class DataReference < Base
49
+ # Reference - References a data component by the components bom-ref attribute
50
+ prop :ref, :string, pattern: Pattern::REF_OR_CDX_URN
51
+ end
52
+
53
+ # Approach - The overall approach to learning used by the model for problem solving.
54
+ prop :approach, Approach
55
+ # Task - Directly influences the input and/or output. Examples include classification, regression, clustering, etc.
56
+ prop :task, :string
57
+ # Architecture Family - The model architecture family such as transformer network, convolutional neural network, residual neural network, LSTM neural network, etc.
58
+ prop :architecture_family, :string
59
+ # Model Architecture - The specific architecture of the model such as GPT-1, ResNet-50, YOLOv3, etc.
60
+ prop :model_architecture, :string
61
+ # Datasets - The datasets used to train and evaluate the model.
62
+ prop :datasets, :array, items: [:union, of: [ComponentData, DataReference]]
63
+ # Inputs - The input format(s) of the model
64
+ prop :inputs, :array, items: InputOutputMLParameter
65
+ # Outputs - The output format(s) from the model
66
+ prop :outputs, :array, items: InputOutputMLParameter
67
+ end
68
+
69
+ # Schema name: QuantitativeAnalysis
70
+ class QuantitativeAnalysis < Base
71
+ # Performance Metrics - The model performance metrics being reported. Examples may include accuracy, F1 score, precision, top-3 error rates, MSC, etc.
72
+ prop :performance_metrics, :array, items: PerformanceMetric
73
+ prop :graphics, GraphicsCollection
74
+ end
75
+
76
+ # BOM Reference - An optional identifier which can be used to reference the model card elsewhere in the BOM. Every bom-ref must be unique within the BOM. Value SHOULD not start with the BOM-Link intro 'urn:cdx:' to avoid conflicts with BOM-Links.
77
+ prop :bom_ref, :string, pattern: Pattern::REF_LINK, json_name: "bom-ref"
78
+ # Model Parameters - Hyper-parameters for construction of the model.
79
+ prop :model_parameters, ModelParameters
80
+ # Quantitative Analysis - A quantitative analysis of the model
81
+ prop :quantitative_analysis, QuantitativeAnalysis
82
+ # Considerations - What considerations should be taken into account regarding the model's construction, training, and application?
83
+ prop :considerations, Considerations
84
+ # Properties - Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is optional.
85
+ prop :properties, :array, items: Property
86
+ end
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../pattern"
4
+ require_relative "base"
5
+ require_relative "attachment"
6
+
7
+ # Note - A note containing the locale and content.
8
+ module SBOM
9
+ module CycloneDX
10
+ module Record
11
+ # Schema name: Note
12
+ class Note < Base
13
+ # Locale - The ISO-639 (or higher) language code and optional ISO-3166 (or higher) country code. Examples include: "en", "en-US", "fr" and "fr-CA"
14
+ prop :locale, :string, pattern: Pattern::LOCALE
15
+ # Release note content - Specifies the full content of the release note.
16
+ prop :text, Attachment, required: true
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../../../email_address_extension"
4
+ require_relative "../pattern"
5
+ require_relative "base"
6
+
7
+ # Organizational Contact
8
+ module SBOM
9
+ module CycloneDX
10
+ module Record
11
+ # Schema name: OrganizationalContact
12
+ class OrganizationalContact < Base
13
+ # BOM Reference - An optional identifier which can be used to reference the object elsewhere in the BOM. Every bom-ref must be unique within the BOM. Value SHOULD not start with the BOM-Link intro 'urn:cdx:' to avoid conflicts with BOM-Links.
14
+ prop :bom_ref, :string, pattern: Pattern::REF_LINK, json_name: "bom-ref"
15
+ # Name - The name of a contact
16
+ # Example: "Contact name"
17
+ prop :name, :string
18
+ # Email Address - The email address of the contact.
19
+ prop :email, :email_address
20
+ # Phone - The phone number of the contact.
21
+ # Example: "800-555-1212"
22
+ prop :phone, :string
23
+ end
24
+ end
25
+ end
26
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "organizational_contact"
4
+ require_relative "postal_address"
5
+ require_relative "../pattern"
6
+ require_relative "base"
7
+
8
+ # Organizational Entity
9
+ module SBOM
10
+ module CycloneDX
11
+ module Record
12
+ # Schema name: OrganizationalEntity
13
+ class OrganizationalEntity < Base
14
+ # BOM Reference - An optional identifier which can be used to reference the object elsewhere in the BOM. Every bom-ref must be unique within the BOM. Value SHOULD not start with the BOM-Link intro 'urn:cdx:' to avoid conflicts with BOM-Links.
15
+ prop :bom_ref, :string, pattern: Pattern::REF_LINK, json_name: "bom-ref"
16
+ # Organization Name - The name of the organization
17
+ # Example: "Example Inc."
18
+ prop :name, :string
19
+ # Organization Address - The physical address (location) of the organization
20
+ prop :address, PostalAddress
21
+ # Organization URL(s) - The URL of the organization. Multiple URLs are allowed.
22
+ prop :url, :array, items: :uri
23
+ # Organizational Contact - A contact at the organization. Multiple contacts are allowed.
24
+ prop :contact, :array, items: OrganizationalContact
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../enum"
4
+ require_relative "base"
5
+ require_relative "resource_reference_choice"
6
+ require_relative "attachment"
7
+ require_relative "property"
8
+
9
+ # Anonymous class from Output
10
+ module SBOM
11
+ module CycloneDX
12
+ module Record
13
+ # Schema name: Output
14
+ class Output < Base
15
+ # Type - Describes the type of data output.
16
+ prop :type, :string, enum: Enum::OUTPUT_TYPE, required: true
17
+ # Source - Component or service that generated or provided the output from the task (e.g., a build tool)
18
+ prop :source, ResourceReferenceChoice
19
+ # Target - Component or service that received the output from the task (e.g., reference to an artifactory service with data flow value of `outbound`)
20
+ prop :target, ResourceReferenceChoice
21
+ # Resource - A reference to an independent resource generated as output by the task.
22
+ prop :resource, ResourceReferenceChoice
23
+ # Data - Outputs that have the form of data.
24
+ prop :data, Attachment
25
+ # Environment variables - Outputs that have the form of environment variables.
26
+ prop :environment_vars, :array, items: [:union, of: [Property, :string]]
27
+ # Properties - Provides the ability to document properties in a name-value store. This provides flexibility to include data not officially supported in the standard without having to use additional namespaces or create extensions. Unlike key-value stores, properties support duplicate names, each potentially having different values. Property names of interest to the general public are encouraged to be registered in the [CycloneDX Property Taxonomy](https://github.com/CycloneDX/cyclonedx-property-taxonomy). Formal registration is optional.
28
+ prop :properties, :array, items: Property
29
+
30
+ validate :resource, :data, :environment_vars, presence: :any
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "base"
4
+
5
+ # Parameter - A representation of a functional parameter.
6
+ module SBOM
7
+ module CycloneDX
8
+ module Record
9
+ # Schema name: Parameter
10
+ class Parameter < Base
11
+ # Name - The name of the parameter.
12
+ prop :name, :string
13
+ # Value - The value of the parameter.
14
+ prop :value, :string
15
+ # Data type - The data type of the parameter.
16
+ prop :data_type, :string
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../enum"
4
+ require_relative "base"
5
+ require_relative "diff"
6
+ require_relative "issue"
7
+
8
+ # Patch - Specifies an individual patch
9
+ module SBOM
10
+ module CycloneDX
11
+ module Record
12
+ # Schema name: Patch
13
+ class Patch < Base
14
+ # Patch Type - Specifies the purpose for the patch including the resolution of defects, security issues, or new behavior or functionality.
15
+ prop :type, :string, enum: Enum::PATCH_TYPE, required: true
16
+ # Diff - The patch file (or diff) that shows changes. Refer to [https://en.wikipedia.org/wiki/Diff](https://en.wikipedia.org/wiki/Diff)
17
+ prop :diff, Diff
18
+ # Resolves - A collection of issues the patch resolves
19
+ prop :resolves, :array, items: Issue
20
+ end
21
+ end
22
+ end
23
+ end