arkaan 0.10.12 → 0.10.13
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_without_filter.rb +10 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6180f327f4462ae9a5d4272aefc06b39e39ac6c8
|
4
|
+
data.tar.gz: 38d166cf6ce1cfc4605ed618c25d65047a2ce634
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 298bc122d64e5c9e7c7725af760c1169edb4ffc1c4ba1e4bec8c91cda34c52e2d7ac293fe1d42ccf5eaaac8b9a5ee1f1d4cd49784c8a775c2fa99303ff5187aa
|
7
|
+
data.tar.gz: 451ff72609d333a36edfda5001ed61fdea1bde37599fa96010881d34b17efdf1efc91bd0fed35511e3519ea2450b1670aa5b2e6ccc7c79c953672c06e297d910
|
@@ -8,28 +8,31 @@ module Arkaan
|
|
8
8
|
# Creates a premium route whithin the Sinatra application, and registers it in the database if it does not already exists.
|
9
9
|
# @param verb [String] the HTTP method used to create this route.
|
10
10
|
# @param path [String] the path, beginning with a /, of the route to create.
|
11
|
-
def self.declare_route(verb, path, &block)
|
12
|
-
self.declare_route_with(verb, path, false, &block)
|
11
|
+
def self.declare_route(verb, path, options: {}, &block)
|
12
|
+
self.declare_route_with(verb, path, false, options, &block)
|
13
13
|
end
|
14
14
|
|
15
15
|
# Creates a non premium route whithin the Sinatra application, and registers it in the database if it does not already exists.
|
16
16
|
# @param verb [String] the HTTP method used to create this route.
|
17
17
|
# @param path [String] the path, beginning with a /, of the route to create.
|
18
|
-
def self.declare_premium_route(verb, path, &block)
|
19
|
-
self.declare_route_with(verb, path, true, &block)
|
18
|
+
def self.declare_premium_route(verb, path, options: {}, &block)
|
19
|
+
self.declare_route_with(verb, path, true, options, &block)
|
20
20
|
end
|
21
21
|
|
22
22
|
# Creates a route whithin the Sinatra application, and registers it in the database if it does not already exists.
|
23
23
|
# @param verb [String] the HTTP method used to create this route.
|
24
24
|
# @param path [String] the path, beginning with a /, of the route to create.
|
25
25
|
# @param premium [Boolean] TRUE to make the route premium, FALSE otherwise.
|
26
|
-
def self.declare_route_with(verb, path, premium, &block)
|
26
|
+
def self.declare_route_with(verb, path, premium, options, &block)
|
27
27
|
service = Arkaan::Utils::MicroService.instance.service
|
28
28
|
unless service.nil? || !service.routes.where(path: path, verb: verb).first.nil?
|
29
29
|
route = Arkaan::Monitoring::Route.create(path: path, verb: verb, premium: premium, service: service)
|
30
|
+
if !options.nil? && !options[:authenticated].nil?
|
31
|
+
route.update_attribute(:authenticated, false)
|
32
|
+
end
|
30
33
|
Arkaan::Permissions::Group.where(is_superuser: true).each do |group|
|
31
|
-
|
32
|
-
|
34
|
+
group.routes << route
|
35
|
+
group.save!
|
33
36
|
end
|
34
37
|
end
|
35
38
|
if premium
|