Skip to content

Commit 6313ba5

Browse files
authored
Merge pull request #15 from aaronweaver/revert-12-master
Revert "Add support for custom DefectDojo URL prefix"
2 parents de61c8f + 0eab5e5 commit 6313ba5

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

defectdojo_api/defectdojo.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,6 @@ def __init__(self, host, api_key, user, api_version='v1', verify_ssl=True, timeo
3333
self.verify_ssl = verify_ssl
3434
self.proxies = proxies
3535
self.timeout = timeout
36-
37-
if host.split('/') > 3:
38-
self.custom_path = '/' + '/'.join(host.split('/')[3:]).rstrip('/')
39-
else:
40-
self.custom_path = ''
4136

4237
if not user_agent:
4338
self.user_agent = 'DefectDojo_api/' + version
@@ -51,47 +46,46 @@ def __init__(self, host, api_key, user, api_version='v1', verify_ssl=True, timeo
5146
requests.packages.urllib3.disable_warnings() # Disabling SSL warning messages if verification is disabled.
5247

5348
###### Helper Functions ######
54-
5549
def get_user_uri(self, user_id):
5650
"""Returns the DefectDojo API URI for a user.
5751
5852
:param user_id: Id of the user
5953
6054
"""
6155

62-
return self.custom_path + "/api/" + self.api_version + "/users/" + str(user_id) + "/"
56+
return "/api/" + self.api_version + "/users/" + str(user_id) + "/"
6357

6458
def get_engagement_uri(self, engagement_id):
6559
"""Returns the DefectDojo API URI for an engagement.
6660
6761
:param engagement_id: Id of the engagement
6862
6963
"""
70-
return self.custom_path + "/api/" + self.api_version + "/engagements/" + str(engagement_id) + "/"
64+
return "/api/" + self.api_version + "/engagements/" + str(engagement_id) + "/"
7165

7266
def get_product_uri(self, product_id):
7367
"""Returns the DefectDojo API URI for a product.
7468
7569
:param product_id: Id of the product
7670
7771
"""
78-
return self.custom_path + "/api/" + self.api_version + "/products/" + str(product_id) + "/"
72+
return "/api/" + self.api_version + "/products/" + str(product_id) + "/"
7973

8074
def get_test_uri(self, test_id):
8175
"""Returns the DefectDojo API URI for a test.
8276
8377
:param test_id: Id of the test
8478
8579
"""
86-
return self.custom_path + "/api/" + self.api_version + "/tests/" + str(test_id) + "/"
80+
return "/api/" + self.api_version + "/tests/" + str(test_id) + "/"
8781

8882
def get_language_uri(self, language_type_id):
8983
"""Returns the DefectDojo API URI for a langauge.
9084
9185
:param test_id: Id of the language
9286
9387
"""
94-
return self.custom_path + "/api/" + self.api_version + "/language_types/" + str(language_type_id) + "/"
88+
return "/api/" + self.api_version + "/language_types/" + str(language_type_id) + "/"
9589

9690
def get_tool_configuration_uri(self, tool_configuration_id):
9791
"""Returns the DefectDojo API URI for a tool.

0 commit comments

Comments
 (0)