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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: ea521aeaff4c65ebe7a1a96ba113d885a40b0b3c
4
- data.tar.gz: b96614a8f13656db93e3bc17cfdce9b9ea7f528b
2
+ SHA256:
3
+ metadata.gz: bca11b23728bdd0d8eb8913a3ddfeeb84d1f8bbc7676d59245a14c9b69946745
4
+ data.tar.gz: 40adc04a6d5e39fbeb216538b540d7811afeea4d0b0255ce9f7560d094ad8edf
5
5
  SHA512:
6
- metadata.gz: 08dedc6d112ee39efac6b1459a133e3b9a229fd2d167f43aa543a036d2eef076a398750aac48e817adbd737cd57b00fb77a975248f5e73d6915b69cc4bedb676
7
- data.tar.gz: 1cfa55183aa24c7a9679a4b25aaee8ad7919392d8fc9ec8933b5bec6d5f508eb3128ebe598c5c1ce190c88975cf6db069a7dcf3339a0232955ef73d2273982cd
6
+ metadata.gz: 7d94e829611086ff905c9fc05759d7baf5478c880346a8940d3187794e411874dca7f692983fb307490b67dc0f92b5b50b3fba1a81bac9414c881491f94e7bbf
7
+ data.tar.gz: 4a50a075be5b8cfd8857df6c726786a57a7bf8f1b0f642051d3d69bc144b03b5d9b00fc9d99810285c9043182cf16004452d2e3d9cb30f23763737f1504892a4
data/.gitignore CHANGED
@@ -20,3 +20,4 @@ tmp
20
20
  *.o
21
21
  *.a
22
22
  mkmf.log
23
+ .ruby-version
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.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 'spec'
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 = default_options.merge(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
- when paths_of(:included_paths, include: path)
49
- true
48
+ when paths_of(:included_paths, include: path)
49
+ true
50
50
 
51
- when paths_of(:excluded_paths, include: path)
52
- false
51
+ when paths_of(:excluded_paths, include: path)
52
+ false
53
53
 
54
- else
55
- true
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
- @options[option_key].any? do |matcher|
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.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: 2016-11-24 00:00:00.000000000 Z
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: spec
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
- rubyforge_project:
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