acts_as_encryptable 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +7 -1
- data/README.md +12 -6
- data/lib/acts_as_encryptable.rb +2 -2
- data/lib/acts_as_encryptable/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee5d3cc0b5cbdacb22cbf522f49b8178e6d448c5
|
4
|
+
data.tar.gz: 4990c13097dba9c1573a251de6a93176eabcd818
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: '0749f5a82b07583f9179e7f6ad18257cfc94fb5e4f810d4f691ecec1f86a437fe06ab20d67b87f8b7f4087dc67177886f35aff2cd9123541d27318287b5f6318'
|
7
|
+
data.tar.gz: 83f685439e9c6a59e44d62e5d5edaf8c97f1f904ee83a6a40e5fd0368f43f226d0169858125d7b6d27fea4ef4fbd2b7585d106d982afa966067dbce55508c5e1
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,13 @@
|
|
1
1
|
# ActsAsEncryptable
|
2
|
+
[![Gem Version](https://badge.fury.io/rb/acts_as_encryptable.svg)](https://badge.fury.io/rb/acts_as_encryptable)
|
3
|
+
[![Build Status](https://travis-ci.org/danielpclark/acts_as_encryptable.svg?branch=master)](https://travis-ci.org/danielpclark/acts_as_encryptable)
|
2
4
|
|
3
|
-
This gem
|
4
|
-
and allows you to set any ActiveRecord model as an encrypted field.
|
5
|
+
This gem adds support with ActiveSupport's existing message encryption
|
6
|
+
and allows you to set any ActiveRecord model column as an encrypted field.
|
5
7
|
|
8
|
+
It's bloat free and easy to use. This way you're up to date on security as
|
9
|
+
long as Rails is. And there's no high maintenance or feature bloat like
|
10
|
+
other "encryption helper gems" have 😉 . It's fully tested too!
|
6
11
|
|
7
12
|
## Installation
|
8
13
|
|
@@ -12,9 +17,10 @@ Add this line to your application's Gemfile:
|
|
12
17
|
gem 'acts_as_encryptable'
|
13
18
|
```
|
14
19
|
|
15
|
-
And create an initializer file
|
20
|
+
And create an initializer file:
|
16
21
|
|
17
22
|
```ruby
|
23
|
+
# config/initializers/acts_as_encryptable.rb
|
18
24
|
ActiveRecord::Base.extend ActsAsEncryptable
|
19
25
|
```
|
20
26
|
|
@@ -45,11 +51,11 @@ class Email < ActiveRecord::Base
|
|
45
51
|
end
|
46
52
|
```
|
47
53
|
|
48
|
-
If you're encrypting multiple fields you may choose to
|
49
|
-
|
54
|
+
If you're encrypting multiple fields you may choose to vary what keys and salts
|
55
|
+
are used per column, but this will add a performance hit for the extra
|
50
56
|
encryption startup time.
|
51
57
|
|
52
|
-
If you want to perform additional work on record data that you want to encrypt
|
58
|
+
If you want to perform additional work on record data that you want to encrypt;
|
53
59
|
write a method alias after the `acts_as_encryptable` decleration and have your
|
54
60
|
new method call it. `acts_as_encryptable` should always be written before any
|
55
61
|
method aliasing.
|
data/lib/acts_as_encryptable.rb
CHANGED
@@ -8,7 +8,7 @@ module ActsAsEncryptable
|
|
8
8
|
instance_variable_set(
|
9
9
|
encryptor,
|
10
10
|
ActiveSupport::MessageEncryptor.new(
|
11
|
-
ActiveSupport::KeyGenerator.new(send key).generate_key(send
|
11
|
+
ActiveSupport::KeyGenerator.new(send key).generate_key(send(salt), 32)
|
12
12
|
)
|
13
13
|
) unless instance_variable_defined? encryptor
|
14
14
|
|
@@ -22,7 +22,7 @@ module ActsAsEncryptable
|
|
22
22
|
instance_variable_set(
|
23
23
|
encryptor,
|
24
24
|
ActiveSupport::MessageEncryptor.new(
|
25
|
-
ActiveSupport::KeyGenerator.new(send key).generate_key(send
|
25
|
+
ActiveSupport::KeyGenerator.new(send key).generate_key(send(salt), 32)
|
26
26
|
)
|
27
27
|
) unless instance_variable_defined? encryptor
|
28
28
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: acts_as_encryptable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel P. Clark
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-06-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -174,7 +174,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
174
|
version: '0'
|
175
175
|
requirements: []
|
176
176
|
rubyforge_project:
|
177
|
-
rubygems_version: 2.
|
177
|
+
rubygems_version: 2.6.11
|
178
178
|
signing_key:
|
179
179
|
specification_version: 4
|
180
180
|
summary: Adds simple record encryption for Rails.
|