wes-cloudkit 1.0.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wes/cloudkit/app_config.rb +30 -8
- data/lib/wes/cloudkit/configuration.rb +1 -1
- data/lib/wes/cloudkit/version.rb +1 -1
- data/wes-cloudkit.gemspec +1 -0
- metadata +15 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30a7fa5c5b9630ce05afe3e1d946a332945700fd
|
4
|
+
data.tar.gz: 4a6cf985e6dd4138780c49cbcb77b687c16201ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 335f6c72ca3250622aba1512fa2f2f8b16e929493f4e9fb221460fb605f3b7388a58bff75fcc70c610d378b4c588736be2cb8ee36e108027260ed119d7c324bb
|
7
|
+
data.tar.gz: 705b7ba8ca6128fd976c331ea4b19b9c2d8625660ec8b1cb2ac93ea1379e083baf922d99bf2d5a252336a0c3c9d89c8b387ad9137d5a38cc4831cc01b03b1bbd
|
@@ -1,6 +1,5 @@
|
|
1
|
-
require "
|
2
|
-
require "
|
3
|
-
require "Wes/cloudkit/configuration"
|
1
|
+
require "gibberish"
|
2
|
+
require "wes/cloudkit/configuration"
|
4
3
|
|
5
4
|
module Wes
|
6
5
|
module Cloudkit
|
@@ -21,12 +20,25 @@ module Wes
|
|
21
20
|
|
22
21
|
attr_reader :json
|
23
22
|
|
23
|
+
def aws_env
|
24
|
+
configuration.aws_env
|
25
|
+
end
|
26
|
+
|
27
|
+
def cipher
|
28
|
+
@cipher ||= Gibberish::AES.new encyption_key
|
29
|
+
end
|
30
|
+
|
24
31
|
def configuration
|
25
32
|
Configuration
|
26
33
|
end
|
27
34
|
|
28
|
-
def
|
29
|
-
|
35
|
+
def decrypt(v)
|
36
|
+
cipher.decrypt v
|
37
|
+
end
|
38
|
+
|
39
|
+
def encyption_key
|
40
|
+
return "batman" unless Configuration.env == "production"
|
41
|
+
ENV["CONFIG_ENCRYPTION_KEY"]
|
30
42
|
end
|
31
43
|
|
32
44
|
def path
|
@@ -37,12 +49,22 @@ module Wes
|
|
37
49
|
|
38
50
|
def parse
|
39
51
|
OpenStruct.new(
|
40
|
-
|
41
|
-
|
42
|
-
|
52
|
+
raw_json.tap do |rj|
|
53
|
+
rj.keys.each do |node|
|
54
|
+
rj[node].keys.each do |key|
|
55
|
+
if rj[node][key]["secure"] == true
|
56
|
+
rj[node][key]["value"] = decrypt rj[node][key]["value"]
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
60
|
+
end
|
43
61
|
)
|
44
62
|
end
|
45
63
|
|
64
|
+
def raw_json
|
65
|
+
JSON.parse File.read(path)
|
66
|
+
end
|
67
|
+
|
46
68
|
def root
|
47
69
|
configuration.root
|
48
70
|
end
|
data/lib/wes/cloudkit/version.rb
CHANGED
data/wes-cloudkit.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: wes-cloudkit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ''
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: gibberish
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '2'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '2'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: json
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|