conf_conf 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/conf_conf.gemspec +2 -2
- data/lib/conf_conf/project/developer.rb +4 -4
- data/lib/conf_conf/project/environment/storage.rb +3 -3
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b8ec24a1efee7afc7e67b9bc762ee3eae813795
|
4
|
+
data.tar.gz: 44af29668baeae4a6f9a5a506163fcefa9fdfe95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7cfe1d1125a572ca7531e1587c82da3339a549c89b3ece96f28dca1b80bff34b0e7c2ab50babcf32f47d5b00b543e47367b55d3ed3669ce2f1c8cd2982768bd5
|
7
|
+
data.tar.gz: 5a6023d66c449958fb8604bc64ee6491cf5b5b724c2e32bfd867b1f607dc80e6d16712d2dd332abe83fb6065f7e2c3aa091c27a93c7b65dc01cfeb0aa1d6b654
|
data/conf_conf.gemspec
CHANGED
@@ -4,10 +4,10 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'conf_conf'
|
7
|
-
s.version = '2.0.
|
7
|
+
s.version = '2.0.4'
|
8
8
|
s.licenses = ['MIT']
|
9
9
|
s.authors = ['James Kassemi']
|
10
|
-
s.email = ['
|
10
|
+
s.email = ['james@bowtie.io']
|
11
11
|
s.homepage = 'https://github.com/jkassemi/conf_conf'
|
12
12
|
s.description = 'Verify correctness of environment variables'
|
13
13
|
s.summary = 'A simple pattern and utility for verifying the correctness of the environment variables at application boot so we can fail fast when there\'s a configuration problem.'
|
@@ -12,8 +12,8 @@ module ConfConf
|
|
12
12
|
|
13
13
|
else
|
14
14
|
private_key = RbNaCl::PrivateKey.generate
|
15
|
-
pretty_private_key =
|
16
|
-
pretty_public_key =
|
15
|
+
pretty_private_key = private_key.to_s.unpack('H*')
|
16
|
+
pretty_public_key = private_key.public_key.to_s.unpack('H*')
|
17
17
|
|
18
18
|
user_config = {
|
19
19
|
'public_key' => pretty_public_key,
|
@@ -27,11 +27,11 @@ module ConfConf
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def private_key
|
30
|
-
|
30
|
+
[pretty_private_key].pack('H*')
|
31
31
|
end
|
32
32
|
|
33
33
|
def public_key
|
34
|
-
|
34
|
+
[pretty_public_key].pack('H*')
|
35
35
|
end
|
36
36
|
end
|
37
37
|
end
|
@@ -11,7 +11,7 @@ module ConfConf
|
|
11
11
|
if File.exists?(environment_config_file_path)
|
12
12
|
environment_config = MultiJson.load(File.read(environment_config_file_path))
|
13
13
|
environment_schema = environment_config['schema']
|
14
|
-
author_public_key =
|
14
|
+
author_public_key = [environment_config['author_public_key']].unpack('H*')
|
15
15
|
encrypted_environment_secret_key = environment_config['encrypted_environment_secret_key'][current_developer.pretty_public_key]
|
16
16
|
|
17
17
|
raise NotAuthorizedError if encrypted_environment_secret_key.nil?
|
@@ -20,7 +20,7 @@ module ConfConf
|
|
20
20
|
environment_secret_key = box.decrypt(encrypted_environment_secret_key)
|
21
21
|
|
22
22
|
box = RbNaCl::SimpleBox.from_secret_key(environment_secret_key)
|
23
|
-
decrypted_environment_variables_json = box.decrypt(environment_config["encrypted_environment"])
|
23
|
+
decrypted_environment_variables_json = box.decrypt(Base64.strict_decode64(environment_config["encrypted_environment"]))
|
24
24
|
|
25
25
|
environment_variables = MultiJson.load(decrypted_environment_variables_json)
|
26
26
|
else
|
@@ -47,7 +47,7 @@ module ConfConf
|
|
47
47
|
end
|
48
48
|
|
49
49
|
box = RbNaCl::SimpleBox.from_secret_key(environment_secret_key)
|
50
|
-
environment_config[:encrypted_environment] = box.encrypt(MultiJson.dump(environment.variables))
|
50
|
+
environment_config[:encrypted_environment] = Base64.strict_encode64(box.encrypt(MultiJson.dump(environment.variables)))
|
51
51
|
|
52
52
|
environment_config_file_path = File.join('config', 'conf_conf', 'environments', "#{environment.name}.json")
|
53
53
|
File.write(environment_config_file_path, MultiJson.dump(environment_config))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: conf_conf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Kassemi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-08-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: httpi
|
@@ -124,7 +124,7 @@ dependencies:
|
|
124
124
|
version: '3.0'
|
125
125
|
description: Verify correctness of environment variables
|
126
126
|
email:
|
127
|
-
-
|
127
|
+
- james@bowtie.io
|
128
128
|
executables:
|
129
129
|
- conf_conf
|
130
130
|
extensions: []
|
@@ -180,3 +180,4 @@ specification_version: 4
|
|
180
180
|
summary: A simple pattern and utility for verifying the correctness of the environment
|
181
181
|
variables at application boot so we can fail fast when there's a configuration problem.
|
182
182
|
test_files: []
|
183
|
+
has_rdoc:
|