Skip to content

Commit aea3b04

Browse files
committed
feat: add cpe format validation
Signed-off-by: Saquib Saifee <[email protected]>
1 parent 39f1ea1 commit aea3b04

File tree

2 files changed

+0
-11
lines changed

2 files changed

+0
-11
lines changed

cyclonedx/model/component.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -64,16 +64,6 @@
6464
from .license import License, LicenseRepository
6565
from .release_note import ReleaseNotes
6666

67-
CPE_REGEX = re.compile(
68-
r'([c][pP][eE]:/[AHOaho]?(:[A-Za-z0-9._\-~%]*){0,6})|'
69-
r'(cpe:2\.3:[aho*-](:(((\?*|\*?)([a-zA-Z0-9\-._]|'
70-
r'(\\[\\\*\?!\"#\$%&\'\(\)\+,/:;<=>@\[\]\^`\{\|\}~]))+(\?*|\*?))|'
71-
r'[\*\-])){5}(:(([a-zA-Z]{2,3}(-([a-zA-Z]{2}|[0-9]{3}))?)|'
72-
r'[\*\-]))(:(((\?*|\*?)([a-zA-Z0-9\-._]|'
73-
r'(\\[\\\*\?!\"#\$%&\'\(\)\+,/:;<=>@\[\]\^`\{\|\}~]))+(\?*|'
74-
r'\*?))|[\*\-])){4})'
75-
)
76-
7767

7868
@serializable.serializable_class
7969
class Commit:

tests/test_model_component.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,6 @@ def test_empty_basic_component(self) -> None:
123123
self.assertSetEqual(c.external_references, set())
124124
self.assertFalse(c.properties)
125125
self.assertIsNone(c.release_notes)
126-
self.assertIsNone(c.cpe)
127126
self.assertEqual(len(c.components), 0)
128127
self.assertEqual(len(c.get_all_nested_components(include_self=True)), 1)
129128

0 commit comments

Comments
 (0)