haveapi 0.23.7 → 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3aa75ace0c33e4332c2e01370c769d011a8b4bc1f143dcc72ff9a5019c55cf6c
|
4
|
+
data.tar.gz: 86bce4af8c7d347bc11f6f3b840bc0d16ea4bac8d6bec827c1d6aea2f5a2c53f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
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', '~>
|
28
|
-
s.add_dependency 'sinatra-contrib', '~>
|
29
|
-
s.add_dependency 'tilt', '~> 2.
|
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
|
@@ -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
|
data/lib/haveapi/server.rb
CHANGED
@@ -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
|
-
'
|
78
|
-
'
|
79
|
-
'
|
80
|
-
'
|
81
|
-
'
|
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
|
-
{ '
|
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 '
|
235
|
-
'
|
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
|
-
{ '
|
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
|
-
{ '
|
54
|
+
{ 'content-type' => 'application/json' }
|
55
55
|
)
|
56
56
|
end
|
57
57
|
end
|
data/lib/haveapi/version.rb
CHANGED
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.
|
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.
|
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.
|
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:
|
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:
|
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:
|
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:
|
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.
|
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.
|
194
|
+
version: '2.4'
|
195
195
|
description: Framework for creating self-describing APIs
|
196
196
|
email: jakub.skokan@vpsfree.cz
|
197
197
|
executables: []
|