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
e67b3ce8
Commit
e67b3ce8
authored
Aug 09, 2017
by
Douglas Barbosa Alexandre
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for restricted projects on a node before processing hooks
parent
389dce86
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
0 deletions
+11
-0
lib/api/geo.rb
lib/api/geo.rb
+11
-0
No files found.
lib/api/geo.rb
View file @
e67b3ce8
...
...
@@ -58,6 +58,8 @@ module API
post
'receive_events'
do
authenticate_by_gitlab_geo_token!
require_node_to_be_enabled!
check_node_restricted_project_ids!
required_attributes!
%w(event_name)
case
params
[
'event_name'
]
...
...
@@ -109,6 +111,15 @@ module API
def
require_node_to_be_secondary!
forbidden!
'Geo node is not secondary node.'
unless
Gitlab
::
Geo
.
current_node
&
.
secondary?
end
def
check_node_restricted_project_ids!
return
unless
params
.
key?
(
:project_id
)
return
if
Gitlab
::
Geo
.
current_node
&
.
restricted_project_ids
.
nil?
unless
Gitlab
::
Geo
.
current_node
.
restricted_project_ids
.
include?
(
params
[
:project_id
])
not_found!
end
end
end
end
end
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