mongoid-kms 0.0.16 → 0.0.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -9
  3. data/lib/mongoid/kms/version.rb +1 -1
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 18d8d83436bd3ff21504f25d350ce292073e6f87
4
- data.tar.gz: 67aed43a318aade0ac6c27afe43f918b02527aec
3
+ metadata.gz: daf435fff7916049bd43927b7d0801d4b9dca290
4
+ data.tar.gz: 08a6217d281d9bd19dfa3e584f9e310d8e874919
5
5
  SHA512:
6
- metadata.gz: aef8308e7a7186427bf44247621cc1a250983aacd06855c774f06498e664838ce5fc9df597c6a3668a2dd2c85ef941e57d61004ee3a32822038f48dd680e5973
7
- data.tar.gz: 274d378dff7c502714d52fc59681253c0ee1596d5c9aec1663e5c430b57a36f040033d0d00212f87cca38e96a5eb709c4268ffcb5b7124d8610b4a3b77076513
6
+ metadata.gz: dbd1e9f79c6b23100a9fb3f079bcbb3f6a2a1aaeba60146ac5b06f510de13955bd8ce9bcf7be637db77b60edb1965b05e4ed8d5723cd60e8f85c8a693029f041
7
+ data.tar.gz: 35344d3727d89ced09d2d778c5985fa8c34802d933b617f469adf78533039e38297cd085c352a5458bf977f1f00baeb0cd4ca413d9c9fad0cd28bac89223c7e7
data/README.md CHANGED
@@ -35,21 +35,23 @@ require 'mongoid/kms'
35
35
  Mongoid::Kms.configure({region: "us-east-1", key: "your aws kms key id i.e <02342-234-232-234-234>"})
36
36
  ```
37
37
 
38
- When defining yoru classes, `include Mongoid::Kms`, and use the
39
- `secure_field` to define your fields with a required `:context`.
40
- Context must return a hash.
38
+ When defining your classes, `include Mongoid::Kms`, and use the
39
+ `secure_field` to define your fields. The `:context` argument is an
40
+ optional list of method names or strings used for encrypting your
41
+ values.
42
+
43
+ The context argument is an important way to ensure simply having the
44
+ authentication keys and data field does not enable decryption. When
45
+ using context, it also requires an attacker to know the decryption
46
+ context.
41
47
 
42
48
  ```ruby
43
49
  class MyClass
44
50
  include Mongoid::Document
45
51
  include Mongoid::Kms
46
52
 
47
- secure_field :secure, type: String, context: lambda { |d| {name: d.name} }
48
- field :unsecure
49
-
50
- def name
51
- @name ||= "me-#{Time.now.to_i}"
52
- end
53
+ secure_field :my_secure_field, type: String, context: [:unsecure_field, "some-string"]
54
+ field :unsecure_field
53
55
  end
54
56
  ```
55
57
 
@@ -1,5 +1,5 @@
1
1
  module Mongoid
2
2
  module Kms
3
- VERSION = "0.0.16"
3
+ VERSION = "0.0.17"
4
4
  end
5
5
  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.16
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Winslett