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
18c61c80
Commit
18c61c80
authored
Mar 16, 2020
by
Jonathan Schafer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove `break` from `not_found` call, use `before`
parent
0002114e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
14 deletions
+13
-14
ee/lib/api/vulnerabilities.rb
ee/lib/api/vulnerabilities.rb
+10
-11
ee/lib/api/vulnerability_issue_links.rb
ee/lib/api/vulnerability_issue_links.rb
+3
-3
No files found.
ee/lib/api/vulnerabilities.rb
View file @
18c61c80
...
...
@@ -34,7 +34,7 @@ module API
end
get
':id'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:read_vulnerability
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
render_vulnerability
(
vulnerability
)
end
...
...
@@ -44,9 +44,9 @@ module API
end
post
':id/resolve'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
break
not_modified!
if
vulnerability
.
resolved?
not_modified!
if
vulnerability
.
resolved?
vulnerability
=
::
Vulnerabilities
::
ResolveService
.
new
(
current_user
,
vulnerability
).
execute
render_vulnerability
(
vulnerability
)
...
...
@@ -57,9 +57,9 @@ module API
end
post
':id/dismiss'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
break
not_modified!
if
vulnerability
.
dismissed?
not_modified!
if
vulnerability
.
dismissed?
vulnerability
=
::
Vulnerabilities
::
DismissService
.
new
(
current_user
,
vulnerability
).
execute
render_vulnerability
(
vulnerability
)
...
...
@@ -70,9 +70,9 @@ module API
end
post
':id/confirm'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
break
not_modified!
if
vulnerability
.
confirmed?
not_modified!
if
vulnerability
.
confirmed?
vulnerability
=
::
Vulnerabilities
::
ConfirmService
.
new
(
current_user
,
vulnerability
).
execute
render_vulnerability
(
vulnerability
)
...
...
@@ -86,12 +86,13 @@ module API
desc
'Get a list of project vulnerabilities'
do
success
EE
::
API
::
Entities
::
Vulnerability
end
before
do
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
user_project
)
end
params
do
use
:pagination
end
get
':id/vulnerabilities'
do
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
user_project
)
authorize!
:read_vulnerability
,
user_project
vulnerabilities
=
paginate
(
...
...
@@ -108,8 +109,6 @@ module API
requires
:finding_id
,
type:
Integer
,
desc:
'The id of confirmed vulnerability finding'
end
post
':id/vulnerabilities'
do
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
user_project
)
authorize!
:create_vulnerability
,
user_project
vulnerability
=
::
Vulnerabilities
::
CreateService
.
new
(
...
...
ee/lib/api/vulnerability_issue_links.rb
View file @
18c61c80
...
...
@@ -33,7 +33,7 @@ module API
end
get
':id/issue_links'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:read_vulnerability
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
present
vulnerability
.
related_issues
...
...
@@ -51,7 +51,7 @@ module API
end
post
':id/issue_links'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability_issue_link
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
issue
=
find_project_issue
(
params
[
:target_issue_iid
],
vulnerability
.
project_id
)
...
...
@@ -69,7 +69,7 @@ module API
end
delete
':id/issue_links/:issue_link_id'
do
vulnerability
=
find_and_authorize_vulnerability!
(
:admin_vulnerability_issue_link
)
break
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
not_found!
unless
Feature
.
enabled?
(
:first_class_vulnerabilities
,
vulnerability
.
project
)
issue_link
=
find_issue_link!
...
...
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