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
a5466229
Commit
a5466229
authored
Aug 30, 2019
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Geo: Fixes to Registry Replication feature
parent
7452537a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
10 deletions
+2
-10
ee/lib/api/container_registry_event.rb
ee/lib/api/container_registry_event.rb
+1
-2
ee/spec/requests/api/container_registry_event_spec.rb
ee/spec/requests/api/container_registry_event_spec.rb
+1
-8
No files found.
ee/lib/api/container_registry_event.rb
View file @
a5466229
...
...
@@ -9,8 +9,7 @@ module API
resource
:container_registry_event
do
helpers
do
def
authenticate_registry_notification!
endpoint
=
Gitlab
.
config
.
registry
.
notifications
.
find
{
|
e
|
e
[
'name'
]
==
'geo_event'
}
secret_token
=
endpoint
[
'headers'
][
'Authorization'
]
secret_token
=
Gitlab
.
config
.
registry
.
notification_secret
unauthorized!
unless
Devise
.
secure_compare
(
secret_token
,
headers
[
'Authorization'
])
end
...
...
ee/spec/requests/api/container_registry_event_spec.rb
View file @
a5466229
...
...
@@ -9,10 +9,7 @@ describe API::ContainerRegistryEvent do
describe
'POST /container_registry_event/events'
do
before
do
stub_registry_endpoints_configuration
([{
name:
'geo_event'
,
headers:
{
'Authorization'
=>
secret_token
}
}.
with_indifferent_access
])
allow
(
Gitlab
.
config
.
registry
).
to
receive
(
:notification_secret
)
{
secret_token
}
end
it
'returns 200 status and events are passed to event handler'
do
...
...
@@ -34,9 +31,5 @@ describe API::ContainerRegistryEvent do
expect
(
response
.
status
).
to
eq
401
end
def
stub_registry_endpoints_configuration
(
configuration
)
allow
(
Gitlab
.
config
.
registry
).
to
receive
(
:notifications
)
{
configuration
}
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