encrypted_form_fields 0.2.4 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +12 -7
- data/Appraisals +4 -0
- data/gemfiles/rails_5.2.gemfile +7 -0
- data/lib/encrypted_form_fields/helpers/encrypted_field.rb +18 -4
- data/lib/encrypted_form_fields/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f8473fbe12c2e4651d59618721c3f558801973dc3bd7e310b7eebbbded6566a0
|
4
|
+
data.tar.gz: cdf26728c8324e54939455e804a79c97202c29532dfc4df365e4f4c40bcb0a96
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 469720e80d0c1755bf03225fcccf35eea9861ca744d6a1750b203cb21315c2aa4c067ada1a72d5144795989bf1776713bcf55bad31a0e5d8d6433798085837c2
|
7
|
+
data.tar.gz: 1f512961dd5d7814964b87b92f29fcda7c1075ce60fbadb66e40af657945f3b9ca28c99f2ac2deba254bab92f2b66833946cf704c5bac3f77c78e9bad7c548dd
|
data/.travis.yml
CHANGED
@@ -5,19 +5,24 @@ gemfile:
|
|
5
5
|
- gemfiles/rails_4.2.gemfile
|
6
6
|
- gemfiles/rails_5.0.gemfile
|
7
7
|
- gemfiles/rails_5.1.gemfile
|
8
|
+
- gemfiles/rails_5.2.gemfile
|
8
9
|
- Gemfile
|
10
|
+
before_install:
|
11
|
+
- gem update --system
|
12
|
+
- gem install bundler
|
9
13
|
rvm:
|
10
|
-
- '2.2.
|
11
|
-
- '2.3.
|
12
|
-
- '2.4.
|
13
|
-
-
|
14
|
+
- '2.2.10'
|
15
|
+
- '2.3.7'
|
16
|
+
- '2.4.4'
|
17
|
+
- '2.5.1'
|
18
|
+
- jruby-9.1.15.0
|
14
19
|
matrix:
|
15
20
|
include:
|
16
|
-
- rvm: '2.3.
|
21
|
+
- rvm: '2.3.7'
|
17
22
|
gemfile: 'gemfiles/rails_4.0.gemfile'
|
18
|
-
- rvm: '2.3.
|
23
|
+
- rvm: '2.3.7'
|
19
24
|
gemfile: 'gemfiles/rails_4.1.gemfile'
|
20
|
-
- rvm: '2.4.
|
25
|
+
- rvm: '2.4.4'
|
21
26
|
gemfile: gemfiles/rails_head.gemfile
|
22
27
|
allow_failures:
|
23
28
|
- gemfile: gemfiles/rails_head.gemfile
|
data/Appraisals
CHANGED
@@ -4,16 +4,30 @@ require "action_view/helpers/tags/hidden_field"
|
|
4
4
|
module EncryptedFormFields
|
5
5
|
module Helpers
|
6
6
|
class EncryptedField < ActionView::Helpers::Tags::HiddenField
|
7
|
+
class << self
|
8
|
+
def field_type
|
9
|
+
"hidden"
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
7
13
|
def initialize(object_name, method_name, template_object, options = {})
|
8
14
|
super(object_name, method_name, template_object, options.dup)
|
9
|
-
value = @options.with_indifferent_access.fetch("value")
|
15
|
+
value = @options.with_indifferent_access.fetch("value") do
|
16
|
+
encrypted_field_value_before_type_cast(object)
|
17
|
+
end
|
10
18
|
@options["value"] = EncryptedFormFields.encrypt_and_sign(value)
|
11
19
|
@object_name = EncryptedFormFields.prefix_name(@object_name)
|
12
20
|
end
|
13
21
|
|
14
|
-
|
15
|
-
|
16
|
-
|
22
|
+
private
|
23
|
+
|
24
|
+
|
25
|
+
def encrypted_field_value_before_type_cast(object)
|
26
|
+
if method(:value_before_type_cast).arity.zero?
|
27
|
+
value_before_type_cast
|
28
|
+
else
|
29
|
+
# Fallbackf for Rails < 5.2
|
30
|
+
value_before_type_cast(object)
|
17
31
|
end
|
18
32
|
end
|
19
33
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: encrypted_form_fields
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ville Lautanala
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-04-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|
@@ -129,6 +129,7 @@ files:
|
|
129
129
|
- gemfiles/rails_4.2.gemfile
|
130
130
|
- gemfiles/rails_5.0.gemfile
|
131
131
|
- gemfiles/rails_5.1.gemfile
|
132
|
+
- gemfiles/rails_5.2.gemfile
|
132
133
|
- gemfiles/rails_head.gemfile
|
133
134
|
- lib/encrypted_form_fields.rb
|
134
135
|
- lib/encrypted_form_fields/dfs.rb
|
@@ -164,7 +165,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
164
165
|
version: '0'
|
165
166
|
requirements: []
|
166
167
|
rubyforge_project:
|
167
|
-
rubygems_version: 2.6
|
168
|
+
rubygems_version: 2.7.6
|
168
169
|
signing_key:
|
169
170
|
specification_version: 4
|
170
171
|
summary: Encrypted form fields for Rails
|