ops_team 1.20.1 → 1.20.2.pre.rc1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dependencies/helpers/ssh_key_decryptor.rb +37 -0
- data/lib/dependencies/sshkey.rb +5 -1
- data/ops_team.gemspec +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 455f0e62f07bc41ac0ef70c79c622a3ae367bf1f73f3b903b63a8a7a7d29cef8
|
4
|
+
data.tar.gz: bc91912b9c30b81ce6f5afb615bb33d0f13f092dcdc20c3fa77ff2536167c421
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b7ff635a4f099ef8ec0bea62b5ae18027520d6d45f9ce94807979741d5c73588dcd635165330fc771921a26a6068f57f8cf56802f457a78938cd780b37d3cc6
|
7
|
+
data.tar.gz: 6eabc65621b9e6e8fc2102a9eff392e1b1347e07e886c6142603de55aa7e610ff1099525cb19895db8901555a6e4fc56d05b69a6f3dc146e79c0ffff5c5cf963
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "tempfile"
|
4
|
+
|
5
|
+
module Dependencies
|
6
|
+
module Helpers
|
7
|
+
class SshKeyDecryptor
|
8
|
+
def initialize(source_key_path, passphrase)
|
9
|
+
@source_key_path = source_key_path
|
10
|
+
@passphrase = passphrase
|
11
|
+
end
|
12
|
+
|
13
|
+
def plaintext_key
|
14
|
+
@plaintext_key ||= begin
|
15
|
+
plaintext = decrypt_key
|
16
|
+
|
17
|
+
File.delete(temp_key_file.path)
|
18
|
+
|
19
|
+
plaintext
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def temp_key_file
|
26
|
+
@temp_key_file ||= Tempfile.new("ops")
|
27
|
+
end
|
28
|
+
|
29
|
+
def decrypt_key
|
30
|
+
FileUtils.cp(@source_key_path, temp_key_file.path)
|
31
|
+
`ssh-keygen -f '#{temp_key_file.path}' -p -P '#{@passphrase}' </dev/null`
|
32
|
+
|
33
|
+
File.read(temp_key_file.path)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
data/lib/dependencies/sshkey.rb
CHANGED
@@ -54,7 +54,11 @@ module Dependencies
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def unencrypted_key
|
57
|
-
Net::SSH::KeyFactory.
|
57
|
+
Net::SSH::KeyFactory.load_data_private_key(decryptor.plaintext_key, nil)
|
58
|
+
end
|
59
|
+
|
60
|
+
def decryptor
|
61
|
+
@decryptor ||= Helpers::SshKeyDecryptor.new(priv_key_name, passphrase)
|
58
62
|
end
|
59
63
|
|
60
64
|
def key_comment
|
data/ops_team.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ops_team
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.20.
|
4
|
+
version: 1.20.2.pre.rc1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- nickthecook@gmail.com
|
@@ -215,6 +215,7 @@ files:
|
|
215
215
|
- lib/dependencies/docker.rb
|
216
216
|
- lib/dependencies/gem.rb
|
217
217
|
- lib/dependencies/helpers/apt_cache_policy.rb
|
218
|
+
- lib/dependencies/helpers/ssh_key_decryptor.rb
|
218
219
|
- lib/dependencies/pip.rb
|
219
220
|
- lib/dependencies/snap.rb
|
220
221
|
- lib/dependencies/sshkey.rb
|
@@ -249,9 +250,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
249
250
|
version: '2.5'
|
250
251
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
251
252
|
requirements:
|
252
|
-
- - "
|
253
|
+
- - ">"
|
253
254
|
- !ruby/object:Gem::Version
|
254
|
-
version:
|
255
|
+
version: 1.3.1
|
255
256
|
requirements: []
|
256
257
|
rubygems_version: 3.3.7
|
257
258
|
signing_key:
|