Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-shell
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
0
Merge Requests
0
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-shell
Commits
2fb171c5
Commit
2fb171c5
authored
Jul 24, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make geo_node a default parameter
parent
f5591f68
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
10 additions
and
7 deletions
+10
-7
CHANGELOG
CHANGELOG
+3
-0
lib/gitlab_access_status.rb
lib/gitlab_access_status.rb
+1
-1
lib/gitlab_net.rb
lib/gitlab_net.rb
+1
-1
spec/gitlab_access_spec.rb
spec/gitlab_access_spec.rb
+2
-2
spec/gitlab_shell_spec.rb
spec/gitlab_shell_spec.rb
+3
-3
No files found.
CHANGELOG
View file @
2fb171c5
v5.5.0
- Support unhiding of all references for Geo nodes
v5.4.0
- Update Gitaly vendoring to use new RPC calls instead of old deprecated ones
...
...
lib/gitlab_access_status.rb
View file @
2fb171c5
...
...
@@ -3,7 +3,7 @@ require 'json'
class
GitAccessStatus
attr_reader
:message
,
:gl_repository
,
:repository_path
,
:gitaly
,
:geo_node
def
initialize
(
status
,
message
,
gl_repository
,
repository_path
,
gitaly
,
geo_node
)
def
initialize
(
status
,
message
,
gl_repository
,
repository_path
,
gitaly
,
geo_node
=
false
)
@status
=
status
@message
=
message
@gl_repository
=
gl_repository
...
...
lib/gitlab_net.rb
View file @
2fb171c5
...
...
@@ -39,7 +39,7 @@ class GitlabNet
if
resp
.
code
==
'200'
GitAccessStatus
.
create_from_json
(
resp
.
body
)
else
GitAccessStatus
.
new
(
false
,
'API is not accessible'
,
nil
,
nil
,
nil
,
false
)
GitAccessStatus
.
new
(
false
,
'API is not accessible'
,
nil
,
nil
,
nil
)
end
end
...
...
spec/gitlab_access_spec.rb
View file @
2fb171c5
...
...
@@ -7,7 +7,7 @@ describe GitlabAccess do
let
(
:repo_path
)
{
File
.
join
(
repository_path
,
repo_name
)
+
".git"
}
let
(
:api
)
do
double
(
GitlabNet
).
tap
do
|
api
|
api
.
stub
(
check_access:
GitAccessStatus
.
new
(
true
,
'ok'
,
'project-1'
,
'/home/git/repositories'
,
nil
,
false
))
api
.
stub
(
check_access:
GitAccessStatus
.
new
(
true
,
'ok'
,
'project-1'
,
'/home/git/repositories'
,
nil
))
end
end
subject
do
...
...
@@ -38,7 +38,7 @@ describe GitlabAccess do
context
"access is denied"
do
before
do
api
.
stub
(
check_access:
GitAccessStatus
.
new
(
false
,
'denied'
,
nil
,
nil
,
nil
,
false
))
api
.
stub
(
check_access:
GitAccessStatus
.
new
(
false
,
'denied'
,
nil
,
nil
,
nil
))
end
it
"returns false"
do
...
...
spec/gitlab_shell_spec.rb
View file @
2fb171c5
...
...
@@ -19,12 +19,12 @@ describe GitlabShell do
end
end
let
(
:gitaly_check_access
)
{
GitAccessStatus
.
new
(
true
,
'ok'
,
gl_repository
,
repo_path
,
{
'repository'
=>
{
'relative_path'
=>
repo_name
,
'storage_name'
=>
'default'
}
,
'address'
=>
'unix:gitaly.socket'
}
,
false
)
}
let
(
:gitaly_check_access
)
{
GitAccessStatus
.
new
(
true
,
'ok'
,
gl_repository
,
repo_path
,
{
'repository'
=>
{
'relative_path'
=>
repo_name
,
'storage_name'
=>
'default'
}
,
'address'
=>
'unix:gitaly.socket'
})
}
let
(
:api
)
do
double
(
GitlabNet
).
tap
do
|
api
|
api
.
stub
(
discover:
{
'name'
=>
'John Doe'
})
api
.
stub
(
check_access:
GitAccessStatus
.
new
(
true
,
'ok'
,
gl_repository
,
repo_path
,
nil
,
false
))
api
.
stub
(
check_access:
GitAccessStatus
.
new
(
true
,
'ok'
,
gl_repository
,
repo_path
,
nil
))
api
.
stub
(
two_factor_recovery_codes:
{
'success'
=>
true
,
'recovery_codes'
=>
[
'f67c514de60c4953'
,
'41278385fc00c1e0'
]
...
...
@@ -326,7 +326,7 @@ describe GitlabShell do
end
it
"should disallow access and log the attempt if check_access returns false status"
do
api
.
stub
(
check_access:
GitAccessStatus
.
new
(
false
,
'denied'
,
nil
,
nil
,
nil
,
false
))
api
.
stub
(
check_access:
GitAccessStatus
.
new
(
false
,
'denied'
,
nil
,
nil
,
nil
))
message
=
"gitlab-shell: Access denied for git command <git-upload-pack gitlab-ci.git> "
message
<<
"by user with key
#{
key_id
}
."
$logger
.
should_receive
(
:warn
).
with
(
message
)
...
...
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