auto_strong_parameters 0.0.2 → 0.0.4
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: dddcaa6e82b8ee32c7c48e829645a716a51298ebdc0e354951782454e6c50a7e
|
4
|
+
data.tar.gz: df7e2c4d6ac02ae237d5d432269be80e5f9182b583216201909dfc99b724e3dc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b311a61ef84324b1cd74e98bafcfa9e11a0b0493baa1e03bc388907cf31f7c06bf079d073349a63167a9936deb5bb6d6e6996c20f4c39ed6b21d2956a850510f
|
7
|
+
data.tar.gz: 9dde9aa41c0af04cbb757429acbf98b3826c981c8d6162468665c2863bcebb6606eac066b384eb72b82566447bee69a407ca6287e80a04410448234f06000236
|
@@ -14,7 +14,7 @@ module AutoStrongParameters::AutoFormParams
|
|
14
14
|
search_field telephone_field date_field time_field datetime_field
|
15
15
|
month_field week_field url_field email_field number_field range_field
|
16
16
|
file_field password_field text_area text_field radio_button phone_field
|
17
|
-
select
|
17
|
+
select collection_select trix_editor
|
18
18
|
)
|
19
19
|
|
20
20
|
TRACKED_FIELDS.each do |name|
|
@@ -3,12 +3,12 @@
|
|
3
3
|
module AutoStrongParameters
|
4
4
|
module AutoPermit
|
5
5
|
def auto_permit!(key)
|
6
|
-
shape = asp_auto_permitted_params
|
6
|
+
shape = asp_auto_permitted_params
|
7
7
|
|
8
8
|
require(key).permit(shape[key])
|
9
9
|
end
|
10
10
|
|
11
|
-
def asp_auto_permitted_params
|
11
|
+
def asp_auto_permitted_params
|
12
12
|
if sig = self[AutoStrongParameters.asp_message_key]
|
13
13
|
AutoStrongParameters.verifier.verify(sig) rescue {}
|
14
14
|
else
|
@@ -71,7 +71,7 @@ module AutoStrongParameters
|
|
71
71
|
end
|
72
72
|
end
|
73
73
|
|
74
|
-
# Rails'
|
74
|
+
# Rails' MessageVerifier exists with a stable API in all versions of Rails
|
75
75
|
# since 4.2.
|
76
76
|
def self.verifier
|
77
77
|
@verifier ||= ActiveSupport::MessageVerifier.new(secret, serializer: JSON)
|
data/test/auto_permit_test.rb
CHANGED
@@ -50,7 +50,7 @@ class AutoPermitTest < ActionController::TestCase
|
|
50
50
|
end
|
51
51
|
|
52
52
|
def test_auto_permit
|
53
|
-
post :auto_permit, **process_args(user: user_params
|
53
|
+
post :auto_permit, **process_args(user: user_params, message_key => signature)
|
54
54
|
assert_response :ok
|
55
55
|
j = ActiveSupport::JSON.decode(response.body)
|
56
56
|
|
@@ -61,7 +61,7 @@ class AutoPermitTest < ActionController::TestCase
|
|
61
61
|
end
|
62
62
|
|
63
63
|
def test_auto_permit_incorrect_signature
|
64
|
-
post :auto_permit, **process_args(user: user_params
|
64
|
+
post :auto_permit, **process_args(user: user_params, message_key => 'abc123')
|
65
65
|
assert_response :ok
|
66
66
|
j = ActiveSupport::JSON.decode(response.body)
|
67
67
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: auto_strong_parameters
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Drew Ulmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-08-
|
11
|
+
date: 2023-08-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|