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
a613dbc7
Commit
a613dbc7
authored
Dec 21, 2018
by
Jacob Vosmaer
Committed by
Douwe Maan
Dec 21, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make better use of constants in lib/gitlab_shell.rb
parent
03e66710
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
lib/gitlab_shell.rb
lib/gitlab_shell.rb
+5
-5
No files found.
lib/gitlab_shell.rb
View file @
a613dbc7
...
...
@@ -23,8 +23,8 @@ class GitlabShell # rubocop:disable Metrics/ClassLength
GIT_RECEIVE_PACK_COMMAND
=>
File
.
join
(
ROOT_PATH
,
'bin'
,
'gitaly-receive-pack'
)
}.
freeze
GIT_COMMANDS
=
(
GITALY_COMMANDS
.
keys
+
[
'git-lfs-authenticate'
]).
freeze
API_COMMANDS
=
%w(2fa_recovery_codes)
.
freeze
GIT_COMMANDS
=
(
GITALY_COMMANDS
.
keys
+
[
GIT_LFS_AUTHENTICATE_COMMAND
]).
freeze
TWO_FACTOR_RECOVERY_COMMAND
=
'2fa_recovery_codes'
GL_PROTOCOL
=
'ssh'
attr_accessor
:gl_id
,
:gl_repository
,
:repo_name
,
:command
,
:git_access
,
:git_protocol
...
...
@@ -114,7 +114,7 @@ class GitlabShell # rubocop:disable Metrics/ClassLength
@git_access
=
@command
return
args
if
API_COMMANDS
.
include?
(
@command
)
return
args
if
TWO_FACTOR_RECOVERY_COMMAND
==
@command
raise
DisallowedCommandError
unless
GIT_COMMANDS
.
include?
(
@command
)
...
...
@@ -151,9 +151,9 @@ class GitlabShell # rubocop:disable Metrics/ClassLength
end
def
process_cmd
(
args
)
return
send
(
"api_
#{
@command
}
"
)
if
API_COMMANDS
.
include?
(
@command
)
return
api_2fa_recovery_codes
if
TWO_FACTOR_RECOVERY_COMMAND
==
@command
if
@command
==
'git-lfs-authenticate'
if
@command
==
GIT_LFS_AUTHENTICATE_COMMAND
GitlabMetrics
.
measure
(
'lfs-authenticate'
)
do
operation
=
args
[
2
]
$logger
.
info
(
'Processing LFS authentication'
,
operation:
operation
,
user:
log_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