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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '085bb6a99b3ae3f07cc5346ae968145952a4ccf14badc37c6407bc03bd3369e7'
4
- data.tar.gz: 19b28b9e8a20ce504bbf0c60c9a21eb3cf10ec5cd8230452863e12236db30eed
3
+ metadata.gz: 455f0e62f07bc41ac0ef70c79c622a3ae367bf1f73f3b903b63a8a7a7d29cef8
4
+ data.tar.gz: bc91912b9c30b81ce6f5afb615bb33d0f13f092dcdc20c3fa77ff2536167c421
5
5
  SHA512:
6
- metadata.gz: c1921cdb2c1ec54c84e4c812bb466c1825451e2d9043aeded6dd136a3d00772fbbc72f4a4d261dccc40dc231f904e216d35eb1ed4bd4c6636b99404f0ec2dee4
7
- data.tar.gz: fbc54e82f30e9d21f420b196e911da14d613bc5d3104ac9e00a9db6e1df95a2930cf1b2e7c4001c0105a685533f446f08f32befb992480bc8d436b1569311451
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
@@ -54,7 +54,11 @@ module Dependencies
54
54
  end
55
55
 
56
56
  def unencrypted_key
57
- Net::SSH::KeyFactory.load_private_key(priv_key_name, passphrase.empty? ? nil : passphrase)
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
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'ops_team'
5
- s.version = '1.20.1'
5
+ s.version = '1.20.2-rc1'
6
6
  s.authors = [
7
7
  'nickthecook@gmail.com'
8
8
  ]
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.1
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: '0'
255
+ version: 1.3.1
255
256
  requirements: []
256
257
  rubygems_version: 3.3.7
257
258
  signing_key: