Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
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
Boxiang Sun
gitlab-ce
Commits
ea28519f
Commit
ea28519f
authored
Feb 18, 2013
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2996 from raphendyr/ssh_fingerprint_fix
Ssh fingerprint fix
parents
97de6f85
c20be05a
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
4 deletions
+17
-4
app/models/key.rb
app/models/key.rb
+1
-1
features/steps/profile/profile_ssh_keys.rb
features/steps/profile/profile_ssh_keys.rb
+1
-1
spec/factories.rb
spec/factories.rb
+6
-0
spec/factories_spec.rb
spec/factories_spec.rb
+4
-1
spec/models/key_spec.rb
spec/models/key_spec.rb
+5
-1
No files found.
app/models/key.rb
View file @
ea28519f
...
@@ -45,7 +45,7 @@ class Key < ActiveRecord::Base
...
@@ -45,7 +45,7 @@ class Key < ActiveRecord::Base
file
.
close
file
.
close
file
.
unlink
# deletes the temp file
file
.
unlink
# deletes the temp file
end
end
errors
.
add
(
:key
,
"can't be fingerprinted"
)
if
fingerprint_output
.
match
(
"failed"
)
errors
.
add
(
:key
,
"can't be fingerprinted"
)
if
$?
.
exitstatus
!=
0
end
end
def
set_identifier
def
set_identifier
...
...
features/steps/profile/profile_ssh_keys.rb
View file @
ea28519f
...
@@ -43,6 +43,6 @@ class ProfileSshKeys < Spinach::FeatureSteps
...
@@ -43,6 +43,6 @@ class ProfileSshKeys < Spinach::FeatureSteps
end
end
And
'I have ssh key "ssh-rsa Work"'
do
And
'I have ssh key "ssh-rsa Work"'
do
create
(
:key
,
:user
=>
@user
,
:title
=>
"ssh-rsa Work"
,
:key
=>
"
jfKLJDFKSFJSHFJssh-rsa
Work"
)
create
(
:key
,
:user
=>
@user
,
:title
=>
"ssh-rsa Work"
,
:key
=>
"
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC+L3TbFegm3k8QjejSwemk4HhlRh+DuN679Pc5ckqE/MPhVtE/+kZQDYCTB284GiT2aIoGzmZ8ee9TkaoejAsBwlA+Wz2Q3vhz65X6sMgalRwpdJx8kSEUYV8ZPV3MZvPo8KdNg993o4jL6G36GDW4BPIyO6FPZhfsawdf6liVD0Xo5kibIK7B9VoE178cdLQtLpS2YolRwf5yy6XR6hbbBGQR+6xrGOdP16eGZDb1CE2bMvvJijjloFqPscGktWOqW+nfh5txwFfBzlfARDTBsS8WZtg3Yoj1kn33kPsWRlgHfNutFRAIynDuDdQzQq8tTtVwm+Yi75RfcPHW8y3P
Work"
)
end
end
end
end
spec/factories.rb
View file @
ea28519f
...
@@ -148,6 +148,12 @@ FactoryGirl.define do
...
@@ -148,6 +148,12 @@ FactoryGirl.define do
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa ++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
"ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAiPWx6WM4lhHNedGfBpPJNPpZ7yKu+dnn1SJejgt4596k6YjzGGphH2TUxwKzxcKDKKezwkpfnxPkSMkuEspGRt/aZZ9wa ++Oi7Qkr8prgHc4soW6NUlfDzpvZK2H5E7eQaSeP3SAwGmQKUFHCddNaP0L+hM7zhFNzjFvpaMgJw0="
end
end
end
end
factory
:invalid_key
do
key
do
"ssh-rsa this_is_invalid_key=="
end
end
end
end
factory
:milestone
do
factory
:milestone
do
...
...
spec/factories_spec.rb
View file @
ea28519f
require
'spec_helper'
require
'spec_helper'
INVALID_FACTORIES
=
[
:key_with_a_space_in_the_middle
]
INVALID_FACTORIES
=
[
:key_with_a_space_in_the_middle
,
:invalid_key
,
]
FactoryGirl
.
factories
.
map
(
&
:name
).
each
do
|
factory_name
|
FactoryGirl
.
factories
.
map
(
&
:name
).
each
do
|
factory_name
|
next
if
INVALID_FACTORIES
.
include?
(
factory_name
)
next
if
INVALID_FACTORIES
.
include?
(
factory_name
)
...
...
spec/models/key_spec.rb
View file @
ea28519f
...
@@ -73,8 +73,12 @@ describe Key do
...
@@ -73,8 +73,12 @@ describe Key do
build
(
:key
,
user:
user
).
should
be_valid
build
(
:key
,
user:
user
).
should
be_valid
end
end
it
"rejects the unfingerprintable key"
do
it
"rejects the unfingerprintable key
(contains space in middle)
"
do
build
(
:key_with_a_space_in_the_middle
).
should_not
be_valid
build
(
:key_with_a_space_in_the_middle
).
should_not
be_valid
end
end
it
"rejects the unfingerprintable key (not a key)"
do
build
(
:invalid_key
).
should_not
be_valid
end
end
end
end
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