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
085fce8d
Commit
085fce8d
authored
Feb 20, 2019
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Addressing review comments. Added tests and some style changes
parent
77faae49
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
ee/lib/gitlab/geo/git_push_ssh_proxy.rb
ee/lib/gitlab/geo/git_push_ssh_proxy.rb
+1
-1
ee/spec/lib/gitlab/geo/git_push_ssh_proxy_spec.rb
ee/spec/lib/gitlab/geo/git_push_ssh_proxy_spec.rb
+7
-1
No files found.
ee/lib/gitlab/geo/git_push_ssh_proxy.rb
View file @
085fce8d
...
@@ -110,7 +110,7 @@ module Gitlab
...
@@ -110,7 +110,7 @@ module Gitlab
end
end
def
auth_scope
def
auth_scope
URI
.
parse
(
primary_repo
).
path
.
gsub
(
/(^\/|\.git$)/
,
''
)
URI
.
parse
(
primary_repo
).
path
.
gsub
(
%r{^
\/
|
\.
git$}
,
''
)
end
end
def
get
(
url
,
headers
)
def
get
(
url
,
headers
)
...
...
ee/spec/lib/gitlab/geo/git_push_ssh_proxy_spec.rb
View file @
085fce8d
...
@@ -70,11 +70,17 @@ describe Gitlab::Geo::GitPushSSHProxy, :geo do
...
@@ -70,11 +70,17 @@ describe Gitlab::Geo::GitPushSSHProxy, :geo do
let
(
:info_refs_http_body_full
)
{
"001f# service=git-receive-pack
\n
0000
#{
info_refs_body_short
}
"
}
let
(
:info_refs_http_body_full
)
{
"001f# service=git-receive-pack
\n
0000
#{
info_refs_body_short
}
"
}
context
'authorization header is scoped'
do
context
'authorization header is scoped'
do
it
'
returns a Gitlab::Geo::GitPushSSHProxy::APIResponse
'
do
it
'
passes the scope when .info_refs is called
'
do
expect
(
Gitlab
::
Geo
::
BaseRequest
).
to
receive
(
:new
).
with
(
scope:
project
.
repository
.
full_path
)
expect
(
Gitlab
::
Geo
::
BaseRequest
).
to
receive
(
:new
).
with
(
scope:
project
.
repository
.
full_path
)
subject
.
info_refs
subject
.
info_refs
end
end
it
'passes the scope when .push is called'
do
expect
(
Gitlab
::
Geo
::
BaseRequest
).
to
receive
(
:new
).
with
(
scope:
project
.
repository
.
full_path
)
subject
.
push
(
info_refs_body_short
)
end
end
end
context
'with a failed response'
do
context
'with a failed response'
do
...
...
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