warden 0.6.5 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/warden/proxy.rb CHANGED
@@ -11,6 +11,10 @@ module Warden
11
11
  # :api: public
12
12
  attr_reader :env
13
13
 
14
+ # A reader for the config of warden that created this proxy.
15
+ # :api: public
16
+ attr_reader :config
17
+
14
18
  extend ::Forwardable
15
19
  include ::Warden::Mixins::Common
16
20
 
@@ -91,7 +95,7 @@ module Warden
91
95
  # env['warden'].stored?(:default) #=> true
92
96
  # env['warden'].stored?(:default, :session) #=> true
93
97
  # env['warden'].stored?(:default, :cookie) #=> false
94
- #
98
+ #
95
99
  # :api: public
96
100
  def stored?(scope = Warden::Manager.default_scope, serializer = nil)
97
101
  if serializer
@@ -276,7 +280,7 @@ module Warden
276
280
  def silence_missing_strategies? # :nodoc:
277
281
  @config[:silence_missing_strategies]
278
282
  end
279
-
283
+
280
284
  # :api: private
281
285
  def silence_missing_serializers? # :nodoc:
282
286
  @config[:silence_missing_serializers]
@@ -1,3 +1,3 @@
1
1
  module Warden
2
- VERSION = "0.6.5"
2
+ VERSION = "0.7.0"
3
3
  end
@@ -176,10 +176,10 @@ describe Warden::Proxy do
176
176
  env['warden'].user(:bar).should == 'bar user'
177
177
  env['warden'].user.should be_nil
178
178
  end
179
-
179
+
180
180
  it "should not be authenticated if scope cannot be retrieved from session" do
181
181
  begin
182
- Warden::Manager.serialize_from_session { |k| nil }
182
+ Warden::Manager.serialize_from_session { |k| nil }
183
183
  app = lambda do |env|
184
184
  env['rack.session']['warden.user.foo_scope.key'] = "a foo user"
185
185
  env['warden'].authenticated?(:foo_scope)
@@ -189,7 +189,7 @@ describe Warden::Proxy do
189
189
  setup_rack(app).call(env)
190
190
  env['warden'].user(:foo_scope).should be_nil
191
191
  ensure
192
- Warden::Manager.serialize_from_session { |k| k }
192
+ Warden::Manager.serialize_from_session { |k| k }
193
193
  end
194
194
  end
195
195
  end
@@ -208,7 +208,7 @@ describe Warden::Proxy do
208
208
  end
209
209
  setup_rack(app).call(@env)
210
210
  end
211
-
211
+
212
212
  it "returns false if user key is not stored in session" do
213
213
  @env['rack.session'].delete("warden.user.default.key")
214
214
  app = lambda do |env|
@@ -611,4 +611,19 @@ describe Warden::Proxy do
611
611
  end
612
612
  end
613
613
 
614
+ describe "attributes" do
615
+
616
+ def def_app(&blk)
617
+ @app = setup_rack(blk)
618
+ end
619
+
620
+ it "should have a config attribute" do
621
+ app = def_app do |e|
622
+ e['warden'].config.should be_a_kind_of(Hash)
623
+ valid_response
624
+ end
625
+ app.call(@env)
626
+ end
627
+ end
628
+
614
629
  end
data/warden.gemspec CHANGED
@@ -1,15 +1,15 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{warden}
8
- s.version = "0.6.5"
8
+ s.version = "0.7.0"
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{2009-12-02}
12
+ s.date = %q{2010-01-04}
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.6.5
4
+ version: 0.7.0
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: 2009-12-02 00:00:00 -02:00
12
+ date: 2010-01-04 00:00:00 +11:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency