escher-rack_middleware 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.gitignore +1 -0
- data/VERSION +1 -1
- data/escher-rack_middleware.gemspec +1 -1
- data/lib/escher/rack_middleware.rb +13 -11
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bca11b23728bdd0d8eb8913a3ddfeeb84d1f8bbc7676d59245a14c9b69946745
|
4
|
+
data.tar.gz: 40adc04a6d5e39fbeb216538b540d7811afeea4d0b0255ce9f7560d094ad8edf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7d94e829611086ff905c9fc05759d7baf5478c880346a8940d3187794e411874dca7f692983fb307490b67dc0f92b5b50b3fba1a81bac9414c881491f94e7bbf
|
7
|
+
data.tar.gz: 4a50a075be5b8cfd8857df6c726786a57a7bf8f1b0f642051d3d69bc144b03b5d9b00fc9d99810285c9043182cf16004452d2e3d9cb30f23763737f1504892a4
|
data/.gitignore
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.3.
|
1
|
+
0.3.4
|
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
|
18
18
|
spec.add_development_dependency 'bundler', '>= 1.6'
|
19
19
|
spec.add_development_dependency 'rake'
|
20
|
-
spec.add_development_dependency '
|
20
|
+
spec.add_development_dependency 'rspec'
|
21
21
|
|
22
22
|
spec.add_dependency 'rack'
|
23
23
|
spec.add_dependency 'escher', '>= 0.3.3'
|
@@ -1,6 +1,6 @@
|
|
1
1
|
require 'escher'
|
2
|
-
class Escher::RackMiddleware
|
3
2
|
|
3
|
+
class Escher::RackMiddleware
|
4
4
|
require 'escher/rack_middleware/version'
|
5
5
|
require 'escher/rack_middleware/logging'
|
6
6
|
require 'escher/rack_middleware/credential'
|
@@ -16,9 +16,9 @@ class Escher::RackMiddleware
|
|
16
16
|
extend Authenticator
|
17
17
|
include DefaultOptions
|
18
18
|
|
19
|
-
def initialize(app,options={})
|
19
|
+
def initialize(app, options = {})
|
20
20
|
@app = app
|
21
|
-
@options =
|
21
|
+
@options = options
|
22
22
|
end
|
23
23
|
|
24
24
|
def call(request_env)
|
@@ -45,21 +45,21 @@ class Escher::RackMiddleware
|
|
45
45
|
def authorize_path?(path)
|
46
46
|
case true
|
47
47
|
|
48
|
-
|
49
|
-
|
48
|
+
when paths_of(:included_paths, include: path)
|
49
|
+
true
|
50
50
|
|
51
|
-
|
52
|
-
|
51
|
+
when paths_of(:excluded_paths, include: path)
|
52
|
+
false
|
53
53
|
|
54
|
-
|
55
|
-
|
54
|
+
else
|
55
|
+
true
|
56
56
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
60
|
def paths_of(option_key, h)
|
61
61
|
path = h[:include]
|
62
|
-
|
62
|
+
final_options[option_key].any? do |matcher|
|
63
63
|
if matcher.is_a?(Regexp)
|
64
64
|
!!(path =~ matcher)
|
65
65
|
else
|
@@ -68,5 +68,7 @@ class Escher::RackMiddleware
|
|
68
68
|
end
|
69
69
|
end
|
70
70
|
|
71
|
-
|
71
|
+
def final_options
|
72
|
+
@final_options ||= default_options.merge(@options)
|
73
|
+
end
|
72
74
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: escher-rack_middleware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Adam Luzsi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-02-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -39,7 +39,7 @@ dependencies:
|
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
|
-
name:
|
42
|
+
name: rspec
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - ">="
|
@@ -129,8 +129,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
129
|
- !ruby/object:Gem::Version
|
130
130
|
version: '0'
|
131
131
|
requirements: []
|
132
|
-
|
133
|
-
rubygems_version: 2.4.8
|
132
|
+
rubygems_version: 3.0.3
|
134
133
|
signing_key:
|
135
134
|
specification_version: 4
|
136
135
|
summary: Escher authorization for rack based http servers
|