hiera-eyaml-cli 0.1 → 0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +3 -0
- data/lib/hiera/backend/eyaml/encryptors/cli.rb +22 -2
- data/lib/hiera/backend/eyaml/encryptors/cli/version.rb +11 -0
- metadata +3 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 991556c46821c35532265701859a6edfb8362e298c93a28c035fb2b4b2e1baf8
|
4
|
+
data.tar.gz: dac9fa2afbce6fdcb2cf21a0e31cda4364ee9994e8d29bb307ce2f1ac9f16aa9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d45fd488d535621545ee1c1f295d6c740b35d8ddc7ead123417f071d469b428dc0b97c0abd46a514acec9f28c26f98801dbba66b03b9c35846cacd29be76c3ba
|
7
|
+
data.tar.gz: 7459500daad9cc90063712c2652929328946efaa857a7a907aea1021f58e237ebef9fbe0f66447c7bad2e24b3444c97f1d14ee6e833c072adad649cb24d634b1
|
data/README.md
ADDED
@@ -15,6 +15,10 @@ class Hiera
|
|
15
15
|
decrypt_command: {
|
16
16
|
desc: 'Command to run to decrypt data (takes data on stdin)',
|
17
17
|
type: :string
|
18
|
+
},
|
19
|
+
stderr: {
|
20
|
+
desc: 'Capture stderr on command output',
|
21
|
+
type: :bool
|
18
22
|
}
|
19
23
|
}
|
20
24
|
|
@@ -35,8 +39,20 @@ class Hiera
|
|
35
39
|
decrypt_command
|
36
40
|
end
|
37
41
|
|
42
|
+
def self.stderr
|
43
|
+
stderr = option :stderr
|
44
|
+
if stderr.nil? || stderr.empty?
|
45
|
+
stderr = false
|
46
|
+
end
|
47
|
+
stderr
|
48
|
+
end
|
49
|
+
|
38
50
|
def self.encrypt(plaintext)
|
39
|
-
|
51
|
+
if self.stderr
|
52
|
+
out, status = Open3.capture2(self.encrypt_command, :stdin_data=>plaintext)
|
53
|
+
else
|
54
|
+
out, err, status = Open3.capture3(self.encrypt_command, :stdin_data=>plaintext)
|
55
|
+
end
|
40
56
|
if status != 0
|
41
57
|
raise 'Call to encrypt subcommand failed'
|
42
58
|
end
|
@@ -44,7 +60,11 @@ class Hiera
|
|
44
60
|
end
|
45
61
|
|
46
62
|
def self.decrypt(ciphertext)
|
47
|
-
|
63
|
+
if self.stderr
|
64
|
+
out, status = Open3.capture2(self.decrypt_command, :stdin_data=>ciphertext)
|
65
|
+
else
|
66
|
+
out, err, status = Open3.capture3(self.decrypt_command, :stdin_data=>ciphertext)
|
67
|
+
end
|
48
68
|
if status != 0
|
49
69
|
raise 'Call to decrypt subcommand failed'
|
50
70
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiera-eyaml-cli
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: '0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan Smith
|
@@ -34,9 +34,11 @@ files:
|
|
34
34
|
- ".rubocop.yml"
|
35
35
|
- Gemfile
|
36
36
|
- LICENSE
|
37
|
+
- README.md
|
37
38
|
- hiera-eyaml-cli.gemspec
|
38
39
|
- lib/hiera/backend/eyaml/encryptors/cli.rb
|
39
40
|
- lib/hiera/backend/eyaml/encryptors/cli/eyaml_init.rb
|
41
|
+
- lib/hiera/backend/eyaml/encryptors/cli/version.rb
|
40
42
|
homepage: http://github.com/ethanhs/hiera-eyaml-cli
|
41
43
|
licenses:
|
42
44
|
- MIT
|