Skip to content

Commit

Permalink
Revert "squash (#169)" (#172)
Browse files Browse the repository at this point in the history
This reverts commit 3ffef3b.
  • Loading branch information
surajswaminathan authored Mar 22, 2024
1 parent 3ffef3b commit a70aa89
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
LW_API_SECRET: ${{ secrets.LW_API_SECRET }}
LW_BASE_DOMAIN: ${{ secrets.LW_BASE_DOMAIN }}
- name: Report Status
if: github.ref_name == 'main'
if: contains(github.ref, "main")
uses: ravsamhq/notify-slack-action@v2
with:
status: ${{ job.status }}
Expand Down
7 changes: 0 additions & 7 deletions laceworksdk/api/v2/vulnerabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def __init__(self, session):
self.containers = self.ContainerVulnerabilitiesAPI(session, self._base_path)
self.hosts = self.HostVulnerabilitiesAPI(session, self._base_path)
self.packages = self.SoftwarePackagesAPI(session, self._base_path)
self.imageSummary = self.ImageSummaryVulnerabilitiesAPI(session, self._base_path)

class ContainerVulnerabilitiesAPI(SearchEndpoint):
"""A class used to represent the Container Vulnerabilities API endpoint."""
Expand Down Expand Up @@ -91,12 +90,6 @@ def status(self, request_id):
)

return response.json()

class ImageSummaryVulnerabilitiesAPI(SearchEndpoint):
"""A class used to represent the ImageSummary Vulnerabilities API endpoint."""

RESOURCE = "ImageSummary"


class HostVulnerabilitiesAPI(SearchEndpoint):
"""A class used to represent the Host Vulnerabilities API endpoint."""
Expand Down
16 changes: 1 addition & 15 deletions tests/api/v2/test_vulnerabilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ class TestVulnerabilitesEndpoint(SearchEndpoint):
OBJECT_TYPE = VulnerabilitiesAPI
OBJECT_MAP = {
"containers": VulnerabilitiesAPI.ContainerVulnerabilitiesAPI,
"hosts": VulnerabilitiesAPI.HostVulnerabilitiesAPI,
"imageSummary": VulnerabilitiesAPI.ImageSummaryVulnerabilitiesAPI
"hosts": VulnerabilitiesAPI.HostVulnerabilitiesAPI
}

def test_vulnerabilities_containers_api_scan(self, api_object, request):
Expand Down Expand Up @@ -68,16 +67,3 @@ def test_vulnerabilities_packages_api_scan(api, api_object):
"pkgVer": "1.1.1-1ubuntu2.1~20.04"
}])
assert "data" in response.keys()

def test_vulnerabilities_image_summary_search(api, api_object):
json = {
"timeFilter": {
"startTime": "2024-03-18T00:00:00Z",
"endTime": "2024-03-19T08:00:00Z"
},
"filters" : [
{"field": "ndvContainers", "expression": "gt", "value": 0}
]
}
response = api_object.imageSummary.search(json)
assert "data" in next(response, None)

0 comments on commit a70aa89

Please sign in to comment.