vault-tools 0.5.21 → 0.5.22

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
  SHA1:
3
- metadata.gz: b1b48f0fc5af1c19d7f8a01bb1e46c5f2992f999
4
- data.tar.gz: d6f43bfb24ca0a0972a8e76c72e5c59731da6911
3
+ metadata.gz: 30a308b70cb2b0dd36a4adbfa44579504e0e3eda
4
+ data.tar.gz: 25851c62a3c1cdede8a40045c7ad413227be03d7
5
5
  SHA512:
6
- metadata.gz: 1ea259bb5567e05f15847324d3259cacebfa539cb69536079ea42b976d6da699877a5c2ecac3e2b59bd493bb250ffc07be829ba3ff6c57c35c6d6b30901487d5
7
- data.tar.gz: 7828d3757b7d7da067a3a450a0c10cb8a322437d3c2274e7635cd8ae50d44db7cf15b10510e22c3982a0159e90767a3adcd7e96bba564cf48dd6f819d10149ff
6
+ metadata.gz: df817efcb1d0e58585de50f92d3db33e378d5955b2cd2e5c07911cee2524395dd3b48db8c289ab91e809625daa12a8753b7f8fa43fc6ef78314a4ea06cab20ab
7
+ data.tar.gz: bb7171a789a86faec92e237759342855921220f651f309e9208bedc2a2092b84a8d3b5006e5aff64df5128e4d110e8affdd5f324d8a02452778883908630482b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- vault-tools (0.5.21)
4
+ vault-tools (0.5.22)
5
5
  aws-sdk (~> 1.0)
6
6
  coderay
7
7
  excon
@@ -26,9 +26,9 @@ GEM
26
26
  aws-sdk-v1 (1.66.0)
27
27
  json (~> 1.4)
28
28
  nokogiri (>= 1.4.4)
29
- coderay (1.1.0)
29
+ coderay (1.1.1)
30
30
  dotenv (2.0.0)
31
- excon (0.45.4)
31
+ excon (0.54.0)
32
32
  fernet (2.0.rc2)
33
33
  valcro (= 0.1)
34
34
  guard-compat (1.2.1)
@@ -43,10 +43,10 @@ GEM
43
43
  method_source (0.8.2)
44
44
  mini_portile (0.6.2)
45
45
  minitest (4.7.5)
46
- multi_json (1.11.2)
46
+ multi_json (1.12.1)
47
47
  nokogiri (1.6.6.2)
48
48
  mini_portile (~> 0.6.0)
49
- pry (0.10.3)
49
+ pry (0.10.4)
50
50
  coderay (~> 1.1.0)
51
51
  method_source (~> 0.8.1)
52
52
  slop (~> 3.4)
@@ -70,7 +70,7 @@ GEM
70
70
  rack-protection (~> 1.4)
71
71
  tilt (>= 1.3, < 3)
72
72
  slop (3.6.0)
73
- tilt (2.0.2)
73
+ tilt (2.0.5)
74
74
  turn (0.9.7)
75
75
  ansi
76
76
  minitest (~> 4)
@@ -102,4 +102,4 @@ DEPENDENCIES
102
102
  yard-sinatra
103
103
 
104
104
  BUNDLED WITH
105
- 1.10.6
105
+ 1.13.6
@@ -1,5 +1,5 @@
1
1
  module Vault
2
2
  module Tools
3
- VERSION = '0.5.21'
3
+ VERSION = '0.5.22'
4
4
  end
5
5
  end
@@ -87,6 +87,13 @@ module Vault
87
87
  # Check request for HTTP Basic creds and
88
88
  # password matches settings.basic_password
89
89
  def authorized?(passwords)
90
+ if passwords.empty?
91
+ if settings.basic_password.is_a?(String)
92
+ passwords << settings.basic_password
93
+ else
94
+ passwords = passwords + settings.basic_password
95
+ end
96
+ end
90
97
  passwords << settings.basic_password if passwords.empty?
91
98
  @auth ||= Rack::Auth::Basic::Request.new(request.env)
92
99
  @auth.provided? && @auth.basic? && @auth.credentials &&
@@ -49,6 +49,27 @@ class WebTest < Vault::TestCase
49
49
  assert_equal 'You may pass', last_response.body
50
50
  end
51
51
 
52
+ def test_http_basic_auth_multi_pass
53
+ app.set :basic_password, ['password', 'password2']
54
+ app.get '/protected' do
55
+ protected!
56
+ 'You may pass'
57
+ end
58
+
59
+ get '/protected'
60
+ assert_equal 401, last_response.status
61
+
62
+ authorize('','password')
63
+ get '/protected'
64
+ assert_equal 200, last_response.status
65
+ assert_equal 'You may pass', last_response.body
66
+
67
+ authorize('','password2')
68
+ get '/protected'
69
+ assert_equal 200, last_response.status
70
+ assert_equal 'You may pass', last_response.body
71
+ end
72
+
52
73
  def test_http_basic_auth_with_alternate_password
53
74
  app.set :basic_password, 'password'
54
75
  app.get '/protected' do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vault-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.21
4
+ version: 0.5.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Continanza
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2016-02-09 00:00:00.000000000 Z
12
+ date: 2017-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: scrolls
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
297
297
  version: '0'
298
298
  requirements: []
299
299
  rubyforge_project:
300
- rubygems_version: 2.2.2
300
+ rubygems_version: 2.5.1
301
301
  signing_key:
302
302
  specification_version: 4
303
303
  summary: Test classes, base web classes, and helpers - oh my!