mongoid-kms 0.0.15 → 0.0.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 029a4f6efe9f5dafce5aef2c5fab0801229f04cc
4
- data.tar.gz: 749be3c2641a52cebab3d4f7f2e8d1491a765649
3
+ metadata.gz: 18d8d83436bd3ff21504f25d350ce292073e6f87
4
+ data.tar.gz: 67aed43a318aade0ac6c27afe43f918b02527aec
5
5
  SHA512:
6
- metadata.gz: b1386752d377273539f4f06130d820316d7398e10aac8303b7794d84015c95213b2ad5d909ff64a77516a5491f2f9878c04957d78888f93dcc5c36808eac8f27
7
- data.tar.gz: 759ce38aba35b4d9b49401e2b3cb08f64ef4017c832bf7b6608bd09b9caac659228d44517a9a0e0eac480fbdfca5167ee51095cb3245cfb4078656b99b3405bb
6
+ metadata.gz: aef8308e7a7186427bf44247621cc1a250983aacd06855c774f06498e664838ce5fc9df597c6a3668a2dd2c85ef941e57d61004ee3a32822038f48dd680e5973
7
+ data.tar.gz: 274d378dff7c502714d52fc59681253c0ee1596d5c9aec1663e5c430b57a36f040033d0d00212f87cca38e96a5eb709c4268ffcb5b7124d8610b4a3b77076513
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Kms
3
- VERSION = "0.0.15"
3
+ VERSION = "0.0.16"
4
4
  end
5
5
  end
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
- @configuration = args
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mongoid-kms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.15
4
+ version: 0.0.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Winslett