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
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
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
18 additions
and
13 deletions
+18
-13
qa.rb
qa/qa.rb
+4
-1
rsa.rb
qa/qa/runtime/key/rsa.rb
+11
-9
add_deploy_key_spec.rb
qa/qa/specs/features/project/add_deploy_key_spec.rb
+1
-1
deploy_key_clone_spec.rb
qa/qa/specs/features/project/deploy_key_clone_spec.rb
+1
-1
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/
rsa_key
.rb
→
qa/qa/runtime/
key/rsa
.rb
View file @
9a538b9e
...
...
@@ -3,18 +3,20 @@ require 'forwardable'
module
QA
module
Runtime
class
RSAKey
extend
Forwardable
module
Key
class
RSA
extend
Forwardable
attr_reader
:key
def_delegators
:@key
,
:fingerprint
,
:to_pem
attr_reader
:key
def_delegators
:@key
,
:fingerprint
,
:to_pem
def
initialize
(
bits
=
4096
)
@key
=
OpenSSL
::
PKey
::
RSA
.
new
(
bits
)
end
def
initialize
(
bits
=
4096
)
@key
=
OpenSSL
::
PKey
::
RSA
.
new
(
bits
)
end
def
public_key
@public_key
||=
"
#{
key
.
ssh_type
}
#{
[
key
.
to_blob
].
pack
(
'm0'
)
}
"
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