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
5ef06ac7
Commit
5ef06ac7
authored
Jul 26, 2018
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move GL_PROTOCOL into GitlabNet
parent
724d7c2f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
lib/gitlab_net.rb
lib/gitlab_net.rb
+1
-0
lib/gitlab_shell.rb
lib/gitlab_shell.rb
+2
-3
No files found.
lib/gitlab_net.rb
View file @
5ef06ac7
...
...
@@ -16,6 +16,7 @@ class GitlabNet # rubocop:disable Metrics/ClassLength
class
NotFound
<
StandardError
;
end
CHECK_TIMEOUT
=
5
GL_PROTOCOL
=
'ssh'
.
freeze
def
check_access
(
cmd
,
gl_repository
,
repo
,
actor
,
changes
,
protocol
,
env:
{})
changes
=
changes
.
join
(
"
\n
"
)
unless
changes
.
is_a?
(
String
)
...
...
lib/gitlab_shell.rb
View file @
5ef06ac7
...
...
@@ -16,7 +16,6 @@ class GitlabShell # rubocop:disable Metrics/ClassLength
'git-receive-pack'
=>
File
.
join
(
ROOT_PATH
,
'bin'
,
'gitaly-receive-pack'
)
}.
freeze
API_COMMANDS
=
%w(2fa_recovery_codes)
.
freeze
GL_PROTOCOL
=
'ssh'
.
freeze
attr_accessor
:key_id
,
:gl_repository
,
:repo_name
,
:command
,
:git_access
attr_reader
:repo_path
...
...
@@ -101,7 +100,7 @@ class GitlabShell # rubocop:disable Metrics/ClassLength
end
def
verify_access
status
=
api
.
check_access
(
@git_access
,
nil
,
@repo_name
,
@key_id
,
'_any'
,
GL_PROTOCOL
)
status
=
api
.
check_access
(
@git_access
,
nil
,
@repo_name
,
@key_id
,
'_any'
,
G
itlabNet
::
G
L_PROTOCOL
)
raise
AccessDeniedError
,
status
.
message
unless
status
.
allowed?
...
...
@@ -162,7 +161,7 @@ class GitlabShell # rubocop:disable Metrics/ClassLength
'LD_LIBRARY_PATH'
=>
ENV
[
'LD_LIBRARY_PATH'
],
'LANG'
=>
ENV
[
'LANG'
],
'GL_ID'
=>
@key_id
,
'GL_PROTOCOL'
=>
GL_PROTOCOL
,
'GL_PROTOCOL'
=>
G
itlabNet
::
G
L_PROTOCOL
,
'GL_REPOSITORY'
=>
@gl_repository
,
'GL_USERNAME'
=>
@username
}
...
...
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