arkaan 0.8.8 → 0.8.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/arkaan/utils/controller.rb +10 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 307e2d6069e3590e31e8bbb4d99bfe89feee56af
|
4
|
+
data.tar.gz: 9cdcd6a5e096bf414b3cd59996de31a12befcd7d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 507a5048c7f777d9cc7e516b672109f05e574dc615695ab250b485b475f10af7568f29461d709a973859b6480c3934c7264e67a51708f51d569dc13c9ff730db
|
7
|
+
data.tar.gz: a31af0a0ea002429fcd45075f04a089125ece822f1dccd335968ccc1c3445a87bb7bcf1563b739037c2af61865bad04082d941c563206c94c7072075ed83d505
|
@@ -12,9 +12,11 @@ module Arkaan
|
|
12
12
|
@application = Arkaan::OAuth::Application.where(key: params['app_key']).first
|
13
13
|
|
14
14
|
if gateway.nil?
|
15
|
-
|
15
|
+
url = 'https://github.com/jdr-tools/arkaan/wiki/Errors#gateway-token-not-found'
|
16
|
+
halt 404, {status: 404, field: 'token', error: 'unknown', docs: url}.to_json
|
16
17
|
elsif @application.nil?
|
17
|
-
|
18
|
+
url = 'https://github.com/jdr-tools/arkaan/wiki/Errors#application-key-not-found'
|
19
|
+
halt 404, {status: 404, field: 'app_key', error: 'unknown', docs: url}.to_json
|
18
20
|
end
|
19
21
|
end
|
20
22
|
|
@@ -45,7 +47,8 @@ module Arkaan
|
|
45
47
|
self.public_send(verb, path) do
|
46
48
|
@sinatra_route = parse_current_route
|
47
49
|
if !@application.premium?
|
48
|
-
|
50
|
+
url = 'https://github.com/jdr-tools/arkaan/wiki/Errors#application-not-premium'
|
51
|
+
halt 403, {status: 403, field: 'app_key', error: 'forbidden', docs: url}.to_json
|
49
52
|
end
|
50
53
|
instance_eval(&block)
|
51
54
|
end
|
@@ -58,7 +61,10 @@ module Arkaan
|
|
58
61
|
# @param fields [Array<String>] an array of fields names to search in the parameters
|
59
62
|
def check_presence(*fields)
|
60
63
|
fields.each do |field|
|
61
|
-
|
64
|
+
if params[field].nil? || params[field] == ''
|
65
|
+
url = 'https://github.com/jdr-tools/arkaan/wiki/Errors#parameter-not-given'
|
66
|
+
halt 400, {status: 400, field: field, error: 'required', docs: url}.to_json
|
67
|
+
end
|
62
68
|
end
|
63
69
|
end
|
64
70
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: arkaan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vincent Courtois
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-04-
|
11
|
+
date: 2018-04-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|