drillbit 2.6.0 → 2.7.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +3 -1
- data/lib/drillbit/authorizers/parameters/filtering.rb +7 -2
- data/lib/drillbit/authorizers/parameters/resource.rb +9 -4
- data/lib/drillbit/middleware/parameter_parser.rb +7 -2
- data/lib/drillbit/version.rb +1 -1
- data/spec/drillbit/authorizers/parameters/filtering_spec.rb +23 -2
- metadata +2 -2
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 04148bb5142b9ebae181f0df4b525fe3e8f3b10d
|
4
|
+
data.tar.gz: b6d1b458eac0fbee1f82e4d97126e8508cd87611
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27c3ce833d7b7a4e1702fbef09fa934fc41436dcb98fae84b585c64fbe06a2a9b36423436a50b10a702bfb1066d289515ec02884913c18f3bc5dcc79f22e70fc
|
7
|
+
data.tar.gz: 00ff0dc854ec766993494a467c32700f459afdd64a4a8c8a11613c51a1d21ebc4753dc47e191fbbb8f6c813b8d669f70ae638ae9aea57890bb0290cef2f3d471
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data.tar.gz.sig
CHANGED
@@ -14,6 +14,11 @@ class Filtering < Authorizers::Parameters
|
|
14
14
|
def authorized_params
|
15
15
|
@authorized_params ||= [
|
16
16
|
:sort,
|
17
|
+
:token,
|
18
|
+
:token_b64,
|
19
|
+
:token_jwt,
|
20
|
+
:format,
|
21
|
+
:accept,
|
17
22
|
page: %i{
|
18
23
|
number
|
19
24
|
size
|
@@ -34,9 +39,9 @@ class Filtering < Authorizers::Parameters
|
|
34
39
|
fetch(name, nil)
|
35
40
|
|
36
41
|
if param.class == Array
|
37
|
-
authorized_params[
|
42
|
+
authorized_params[6][:filter][1][name] = []
|
38
43
|
else
|
39
|
-
authorized_params[
|
44
|
+
authorized_params[6][:filter] << name
|
40
45
|
end
|
41
46
|
end
|
42
47
|
|
@@ -14,6 +14,11 @@ class Resource < Authorizers::Parameters
|
|
14
14
|
def authorized_params
|
15
15
|
@authorized_params ||= [
|
16
16
|
:id,
|
17
|
+
:token,
|
18
|
+
:token_b64,
|
19
|
+
:token_jwt,
|
20
|
+
:format,
|
21
|
+
:accept,
|
17
22
|
data: [
|
18
23
|
:type,
|
19
24
|
:id,
|
@@ -34,9 +39,9 @@ class Resource < Authorizers::Parameters
|
|
34
39
|
fetch(name, nil)
|
35
40
|
|
36
41
|
if param.class == Array
|
37
|
-
authorized_params[
|
42
|
+
authorized_params[6][:data][2][:attributes][0][name] = []
|
38
43
|
else
|
39
|
-
authorized_params[
|
44
|
+
authorized_params[6][:data][2][:attributes] << name
|
40
45
|
end
|
41
46
|
end
|
42
47
|
|
@@ -54,9 +59,9 @@ class Resource < Authorizers::Parameters
|
|
54
59
|
fetch(:data, nil)
|
55
60
|
|
56
61
|
if param.nil?
|
57
|
-
authorized_params[
|
62
|
+
authorized_params[6][:data][2][:relationships][name] = [:data]
|
58
63
|
else
|
59
|
-
authorized_params[
|
64
|
+
authorized_params[6][:data][2][:relationships][name] = { data: %i{type id} }
|
60
65
|
end
|
61
66
|
end
|
62
67
|
|
@@ -33,8 +33,13 @@ class ParameterParser
|
|
33
33
|
private
|
34
34
|
|
35
35
|
def underscore_request_parameters(request_parameters)
|
36
|
-
|
37
|
-
|
36
|
+
request_parameter_string = if request_parameters.respond_to?(:read)
|
37
|
+
request_parameters.read
|
38
|
+
else
|
39
|
+
request_parameters.to_s
|
40
|
+
end
|
41
|
+
data = JSON.parse(request_parameter_string)
|
42
|
+
data = underscore_parameters(data)
|
38
43
|
|
39
44
|
JSON.dump(data)
|
40
45
|
end
|
data/lib/drillbit/version.rb
CHANGED
@@ -20,7 +20,15 @@ describe Filtering do
|
|
20
20
|
filter_params.call
|
21
21
|
|
22
22
|
expect(params).to have_received(:permit).
|
23
|
-
with(:sort,
|
23
|
+
with(:sort,
|
24
|
+
:token,
|
25
|
+
:token_b64,
|
26
|
+
:token_jwt,
|
27
|
+
:format,
|
28
|
+
:accept,
|
29
|
+
include(
|
30
|
+
filter: include(:name, :age),
|
31
|
+
))
|
24
32
|
end
|
25
33
|
|
26
34
|
it 'can authorize parameters if they come in as arrays', verify: false do
|
@@ -41,7 +49,15 @@ describe Filtering do
|
|
41
49
|
filter_params.call
|
42
50
|
|
43
51
|
expect(params).to have_received(:permit).
|
44
|
-
with(:sort,
|
52
|
+
with(:sort,
|
53
|
+
:token,
|
54
|
+
:token_b64,
|
55
|
+
:token_jwt,
|
56
|
+
:format,
|
57
|
+
:accept,
|
58
|
+
include(
|
59
|
+
filter: include(:name, ary: []),
|
60
|
+
))
|
45
61
|
end
|
46
62
|
|
47
63
|
it 'has default authorized parameters', verify: false do
|
@@ -56,6 +72,11 @@ describe Filtering do
|
|
56
72
|
|
57
73
|
expect(params).to have_received(:permit).
|
58
74
|
with(:sort,
|
75
|
+
:token,
|
76
|
+
:token_b64,
|
77
|
+
:token_jwt,
|
78
|
+
:format,
|
79
|
+
:accept,
|
59
80
|
page: %i{
|
60
81
|
number
|
61
82
|
size
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: drillbit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- thegranddesign
|
@@ -31,7 +31,7 @@ cert_chain:
|
|
31
31
|
zRIv8lqQM8QFT76rzP5SBCERwN+ltKAFbQ5/FwmZNGWYnmCP3RZMQiRnbh+9H9lh
|
32
32
|
mlbwaYZTjgsXq6cy8N38EecewgBbZYS1IYJraE/M
|
33
33
|
-----END CERTIFICATE-----
|
34
|
-
date: 2016-10-
|
34
|
+
date: 2016-10-23 00:00:00.000000000 Z
|
35
35
|
dependencies:
|
36
36
|
- !ruby/object:Gem::Dependency
|
37
37
|
name: erratum
|
metadata.gz.sig
CHANGED
Binary file
|