BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
d4d95ad3
Commit
d4d95ad3
authored
Apr 05, 2017
by
Sean McGivern
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'sh-fix-ssh-keys-with-spaces' into 'master'
Handle SSH keys that have multiple spaces between each marker See merge request !10466
parents
2316774d
54849afc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
1 deletion
+14
-1
sh-fix-ssh-keys-with-spaces.yml
changelogs/unreleased/sh-fix-ssh-keys-with-spaces.yml
+4
-0
shell.rb
lib/gitlab/shell.rb
+1
-1
shell_spec.rb
spec/lib/gitlab/backend/shell_spec.rb
+9
-0
No files found.
changelogs/unreleased/sh-fix-ssh-keys-with-spaces.yml
0 → 100644
View file @
d4d95ad3
---
title
:
Handle SSH keys that have multiple spaces between each marker
merge_request
:
author
:
lib/gitlab/shell.rb
View file @
d4d95ad3
...
...
@@ -35,7 +35,7 @@ module Gitlab
end
def
strip_key
(
key
)
key
.
split
(
/
/
)[
0
,
2
].
join
(
' '
)
key
.
split
(
/
[ ]+
/
)[
0
,
2
].
join
(
' '
)
end
private
...
...
spec/lib/gitlab/backend/shell_spec.rb
View file @
d4d95ad3
...
...
@@ -69,6 +69,15 @@ describe Gitlab::Shell, lib: true do
expect
(
io
).
to
have_received
(
:puts
).
with
(
"key-42
\t
ssh-rsa foo"
)
end
it
'handles multiple spaces in the key'
do
io
=
spy
(
:io
)
adder
=
described_class
.
new
(
io
)
adder
.
add_key
(
'key-42'
,
"ssh-rsa foo"
)
expect
(
io
).
to
have_received
(
:puts
).
with
(
"key-42
\t
ssh-rsa foo"
)
end
it
'raises an exception if the key contains a tab'
do
expect
do
described_class
.
new
(
StringIO
.
new
).
add_key
(
'key-42'
,
"ssh-rsa
\t
foobar"
)
...
...
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