hiera-eyaml 1.3.1 → 1.3.2
Sign up to get free protection for your applications and to get access to all the features.
- data/hiera-eyaml.gemspec +1 -1
- data/lib/hiera/backend/eyaml.rb +1 -1
- data/lib/hiera/backend/eyaml/CLI.rb +1 -0
- data/lib/hiera/backend/eyaml/actions/encrypt_action.rb +18 -8
- data/lib/hiera/backend/eyaml/encryptors/pkcs7.rb +3 -1
- data/lib/hiera/backend/eyaml/utils.rb +5 -2
- data/lib/hiera/backend/eyaml_backend.rb +2 -2
- metadata +3 -55
- data/features/decrypts.feature +0 -44
- data/features/edit.feature +0 -54
- data/features/encrypts.feature +0 -26
- data/features/keys.feature +0 -13
- data/features/outputs.feature +0 -30
- data/features/plugin.feature +0 -35
- data/features/plugin_api.feature +0 -16
- data/features/puppet.feature +0 -15
- data/features/sandbox/convert_decrypted_values_to_uppercase.sh +0 -2
- data/features/sandbox/keys/private_key.pkcs7.pem +0 -27
- data/features/sandbox/keys/public_key.pkcs7.pem +0 -18
- data/features/sandbox/pipe_string.sh +0 -5
- data/features/sandbox/puppet/environments/local/test.eyaml +0 -3
- data/features/sandbox/puppet/hiera.yaml +0 -17
- data/features/sandbox/puppet/manifests/init.pp +0 -3
- data/features/sandbox/puppet/modules/test/manifests/init.pp +0 -18
- data/features/sandbox/puppet/puppet.conf +0 -6
- data/features/sandbox/supply_password.sh +0 -7
- data/features/sandbox/test_input.bin +0 -0
- data/features/sandbox/test_input.encrypted.txt +0 -1
- data/features/sandbox/test_input.txt +0 -3
- data/features/sandbox/test_input.yaml +0 -114
- data/features/step_definitions/environment_overrides.rb +0 -3
- data/features/support/env.rb +0 -26
- data/features/support/setup_sandbox.rb +0 -21
- data/features/valid_encryption.feature +0 -12
data/hiera-eyaml.gemspec
CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |gem|
|
|
12
12
|
gem.license = "MIT"
|
13
13
|
|
14
14
|
gem.homepage = "http://github.com/TomPoulton/hiera-eyaml"
|
15
|
-
gem.files = `git ls-files`.split($/)
|
15
|
+
gem.files = `git ls-files`.split($/).reject { |file| file =~ /^features.*$/ }
|
16
16
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
17
17
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
18
18
|
gem.require_paths = ["lib"]
|
data/lib/hiera/backend/eyaml.rb
CHANGED
@@ -43,6 +43,7 @@ Options:
|
|
43
43
|
opt :stdin, "Source input it taken from stdin", :short => 'z'
|
44
44
|
opt :encrypt_method, "Override default encryption and decryption method (default is PKCS7)", :short => 'n', :default => "pkcs7"
|
45
45
|
opt :output, "Output format of final result (examples, block, string)", :type => :string, :default => "examples"
|
46
|
+
opt :label, "Apply a label to the encrypted result", :short => 'l', :type => :string
|
46
47
|
|
47
48
|
Hiera::Backend::Eyaml::Plugins.options.each do |name, option|
|
48
49
|
opt name, option[:desc], :type => option[:type], :short => option[:short], :default => option[:default]
|
@@ -39,7 +39,7 @@ class Hiera
|
|
39
39
|
"ENC[#{encryptor.tag},#{ciphertext}]"
|
40
40
|
end
|
41
41
|
|
42
|
-
self.format :data => output_data, :structure => Eyaml::Options[:output]
|
42
|
+
self.format :data => output_data, :structure => Eyaml::Options[:output], :label => Eyaml::Options[:label]
|
43
43
|
|
44
44
|
end
|
45
45
|
|
@@ -50,22 +50,32 @@ class Hiera
|
|
50
50
|
regex_result.split("::").last
|
51
51
|
end
|
52
52
|
|
53
|
+
def self.format_string data, label
|
54
|
+
data_as_string = data.split("\n").join("")
|
55
|
+
prefix = label ? "#{label}: " : ''
|
56
|
+
prefix + data_as_string
|
57
|
+
end
|
58
|
+
|
59
|
+
def self.format_block data, label
|
60
|
+
data_as_block = data.split("\n").join("\n ")
|
61
|
+
prefix = label ? "#{label}: >\n" : ''
|
62
|
+
prefix + " #{data_as_block}"
|
63
|
+
end
|
64
|
+
|
53
65
|
def self.format args
|
54
66
|
data = args[:data]
|
55
|
-
data_as_block = data.split("\n").join("\n ")
|
56
|
-
data_as_string = data.split("\n").join("")
|
57
67
|
structure = args[:structure]
|
68
|
+
label = args[:label]
|
58
69
|
|
59
70
|
case structure
|
60
71
|
when "examples"
|
61
|
-
|
72
|
+
self.format_string(data, label || 'string') + "\n\n" +
|
62
73
|
"OR\n\n" +
|
63
|
-
|
64
|
-
" #{data_as_block}"
|
74
|
+
self.format_block(data, label || 'block')
|
65
75
|
when "block"
|
66
|
-
|
76
|
+
self.format_block data, label
|
67
77
|
when "string"
|
68
|
-
|
78
|
+
self.format_string data, label
|
69
79
|
else
|
70
80
|
data.to_s
|
71
81
|
end
|
@@ -61,7 +61,8 @@ class Hiera
|
|
61
61
|
private_key = self.option :private_key
|
62
62
|
|
63
63
|
key = OpenSSL::PKey::RSA.new(2048)
|
64
|
-
Utils.
|
64
|
+
Utils.ensure_key_dir_exists private_key
|
65
|
+
Utils.write_important_file :filename => private_key, :content => key.to_pem, :mode => 0600
|
65
66
|
|
66
67
|
name = OpenSSL::X509::Name.parse("/")
|
67
68
|
cert = OpenSSL::X509::Certificate.new()
|
@@ -83,6 +84,7 @@ class Hiera
|
|
83
84
|
|
84
85
|
cert.sign key, OpenSSL::Digest::SHA1.new
|
85
86
|
|
87
|
+
Utils.ensure_key_dir_exists public_key
|
86
88
|
Utils.write_important_file :filename => public_key, :content => cert.to_pem
|
87
89
|
puts "Keys created OK"
|
88
90
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'highline/import'
|
2
2
|
require 'tempfile'
|
3
|
+
require 'fileutils'
|
3
4
|
|
4
5
|
class Hiera
|
5
6
|
module Backend
|
@@ -39,7 +40,7 @@ class Hiera
|
|
39
40
|
num_bytes.times { file.print(byte.chr) }
|
40
41
|
file.fsync
|
41
42
|
end
|
42
|
-
File.delete file
|
43
|
+
File.delete args[:file]
|
43
44
|
end
|
44
45
|
|
45
46
|
def self.write_tempfile data_to_write
|
@@ -55,12 +56,14 @@ class Hiera
|
|
55
56
|
def self.write_important_file args
|
56
57
|
filename = args[ :filename ]
|
57
58
|
content = args[ :content ]
|
59
|
+
mode = args[ :mode ]
|
58
60
|
if File.file? "#{filename}"
|
59
61
|
raise StandardError, "User aborted" unless Utils::confirm? "Are you sure you want to overwrite \"#{filename}\"?"
|
60
62
|
end
|
61
63
|
open( "#{filename}", "w" ) do |io|
|
62
64
|
io.write(content)
|
63
65
|
end
|
66
|
+
File.chmod( mode, filename ) unless mode.nil?
|
64
67
|
end
|
65
68
|
|
66
69
|
def self.ensure_key_dir_exists key_file
|
@@ -68,7 +71,7 @@ class Hiera
|
|
68
71
|
|
69
72
|
unless File.directory? key_dir
|
70
73
|
begin
|
71
|
-
|
74
|
+
FileUtils.mkdir_p key_dir
|
72
75
|
puts "Created key directory: #{key_dir}"
|
73
76
|
rescue
|
74
77
|
raise StandardError, "Cannot create key directory: #{key_dir}"
|
@@ -65,13 +65,13 @@ class Hiera
|
|
65
65
|
elsif data.is_a?(Hash)
|
66
66
|
answer = {}
|
67
67
|
data.each_pair do |key, val|
|
68
|
-
answer[key] = parse_answer(val, scope, extra_data)
|
68
|
+
answer[key] = parse_answer(key, val, scope, extra_data)
|
69
69
|
end
|
70
70
|
answer
|
71
71
|
elsif data.is_a?(Array)
|
72
72
|
answer = []
|
73
73
|
data.each do |item|
|
74
|
-
answer << parse_answer(item, scope, extra_data)
|
74
|
+
answer << parse_answer(key, item, scope, extra_data)
|
75
75
|
end
|
76
76
|
answer
|
77
77
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hiera-eyaml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-20 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: trollop
|
@@ -58,32 +58,6 @@ files:
|
|
58
58
|
- README.md
|
59
59
|
- Rakefile
|
60
60
|
- bin/eyaml
|
61
|
-
- features/decrypts.feature
|
62
|
-
- features/edit.feature
|
63
|
-
- features/encrypts.feature
|
64
|
-
- features/keys.feature
|
65
|
-
- features/outputs.feature
|
66
|
-
- features/plugin.feature
|
67
|
-
- features/plugin_api.feature
|
68
|
-
- features/puppet.feature
|
69
|
-
- features/sandbox/convert_decrypted_values_to_uppercase.sh
|
70
|
-
- features/sandbox/keys/private_key.pkcs7.pem
|
71
|
-
- features/sandbox/keys/public_key.pkcs7.pem
|
72
|
-
- features/sandbox/pipe_string.sh
|
73
|
-
- features/sandbox/puppet/environments/local/test.eyaml
|
74
|
-
- features/sandbox/puppet/hiera.yaml
|
75
|
-
- features/sandbox/puppet/manifests/init.pp
|
76
|
-
- features/sandbox/puppet/modules/test/manifests/init.pp
|
77
|
-
- features/sandbox/puppet/puppet.conf
|
78
|
-
- features/sandbox/supply_password.sh
|
79
|
-
- features/sandbox/test_input.bin
|
80
|
-
- features/sandbox/test_input.encrypted.txt
|
81
|
-
- features/sandbox/test_input.txt
|
82
|
-
- features/sandbox/test_input.yaml
|
83
|
-
- features/step_definitions/environment_overrides.rb
|
84
|
-
- features/support/env.rb
|
85
|
-
- features/support/setup_sandbox.rb
|
86
|
-
- features/valid_encryption.feature
|
87
61
|
- hiera-eyaml.gemspec
|
88
62
|
- lib/hiera/backend/eyaml.rb
|
89
63
|
- lib/hiera/backend/eyaml/CLI.rb
|
@@ -126,30 +100,4 @@ rubygems_version: 1.8.25
|
|
126
100
|
signing_key:
|
127
101
|
specification_version: 3
|
128
102
|
summary: OpenSSL Encryption backend for Hiera
|
129
|
-
test_files:
|
130
|
-
- features/decrypts.feature
|
131
|
-
- features/edit.feature
|
132
|
-
- features/encrypts.feature
|
133
|
-
- features/keys.feature
|
134
|
-
- features/outputs.feature
|
135
|
-
- features/plugin.feature
|
136
|
-
- features/plugin_api.feature
|
137
|
-
- features/puppet.feature
|
138
|
-
- features/sandbox/convert_decrypted_values_to_uppercase.sh
|
139
|
-
- features/sandbox/keys/private_key.pkcs7.pem
|
140
|
-
- features/sandbox/keys/public_key.pkcs7.pem
|
141
|
-
- features/sandbox/pipe_string.sh
|
142
|
-
- features/sandbox/puppet/environments/local/test.eyaml
|
143
|
-
- features/sandbox/puppet/hiera.yaml
|
144
|
-
- features/sandbox/puppet/manifests/init.pp
|
145
|
-
- features/sandbox/puppet/modules/test/manifests/init.pp
|
146
|
-
- features/sandbox/puppet/puppet.conf
|
147
|
-
- features/sandbox/supply_password.sh
|
148
|
-
- features/sandbox/test_input.bin
|
149
|
-
- features/sandbox/test_input.encrypted.txt
|
150
|
-
- features/sandbox/test_input.txt
|
151
|
-
- features/sandbox/test_input.yaml
|
152
|
-
- features/step_definitions/environment_overrides.rb
|
153
|
-
- features/support/env.rb
|
154
|
-
- features/support/setup_sandbox.rb
|
155
|
-
- features/valid_encryption.feature
|
103
|
+
test_files: []
|
data/features/decrypts.feature
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
Feature: eyaml decrypting
|
2
|
-
|
3
|
-
In order to decrypt data
|
4
|
-
As a developer using hiera-eyaml
|
5
|
-
I want to use the eyaml tool to decrypt data in various ways
|
6
|
-
|
7
|
-
Scenario: decrypt a simple string
|
8
|
-
When I run `eyaml -d -s 'ENC[PKCS7,MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAJsIbL+DE4b5mbT4ozzsGximhweXkJakBXRNqi/TOBV5RnMjlAhik2NQGyZdrg4fmQynyQvI7lKPos5bmqT6Ltk0XxfL0l1x8MIdVLDu7JG72a+5bbU7EK/PlhwaeJ0QpnA0M34koNykSmcvdVUoIDag71lqw4Hmk8JQuXmo95gP0sXHvlahgxR522Z8MTEitfimtZPnHJVMjQEnBHIwXLkEfqUHH3RciED3AkeU+En63Ou7Nq1SqoC4ln0oL1L2gRqsyEKWF/cigcZfAggh9rva6wlthh+Fj7yJy7ALVG/AXwrF1sJfTR31+RMbzPbgOHXES8P4yQvQnx6LNUSKAgDBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBCSuNScp5k8F0RKt63fkoPrgCBYbnl44Wdv5mtaJmJcc0WIUcLTpixl1IY2uQ7IiI358w==]'`
|
9
|
-
Then the output should match /^one flew over the cuckoos nest$/
|
10
|
-
|
11
|
-
Scenario: decrypt a default encryption string
|
12
|
-
When I run `eyaml -d -s 'ENC[MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAJsIbL+DE4b5mbT4ozzsGximhweXkJakBXRNqi/TOBV5RnMjlAhik2NQGyZdrg4fmQynyQvI7lKPos5bmqT6Ltk0XxfL0l1x8MIdVLDu7JG72a+5bbU7EK/PlhwaeJ0QpnA0M34koNykSmcvdVUoIDag71lqw4Hmk8JQuXmo95gP0sXHvlahgxR522Z8MTEitfimtZPnHJVMjQEnBHIwXLkEfqUHH3RciED3AkeU+En63Ou7Nq1SqoC4ln0oL1L2gRqsyEKWF/cigcZfAggh9rva6wlthh+Fj7yJy7ALVG/AXwrF1sJfTR31+RMbzPbgOHXES8P4yQvQnx6LNUSKAgDBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBCSuNScp5k8F0RKt63fkoPrgCBYbnl44Wdv5mtaJmJcc0WIUcLTpixl1IY2uQ7IiI358w==]'`
|
13
|
-
Then the output should match /^one flew over the cuckoos nest$/
|
14
|
-
|
15
|
-
Scenario: decrypt an encrypted file
|
16
|
-
When I run `eyaml -d -f test_input.encrypted.txt`
|
17
|
-
Then the output should match /^danger will robinson$/
|
18
|
-
|
19
|
-
Scenario: decrypt an eyaml file
|
20
|
-
When I run `eyaml -d -y test_input.yaml`
|
21
|
-
Then the output should match /encrypted_string: DEC::PKCS7\[planet of the apes\]\!/
|
22
|
-
And the output should match /encrypted_block: >\n\s+DEC::PKCS7\[gangs of new york\]\!/
|
23
|
-
And the output should match /\- DEC::PKCS7\[apocalypse now\]\!/
|
24
|
-
And the output should match /\- DEC::PKCS7\[the count of monte cristo\]\!/
|
25
|
-
And the output should match /\- array4/
|
26
|
-
And the output should match /\- DEC::PKCS7\[dr strangelove\]\!/
|
27
|
-
And the output should match /\- array5/
|
28
|
-
And the output should match /\- >\n\s+DEC::PKCS7\[kramer vs kramer\]\!/
|
29
|
-
And the output should match /\- >\n\s+DEC::PKCS7\[the manchurian candidate\]\!/
|
30
|
-
And the output should match /\- >\n\s+tomorrow and tomorrow and\s*\n\s+tomorrow creeps/
|
31
|
-
And the output should match /\- >\n\s+DEC::PKCS7\[much ado about nothing\]\!/
|
32
|
-
And the output should match /\- >\n\s+when shall we three meet again\n\s+in thunder/
|
33
|
-
And the output should match /\- DEC::PKCS7\[the english patient\]\!/
|
34
|
-
And the output should match /\- >\n\s+DEC::PKCS7\[the pink panther\]\!/
|
35
|
-
And the output should match /\- >\n\s+i wondered lonely\s*\n\s+as a cloud/
|
36
|
-
And the output should match /\s+key5: DEC::PKCS7\[value5\]\!/
|
37
|
-
And the output should match /\s+key6: DEC::PKCS7\[value6\]\!/
|
38
|
-
|
39
|
-
Scenario: decrypt using STDIN
|
40
|
-
When I run `./pipe_string.sh ENC[MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAJsIbL+DE4b5mbT4ozzsGximhweXkJakBXRNqi/TOBV5RnMjlAhik2NQGyZdrg4fmQynyQvI7lKPos5bmqT6Ltk0XxfL0l1x8MIdVLDu7JG72a+5bbU7EK/PlhwaeJ0QpnA0M34koNykSmcvdVUoIDag71lqw4Hmk8JQuXmo95gP0sXHvlahgxR522Z8MTEitfimtZPnHJVMjQEnBHIwXLkEfqUHH3RciED3AkeU+En63Ou7Nq1SqoC4ln0oL1L2gRqsyEKWF/cigcZfAggh9rva6wlthh+Fj7yJy7ALVG/AXwrF1sJfTR31+RMbzPbgOHXES8P4yQvQnx6LNUSKAgDBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBCSuNScp5k8F0RKt63fkoPrgCBYbnl44Wdv5mtaJmJcc0WIUcLTpixl1IY2uQ7IiI358w==] eyaml -d --stdin`
|
41
|
-
Then the output should match /^one flew over the cuckoos nest$/
|
42
|
-
|
43
|
-
|
44
|
-
|
data/features/edit.feature
DELETED
@@ -1,54 +0,0 @@
|
|
1
|
-
Feature: eyaml editing
|
2
|
-
|
3
|
-
In order to edit encrypted data
|
4
|
-
As a developer using hiera-eyaml
|
5
|
-
I want to use the eyaml tool to edit data in various ways
|
6
|
-
|
7
|
-
Scenario: decrypt an eyaml file
|
8
|
-
Given my EDITOR is set to "/bin/cat"
|
9
|
-
When I run `bash -c 'cp test_input.yaml test_input.eyaml'`
|
10
|
-
When I run `eyaml -i test_input.eyaml`
|
11
|
-
Then the output should match /encrypted_string: DEC::PKCS7\[planet of the apes\]\!/
|
12
|
-
And the output should match /encrypted_default_encryption_string: DEC::PKCS7\[planet of the apes\]\!/
|
13
|
-
And the output should match /encrypted_block: >\n\s+DEC::PKCS7\[gangs of new york\]\!/
|
14
|
-
And the output should match /encrypted_default_encryption_block: >\n\s+DEC::PKCS7\[gangs of new york\]\!/
|
15
|
-
And the output should match /\- DEC::PKCS7\[apocalypse now\]\!/
|
16
|
-
And the output should match /\- DEC::PKCS7\[the count of monte cristo\]\!/
|
17
|
-
And the output should match /\- array4/
|
18
|
-
And the output should match /\- DEC::PKCS7\[dr strangelove\]\!/
|
19
|
-
And the output should match /\- array5/
|
20
|
-
And the output should match /\- >\n\s+DEC::PKCS7\[kramer vs kramer\]\!/
|
21
|
-
And the output should match /\- >\n\s+DEC::PKCS7\[the manchurian candidate\]\!/
|
22
|
-
And the output should match /\- >\n\s+tomorrow and tomorrow and\s*\n\s+tomorrow creeps/
|
23
|
-
And the output should match /\- >\n\s+DEC::PKCS7\[much ado about nothing\]\!/
|
24
|
-
And the output should match /\- >\n\s+when shall we three meet again\n\s+in thunder/
|
25
|
-
And the output should match /\- DEC::PKCS7\[the english patient\]\!/
|
26
|
-
And the output should match /\- >\n\s+DEC::PKCS7\[the pink panther\]\!/
|
27
|
-
And the output should match /\- >\n\s+i wondered lonely\s*\n\s+as a cloud/
|
28
|
-
And the output should match /\s+key5: DEC::PKCS7\[value5\]\!/
|
29
|
-
And the output should match /\s+key6: DEC::PKCS7\[value6\]\!/
|
30
|
-
And the output should match /multi_encryption: DEC::PLAINTEXT\[jammy\]\! DEC::PKCS7\[dodger\]!/
|
31
|
-
|
32
|
-
Scenario: decrypt and reencrypt an eyaml file
|
33
|
-
Given my EDITOR is set to "./convert_decrypted_values_to_uppercase.sh"
|
34
|
-
When I run `bash -c 'cp test_input.yaml test_input.eyaml'`
|
35
|
-
When I run `eyaml -i test_input.eyaml`
|
36
|
-
When I run `eyaml -d -y test_input.eyaml`
|
37
|
-
Then the output should match /encrypted_string: DEC::PKCS7\[PLANET OF THE APES\]\!/
|
38
|
-
And the output should match /encrypted_block: >\n\s+DEC::PKCS7\[GANGS OF NEW YORK\]\!/
|
39
|
-
And the output should match /\- DEC::PKCS7\[APOCALYPSE NOW\]\!/
|
40
|
-
And the output should match /\- DEC::PKCS7\[THE COUNT OF MONTE CRISTO\]\!/
|
41
|
-
And the output should match /\- array4/
|
42
|
-
And the output should match /\- DEC::PKCS7\[DR STRANGELOVE\]\!/
|
43
|
-
And the output should match /\- array5/
|
44
|
-
And the output should match /\- >\n\s+DEC::PKCS7\[KRAMER VS KRAMER\]\!/
|
45
|
-
And the output should match /\- >\n\s+DEC::PKCS7\[THE MANCHURIAN CANDIDATE\]\!/
|
46
|
-
And the output should match /\- >\n\s+tomorrow and tomorrow and\s*\n\s+tomorrow creeps/
|
47
|
-
And the output should match /\- >\n\s+DEC::PKCS7\[MUCH ADO ABOUT NOTHING\]\!/
|
48
|
-
And the output should match /\- >\n\s+when shall we three meet again\n\s+in thunder/
|
49
|
-
And the output should match /\- DEC::PKCS7\[THE ENGLISH PATIENT\]\!/
|
50
|
-
And the output should match /\- >\n\s+DEC::PKCS7\[THE PINK PANTHER\]\!/
|
51
|
-
And the output should match /\- >\n\s+i wondered lonely\s*\n\s+as a cloud/
|
52
|
-
And the output should match /\s+key5: DEC::PKCS7\[VALUE5\]\!/
|
53
|
-
And the output should match /\s+key6: DEC::PKCS7\[VALUE6\]\!/
|
54
|
-
And the output should match /multi_encryption: DEC::PLAINTEXT\[JAMMY\]\! DEC::PKCS7\[DODGER\]\!/
|
data/features/encrypts.feature
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
Feature: eyaml encrypting
|
2
|
-
|
3
|
-
In order to encrypt data
|
4
|
-
As a developer using hiera-eyaml
|
5
|
-
I want to use the eyaml tool to encrypt data in various ways
|
6
|
-
|
7
|
-
Scenario: encrypt a simple string
|
8
|
-
When I run `eyaml -e -o string -s some_string`
|
9
|
-
Then the output should match /ENC\[PKCS7,(.*?)\]$/
|
10
|
-
|
11
|
-
Scenario: encrypt a simple file
|
12
|
-
When I run `eyaml -e -o string -f test_input.txt`
|
13
|
-
Then the output should match /ENC\[PKCS7,(.*?)\]$/
|
14
|
-
|
15
|
-
Scenario: encrypt a binary file
|
16
|
-
When I run `eyaml -e -o string -f test_input.bin`
|
17
|
-
Then the output should match /ENC\[PKCS7,(.*?)\]$/
|
18
|
-
|
19
|
-
Scenario: encrypt a password
|
20
|
-
When I run `./supply_password.sh eyaml -e -o string -p`
|
21
|
-
Then the file "password.output" should match /ENC\[PKCS7,(.*?)\]/
|
22
|
-
|
23
|
-
Scenario: encrypt using STDIN
|
24
|
-
When I run `./pipe_string.sh encrypt_me eyaml -e -o string --stdin`
|
25
|
-
Then the output should match /ENC\[PKCS7,(.*?)\]$/
|
26
|
-
|
data/features/keys.feature
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
Feature: eyaml key generation
|
2
|
-
|
3
|
-
In order to encrypt data with various encryption methods
|
4
|
-
As a developer using hiera-eyaml
|
5
|
-
I want to use the eyaml tool to generate keys and certs
|
6
|
-
|
7
|
-
Scenario: create some pkcs7 keys
|
8
|
-
When I run `eyaml -c --pkcs7-public-key keys/new_public_key.pem --pkcs7-private-key keys/new_private_key.pem`
|
9
|
-
Then the output should match /Keys created OK/
|
10
|
-
|
11
|
-
Scenario: create some plaintext keys
|
12
|
-
When I run `eyaml -n plaintext -c`
|
13
|
-
Then the output should match /success/
|
data/features/outputs.feature
DELETED
@@ -1,30 +0,0 @@
|
|
1
|
-
Feature: eyaml outputs
|
2
|
-
|
3
|
-
In order to better understand the link between eyaml and yaml files
|
4
|
-
As a developer using hiera-eyaml
|
5
|
-
I want to use the eyaml tool to output encrypted data in various yaml formats
|
6
|
-
|
7
|
-
|
8
|
-
Scenario: encrypt a simple string with default output
|
9
|
-
When I run `eyaml -e -s some_string`
|
10
|
-
Then the output should match /string: ENC\[PKCS7,(.*?)\]/
|
11
|
-
And the output should match /block: >\s*\n\s*ENC\[PKCS7,(.*?)\]/
|
12
|
-
|
13
|
-
Scenario: encrypt a simple string with examples output
|
14
|
-
When I run `eyaml -e -o examples -s some_string`
|
15
|
-
Then the output should match /string: ENC\[PKCS7,(.*?)\]/
|
16
|
-
And the output should match /block: >\s*\n\s*ENC\[PKCS7,(.*?)\]/
|
17
|
-
|
18
|
-
Scenario: encrypt a simple string with string output
|
19
|
-
When I run `eyaml -e -o string -s some_string`
|
20
|
-
Then the output should match /^ENC\[PKCS7,(.*?)\]$/
|
21
|
-
|
22
|
-
Scenario: encrypt a simple string with raw output
|
23
|
-
When I run `eyaml -e -o raw -s some_string`
|
24
|
-
Then the output should match /^ENC\[PKCS7,(.*?)\]$/
|
25
|
-
And the output should contain "\n"
|
26
|
-
|
27
|
-
Scenario: encrypt a simple string with block output
|
28
|
-
When I run `eyaml -e -o block -s some_string`
|
29
|
-
Then the output should match /^\s+ENC\[PKCS7,(.*?)\]$/
|
30
|
-
|
data/features/plugin.feature
DELETED
@@ -1,35 +0,0 @@
|
|
1
|
-
Feature: eyaml plugins
|
2
|
-
|
3
|
-
In order to encrypt data with various encryption methods
|
4
|
-
As a developer using hiera-eyaml
|
5
|
-
I want to use the eyaml tool to encrypt data in various ways
|
6
|
-
|
7
|
-
Scenario: encrypt using plaintext plugin
|
8
|
-
When I run `eyaml -e -n plaintext -o string -s hello`
|
9
|
-
Then the output should match /ENC\[PLAINTEXT,(.*?)\]$/
|
10
|
-
|
11
|
-
Scenario: decrypt using plaintext plugin
|
12
|
-
When I run `eyaml -d -n plaintext -s 'ENC[PLAINTEXT,aGVsbG8=]'`
|
13
|
-
Then the output should match /^hello$/
|
14
|
-
|
15
|
-
Scenario: decrypt using inferred plugin
|
16
|
-
When I run `eyaml -d -s 'ENC[PLAINTEXT,aGVsbG8=]'`
|
17
|
-
Then the output should match /^hello$/
|
18
|
-
|
19
|
-
Scenario: decrypt using forced plaintext plugin
|
20
|
-
When I run `eyaml -d -n plaintext -s 'ENC[aGVsbG8=]'`
|
21
|
-
Then the output should match /^hello$/
|
22
|
-
|
23
|
-
Scenario: decrypt using two plugins
|
24
|
-
When I run `eyaml -d -s 'ENC[PLAINTEXT,cmVkIGxvcnJ5IA==]ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAaezXCbx6WspcsKsCkgr9thLEckRppDvQyFloAHqswDNXllHxTSJDYlyoi96YvO96wazffdWO05TMs7HmkqJHkRzoTLGTdXSMz2Mu14QkUDe0zZyB0hl8qTbTcHzrw3ybUEJZEZ45Eenmr5VKuoBina7XJdIAXW8Ps4L/Dj7zsXlUxuyjDWu2WUd2X4gxO3W1SGfntk4OQ41NKXYKPIZLAXWMjC4VFh20tKXFwYhCpAanTBRNWgLBX3Dwg+c/l35EW8OQLfdaOQ30R/DgcoSsAZJveH3xqBv7UOes7vONLSYXTek6yFJBll7EuGbA/Mdw4gxd1qtCBdf48IiPPR0peTA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBCNWcGBqa8joAd0RMRzvx9VgBAf6PsvDZEa5cWdBaoTM/lP]'`
|
25
|
-
Then the output should match /^red lorry blue lorry/
|
26
|
-
|
27
|
-
Scenario: decrypt using two plugins with default plaintext
|
28
|
-
When I run `eyaml -d -n plaintext -s 'ENC[cmVkIGxvcnJ5IA==]ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAaezXCbx6WspcsKsCkgr9thLEckRppDvQyFloAHqswDNXllHxTSJDYlyoi96YvO96wazffdWO05TMs7HmkqJHkRzoTLGTdXSMz2Mu14QkUDe0zZyB0hl8qTbTcHzrw3ybUEJZEZ45Eenmr5VKuoBina7XJdIAXW8Ps4L/Dj7zsXlUxuyjDWu2WUd2X4gxO3W1SGfntk4OQ41NKXYKPIZLAXWMjC4VFh20tKXFwYhCpAanTBRNWgLBX3Dwg+c/l35EW8OQLfdaOQ30R/DgcoSsAZJveH3xqBv7UOes7vONLSYXTek6yFJBll7EuGbA/Mdw4gxd1qtCBdf48IiPPR0peTA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBCNWcGBqa8joAd0RMRzvx9VgBAf6PsvDZEa5cWdBaoTM/lP]'`
|
29
|
-
Then the output should match /^red lorry blue lorry/
|
30
|
-
|
31
|
-
Scenario: decrypt using two plugins with default pkcs7
|
32
|
-
When I run `eyaml -d -n pkcs7 -s 'ENC[PLAINTEXT,cmVkIGxvcnJ5IA==]ENC[MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAaezXCbx6WspcsKsCkgr9thLEckRppDvQyFloAHqswDNXllHxTSJDYlyoi96YvO96wazffdWO05TMs7HmkqJHkRzoTLGTdXSMz2Mu14QkUDe0zZyB0hl8qTbTcHzrw3ybUEJZEZ45Eenmr5VKuoBina7XJdIAXW8Ps4L/Dj7zsXlUxuyjDWu2WUd2X4gxO3W1SGfntk4OQ41NKXYKPIZLAXWMjC4VFh20tKXFwYhCpAanTBRNWgLBX3Dwg+c/l35EW8OQLfdaOQ30R/DgcoSsAZJveH3xqBv7UOes7vONLSYXTek6yFJBll7EuGbA/Mdw4gxd1qtCBdf48IiPPR0peTA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBCNWcGBqa8joAd0RMRzvx9VgBAf6PsvDZEa5cWdBaoTM/lP]'`
|
33
|
-
Then the output should match /^red lorry blue lorry/
|
34
|
-
|
35
|
-
|
data/features/plugin_api.feature
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
Feature: eyaml plugin api
|
2
|
-
|
3
|
-
In order to develop new encryption plugins for eyaml
|
4
|
-
As a developer using hiera-eyaml
|
5
|
-
I want to use the eyaml tool to exercise the encryption plugins in various ways
|
6
|
-
|
7
|
-
Scenario: verify plugin options are available in eyaml
|
8
|
-
When I run `eyaml --help`
|
9
|
-
Then the output should match /plaintext-diagnostic-message/
|
10
|
-
And the output should match /pkcs7-private-key/
|
11
|
-
And the output should match /pkcs7-public-key/
|
12
|
-
|
13
|
-
Scenario: exercise plugin options for a plugin
|
14
|
-
When I run `eyaml -n plaintext -c --plaintext-diagnostic-message marker12345`
|
15
|
-
Then the output should match /Create_keys: marker12345/
|
16
|
-
|
data/features/puppet.feature
DELETED
@@ -1,15 +0,0 @@
|
|
1
|
-
Feature: eyaml hiera integration
|
2
|
-
|
3
|
-
In order to use eyaml as a hiera plugin
|
4
|
-
As a developer using hiera-eyaml
|
5
|
-
I want to verify that hiera-eyaml works within puppet and hiera
|
6
|
-
|
7
|
-
Scenario: verify puppet3 with hiera can use hiera-eyaml to decrypt data
|
8
|
-
When I run `rm -f /tmp/eyaml_puppettest.1 /tmp/eyaml_puppettest.2 /tmpeyaml_puppettest.3 2>/dev/null`
|
9
|
-
When I run `puppet apply --confdir ./puppet --node_name_value localhost puppet/manifests/init.pp`
|
10
|
-
When I run `cat /tmp/eyaml_puppettest.1`
|
11
|
-
Then the output should match /good night/
|
12
|
-
When I run `cat /tmp/eyaml_puppettest.2`
|
13
|
-
Then the output should match /and good luck/
|
14
|
-
When I run `cat /tmp/eyaml_puppettest.3`
|
15
|
-
Then the output should match /and good luck/
|
@@ -1,27 +0,0 @@
|
|
1
|
-
-----BEGIN RSA PRIVATE KEY-----
|
2
|
-
MIIEowIBAAKCAQEA0kX0qkf4FOHXuFqlVmbgo+UDrJdneH8XnmWM+stAs0XpzEQq
|
3
|
-
ErelZUhEi2x5z16RAsEw3cjd2BG78WHz1lcu3NP25BM990YQDl6e9pvmeMNA+wCK
|
4
|
-
1bwD7fCWXrAKb7xIXPJVd0ivP82ZPe71CmkFtiFr14mqNWrEpP/d2eQ4PAaCimAE
|
5
|
-
bBKyRRHHJzU6X+hOnq8GRZBwKh6Ljl31JYE2DG3KQ+ydM+r411jY2sjSykOovbeR
|
6
|
-
b7FCyOPaLRgyNjiDIJSTRlWLVJbYj6KDSoUD2+R95Owb5Z1OUL9Yn/BRIv5RyDvf
|
7
|
-
Br42sp0KR7t3pWGiHEuRYZkGDU5jKB/8bK7DRwIDAQABAoIBAERJKZp/AsatTSP2
|
8
|
-
dAkqIbu37MiI5rZP97id2/m6NgnCI5oNbOhlMVZB8NiiYrCAUnFlkdwEll7L65AJ
|
9
|
-
MmmiKHrYby5EPXRnEWHJQrBtkpwXNKwO0gd1JoWIAx0+6DS/HXTp0e2J8jezKhfd
|
10
|
-
2UAHOS6bje0SLO9p+/Blk4NmRQjgsYk5nunl463+IkRGU8cna7GIOnvExrT6H3FD
|
11
|
-
UsL9hL1J/+f4cSmsJoNHtQfKV0OkmQhENpFFwVMunMJPDjGEbaliKqqX05ZnJ1Tu
|
12
|
-
kDKG+QL1wJbehDNNpiwTGo+Ei8EbP8LYsSkKtMl0zVED636AiuQ259oNDGXo2f+t
|
13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u0h/GmOtVQH654NCQSs1dLD+K4+8mn591Nv4uLrCiNJzTM
|
17
|
-
zGRUV6zOPlUa3ye6Dg==
|
18
|
-
-----END CERTIFICATE-----
|
@@ -1,3 +0,0 @@
|
|
1
|
-
plaintext_string: good night
|
2
|
-
encrypted_string: ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAQoDt5EgMoJUpsqgcH7OdGJ3d9LzSpaAsgnPuyDHRaHRFHpOmeUk4J4qwHqlNDqD+AMkydaGlNswA/bLdoBwofZGZAUoly/Vkt3ciB4sw0pWlezEUx0dUfWGB95qOJwTqyXhQ4b4fcgCMUbwwCCombN5/LVwjxKHmC9knLNCDkUU5VNDy5Lanh3y8S2XwCJpjArhEcJNfwrf4yz3luQcKD3x91FR3NUYPjJOiTHl9lzxEJm4Mod7ioSj62FcP79qgULWqTKpxMpG4LPwCo/J84jhTkl+fhL/Bs/tmujgpLqBO000kdg4ZmrYrwYqpK6vgcFzVtZJEB3Tq8nXD9hSuAzA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBFKh+qgHj0ajgtgpsFq5NEgBB/nP/DgjeKtd+D2MX6sOTv]
|
3
|
-
|
@@ -1,17 +0,0 @@
|
|
1
|
-
---
|
2
|
-
:backends:
|
3
|
-
- yaml
|
4
|
-
- eyaml
|
5
|
-
|
6
|
-
:hierarchy:
|
7
|
-
- environments/%{environment}/%{module_name}
|
8
|
-
|
9
|
-
:yaml:
|
10
|
-
:datadir: ./puppet
|
11
|
-
|
12
|
-
:logger: console
|
13
|
-
|
14
|
-
:eyaml:
|
15
|
-
:datadir: ./puppet
|
16
|
-
:pkcs7_private_key: ./keys/private_key.pkcs7.pem
|
17
|
-
:pkcs7_public_key: ./keys/public_key.pkcs7.pem
|
@@ -1,18 +0,0 @@
|
|
1
|
-
class test::run {
|
2
|
-
|
3
|
-
file { "/tmp/eyaml_puppettest.1":
|
4
|
-
ensure => present,
|
5
|
-
content => hiera("plaintext_string"),
|
6
|
-
}
|
7
|
-
|
8
|
-
file { "/tmp/eyaml_puppettest.2":
|
9
|
-
ensure => present,
|
10
|
-
content => hiera("encrypted_string"),
|
11
|
-
}
|
12
|
-
|
13
|
-
file { "/tmp/eyaml_puppettest.3":
|
14
|
-
ensure => present,
|
15
|
-
content => inline_template("<%= scope.function_hiera(['encrypted_string']) %>"),
|
16
|
-
}
|
17
|
-
|
18
|
-
}
|
Binary file
|
@@ -1 +0,0 @@
|
|
1
|
-
ENC[PKCS7,MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAgO8TSTj+8D1EyN7T1p2a7YqlXLQdNkr7xfV8DU3foG5x1wXOCVNvANrMNzyCoc8zAeHywhzvG60DaDKMcd/1TIiySpt912rYCWJDcGV0YlfsBDpJTvQlU7ygWoHgDzvtX0Eo1ChCh4TZUmllU96da+6e2c/3/45OyDBiHWy/OZzYzNcA8fx2bqdq+Ucy/WAfvSK8aAVHJu1B2AnXECyopyMgly14j6rAW4dDzsnh9oge+iMsC9uLhqykTMR8q9wo+W092g+rzms8V5CprTGFVLl2Kq/V3o7ItnOqiPURXPxwykCrW8NHr591sWxlXtY1gf1f6u++Fa4UJbEMt7iZkTBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBb5+JHGoxKxM3KQ09F8pyTgCBzK1YAZ5ceYNwW2ybSGqt9x8jfWHbM/jzbCnNOLnAU2Q==]
|
@@ -1,114 +0,0 @@
|
|
1
|
-
simple_string: how do you do
|
2
|
-
encrypted_string: ENC[PKCS7,MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAgld+rftjW8WmMwTJLX/3Kk9hQv9ZUufsieijxhnCo3gtR/6xaKdMC4wpYM9Eck7FFdmjz2XnJK9o5rlvjW5ZBH3u2A3tphs6cgy7HzsfrsJvw1Mc+CLSNL35MVi/YvNCxezn+rXn28NW8NntByoLTzZnd6iGxSBk4S7Z7XwvdQWuUjXy0muEeAUYtS/eppNZYdyeMpzE9oHmfMM+zwdOYzc/nfwvnoLHGP+sv6KmnzCyNtqyrdvCIn+m+ljPWpGvj410Q52Xili1Scgi+ALJf4xiEnD5c5YjEkYY8uUe4etCDYZ/aXp9RGvZiHD8Le6jz34fcWbLZlQacCfgcyY8AzBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBD4CRz8QLvbtgRx/NTxEnpfgCBLQD1ei8KAcd0LTT7sezZPt6LQnLxPuwx5StflI5xOgA==]
|
3
|
-
encrypted_default_encryption_string: ENC[MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAgld+rftjW8WmMwTJLX/3Kk9hQv9ZUufsieijxhnCo3gtR/6xaKdMC4wpYM9Eck7FFdmjz2XnJK9o5rlvjW5ZBH3u2A3tphs6cgy7HzsfrsJvw1Mc+CLSNL35MVi/YvNCxezn+rXn28NW8NntByoLTzZnd6iGxSBk4S7Z7XwvdQWuUjXy0muEeAUYtS/eppNZYdyeMpzE9oHmfMM+zwdOYzc/nfwvnoLHGP+sv6KmnzCyNtqyrdvCIn+m+ljPWpGvj410Q52Xili1Scgi+ALJf4xiEnD5c5YjEkYY8uUe4etCDYZ/aXp9RGvZiHD8Le6jz34fcWbLZlQacCfgcyY8AzBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBD4CRz8QLvbtgRx/NTxEnpfgCBLQD1ei8KAcd0LTT7sezZPt6LQnLxPuwx5StflI5xOgA==]
|
4
|
-
|
5
|
-
simple_block: >
|
6
|
-
once upon a time
|
7
|
-
in a galaxy far far
|
8
|
-
away
|
9
|
-
|
10
|
-
encrypted_block: >
|
11
|
-
ENC[PKCS7,MIIBiQYJKoZIhvcNAQcDo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kBD9e6N78NNx+PAJswsFAV4DOCbXdf2BisyYbM3na35MVfyb6ggDegrE
|
29
|
-
ebOxxDBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBCWeGlYS5cQoX78L6LK
|
30
|
-
/mczgCD/pI7usp1XPebnN8CngxHXuUjj5S+6IUpOW6l2JgUeWw==]
|
31
|
-
|
32
|
-
simple_array:
|
33
|
-
- array1
|
34
|
-
- array2
|
35
|
-
- array3
|
36
|
-
|
37
|
-
encrypted_array_with_strings:
|
38
|
-
- ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAPBII8uG/2up91TFBV4Ro5h7qkSlREXyiABQtIjfmR+hwE5v12rxSjFrNRqLJFDzTp9kOHZRpbrN7oGwj2L+qQx26PBF5sTcSN+iXr4DIhmOcSnwK+FDUi1l13zVESobUtk++tp44NR5R/ssy7Da476aBCzK1IW3DjZN8dLGLZRvF9I6e3Sg1r0SB/x+1dKpOsqHXcA6rXT75ww1OOh8+/TPMnRIXBbdd+6TLUuom065JTkfgRmzEXfJFZOMu4H2g0eUjNUJBHhEE7cMyWVOap0vUmMrjc2oLIuJSxwZ15JFH4bGOc9U6fbm5t7VOMtPtH1aVvA54hCqIbf7c9cbPwDA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBExu0Pqe4YHDVeMYKOpYcNgBBplVycTULp98dIuHc04iGM]
|
39
|
-
- ENC[PKCS7,MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAoEOorG1Vd8gSQVmzKaUyH1xuxA8VtFsOfrN9lzba1DxrySAH4e28N3fUwcwGR37XIlmxU9tDXDuvGom5dV+ajSBgmaVoUS3PerPUOxjC3lQ7Q2J9+Af51hfFlGovNZz8p/eelQoClZk93p9+Tn4VM84sGPXZiOMi1hDQjU5kOtFnfendNQmEL/8T0/nns5MtCvleuYkPEfw5COnsBmjkRBC2ancBd88leG1DCsj32XNWFBG2jZoJbIsczIBNOduP1ajLMXrq7EVUOk5DCZQB1Ku1dWGPN55GzWe1GxxVIpFUzTsKAExafM+FYcamKFACeL9yFtei00mm6kyc1+GRuzBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBCWbEJkf7PwSwCpbMUm68mZgCCMMj4zrPZVmzj5PEx3ElW0TAdAxNHmN7DPpbBkSLcKcQ==]
|
40
|
-
|
41
|
-
mixed_array_with_strings:
|
42
|
-
- array4
|
43
|
-
- ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAeHR6sUJ/dBEo3ua7GEulLaxVwg029zo68XjsZQiTxg2I3UzH/nE+XJYGx9jRYUO7dehvMjam+LQ3ILFnaX/oIExreb1dXv7xpEyYqQAldpZdflyzAANmSxuzmxjyXQPWezyNTWta/Fn2BTf4pv++CU+Vps9g4idZ7/a3619Vp6lEZGycmSIirkE74PFcrVWlWQXqDW4VMkBQ1jEyu0mUnt+D0cZypNPwNTXnxzcAYYKbvfv2piE+dk4HCYt3txcdCc59Gyc035JsVv6fH7ksotM43+mgK4zOzaOpYg6RZIvSCt1vXNSwsVUIOEjdqe9VqNzt4W3jrXF1Ot16slorszA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBAabuHst7lWfK4lClC74O2PgBAgOeDR0fJBpE63mqXFyYLk]
|
44
|
-
- array5
|
45
|
-
|
46
|
-
encrypted_array_with_blocks:
|
47
|
-
- >
|
48
|
-
ENC[PKCS7,MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQAw
|
49
|
-
DQYJKoZIhvcNAQEBBQAEggEAQjttHzRiVQWu2Vy7zgWQidZwBaMcXozdrZ+m
|
50
|
-
ICa7B+v9dOawM/K0+nUY7/BpC8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-
|
68
|
-
mixed_array_with_blocks:
|
69
|
-
- >
|
70
|
-
tomorrow and tomorrow and
|
71
|
-
tomorrow creeps in this petty
|
72
|
-
pace
|
73
|
-
- >
|
74
|
-
ENC[PKCS7,MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQAw
|
75
|
-
DQYJKoZIhvcNAQEBBQAEggEAj9R0rZ98jseASAthfPUflx1oj2bNmOoCkfv9
|
76
|
-
H9PpsQnr4NzqrTpYLAX72sewLD2GZYAA61ukb8Z6KRjNg6iSTZjYuRA7jhRc
|
77
|
-
QV6NJ3KgYI7w4RJs4lUvYOIgZe6MwXjPDeoEaSTDDaee5pld5AT//MNXtPgp
|
78
|
-
Ez2ms9Ude+PvGbf7y38HKhkguSbDs34aacuz4X7IGEZCZMrbfxUo1M+HzPlY
|
79
|
-
RvlmjDHwWJmG9Aj1G439AKUwr7KJgTvPzzZLcXz/lENdjk92HLSEaRFMMnTJ
|
80
|
-
XkJLIXcBdzdd6gw+3WqEljQUYAmOv36avTZt7IA1AeCycTa+xDCKZ4gZE/O7
|
81
|
-
zasLkTBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBAI+wtFyu4rvbeY5Zwg
|
82
|
-
VR0ggCDK2aXbmJOBwtj6GyRBYokOEk8EcLuUTDh+GOvYaErUdQ==]
|
83
|
-
- >
|
84
|
-
when shall we three meet again
|
85
|
-
in thunder lightning or
|
86
|
-
in rain
|
87
|
-
|
88
|
-
mixed_array_with_random:
|
89
|
-
- ENC[PKCS7,MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEApxf3lqPCoidIFp5qvB21dUhlmCHx6JLm7rtt9m6rXwc35VrJVukSCIrjvAz1b/osEU+RdSEQh9WL2E65QHB9aHklWdu4SgR3QvC/TU4uVWQCvfy3g/bpX3D/j13BkSpe99nH0Va0kZpCnaorHEwiv9fvs5VneGIwSKiBIy/5lYdcmmHWPSlE+4G285XwznMKUqh+P/prUTn664oDA8LeRGitENfndmFGLPaoEbgfJLAQQlVPzt/DhR/YiYoG5qHh9445NAVo/MVq13SVzbxCwyg7WVrNTI3KK4Z2/hDiizRHpE/L7ceWfJiXCUQ4ouy2QvWNcNjmGTM0bRZDgep8XDBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBWzWT0Fn9sVdKPp0BoGWIcgCC0ga55Q3kw9i+D6acq4TOlI1rcdIyS/lwBSe7gixWQdg==]
|
90
|
-
- >
|
91
|
-
ENC[PKCS7,MIIBiQYJKoZIhvcNAQcDoIIBejCCAXYCAQAxggEhMIIBHQIBADAFMAACAQAw
|
92
|
-
DQYJKoZIhvcNAQEBBQAEggEAZIrpP5Gtt54I4S68hrZj3pjaqO9IcEnX0J66
|
93
|
-
I7Zc8+r9VUsahJWSGlDutvmz5b8vo94ZqWy9vKaJFKBc762ih8YDhMKjDTKL
|
94
|
-
2Pbdshv/cbWF09oF2HoNqU+qC8OK+Uku+lf7F8UOmkzTsB2QS6LzQKXoZtff
|
95
|
-
WWum8ZNfShgCHsb6qy+1C/pNPNMSvO+JnFhTp7e7MS62wIAY6denn2ODCj4c
|
96
|
-
MJhU8siBOWcyIBOHDdlHr658qXfpixN3vmN4qpXoqD5A4r2rv5Jh0uqYNYdo
|
97
|
-
peROsTg5yYz46NovQF/iM4ZOed+jcHjANFW1+tLsT8MgesvN19pTpLyVeCdq
|
98
|
-
lwed8jBMBgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBDs+GHGdE7N5Livn7K+
|
99
|
-
Dfs1gCBnNYMzne3ae3pyxKTf2FUaJyZWOgmCPMoWAwgr20Gkvw==]
|
100
|
-
- >
|
101
|
-
i wondered lonely
|
102
|
-
as a cloud
|
103
|
-
- the grand old duke of york
|
104
|
-
|
105
|
-
simple_hash:
|
106
|
-
key1: value1
|
107
|
-
key2: value2
|
108
|
-
|
109
|
-
encrypted_hash_value:
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ryption: ENC[PLAINTEXT,amFtbXk=] ENC[PKCS7,MIIBeQYJKoZIhvcNAQcDoIIBajCCAWYCAQAxggEhMIIBHQIBADAFMAACAQAwDQYJKoZIhvcNAQEBBQAEggEAKjKPUtDSN+X/n91bpIjhZHW3eLG9efNNWz7unq8ToxQOIMLrQcr3mj+83E1UNhmRu4TSymSz0kFkkPtjWd2TAkAG3PZvUj6ldFeUhbPMAvTOH/Q23hEZfQdI0GmZHTe6YsYBjJwAxEegXfdg1HKzCY3SBZoMTCEu9yFIJKd3slPxw8zPI6GERTg2ZBRWIckv9W9t7EN7nu9liWR0csRPEYwXUiAZlrgdX2r2Fhx/ZzWZ0tWJ55BiYYzE9U9bvSGZOjZJpWU9wUaOhpAhAx9xaIg48CO5THXMvV+8ss/zEMhYHGfhN56Cr69oQRDXGunYKnWT9tgoDCrxMGIrurtBnDA8BgkqhkiG9w0BBwEwHQYJYIZIAWUDBAEqBBBntvZSBPjinBRMofJhVxEtgBAd3fhzETLtxJm58bnlM3ci]
|
114
|
-
|
data/features/support/env.rb
DELETED
@@ -1,26 +0,0 @@
|
|
1
|
-
ENV['RUBYLIB'] = File.dirname(__FILE__) + '/../../lib'
|
2
|
-
require 'rubygems'
|
3
|
-
require 'aruba/config'
|
4
|
-
require 'aruba/cucumber'
|
5
|
-
require 'fileutils'
|
6
|
-
require 'rspec/expectations'
|
7
|
-
|
8
|
-
test_files = {}
|
9
|
-
Dir["features/sandbox/**/*"].each do |file_name|
|
10
|
-
next unless File.file? file_name
|
11
|
-
read_mode = "r"
|
12
|
-
read_mode = "rb" if file_name =~ /\.bin$/
|
13
|
-
file = File.open(file_name, "r")
|
14
|
-
file_contents = file.read
|
15
|
-
file.close
|
16
|
-
file_name = file_name.slice(17, file_name.length)
|
17
|
-
test_files[file_name] = file_contents
|
18
|
-
end
|
19
|
-
|
20
|
-
# ENV['EDITOR']="/bin/cat"
|
21
|
-
|
22
|
-
Aruba.configure do |config|
|
23
|
-
config.before_cmd do |cmd|
|
24
|
-
SetupSandbox.create_files test_files
|
25
|
-
end
|
26
|
-
end
|
@@ -1,21 +0,0 @@
|
|
1
|
-
require 'fileutils'
|
2
|
-
|
3
|
-
class SetupSandbox
|
4
|
-
|
5
|
-
def self.create_files test_files
|
6
|
-
|
7
|
-
test_files.each do |test_file, contents|
|
8
|
-
extension = test_file.split('.').last
|
9
|
-
target_dir = File.dirname(test_file)
|
10
|
-
FileUtils.mkdir_p( target_dir ) unless Dir.exists?( target_dir )
|
11
|
-
write_mode = "w"
|
12
|
-
write_mode = "wb" if extension == "bin"
|
13
|
-
File.open(test_file, write_mode) {|input_file|
|
14
|
-
input_file.puts contents
|
15
|
-
} unless File.exists?( test_file )
|
16
|
-
File.chmod(0755, test_file) if extension == "sh"
|
17
|
-
end
|
18
|
-
|
19
|
-
end
|
20
|
-
|
21
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
Feature: eyaml encrypting is valid
|
2
|
-
|
3
|
-
Scenario: encrypt and decrypt a binary file
|
4
|
-
When I run `bash -c "eyaml -e -o string -f test_input.bin > test_output.txt"`
|
5
|
-
When I run `bash -c "eyaml -d -f test_output.txt > test_output.bin"`
|
6
|
-
When I run `file test_output.bin`
|
7
|
-
Then the output should match /PNG image data/
|
8
|
-
|
9
|
-
Scenario: encrypt and decrypt a simple file
|
10
|
-
When I run `bash -c "eyaml -e -o string -f test_input.txt > test_output.txt"`
|
11
|
-
When I run `eyaml -d -f test_output.txt`
|
12
|
-
Then the output should match /fox jumped over/
|