Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
defectdojo_api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Raul Barreras
defectdojo_api
Commits
6313ba54
Unverified
Commit
6313ba54
authored
6 years ago
by
Aaron Weaver
Committed by
GitHub
6 years ago
Browse files
Options
Downloads
Plain Diff
Merge pull request #15 from aaronweaver/revert-12-master
Revert "Add support for custom DefectDojo URL prefix"
parents
de61c8fe
0eab5e58
Branches
Branches containing commit
Tags
v1.1.4
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
defectdojo_api/defectdojo.py
+5
-11
5 additions, 11 deletions
defectdojo_api/defectdojo.py
with
5 additions
and
11 deletions
defectdojo_api/defectdojo.py
+
5
−
11
View file @
6313ba54
...
@@ -34,11 +34,6 @@ class DefectDojoAPI(object):
...
@@ -34,11 +34,6 @@ class DefectDojoAPI(object):
self
.
proxies
=
proxies
self
.
proxies
=
proxies
self
.
timeout
=
timeout
self
.
timeout
=
timeout
if
host
.
split
(
'
/
'
)
>
3
:
self
.
custom_path
=
'
/
'
+
'
/
'
.
join
(
host
.
split
(
'
/
'
)[
3
:]).
rstrip
(
'
/
'
)
else
:
self
.
custom_path
=
''
if
not
user_agent
:
if
not
user_agent
:
self
.
user_agent
=
'
DefectDojo_api/
'
+
version
self
.
user_agent
=
'
DefectDojo_api/
'
+
version
else
:
else
:
...
@@ -51,7 +46,6 @@ class DefectDojoAPI(object):
...
@@ -51,7 +46,6 @@ class DefectDojoAPI(object):
requests
.
packages
.
urllib3
.
disable_warnings
()
# Disabling SSL warning messages if verification is disabled.
requests
.
packages
.
urllib3
.
disable_warnings
()
# Disabling SSL warning messages if verification is disabled.
###### Helper Functions ######
###### Helper Functions ######
def
get_user_uri
(
self
,
user_id
):
def
get_user_uri
(
self
,
user_id
):
"""
Returns the DefectDojo API URI for a user.
"""
Returns the DefectDojo API URI for a user.
...
@@ -59,7 +53,7 @@ class DefectDojoAPI(object):
...
@@ -59,7 +53,7 @@ class DefectDojoAPI(object):
"""
"""
return
self
.
custom_path
+
"
/api/
"
+
self
.
api_version
+
"
/users/
"
+
str
(
user_id
)
+
"
/
"
return
"
/api/
"
+
self
.
api_version
+
"
/users/
"
+
str
(
user_id
)
+
"
/
"
def
get_engagement_uri
(
self
,
engagement_id
):
def
get_engagement_uri
(
self
,
engagement_id
):
"""
Returns the DefectDojo API URI for an engagement.
"""
Returns the DefectDojo API URI for an engagement.
...
@@ -67,7 +61,7 @@ class DefectDojoAPI(object):
...
@@ -67,7 +61,7 @@ class DefectDojoAPI(object):
:param engagement_id: Id of the engagement
:param engagement_id: Id of the engagement
"""
"""
return
self
.
custom_path
+
"
/api/
"
+
self
.
api_version
+
"
/engagements/
"
+
str
(
engagement_id
)
+
"
/
"
return
"
/api/
"
+
self
.
api_version
+
"
/engagements/
"
+
str
(
engagement_id
)
+
"
/
"
def
get_product_uri
(
self
,
product_id
):
def
get_product_uri
(
self
,
product_id
):
"""
Returns the DefectDojo API URI for a product.
"""
Returns the DefectDojo API URI for a product.
...
@@ -75,7 +69,7 @@ class DefectDojoAPI(object):
...
@@ -75,7 +69,7 @@ class DefectDojoAPI(object):
:param product_id: Id of the product
:param product_id: Id of the product
"""
"""
return
self
.
custom_path
+
"
/api/
"
+
self
.
api_version
+
"
/products/
"
+
str
(
product_id
)
+
"
/
"
return
"
/api/
"
+
self
.
api_version
+
"
/products/
"
+
str
(
product_id
)
+
"
/
"
def
get_test_uri
(
self
,
test_id
):
def
get_test_uri
(
self
,
test_id
):
"""
Returns the DefectDojo API URI for a test.
"""
Returns the DefectDojo API URI for a test.
...
@@ -83,7 +77,7 @@ class DefectDojoAPI(object):
...
@@ -83,7 +77,7 @@ class DefectDojoAPI(object):
:param test_id: Id of the test
:param test_id: Id of the test
"""
"""
return
self
.
custom_path
+
"
/api/
"
+
self
.
api_version
+
"
/tests/
"
+
str
(
test_id
)
+
"
/
"
return
"
/api/
"
+
self
.
api_version
+
"
/tests/
"
+
str
(
test_id
)
+
"
/
"
def
get_language_uri
(
self
,
language_type_id
):
def
get_language_uri
(
self
,
language_type_id
):
"""
Returns the DefectDojo API URI for a langauge.
"""
Returns the DefectDojo API URI for a langauge.
...
@@ -91,7 +85,7 @@ class DefectDojoAPI(object):
...
@@ -91,7 +85,7 @@ class DefectDojoAPI(object):
:param test_id: Id of the language
:param test_id: Id of the language
"""
"""
return
self
.
custom_path
+
"
/api/
"
+
self
.
api_version
+
"
/language_types/
"
+
str
(
language_type_id
)
+
"
/
"
return
"
/api/
"
+
self
.
api_version
+
"
/language_types/
"
+
str
(
language_type_id
)
+
"
/
"
def
get_tool_configuration_uri
(
self
,
tool_configuration_id
):
def
get_tool_configuration_uri
(
self
,
tool_configuration_id
):
"""
Returns the DefectDojo API URI for a tool.
"""
Returns the DefectDojo API URI for a tool.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment