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
b331b7bc
Commit
b331b7bc
authored
Apr 13, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
endpoint in geo to receive system hook events from primary node
parent
c90f6d22
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
1 deletion
+15
-1
lib/api/geo.rb
lib/api/geo.rb
+14
-0
lib/gitlab/middleware/readonly_geo.rb
lib/gitlab/middleware/readonly_geo.rb
+1
-1
No files found.
lib/api/geo.rb
View file @
b331b7bc
...
...
@@ -31,6 +31,20 @@ module API
required_attributes!
%w(event_name key id)
::
Geo
::
ScheduleKeyChangeService
.
new
(
params
).
execute
end
# Receive event streams from primary and enqueue changes
#
# Example request:
# POST /geo/receive_events
post
'receive_events'
do
required_attributes!
%w(event_name)
case
params
[
'event_name'
]
when
'key_create'
,
'key_destroy'
required_attributes!
%w(key id)
::
Geo
::
ScheduleKeyChangeService
.
new
(
params
).
execute
end
end
end
end
end
lib/gitlab/middleware/readonly_geo.rb
View file @
b331b7bc
...
...
@@ -2,7 +2,7 @@ module Gitlab
module
Middleware
class
ReadonlyGeo
DISALLOWED_METHODS
=
%w(POST PATCH PUT DELETE)
WHITELISTED
=
%w(api/v3/internal api/v3/geo/refresh_projects api/v3/geo/refresh_wikis api/v3/geo/refresh_key)
WHITELISTED
=
%w(api/v3/internal api/v3/geo/refresh_projects api/v3/geo/refresh_wikis api/v3/geo/refresh_key
api/v3/geo/receive_events
)
APPLICATION_JSON
=
'application/json'
def
initialize
(
app
)
...
...
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