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
Léo-Paul Géneau
gitlab-ce
Commits
9a538b9e
Commit
9a538b9e
authored
Mar 09, 2018
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Introduce Key namespace so we could put more keys
parent
8230b774
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
25 deletions
+30
-25
qa/qa.rb
qa/qa.rb
+4
-1
qa/qa/runtime/key/rsa.rb
qa/qa/runtime/key/rsa.rb
+23
-0
qa/qa/runtime/rsa_key.rb
qa/qa/runtime/rsa_key.rb
+0
-21
qa/qa/specs/features/project/add_deploy_key_spec.rb
qa/qa/specs/features/project/add_deploy_key_spec.rb
+1
-1
qa/qa/specs/features/project/deploy_key_clone_spec.rb
qa/qa/specs/features/project/deploy_key_clone_spec.rb
+1
-1
qa/spec/runtime/key/rsa_spec.rb
qa/spec/runtime/key/rsa_spec.rb
+1
-1
No files found.
qa/qa.rb
View file @
9a538b9e
...
...
@@ -11,9 +11,12 @@ module QA
autoload
:Scenario
,
'qa/runtime/scenario'
autoload
:Browser
,
'qa/runtime/browser'
autoload
:Env
,
'qa/runtime/env'
autoload
:RSAKey
,
'qa/runtime/rsa_key'
autoload
:Address
,
'qa/runtime/address'
autoload
:API
,
'qa/runtime/api'
module
Key
autoload
:RSA
,
'qa/runtime/key/rsa'
end
end
##
...
...
qa/qa/runtime/key/rsa.rb
0 → 100644
View file @
9a538b9e
require
'net/ssh'
require
'forwardable'
module
QA
module
Runtime
module
Key
class
RSA
extend
Forwardable
attr_reader
:key
def_delegators
:@key
,
:fingerprint
,
:to_pem
def
initialize
(
bits
=
4096
)
@key
=
OpenSSL
::
PKey
::
RSA
.
new
(
bits
)
end
def
public_key
@public_key
||=
"
#{
key
.
ssh_type
}
#{
[
key
.
to_blob
].
pack
(
'm0'
)
}
"
end
end
end
end
end
qa/qa/runtime/rsa_key.rb
deleted
100644 → 0
View file @
8230b774
require
'net/ssh'
require
'forwardable'
module
QA
module
Runtime
class
RSAKey
extend
Forwardable
attr_reader
:key
def_delegators
:@key
,
:fingerprint
,
:to_pem
def
initialize
(
bits
=
4096
)
@key
=
OpenSSL
::
PKey
::
RSA
.
new
(
bits
)
end
def
public_key
@public_key
||=
"
#{
key
.
ssh_type
}
#{
[
key
.
to_blob
].
pack
(
'm0'
)
}
"
end
end
end
end
qa/qa/specs/features/project/add_deploy_key_spec.rb
View file @
9a538b9e
...
...
@@ -4,7 +4,7 @@ module QA
Runtime
::
Browser
.
visit
(
:gitlab
,
Page
::
Main
::
Login
)
Page
::
Main
::
Login
.
act
{
sign_in_using_credentials
}
key
=
Runtime
::
RSAKey
.
new
key
=
Runtime
::
Key
::
RSA
.
new
deploy_key_title
=
'deploy key title'
deploy_key_value
=
key
.
public_key
...
...
qa/qa/specs/features/project/deploy_key_clone_spec.rb
View file @
9a538b9e
...
...
@@ -3,7 +3,7 @@ require 'digest/sha1'
module
QA
feature
'cloning code using a deploy key'
,
:core
,
:docker
do
let
(
:runner_name
)
{
"qa-runner-
#{
Time
.
now
.
to_i
}
"
}
let
(
:key
)
{
Runtime
::
RSAKey
.
new
}
let
(
:key
)
{
Runtime
::
Key
::
RSA
.
new
}
given
(
:project
)
do
Factory
::
Resource
::
Project
.
fabricate!
do
|
resource
|
...
...
qa/spec/runtime/
rsa_key
.rb
→
qa/spec/runtime/
key/rsa_spec
.rb
View file @
9a538b9e
describe
QA
::
Runtime
::
RSAKey
do
describe
QA
::
Runtime
::
Key
::
RSA
do
describe
'#public_key'
do
subject
{
described_class
.
new
.
public_key
}
...
...
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