Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0002114e
Commit
0002114e
authored
Mar 11, 2020
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix rubocop formatting issues
parent
9765f172
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
0 deletions
+8
-0
ee/lib/api/vulnerabilities.rb
ee/lib/api/vulnerabilities.rb
+6
-0
ee/lib/api/vulnerability_issue_links.rb
ee/lib/api/vulnerability_issue_links.rb
+2
-0
No files found.
ee/lib/api/vulnerabilities.rb
View file @
0002114e
...
@@ -35,6 +35,7 @@ module API
...
@@ -35,6 +35,7 @@ module API
get
':id'
do
get
':id'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:read_vulnerability
)
vulnerability
=
find_and_authorize_vulnerability!
(
:read_vulnerability
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
render_vulnerability
(
vulnerability
)
render_vulnerability
(
vulnerability
)
end
end
...
@@ -44,6 +45,7 @@ module API
...
@@ -44,6 +45,7 @@ module API
post
':id/resolve'
do
post
':id/resolve'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability
)
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
break
not_modified!
if
vulnerability
.
resolved?
break
not_modified!
if
vulnerability
.
resolved?
vulnerability
=
::
Vulnerabilities
::
ResolveService
.
new
(
current_user
,
vulnerability
).
execute
vulnerability
=
::
Vulnerabilities
::
ResolveService
.
new
(
current_user
,
vulnerability
).
execute
...
@@ -56,6 +58,7 @@ module API
...
@@ -56,6 +58,7 @@ module API
post
':id/dismiss'
do
post
':id/dismiss'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability
)
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
break
not_modified!
if
vulnerability
.
dismissed?
break
not_modified!
if
vulnerability
.
dismissed?
vulnerability
=
::
Vulnerabilities
::
DismissService
.
new
(
current_user
,
vulnerability
).
execute
vulnerability
=
::
Vulnerabilities
::
DismissService
.
new
(
current_user
,
vulnerability
).
execute
...
@@ -68,6 +71,7 @@ module API
...
@@ -68,6 +71,7 @@ module API
post
':id/confirm'
do
post
':id/confirm'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability
)
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
break
not_modified!
if
vulnerability
.
confirmed?
break
not_modified!
if
vulnerability
.
confirmed?
vulnerability
=
::
Vulnerabilities
::
ConfirmService
.
new
(
current_user
,
vulnerability
).
execute
vulnerability
=
::
Vulnerabilities
::
ConfirmService
.
new
(
current_user
,
vulnerability
).
execute
...
@@ -87,6 +91,7 @@ module API
...
@@ -87,6 +91,7 @@ module API
end
end
get
':id/vulnerabilities'
do
get
':id/vulnerabilities'
do
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
user_project
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
user_project
)
authorize!
:read_vulnerability
,
user_project
authorize!
:read_vulnerability
,
user_project
vulnerabilities
=
paginate
(
vulnerabilities
=
paginate
(
...
@@ -104,6 +109,7 @@ module API
...
@@ -104,6 +109,7 @@ module API
end
end
post
':id/vulnerabilities'
do
post
':id/vulnerabilities'
do
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
user_project
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
user_project
)
authorize!
:create_vulnerability
,
user_project
authorize!
:create_vulnerability
,
user_project
vulnerability
=
::
Vulnerabilities
::
CreateService
.
new
(
vulnerability
=
::
Vulnerabilities
::
CreateService
.
new
(
...
...
ee/lib/api/vulnerability_issue_links.rb
View file @
0002114e
...
@@ -52,6 +52,7 @@ module API
...
@@ -52,6 +52,7 @@ module API
post
':id/issue_links'
do
post
':id/issue_links'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability_issue_link
)
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability_issue_link
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
issue
=
find_project_issue
(
params
[
:target_issue_iid
],
vulnerability
.
project_id
)
issue
=
find_project_issue
(
params
[
:target_issue_iid
],
vulnerability
.
project_id
)
response
=
::
VulnerabilityIssueLinks
::
CreateService
.
new
(
response
=
::
VulnerabilityIssueLinks
::
CreateService
.
new
(
...
@@ -69,6 +70,7 @@ module API
...
@@ -69,6 +70,7 @@ module API
delete
':id/issue_links/:issue_link_id'
do
delete
':id/issue_links/:issue_link_id'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability_issue_link
)
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability_issue_link
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
issue_link
=
find_issue_link!
issue_link
=
find_issue_link!
service_response
=
::
VulnerabilityIssueLinks
::
DeleteService
.
new
(
current_user
,
issue_link
).
execute
service_response
=
::
VulnerabilityIssueLinks
::
DeleteService
.
new
(
current_user
,
issue_link
).
execute
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment