Skip to content

Commit e291104

Browse files
authored
Merge branch 'main' into johnsca/feat/ENG-2685/default-policy-collection
2 parents 860d4ea + 451f537 commit e291104

File tree

3 files changed

+16
-20
lines changed

3 files changed

+16
-20
lines changed

scripts/openapi.json

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2194,7 +2194,7 @@
21942194
"added": 0,
21952195
"updated": 0,
21962196
"removed": 0,
2197-
"started_at": "2023-09-19T20:57:16.486859"
2197+
"started_at": "2023-10-06T20:10:54.534411"
21982198
}
21992199
}
22002200
}
@@ -2320,7 +2320,7 @@
23202320
"added": 0,
23212321
"updated": 0,
23222322
"removed": 0,
2323-
"started_at": "2023-09-19T20:57:16.486380"
2323+
"started_at": "2023-10-06T20:10:54.533561"
23242324
}
23252325
}
23262326
}
@@ -2715,7 +2715,9 @@
27152715
},
27162716
{
27172717
"type": "array",
2718-
"items": {}
2718+
"items": {
2719+
"type": "string"
2720+
}
27192721
}
27202722
]
27212723
},
@@ -2832,14 +2834,9 @@
28322834
},
28332835
"Severity": {
28342836
"title": "Severity",
2835-
"enum": [
2836-
"HIGH",
2837-
"MEDIUM",
2838-
"LOW",
2839-
"UNKNOWN"
2840-
],
28412837
"type": "string",
2842-
"description": "An enumeration."
2838+
"description": "Severity of a policy violation.",
2839+
"pattern": "(?i)^(high|medium|low|unknown)$"
28432840
},
28442841
"Summary": {
28452842
"title": "Summary",

stacklet/client/sinistral/commands/scans.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,10 @@ class Create(ClientCommand):
9090
"title": "Resource",
9191
"anyOf": [
9292
{"type": "string"},
93-
{"type": "array", "items": {}},
93+
{
94+
"type": "array",
95+
"items": {"type": "string"},
96+
},
9497
],
9598
},
9699
"description": {
@@ -103,14 +106,9 @@ class Create(ClientCommand):
103106
"properties": {
104107
"severity": {
105108
"title": "Severity",
106-
"enum": [
107-
"HIGH",
108-
"MEDIUM",
109-
"LOW",
110-
"UNKNOWN",
111-
],
112109
"type": "string",
113-
"description": "An enumeration.",
110+
"description": "Severity of a policy violation.",
111+
"pattern": "(?i)^(high|medium|low|unknown)$",
114112
}
115113
},
116114
},

tests/test_client.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ def test_client_command_uses_query_params():
316316
assert res == {"a": "policy"}
317317

318318

319-
def test_client_command_scan_create():
319+
@pytest.mark.parametrize("severity", ["HIGH", "high"])
320+
def test_client_command_scan_create(severity):
320321
client = sinistral_client().client("scans")
321322
with patch.object(
322323
RestExecutor, "post", return_value=get_mock_response(json={"id": "new-scan"})
@@ -332,7 +333,7 @@ def test_client_command_scan_create():
332333
"description": "foo",
333334
"filters": [],
334335
"mode": {},
335-
"metadata": {"severity": "HIGH"},
336+
"metadata": {"severity": f"{severity}"},
336337
},
337338
"resource": {
338339
"id": "foo",

0 commit comments

Comments
 (0)