mongoid-kms 0.0.16 → 0.0.17
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/README.md +11 -9
- data/lib/mongoid/kms/version.rb +1 -1
- 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: daf435fff7916049bd43927b7d0801d4b9dca290
|
4
|
+
data.tar.gz: 08a6217d281d9bd19dfa3e584f9e310d8e874919
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
39
|
-
`secure_field` to define your fields
|
40
|
-
|
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 :
|
48
|
-
field :
|
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
|
|
data/lib/mongoid/kms/version.rb
CHANGED