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
80cbaad5
Commit
80cbaad5
authored
Feb 02, 2018
by
Yorick Peterse
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Whitelist query counts for EE controllers
parent
168739c6
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
0 deletions
+17
-0
app/controllers/projects/issues_controller.rb
app/controllers/projects/issues_controller.rb
+5
-0
app/controllers/projects/merge_requests_controller.rb
app/controllers/projects/merge_requests_controller.rb
+6
-0
lib/api/groups.rb
lib/api/groups.rb
+2
-0
lib/api/v3/groups.rb
lib/api/v3/groups.rb
+2
-0
lib/api/v3/merge_requests.rb
lib/api/v3/merge_requests.rb
+2
-0
No files found.
app/controllers/projects/issues_controller.rb
View file @
80cbaad5
...
@@ -8,6 +8,7 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -8,6 +8,7 @@ class Projects::IssuesController < Projects::ApplicationController
prepend_before_action
:authenticate_user!
,
only:
[
:new
,
:export_csv
]
prepend_before_action
:authenticate_user!
,
only:
[
:new
,
:export_csv
]
before_action
:whitelist_query_limiting_ee
,
only:
[
:update
]
before_action
:whitelist_query_limiting
,
only:
[
:create
,
:create_merge_request
,
:move
,
:bulk_update
]
before_action
:whitelist_query_limiting
,
only:
[
:create
,
:create_merge_request
,
:move
,
:bulk_update
]
before_action
:check_issues_available!
before_action
:check_issues_available!
before_action
:issue
,
except:
[
:index
,
:new
,
:create
,
:bulk_update
,
:export_csv
]
before_action
:issue
,
except:
[
:index
,
:new
,
:create
,
:bulk_update
,
:export_csv
]
...
@@ -260,4 +261,8 @@ class Projects::IssuesController < Projects::ApplicationController
...
@@ -260,4 +261,8 @@ class Projects::IssuesController < Projects::ApplicationController
# 3. https://gitlab.com/gitlab-org/gitlab-ce/issues/42426
# 3. https://gitlab.com/gitlab-org/gitlab-ce/issues/42426
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ce/issues/42422'
)
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ce/issues/42422'
)
end
end
def
whitelist_query_limiting_ee
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ee/issues/4794'
)
end
end
end
app/controllers/projects/merge_requests_controller.rb
View file @
80cbaad5
...
@@ -9,6 +9,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
...
@@ -9,6 +9,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
prepend
::
EE
::
Projects
::
MergeRequestsController
prepend
::
EE
::
Projects
::
MergeRequestsController
skip_before_action
:merge_request
,
only:
[
:index
,
:bulk_update
]
skip_before_action
:merge_request
,
only:
[
:index
,
:bulk_update
]
before_action
:whitelist_query_limiting_ee
,
only:
[
:merge
,
:show
]
before_action
:whitelist_query_limiting
,
only:
[
:assign_related_issues
,
:update
]
before_action
:whitelist_query_limiting
,
only:
[
:assign_related_issues
,
:update
]
before_action
:authorize_update_issuable!
,
only:
[
:close
,
:edit
,
:update
,
:remove_wip
,
:sort
]
before_action
:authorize_update_issuable!
,
only:
[
:close
,
:edit
,
:update
,
:remove_wip
,
:sort
]
before_action
:set_issuables_index
,
only:
[
:index
]
before_action
:set_issuables_index
,
only:
[
:index
]
...
@@ -354,4 +355,9 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
...
@@ -354,4 +355,9 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo
# Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/42441
# Also see https://gitlab.com/gitlab-org/gitlab-ce/issues/42441
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ce/issues/42438'
)
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ce/issues/42438'
)
end
end
def
whitelist_query_limiting_ee
# Also see https://gitlab.com/gitlab-org/gitlab-ee/issues/4793
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ee/issues/4792'
)
end
end
end
lib/api/groups.rb
View file @
80cbaad5
...
@@ -181,6 +181,8 @@ module API
...
@@ -181,6 +181,8 @@ module API
desc
'Remove a group.'
desc
'Remove a group.'
delete
":id"
do
delete
":id"
do
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ee/issues/4795'
)
group
=
find_group!
(
params
[
:id
])
group
=
find_group!
(
params
[
:id
])
authorize!
:admin_group
,
group
authorize!
:admin_group
,
group
...
...
lib/api/v3/groups.rb
View file @
80cbaad5
...
@@ -151,6 +151,8 @@ module API
...
@@ -151,6 +151,8 @@ module API
desc
'Remove a group.'
desc
'Remove a group.'
delete
":id"
do
delete
":id"
do
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ee/issues/4797'
)
group
=
find_group!
(
params
[
:id
])
group
=
find_group!
(
params
[
:id
])
authorize!
:admin_group
,
group
authorize!
:admin_group
,
group
present
::
Groups
::
DestroyService
.
new
(
group
,
current_user
).
execute
,
with:
Entities
::
GroupDetail
,
current_user:
current_user
present
::
Groups
::
DestroyService
.
new
(
group
,
current_user
).
execute
,
with:
Entities
::
GroupDetail
,
current_user:
current_user
...
...
lib/api/v3/merge_requests.rb
View file @
80cbaad5
...
@@ -200,6 +200,8 @@ module API
...
@@ -200,6 +200,8 @@ module API
optional
:squash
,
type:
Boolean
,
desc:
'When true, the commits will be squashed into a single commit on merge'
optional
:squash
,
type:
Boolean
,
desc:
'When true, the commits will be squashed into a single commit on merge'
end
end
put
"
#{
path
}
/merge"
do
put
"
#{
path
}
/merge"
do
Gitlab
::
QueryLimiting
.
whitelist
(
'https://gitlab.com/gitlab-org/gitlab-ee/issues/4796'
)
merge_request
=
find_project_merge_request
(
params
[
:merge_request_id
])
merge_request
=
find_project_merge_request
(
params
[
:merge_request_id
])
# Merge request can not be merged
# Merge request can not be merged
...
...
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