mongoid-kms 0.0.15 → 0.0.16
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/lib/mongoid/kms/version.rb +1 -1
- data/lib/mongoid/kms.rb +9 -1
- data/spec/lib/mongoid/kms_spec.rb +4 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 18d8d83436bd3ff21504f25d350ce292073e6f87
|
|
4
|
+
data.tar.gz: 67aed43a318aade0ac6c27afe43f918b02527aec
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: aef8308e7a7186427bf44247621cc1a250983aacd06855c774f06498e664838ce5fc9df597c6a3668a2dd2c85ef941e57d61004ee3a32822038f48dd680e5973
|
|
7
|
+
data.tar.gz: 274d378dff7c502714d52fc59681253c0ee1596d5c9aec1663e5c430b57a36f040033d0d00212f87cca38e96a5eb709c4268ffcb5b7124d8610b4a3b77076513
|
data/lib/mongoid/kms/version.rb
CHANGED
data/lib/mongoid/kms.rb
CHANGED
|
@@ -20,7 +20,11 @@ module Mongoid
|
|
|
20
20
|
# Module methods
|
|
21
21
|
class << self
|
|
22
22
|
def configure(args)
|
|
23
|
-
|
|
23
|
+
if args[:region] && args[:region] != "" && args[:key] && args[:key] != ""
|
|
24
|
+
@configuration = args
|
|
25
|
+
else
|
|
26
|
+
raise Errors::ConfigurationError.new("Region and KMS id key are required.")
|
|
27
|
+
end
|
|
24
28
|
end
|
|
25
29
|
|
|
26
30
|
def configuration
|
|
@@ -164,5 +168,9 @@ module Mongoid
|
|
|
164
168
|
end
|
|
165
169
|
end
|
|
166
170
|
end
|
|
171
|
+
|
|
172
|
+
module Errors
|
|
173
|
+
class ConfigurationError < RuntimeError; end
|
|
174
|
+
end
|
|
167
175
|
end
|
|
168
176
|
end
|
|
@@ -48,4 +48,8 @@ describe Mongoid::Kms do
|
|
|
48
48
|
expect(o.secure).to eq("bla")
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
+
it "fails to configure without a region" do
|
|
52
|
+
expect{Mongoid::Kms.configure({region: "", key: ""})}.to raise_error(Mongoid::Kms::Errors::ConfigurationError, "Region and KMS id key are required.")
|
|
53
|
+
end
|
|
54
|
+
|
|
51
55
|
end
|