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
e621b365
Commit
e621b365
authored
Jul 31, 2018
by
Ash McKenzie
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use full_key to highlight it's the full SSH key
parent
be5b38f5
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
10 deletions
+10
-10
bin/authorized_keys
bin/authorized_keys
+5
-5
bin/gitlab-keys
bin/gitlab-keys
+1
-1
bin/gitlab-shell-authorized-keys-check
bin/gitlab-shell-authorized-keys-check
+4
-4
No files found.
bin/authorized_keys
View file @
e621b365
...
...
@@ -10,16 +10,16 @@
# command="/bin/gitlab-shell key-#",no-port-forwarding,no-X11-forwarding,no-agent-forwarding,no-pty ssh-rsa AAAAB3NzaC1yc2EAAAADAQA...
#
key
=
ARGV
[
0
]
abort
"# No key provided"
if
key
.
nil?
||
key
.
empty?
full_
key
=
ARGV
[
0
]
abort
"# No key provided"
if
full_key
.
nil?
||
full_
key
.
empty?
require_relative
"../lib/gitlab_init"
require_relative
"../lib/gitlab_net"
require_relative
"../lib/gitlab_keys"
authorized_key
=
GitlabNet
.
new
.
authorized_key
(
key
)
authorized_key
=
GitlabNet
.
new
.
authorized_key
(
full_
key
)
if
authorized_key
.
nil?
puts
"# No key was found for
#{
key
}
"
puts
"# No key was found for
#{
full_
key
}
"
else
puts
GitlabKeys
.
key_line
(
"key-
#{
authorized_key
[
'id'
]
}
"
,
authorized_key
[
"key"
])
puts
GitlabKeys
.
key_line
(
"key-
#{
authorized_key
[
'id'
]
}
"
,
authorized_key
[
'key'
])
end
bin/gitlab-keys
View file @
e621b365
...
...
@@ -13,7 +13,7 @@ require_relative '../lib/gitlab_init'
# /bin/gitlab-keys rm-key key-23 "ssh-rsa AAAAx321..."
#
# /bin/gitlab-keys list-keys
#
#
# /bin/gitlab-keys clear
#
...
...
bin/gitlab-shell-authorized-keys-check
View file @
e621b365
...
...
@@ -27,16 +27,16 @@ abort '# No username provided' if actual_username.nil? || actual_username == ''
# Normally, these would both be 'git', but it can be configured by the user
exit
0
unless
expected_username
==
actual_username
key
=
ARGV
[
2
]
abort
"# No key provided"
if
key
.
nil?
||
key
==
''
full_
key
=
ARGV
[
2
]
abort
"# No key provided"
if
full_key
.
nil?
||
full_
key
==
''
require_relative
'../lib/gitlab_init'
require_relative
'../lib/gitlab_net'
require_relative
'../lib/gitlab_keys'
authorized_key
=
GitlabNet
.
new
.
authorized_key
(
key
)
authorized_key
=
GitlabNet
.
new
.
authorized_key
(
full_
key
)
if
authorized_key
.
nil?
puts
"# No key was found for
#{
key
}
"
puts
"# No key was found for
#{
full_
key
}
"
else
puts
GitlabKeys
.
key_line
(
"key-
#{
authorized_key
[
'id'
]
}
"
,
authorized_key
[
'key'
])
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