rack 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rack might be problematic. Click here for more details.
- data/README.rdoc +10 -0
- data/lib/rack.rb +12 -0
- data/lib/rack/auth/abstract/request.rb +5 -1
- data/lib/rack/utils.rb +0 -1
- data/rack.gemspec +1 -1
- data/test/spec_auth.rb +57 -0
- data/test/spec_lock.rb +1 -1
- metadata +7 -5
data/README.rdoc
CHANGED
@@ -479,11 +479,21 @@ run on port 11211) and memcache-client installed.
|
|
479
479
|
* January 7th, 2013: Thirty first public release 1.4.3
|
480
480
|
* Security: Prevent unbounded reads in large multipart boundaries
|
481
481
|
|
482
|
+
* January 13th, 2013: Thirty second public release 1.4.4, 1.3.9, 1.2.7, 1.1.5
|
483
|
+
* [SEC] Rack::Auth::AbstractRequest no longer symbolizes arbitrary strings
|
484
|
+
* Fixed erroneous test case in the 1.3.x series
|
485
|
+
|
482
486
|
== Contact
|
483
487
|
|
484
488
|
Please post bugs, suggestions and patches to
|
485
489
|
the bug tracker at <http://github.com/rack/rack/issues>.
|
486
490
|
|
491
|
+
Please post security related bugs and suggestions to the core team at
|
492
|
+
<https://groups.google.com/group/rack-core> or rack-core@googlegroups.com. Due
|
493
|
+
to wide usage of the library, it is strongly preferred that we manage timing in
|
494
|
+
order to provide viable patches at the time of disclosure. Your assistance in
|
495
|
+
this matter is greatly appreciated.
|
496
|
+
|
487
497
|
Mailing list archives are available at
|
488
498
|
<http://groups.google.com/group/rack-devel>.
|
489
499
|
|
data/lib/rack.rb
CHANGED
@@ -73,6 +73,18 @@ module Rack
|
|
73
73
|
autoload :Params, "rack/auth/digest/params"
|
74
74
|
autoload :Request, "rack/auth/digest/request"
|
75
75
|
end
|
76
|
+
|
77
|
+
# Not all of the following schemes are "standards", but they are used often.
|
78
|
+
@schemes = %w[basic digest bearer mac token oauth oauth2]
|
79
|
+
|
80
|
+
def self.add_scheme scheme
|
81
|
+
@schemes << scheme
|
82
|
+
@schemes.uniq!
|
83
|
+
end
|
84
|
+
|
85
|
+
def self.schemes
|
86
|
+
@schemes.dup
|
87
|
+
end
|
76
88
|
end
|
77
89
|
|
78
90
|
module Session
|
data/lib/rack/utils.rb
CHANGED
data/rack.gemspec
CHANGED
data/test/spec_auth.rb
ADDED
@@ -0,0 +1,57 @@
|
|
1
|
+
require 'rack'
|
2
|
+
|
3
|
+
describe Rack::Auth do
|
4
|
+
it "should have all common authentication schemes" do
|
5
|
+
Rack::Auth.schemes.should.include? 'basic'
|
6
|
+
Rack::Auth.schemes.should.include? 'digest'
|
7
|
+
Rack::Auth.schemes.should.include? 'bearer'
|
8
|
+
Rack::Auth.schemes.should.include? 'token'
|
9
|
+
end
|
10
|
+
|
11
|
+
it "should allow registration of new auth schemes" do
|
12
|
+
Rack::Auth.schemes.should.not.include "test"
|
13
|
+
Rack::Auth.add_scheme "test"
|
14
|
+
Rack::Auth.schemes.should.include "test"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
describe Rack::Auth::AbstractRequest do
|
19
|
+
it "should symbolize known auth schemes" do
|
20
|
+
env = Rack::MockRequest.env_for('/')
|
21
|
+
env['HTTP_AUTHORIZATION'] = 'Basic aXJyZXNwb25zaWJsZQ=='
|
22
|
+
req = Rack::Auth::AbstractRequest.new(env)
|
23
|
+
req.scheme.should.equal :basic
|
24
|
+
|
25
|
+
|
26
|
+
env['HTTP_AUTHORIZATION'] = 'Digest aXJyZXNwb25zaWJsZQ=='
|
27
|
+
req = Rack::Auth::AbstractRequest.new(env)
|
28
|
+
req.scheme.should.equal :digest
|
29
|
+
|
30
|
+
env['HTTP_AUTHORIZATION'] = 'Bearer aXJyZXNwb25zaWJsZQ=='
|
31
|
+
req = Rack::Auth::AbstractRequest.new(env)
|
32
|
+
req.scheme.should.equal :bearer
|
33
|
+
|
34
|
+
env['HTTP_AUTHORIZATION'] = 'MAC aXJyZXNwb25zaWJsZQ=='
|
35
|
+
req = Rack::Auth::AbstractRequest.new(env)
|
36
|
+
req.scheme.should.equal :mac
|
37
|
+
|
38
|
+
env['HTTP_AUTHORIZATION'] = 'Token aXJyZXNwb25zaWJsZQ=='
|
39
|
+
req = Rack::Auth::AbstractRequest.new(env)
|
40
|
+
req.scheme.should.equal :token
|
41
|
+
|
42
|
+
env['HTTP_AUTHORIZATION'] = 'OAuth aXJyZXNwb25zaWJsZQ=='
|
43
|
+
req = Rack::Auth::AbstractRequest.new(env)
|
44
|
+
req.scheme.should.equal :oauth
|
45
|
+
|
46
|
+
env['HTTP_AUTHORIZATION'] = 'OAuth2 aXJyZXNwb25zaWJsZQ=='
|
47
|
+
req = Rack::Auth::AbstractRequest.new(env)
|
48
|
+
req.scheme.should.equal :oauth2
|
49
|
+
end
|
50
|
+
|
51
|
+
it "should not symbolize unknown auth schemes" do
|
52
|
+
env = Rack::MockRequest.env_for('/')
|
53
|
+
env['HTTP_AUTHORIZATION'] = 'magic aXJyZXNwb25zaWJsZQ=='
|
54
|
+
req = Rack::Auth::AbstractRequest.new(env)
|
55
|
+
req.scheme.should == "magic"
|
56
|
+
end
|
57
|
+
end
|
data/test/spec_lock.rb
CHANGED
@@ -142,7 +142,7 @@ describe Rack::Lock do
|
|
142
142
|
should "unlock if the app throws" do
|
143
143
|
lock = Lock.new
|
144
144
|
env = Rack::MockRequest.env_for("/")
|
145
|
-
app = lock_app(lambda {|
|
145
|
+
app = lock_app(lambda {|_| throw :bacon }, lock)
|
146
146
|
lambda { app.call(env) }.should.throw(:bacon)
|
147
147
|
lock.synchronized.should.equal false
|
148
148
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 4
|
9
|
-
-
|
10
|
-
version: 1.4.
|
9
|
+
- 4
|
10
|
+
version: 1.4.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Christian Neukirchen
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2013-01-
|
18
|
+
date: 2013-01-13 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: bacon
|
@@ -81,7 +81,7 @@ dependencies:
|
|
81
81
|
requirements:
|
82
82
|
- - ">="
|
83
83
|
- !ruby/object:Gem::Version
|
84
|
-
hash: -
|
84
|
+
hash: -2982847160
|
85
85
|
segments:
|
86
86
|
- 1
|
87
87
|
- 2
|
@@ -237,6 +237,7 @@ files:
|
|
237
237
|
- test/multipart/webkit
|
238
238
|
- test/rackup/config.ru
|
239
239
|
- test/registering_handler/rack/handler/registering_myself.rb
|
240
|
+
- test/spec_auth.rb
|
240
241
|
- test/spec_auth_basic.rb
|
241
242
|
- test/spec_auth_digest.rb
|
242
243
|
- test/spec_body_proxy.rb
|
@@ -328,6 +329,7 @@ signing_key:
|
|
328
329
|
specification_version: 3
|
329
330
|
summary: a modular Ruby webserver interface
|
330
331
|
test_files:
|
332
|
+
- test/spec_auth.rb
|
331
333
|
- test/spec_auth_basic.rb
|
332
334
|
- test/spec_auth_digest.rb
|
333
335
|
- test/spec_body_proxy.rb
|