secure_yaml 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +1 -0
- data/lib/secure_yaml/version.rb +1 -1
- data/lib/secure_yaml.rb +1 -0
- data/spec/secure_yaml_spec.rb +5 -3
- metadata +1 -1
data/README.md
CHANGED
@@ -58,6 +58,7 @@ export PROPERTIES_ENCRYPTION_PASSWORD=abc12345678; ruby app.rb
|
|
58
58
|
|
59
59
|
<strong>*** The value of the secret key must NOT be submitted to source control. Knowing the secret key allows a person to easily decrypt your properties.</strong>
|
60
60
|
<br />
|
61
|
+
<br />
|
61
62
|
|
62
63
|
<strong>4) Load and use the decrypted version of your YAML file within your app</strong>
|
63
64
|
|
data/lib/secure_yaml/version.rb
CHANGED
data/lib/secure_yaml.rb
CHANGED
data/spec/secure_yaml_spec.rb
CHANGED
@@ -3,14 +3,16 @@ require 'spec_helper'
|
|
3
3
|
describe 'SecureYaml' do
|
4
4
|
|
5
5
|
before(:each) do
|
6
|
+
@secret_key = 'secret key'
|
6
7
|
@yaml = {prop: 'test'}
|
7
8
|
loader = double(SecureYaml::Loader)
|
8
9
|
loader.stub(:load).and_return(@yaml)
|
9
|
-
SecureYaml::Loader.stub(:new).and_return(loader)
|
10
|
+
SecureYaml::Loader.stub(:new).with(@secret_key).and_return(loader)
|
10
11
|
end
|
11
12
|
|
12
13
|
it 'should load decrypted yaml file' do
|
13
|
-
|
14
|
+
|
15
|
+
ENV[SecureYaml::DEFAULT_SECRET_KEY_PROP_NAME] = @secret_key
|
14
16
|
|
15
17
|
yaml = SecureYaml::load(double(File))
|
16
18
|
|
@@ -25,7 +27,7 @@ describe 'SecureYaml' do
|
|
25
27
|
|
26
28
|
it 'should allow use of custom secret key property name' do
|
27
29
|
custom_secret_key_prop_name = 'CUSTOMER_SECRET_KEY_PROP_NAME'
|
28
|
-
ENV[custom_secret_key_prop_name] =
|
30
|
+
ENV[custom_secret_key_prop_name] = @secret_key
|
29
31
|
|
30
32
|
yaml = SecureYaml::load(double(File), custom_secret_key_prop_name)
|
31
33
|
|