Skip to content

Commit

Permalink
Make the "name" field for plugins mandatory (#3471)
Browse files Browse the repository at this point in the history
Signed-off-by: Donny Peeters <[email protected]>
Co-authored-by: Jan Klopper <[email protected]>
  • Loading branch information
Donnype and underdarknl authored Sep 9, 2024
1 parent a11a739 commit a0c48c8
Show file tree
Hide file tree
Showing 12 changed files with 19 additions and 1 deletion.
2 changes: 1 addition & 1 deletion boefjes/boefjes/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Organisation(BaseModel):

class Plugin(BaseModel):
id: str
name: str | None = None
name: str
version: str | None = None
created: datetime.datetime | None = None
description: str | None = None
Expand Down
1 change: 1 addition & 0 deletions boefjes/boefjes/plugins/kat_dns_version/normalizer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "dns-bind-version-normalize",
"name": "DNS bind version normalizer",
"consumes": [
"boefje/dns-bind-version"
],
Expand Down
1 change: 1 addition & 0 deletions boefjes/boefjes/plugins/kat_green_hosting/normalizer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"id": "kat_green_hosting_normalize",
"description": "Parses the Green Hosting output into findings.",
"name": "Green Hosting",
"consumes": [
"boefje/green-hosting"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "kat_kat_finding_types_normalize",
"name": "KAT finding types",
"description": "Parses KAT finding types.",
"consumes": [
"boefje/kat-finding-types"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "kat_manual_ooi",
"name": "Manual OOI normalizer",
"consumes": [
"manual/ooi"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "kat_test_normalize_2",
"name": "Test normalizer 2",
"description": "Testing KAT 2",
"consumes": [
"text/html"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "kat_test_normalize",
"name": "Test normalizer",
"description": "Testing KAT",
"consumes": [
"text/html"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "dummy_bad_normalizer_dict_structure",
"name": "dummy_bad_normalizer_dict_structure",
"description": "",
"consumes": [],
"produces": []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "dummy_bad_normalizer_return_type",
"name": "dummy_bad_normalizer_return_type",
"description": "",
"consumes": [],
"produces": []
Expand Down
1 change: 1 addition & 0 deletions boefjes/tests/modules/dummy_normalizer/normalizer.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "dummy_normalizer",
"name": "dummy_normalizer",
"description": "",
"consumes": [],
"produces": []
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"id": "dummy_normalizer",
"name": "dummy_normalizer",
"description": "",
"consumes": [],
"produces": []
Expand Down
8 changes: 8 additions & 0 deletions boefjes/tests/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,46 +22,54 @@ def setUp(self) -> None:
self.boefjes = [
Boefje(
id="test-boefje-1",
name="test-boefje-1",
consumes={"SomeOOI"},
produces=["test-boef-1", "test/text"],
),
Boefje(
id="test-boefje-2",
name="test-boefje-2",
consumes={"SomeOOI"},
produces=["test-boef-2", "test/text"],
),
Boefje(
id="test-boefje-3",
name="test-boefje-3",
consumes={"SomeOOI"},
produces=["test-boef-3", "test/plain"],
),
Boefje(
id="test-boefje-4",
name="test-boefje-4",
consumes={"SomeOOI"},
produces=["test-boef-4", "test/and-simple"],
),
]
self.normalizers = [
Normalizer(
id="test-normalizer-1",
name="test-normalizer-1",
consumes=["test-boef-3", "test/text"],
produces=["SomeOOI", "OtherOOI"],
),
Normalizer(
id="test-normalizer-2",
name="test-normalizer-2",
consumes=["test/text"],
produces=["SomeOtherOOI"],
),
]
self.bits = [
Bit(
id="test-bit-1",
name="test-bit-1",
consumes="SomeOOI",
produces=["SomeOOI"],
parameters=[],
),
Bit(
id="test-bit-2",
name="test-bit-2",
consumes="SomeOOI",
produces=["SomeOOI", "SomeOtherOOI"],
parameters=[],
Expand Down

0 comments on commit a0c48c8

Please sign in to comment.