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
e6757060
Commit
e6757060
authored
Apr 13, 2016
by
Gabriel Mazetto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
remove refresh_key endpoint and fix specs
parent
b331b7bc
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
24 deletions
+4
-24
lib/api/geo.rb
lib/api/geo.rb
+0
-9
spec/lib/gitlab/geo_spec.rb
spec/lib/gitlab/geo_spec.rb
+0
-11
spec/requests/api/geo_spec.rb
spec/requests/api/geo_spec.rb
+4
-4
No files found.
lib/api/geo.rb
View file @
e6757060
...
@@ -23,15 +23,6 @@ module API
...
@@ -23,15 +23,6 @@ module API
::
Geo
::
ScheduleWikiRepoUpdateService
.
new
(
params
[
:projects
]).
execute
::
Geo
::
ScheduleWikiRepoUpdateService
.
new
(
params
[
:projects
]).
execute
end
end
# Enqueue a change operation for specific key ID
#
# Example request:
# POST /geo/refresh_key
post
'refresh_key'
do
required_attributes!
%w(event_name key id)
::
Geo
::
ScheduleKeyChangeService
.
new
(
params
).
execute
end
# Receive event streams from primary and enqueue changes
# Receive event streams from primary and enqueue changes
#
#
# Example request:
# Example request:
...
...
spec/lib/gitlab/geo_spec.rb
View file @
e6757060
...
@@ -79,15 +79,4 @@ describe Gitlab::Geo, lib: true do
...
@@ -79,15 +79,4 @@ describe Gitlab::Geo, lib: true do
described_class
.
notify_project_update
(
project
)
described_class
.
notify_project_update
(
project
)
end
end
end
end
describe
'notify_ssh_key_change'
do
let
(
:key
)
{
FactoryGirl
.
build
(
:key
)
}
it
'schedule async notification'
do
expect
(
GeoKeyChangeNotifyWorker
).
to
receive
(
:perform_async
).
and_call_original
expect_any_instance_of
(
GeoKeyChangeNotifyWorker
).
to
receive
(
:perform
)
described_class
.
notify_key_change
(
key
.
id
,
key
,
'create'
)
end
end
end
end
spec/requests/api/geo_spec.rb
View file @
e6757060
...
@@ -19,7 +19,7 @@ describe API::API, api: true do
...
@@ -19,7 +19,7 @@ describe API::API, api: true do
end
end
end
end
describe
'POST /geo/re
fresh_key
'
do
describe
'POST /geo/re
ceive_events
'
do
before
(
:each
)
{
allow_any_instance_of
(
::
Geo
::
ScheduleKeyChangeService
).
to
receive
(
:execute
)
}
before
(
:each
)
{
allow_any_instance_of
(
::
Geo
::
ScheduleKeyChangeService
).
to
receive
(
:execute
)
}
let
(
:key_create_payload
)
do
let
(
:key_create_payload
)
do
{
{
...
@@ -44,17 +44,17 @@ describe API::API, api: true do
...
@@ -44,17 +44,17 @@ describe API::API, api: true do
end
end
it
'enqueues on disk key creation if admin and correct params'
do
it
'enqueues on disk key creation if admin and correct params'
do
post
api
(
'/geo/re
fresh_key
'
,
admin
),
key_create_payload
post
api
(
'/geo/re
ceive_events
'
,
admin
),
key_create_payload
expect
(
response
.
status
).
to
eq
201
expect
(
response
.
status
).
to
eq
201
end
end
it
'enqueues on disk key removal if admin and correct params'
do
it
'enqueues on disk key removal if admin and correct params'
do
post
api
(
'/geo/re
fresh_key
'
,
admin
),
key_destroy_payload
post
api
(
'/geo/re
ceive_events
'
,
admin
),
key_destroy_payload
expect
(
response
.
status
).
to
eq
201
expect
(
response
.
status
).
to
eq
201
end
end
it
'denies access if not admin'
do
it
'denies access if not admin'
do
post
api
(
'/geo/re
fresh_key
'
,
user
)
post
api
(
'/geo/re
ceive_events
'
,
user
)
expect
(
response
.
status
).
to
eq
403
expect
(
response
.
status
).
to
eq
403
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