Skip to content

Commit

Permalink
add offset to list_findings
Browse files Browse the repository at this point in the history
  • Loading branch information
quirinziessler committed Feb 23, 2024
1 parent 7c1e1e7 commit eaf8810
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions defectdojo_api/defectdojo_apiv2.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ def get_user_by_name(self, user_name):
if user_name == iterate['username']:
output = self.get_user_by_id(iterate['id'])
return output

def get_user_by_email(self, email):
"""Retrieve user by given email
:param email: User email
Expand Down Expand Up @@ -280,7 +281,7 @@ def delete_user(self, user_id):
"""
return self._request('DELETE', f'users/{user_id}/')

def create_user(self,user_name,first_name=None,last_name=None,email=None,is_active=True,is_superuser=False, password="asdf"): # nosemgrep
def create_user(self,user_name,first_name=None,last_name=None,email=None,is_active=True,is_superuser=False, password="asdf"): # nosec
"""password have to change this is justfor development use only"""
data={"username":user_name,
"is_active":is_active,
Expand All @@ -302,7 +303,7 @@ def delete_preview_user(self,user_id,limit=2000):
params['limit'] = limit

return self._request('GET',f'users/{user_id}/delete_preview/', params).data['results']

###### User contact info API #######

def list_user_contact_info(self, user_id=None, slack_username=None, block_execution=None, cell_number=None, github_username=None, offset=None, prefetch=None, slack_user_id=None, title=None, twitter_username=None, limit=20000):
Expand Down Expand Up @@ -1234,7 +1235,7 @@ def set_test(self, test_id, engagement_id=None, test_type=None, environment=None
###### Findings API #######
def list_findings(self, id=None, active=None, is_mitigated=None, duplicate=None, mitigated=None, severity=None, verified=None, severity_lt=None,
severity_gt=None, severity_contains=None, title=None, url_contains=None, date_lt=None,
date_gt=None, date=None, product_id_in=None, engagement_id_in=None, test_id_in=None, build=None,found_by=None, related_fields=None,limit=20000):
date_gt=None, date=None, product_id_in=None, engagement_id_in=None, test_id_in=None, build=None,found_by=None, related_fields=None, offset=None, limit=20000):

"""Returns filtered list of findings.
Expand Down Expand Up @@ -1327,6 +1328,9 @@ def list_findings(self, id=None, active=None, is_mitigated=None, duplicate=None,
if is_mitigated:
params['is_mitigated'] = is_mitigated

if offset:
params['offset'] = offset

return self._request('GET', 'findings/', params)

def get_finding(self, finding_id,related_fields="false"):
Expand Down

0 comments on commit eaf8810

Please sign in to comment.