haveapi 0.23.6 → 0.24.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
  SHA256:
3
- metadata.gz: 7f02822c658ab380548ae4dff814cb32eade078d22498ac0aa11312b54295c23
4
- data.tar.gz: 8a994e4132a15f37f1d77c91dba3bb9f19f45a19dbe74db8f8d332f0d901c4f0
3
+ metadata.gz: 3aa75ace0c33e4332c2e01370c769d011a8b4bc1f143dcc72ff9a5019c55cf6c
4
+ data.tar.gz: 86bce4af8c7d347bc11f6f3b840bc0d16ea4bac8d6bec827c1d6aea2f5a2c53f
5
5
  SHA512:
6
- metadata.gz: 7d4d1a9bc940b407fb27dd38c71daecf9b4b4f6c52b1d273d78c6c6aee44d030e7445c8d56bc4c4dd48c5dcf041839faab1a4854681f311b4164bf9d1c68e629
7
- data.tar.gz: b560e62271490e24c84f47edbe212d4007010724b0a77d996df4ef1fe9a005600e957717c57caf1b298a85f4b92170f0003f643950def642a0ff5c1500e2aa2c
6
+ metadata.gz: bb2e3d9d6f1b554b96896b1d3d45b18ac07e9a4d0bf6ea98a505125d741414a41c973f37d3717cac128f1ba58a1fc645d490f4fa8881e1394f2c0f9a56df7d68
7
+ data.tar.gz: 8af545bdde9b7535460a99da6999a85c79c482b85c08a82af984e3acccd42d27df1dabb235a1f876280b6dd20763462a98789b1c44da6918e5bbfedcf3d7f48f
data/haveapi.gemspec CHANGED
@@ -16,7 +16,7 @@ Gem::Specification.new do |s|
16
16
 
17
17
  s.add_dependency 'activesupport', '>= 7.1'
18
18
  s.add_dependency 'github-markdown'
19
- s.add_dependency 'haveapi-client', '~> 0.23.4'
19
+ s.add_dependency 'haveapi-client', '~> 0.24.0'
20
20
  s.add_dependency 'json'
21
21
  s.add_dependency 'mail'
22
22
  s.add_dependency 'nesty', '~> 1.0'
@@ -24,7 +24,7 @@ Gem::Specification.new do |s|
24
24
  s.add_dependency 'rake'
25
25
  s.add_dependency 'redcarpet', '~> 3.6'
26
26
  s.add_dependency 'require_all', '~> 2.0.0'
27
- s.add_dependency 'sinatra', '~> 3.1.0'
28
- s.add_dependency 'sinatra-contrib', '~> 3.1.0'
29
- s.add_dependency 'tilt', '~> 2.3.0'
27
+ s.add_dependency 'sinatra', '~> 4.0'
28
+ s.add_dependency 'sinatra-contrib', '~> 4.0'
29
+ s.add_dependency 'tilt', '~> 2.4'
30
30
  end
@@ -114,7 +114,7 @@ module HaveAPI::Authentication
114
114
 
115
115
  def authenticate(request)
116
116
  tokens = [
117
- request['access_token'],
117
+ request.params['access_token'],
118
118
  token_from_authorization_header(request),
119
119
  token_from_haveapi_header(request)
120
120
  ].compact
@@ -159,7 +159,7 @@ module HaveAPI::Authentication
159
159
  # @param request [Sinatra::Request]
160
160
  # @return [String]
161
161
  def token(request)
162
- request[config.class.query_parameter] || request.env[header_to_env]
162
+ request.params[config.class.query_parameter] || request.env[header_to_env]
163
163
  end
164
164
 
165
165
  def describe
@@ -74,11 +74,11 @@ module HaveAPI
74
74
  return unless request.env['HTTP_ORIGIN'] && request.env['HTTP_ACCESS_CONTROL_REQUEST_METHOD']
75
75
 
76
76
  halt 200, {
77
- 'Access-Control-Allow-Origin' => '*',
78
- 'Access-Control-Allow-Methods' => 'GET,POST,OPTIONS,PATCH,PUT,DELETE',
79
- 'Access-Control-Allow-Credentials' => 'false',
80
- 'Access-Control-Allow-Headers' => settings.api_server.allowed_headers,
81
- 'Access-Control-Max-Age' => (60 * 60).to_s
77
+ 'access-control-allow-origin' => '*',
78
+ 'access-control-allow-methods' => 'GET,POST,OPTIONS,PATCH,PUT,DELETE',
79
+ 'access-control-allow-credentials' => 'false',
80
+ 'access-control-allow-headers' => settings.api_server.allowed_headers,
81
+ 'access-control-max-age' => (60 * 60).to_s
82
82
  }, ''
83
83
  end
84
84
 
@@ -94,7 +94,7 @@ module HaveAPI
94
94
  def require_auth!
95
95
  report_error(
96
96
  401,
97
- { 'WWW-Authenticate' => 'Basic realm="Restricted Area"' },
97
+ { 'www-authenticate' => 'Basic realm="Restricted Area"' },
98
98
  'Action requires user to authenticate'
99
99
  )
100
100
  end
@@ -231,8 +231,8 @@ module HaveAPI
231
231
 
232
232
  before do
233
233
  if request.env['HTTP_ORIGIN']
234
- headers 'Access-Control-Allow-Origin' => '*',
235
- 'Access-Control-Allow-Credentials' => 'false'
234
+ headers 'access-control-allow-origin' => '*',
235
+ 'access-control-allow-credentials' => 'false'
236
236
  end
237
237
  end
238
238
 
@@ -468,8 +468,6 @@ module HaveAPI
468
468
  authenticated?(v)
469
469
  end
470
470
 
471
- request.body.rewind
472
-
473
471
  begin
474
472
  body = request.body.read
475
473
 
@@ -42,7 +42,7 @@ module HaveAPI::Spec
42
42
  method(action.http_method).call(
43
43
  path,
44
44
  params && params.to_json,
45
- { 'Content-Type' => 'application/json' }
45
+ { 'content-type' => 'application/json' }
46
46
  )
47
47
 
48
48
  else
@@ -51,7 +51,7 @@ module HaveAPI::Spec
51
51
  method(http_method).call(
52
52
  path,
53
53
  params && params.to_json,
54
- { 'Content-Type' => 'application/json' }
54
+ { 'content-type' => 'application/json' }
55
55
  )
56
56
  end
57
57
  end
@@ -1,4 +1,4 @@
1
1
  module HaveAPI
2
2
  PROTOCOL_VERSION = '2.0'.freeze
3
- VERSION = '0.23.6'.freeze
3
+ VERSION = '0.24.0'.freeze
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: haveapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.23.6
4
+ version: 0.24.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Skokan
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: 0.23.4
47
+ version: 0.24.0
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: 0.23.4
54
+ version: 0.24.0
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: json
57
57
  requirement: !ruby/object:Gem::Requirement
@@ -156,42 +156,42 @@ dependencies:
156
156
  requirements:
157
157
  - - "~>"
158
158
  - !ruby/object:Gem::Version
159
- version: 3.1.0
159
+ version: '4.0'
160
160
  type: :runtime
161
161
  prerelease: false
162
162
  version_requirements: !ruby/object:Gem::Requirement
163
163
  requirements:
164
164
  - - "~>"
165
165
  - !ruby/object:Gem::Version
166
- version: 3.1.0
166
+ version: '4.0'
167
167
  - !ruby/object:Gem::Dependency
168
168
  name: sinatra-contrib
169
169
  requirement: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: 3.1.0
173
+ version: '4.0'
174
174
  type: :runtime
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: 3.1.0
180
+ version: '4.0'
181
181
  - !ruby/object:Gem::Dependency
182
182
  name: tilt
183
183
  requirement: !ruby/object:Gem::Requirement
184
184
  requirements:
185
185
  - - "~>"
186
186
  - !ruby/object:Gem::Version
187
- version: 2.3.0
187
+ version: '2.4'
188
188
  type: :runtime
189
189
  prerelease: false
190
190
  version_requirements: !ruby/object:Gem::Requirement
191
191
  requirements:
192
192
  - - "~>"
193
193
  - !ruby/object:Gem::Version
194
- version: 2.3.0
194
+ version: '2.4'
195
195
  description: Framework for creating self-describing APIs
196
196
  email: jakub.skokan@vpsfree.cz
197
197
  executables: []