We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9d992d7 + 9f6c47c commit f476138Copy full SHA for f476138
src/e3/spdx.py
@@ -420,6 +420,30 @@ class ExternalRefCategory(Enum):
420
other = "OTHER"
421
422
423
+# Create some constants to make writing easier
424
+SECURITY = ExternalRefCategory.security
425
+PACKAGE_MANAGER = ExternalRefCategory.package_manager
426
+PERSISTENT_ID = ExternalRefCategory.persistent_id
427
+OTHER = ExternalRefCategory.other
428
+
429
+# List of valid external reference types when Category is not OTHER
430
+SPDX_EXTERNAL_REF_TYPES = (
431
+ (SECURITY, "cpe22Type"),
432
+ (SECURITY, "cpe23Type"),
433
+ (SECURITY, "advisory"),
434
+ (SECURITY, "fix"),
435
+ (SECURITY, "url"),
436
+ (SECURITY, "swid"),
437
+ (PACKAGE_MANAGER, "maven-central"),
438
+ (PACKAGE_MANAGER, "npm"),
439
+ (PACKAGE_MANAGER, "nuget"),
440
+ (PACKAGE_MANAGER, "bower"),
441
+ (PACKAGE_MANAGER, "purl"),
442
+ (PERSISTENT_ID, "swh"),
443
+ (PERSISTENT_ID, "gitoid"),
444
+)
445
446
447
class ExternalRef(SPDXEntry):
448
"""Reference an external source of information relevant to the package.
449
0 commit comments