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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b2489de3825c857eafa4ce5ed003756b6982d17f
4
- data.tar.gz: b45954c7b2f625091dd4d7ad8655356eb34f252b
3
+ metadata.gz: 04148bb5142b9ebae181f0df4b525fe3e8f3b10d
4
+ data.tar.gz: b6d1b458eac0fbee1f82e4d97126e8508cd87611
5
5
  SHA512:
6
- metadata.gz: 3713b7f2902368cbfb14511474759a354d2d996d4866020d424b759a4becd43ee7184d148bd34cd05155e58aff661e47e07e0681104006127de9f333b2d0b43e
7
- data.tar.gz: 3302950a73fa0c982bbd3edb7e41e7f2086b67fecdcfec64f5cc62cd142a0c4c58fbee1a02ca8a6a8e74158ad350d1712363576990b780769ac653035139d3f5
6
+ metadata.gz: 27c3ce833d7b7a4e1702fbef09fa934fc41436dcb98fae84b585c64fbe06a2a9b36423436a50b10a702bfb1066d289515ec02884913c18f3bc5dcc79f22e70fc
7
+ data.tar.gz: 00ff0dc854ec766993494a467c32700f459afdd64a4a8c8a11613c51a1d21ebc4753dc47e191fbbb8f6c813b8d669f70ae638ae9aea57890bb0290cef2f3d471
checksums.yaml.gz.sig CHANGED
Binary file
data.tar.gz.sig CHANGED
@@ -1 +1,3 @@
1
- |g�Y���2 q"7)���W �QW
1
+ Tб`����4(��ѝ�}�4���W!G<�Y���۩�vlM�4C'K-y2�"�l��jl]��Uբ��W�R��
2
+ ��'0�d�Ó��QT�S3i6Ÿ�BP�z��f&@K�Bߨ�Gd��=[^ Q�p�*.���r��3
3
+ Ĉ��*..(��U&�?>�'Q��xZ򜛚t��w�)�%v]j!�G�5!q� k�-�\��`؞��@@�x����V�X�-2�!҄N��51dˊ�U��n-
@@ -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[1][:filter][1][name] = []
42
+ authorized_params[6][:filter][1][name] = []
38
43
  else
39
- authorized_params[1][:filter] << name
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[1][:data][2][:attributes][0][name] = []
42
+ authorized_params[6][:data][2][:attributes][0][name] = []
38
43
  else
39
- authorized_params[1][:data][2][:attributes] << name
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[1][:data][2][:relationships][name] = [:data]
62
+ authorized_params[6][:data][2][:relationships][name] = [:data]
58
63
  else
59
- authorized_params[1][:data][2][:relationships][name] = { data: %i{type id} }
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
- data = JSON.parse(request_parameters)
37
- data = underscore_parameters(data)
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Drillbit
3
- VERSION = '2.6.0'
3
+ VERSION = '2.7.0'
4
4
  end
@@ -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, include(filter: include(:name, :age)))
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, include(filter: include(:name, ary: [])))
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.6.0
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-17 00:00:00.000000000 Z
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