action_encrypt 0.1.4 → 0.2.0
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
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 850dbcfb530af9a8e6b85b1885c9ea4390c3850dae49aaaebc67ea383c7dcaf4
|
4
|
+
data.tar.gz: 56bb5d876520484d803e21d5bb0e56be1fa168de379e2d0530c8e6a70c8f142e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 961ae2946e16d396104cb911f2420bb449d204cb617d91ee10fc6732846c1057055f6ed8c100b3b6d87160135e7989ebc52f22a8cdd730e113ab5ab308e13d66
|
7
|
+
data.tar.gz: 34659ca935c25192bbfe2c313acf06d057a5b44098cb66e3924c146dd7a16f921c9d68f613eb282b40efb7a8371dad01bcd860b308e4229bb0204b09e69751bb
|
data/README.md
CHANGED
@@ -18,10 +18,14 @@ Install migrations:
|
|
18
18
|
$ rails action_encrypt:install:migrations
|
19
19
|
```
|
20
20
|
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
21
|
+
Create `action_encrypt.rb` in your initializers folder and set encryption keys. Generate them
|
22
|
+
using `SecureRandom.hex(32)`. You can decide between storing the values in ENV or using rails encrypted credentials system.
|
23
|
+
|
24
|
+
```ruby
|
25
|
+
ActionEncrypt.configure do |config|
|
26
|
+
config.key_encryption_key = ENV.fetch('KEY_ENCRYPTION_KEY')
|
27
|
+
config.blind_index_key = ENV.fetch('BLIND_INDEX_KEY')
|
28
|
+
end
|
25
29
|
```
|
26
30
|
|
27
31
|
Create a Data Encryption Key
|
@@ -8,7 +8,7 @@ module ActionEncrypt
|
|
8
8
|
def search_encrypted(name, opts = {})
|
9
9
|
require 'blind_index'
|
10
10
|
|
11
|
-
blind_index :"#{name}", key: [
|
11
|
+
blind_index :"#{name}", key: [ActionEncrypt.configuration.blind_index_key].pack("H*")
|
12
12
|
|
13
13
|
before_validation :"compute_#{name}_bidx"
|
14
14
|
|
data/lib/action_encrypt.rb
CHANGED
@@ -6,4 +6,15 @@ module ActionEncrypt
|
|
6
6
|
extend ActiveSupport::Autoload
|
7
7
|
|
8
8
|
autoload :Attribute
|
9
|
+
autoload :Configuration
|
10
|
+
|
11
|
+
class << self
|
12
|
+
def configuration
|
13
|
+
@configuration ||= Configuration.new
|
14
|
+
end
|
15
|
+
|
16
|
+
def configure
|
17
|
+
yield(configuration)
|
18
|
+
end
|
19
|
+
end
|
9
20
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: action_encrypt
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Van Der Beek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-12-
|
11
|
+
date: 2021-12-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -86,6 +86,7 @@ files:
|
|
86
86
|
- db/migrate/20190628112807_unique_index_iv_columns.rb
|
87
87
|
- lib/action_encrypt.rb
|
88
88
|
- lib/action_encrypt/attribute.rb
|
89
|
+
- lib/action_encrypt/configuration.rb
|
89
90
|
- lib/action_encrypt/engine.rb
|
90
91
|
- lib/action_encrypt/version.rb
|
91
92
|
- lib/tasks/action_encrypt_tasks.rake
|