warden 0.9.3 → 0.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ == Version 0.9.4 / 2010-02-23
2
+
3
+ * Fix an issue where winning_strategy was not cleaned, allowing multiple scopes to sign in, even when the second one should not
4
+
1
5
  == Version 0.9.3 / 2010-02-17
2
6
 
3
7
  * Add prepend_ to all hooks (josevalim)
data/lib/warden/proxy.rb CHANGED
@@ -263,6 +263,7 @@ module Warden
263
263
 
264
264
  # Run the strategies for a given scope
265
265
  def _run_strategies_for(scope, args) #:nodoc:
266
+ self.winning_strategy = nil
266
267
  strategies = args.empty? ? @config.default_strategies : args
267
268
 
268
269
  strategies.each do |name|
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module Warden
3
- VERSION = "0.9.3".freeze
3
+ VERSION = "0.9.4".freeze
4
4
  end
@@ -181,9 +181,6 @@ describe Warden::Proxy do
181
181
  app = lambda do |env|
182
182
  env['rack.session']['warden.user.foo.key'] = 'foo user'
183
183
  env['rack.session']['warden.user.bar.key'] = 'bar user'
184
- env['warden'].authenticate(:pass, :scope => :foo)
185
- env['warden'].authenticate(:pass, :scope => :bar)
186
- env['warden'].authenticate(:password)
187
184
  env['warden'].should be_authenticated(:foo)
188
185
  env['warden'].should be_authenticated(:bar)
189
186
  env['warden'].should_not be_authenticated # default scope
@@ -195,6 +192,18 @@ describe Warden::Proxy do
195
192
  env['warden'].user(:bar).should == 'bar user'
196
193
  env['warden'].user.should be_nil
197
194
  end
195
+
196
+ it "should not authenticate other scopes just because the first is authenticated" do
197
+ app = lambda do |env|
198
+ env['warden'].authenticate(:pass, :scope => :foo)
199
+ env['warden'].authenticate(:invalid, :scope => :bar)
200
+ env['warden'].should be_authenticated(:foo)
201
+ env['warden'].should_not be_authenticated(:bar)
202
+ valid_response
203
+ end
204
+ env = env_with_params
205
+ setup_rack(app).call(env)
206
+ end
198
207
  end
199
208
 
200
209
  describe "authentication cache" do
data/warden.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{warden}
8
- s.version = "0.9.3"
8
+ s.version = "0.9.4"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Daniel Neighman"]
12
- s.date = %q{2010-02-17}
12
+ s.date = %q{2010-02-23}
13
13
  s.email = %q{has.sox@gmail.com}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: warden
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 0.9.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Neighman
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-17 00:00:00 +01:00
12
+ date: 2010-02-23 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency