rack_csrf 2.0.0 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +2 -0
- data/Changelog.md +11 -0
- data/README.rdoc +12 -0
- data/Rakefile +4 -10
- data/VERSION +1 -1
- data/examples/camping/README.rdoc +16 -0
- data/examples/camping/app.rb +81 -0
- data/examples/camping/config.ru +4 -0
- data/features/setup.feature +5 -0
- data/features/step_definitions/request_steps.rb +1 -1
- data/features/step_definitions/setup_steps.rb +11 -0
- data/features/support/env.rb +1 -3
- data/features/variation_on_key_name.feature +29 -0
- data/lib/rack/csrf.rb +8 -2
- data/rack_csrf.gemspec +14 -10
- data/spec/csrf_spec.rb +45 -21
- data/spec/spec_helper.rb +1 -3
- metadata +61 -24
- data/spec/spec.opts +0 -2
data/.rspec
ADDED
data/Changelog.md
CHANGED
@@ -1,3 +1,14 @@
|
|
1
|
+
# v2.1.0 (2010-10-11)
|
2
|
+
|
3
|
+
* Tiny improvements to Rakefile.
|
4
|
+
* Added the :key option.
|
5
|
+
* Moved to RSpec 2.
|
6
|
+
* Tweaked Camping application's load path.
|
7
|
+
* Camping example, courtesy of David Susco.
|
8
|
+
* Summer spec cleanings.
|
9
|
+
|
10
|
+
|
11
|
+
|
1
12
|
# v2.0.0 (2010-01-11)
|
2
13
|
|
3
14
|
* Added a changelog and a Rake task to help.
|
data/README.rdoc
CHANGED
@@ -55,6 +55,14 @@ The following options allow you to tweak Rack::Csrf.
|
|
55
55
|
|
56
56
|
Default value: _csrf
|
57
57
|
|
58
|
+
[<tt>:key</tt>]
|
59
|
+
The key used to store/retrieve the token from the Rack session; you can
|
60
|
+
adapt it to specific needs.
|
61
|
+
|
62
|
+
use Rack::Csrf, :key => 'my.own_session.key'
|
63
|
+
|
64
|
+
Default value: csrf.token
|
65
|
+
|
58
66
|
The <tt>:browser_only</tt> option has been removed; you do not need to edit
|
59
67
|
any rackup file because Rack::Csrf simply ignores unknown options. Changes
|
60
68
|
introduced in Rack version 1.1.0 tightened the parsing of POST params, so
|
@@ -71,6 +79,10 @@ The ill devised <tt>:browser_only</tt> option could have been used to
|
|
71
79
|
The following class methods try to ease the insertion of the anti-forging
|
72
80
|
token.
|
73
81
|
|
82
|
+
[<tt>Rack::Csrf.csrf_key</tt>]
|
83
|
+
Returns the name of the key used to store/retrieve the token from the Rack
|
84
|
+
session.
|
85
|
+
|
74
86
|
[<tt>Rack::Csrf.csrf_field</tt>]
|
75
87
|
Returns the name of the field that must be present in the request.
|
76
88
|
|
data/Rakefile
CHANGED
@@ -1,20 +1,14 @@
|
|
1
1
|
require 'rake/clean'
|
2
2
|
require 'cucumber/rake/task'
|
3
|
-
require '
|
3
|
+
require 'rspec/core/rake_task'
|
4
4
|
require 'rake/rdoctask'
|
5
5
|
require 'jeweler'
|
6
6
|
|
7
|
-
Cucumber::Rake::Task.new :features
|
8
|
-
c.cucumber_opts = '--profile default'
|
9
|
-
end
|
10
|
-
|
7
|
+
Cucumber::Rake::Task.new :features
|
11
8
|
task :features => :check_dependencies
|
12
9
|
task :default => :features
|
13
10
|
|
14
|
-
|
15
|
-
t.spec_opts = %w(-O spec/spec.opts)
|
16
|
-
end
|
17
|
-
|
11
|
+
RSpec::Core::RakeTask.new :spec
|
18
12
|
task :spec => :check_dependencies
|
19
13
|
task :default => :spec
|
20
14
|
|
@@ -38,7 +32,7 @@ Jeweler::Tasks.new do |gem|
|
|
38
32
|
gem.add_dependency 'rack', '>= 0.9'
|
39
33
|
gem.add_development_dependency 'cucumber', '>= 0.1.13'
|
40
34
|
gem.add_development_dependency 'rack-test'
|
41
|
-
gem.add_development_dependency 'rspec'
|
35
|
+
gem.add_development_dependency 'rspec', '>= 2.0.0'
|
42
36
|
gem.rdoc_options << '--line-numbers' << '--inline-source' << '--title' <<
|
43
37
|
"Rack::Csrf #{version}" << '--main' << 'README.rdoc'
|
44
38
|
gem.test_files.clear
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
2.1.0
|
@@ -0,0 +1,16 @@
|
|
1
|
+
= How to use Rack::Csrf with Camping
|
2
|
+
|
3
|
+
This Camping application has been provided by David Susco. All you need is
|
4
|
+
Camping itself and Markaby.
|
5
|
+
|
6
|
+
$ sudo gem install camping markaby
|
7
|
+
$ camping -p 3000 app.rb
|
8
|
+
|
9
|
+
The <tt>config.ru</tt> can be used to run the application with any
|
10
|
+
Rack-compliant web server.
|
11
|
+
|
12
|
+
Please, note the way Rack::Csrf has been inserted into the stack and the
|
13
|
+
position relative to Camping::Session (see Camping's internals for the
|
14
|
+
reason).
|
15
|
+
|
16
|
+
Tested with Camping 2.1 and Markaby 0.7.1.
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'camping'
|
2
|
+
require 'camping/session'
|
3
|
+
|
4
|
+
$: << File.join(File.dirname(__FILE__), '../../lib')
|
5
|
+
require 'rack/csrf'
|
6
|
+
|
7
|
+
Camping.goes :LittleApp
|
8
|
+
|
9
|
+
module LittleApp
|
10
|
+
use Rack::Csrf # This has to come BEFORE 'include Camping::Session',
|
11
|
+
# otherwise you get the 'Rack::Csrf depends on session
|
12
|
+
# middleware' exception. Weird...
|
13
|
+
include Camping::Session
|
14
|
+
|
15
|
+
module Controllers
|
16
|
+
class Working < R '/'
|
17
|
+
def get
|
18
|
+
render :working
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
class NotWorking < R '/notworking'
|
23
|
+
def get
|
24
|
+
render :notworking
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
class Response < R '/response'
|
29
|
+
def post
|
30
|
+
render :response
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
module Views
|
36
|
+
def working
|
37
|
+
form :action => URL(Response), :method => :post do
|
38
|
+
h1 'Spit your utterance!'
|
39
|
+
input :name => :utterance, :type => :text
|
40
|
+
text Rack::Csrf.csrf_tag(@env)
|
41
|
+
p {
|
42
|
+
input :type => :submit, :value => :Send!
|
43
|
+
}
|
44
|
+
end
|
45
|
+
p {
|
46
|
+
text 'Try also the '
|
47
|
+
a 'not working', :href => URL(NotWorking)
|
48
|
+
text ' form!'
|
49
|
+
}
|
50
|
+
end
|
51
|
+
|
52
|
+
def notworking
|
53
|
+
form :action => URL(Response), :method => :post do
|
54
|
+
h1 'Spit your utterance!'
|
55
|
+
input :name => :utterance, :type => :text
|
56
|
+
p {
|
57
|
+
input :type => :submit, :value => :Send!
|
58
|
+
}
|
59
|
+
end
|
60
|
+
p {
|
61
|
+
text 'Try also the '
|
62
|
+
a 'working', :href => URL(Working)
|
63
|
+
text ' form!'
|
64
|
+
}
|
65
|
+
end
|
66
|
+
|
67
|
+
def response
|
68
|
+
p {
|
69
|
+
text "It seems you've just said: "
|
70
|
+
em @input.utterance
|
71
|
+
}
|
72
|
+
p {
|
73
|
+
text "Here's the anti-CSRF token stuffed in the session: "
|
74
|
+
strong @input._csrf
|
75
|
+
}
|
76
|
+
p {
|
77
|
+
a 'Back', :href => URL(Working)
|
78
|
+
}
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
data/features/setup.feature
CHANGED
@@ -27,3 +27,8 @@ Feature: Setup of the middleware
|
|
27
27
|
Given a rack with the session middleware
|
28
28
|
When I insert the anti-CSRF middleware with the :field option
|
29
29
|
Then I get a fully functional rack
|
30
|
+
|
31
|
+
Scenario: Setup with the :key option
|
32
|
+
Given a rack with the session middleware
|
33
|
+
When I insert the anti-CSRF middleware with the :key option
|
34
|
+
Then I get a fully functional rack
|
@@ -24,7 +24,7 @@ end
|
|
24
24
|
|
25
25
|
When /^it receives a (POST|PUT|DELETE) request with the right CSRF token$/ do |http_method|
|
26
26
|
@browser.request '/', :method => http_method,
|
27
|
-
'rack.session' => {
|
27
|
+
'rack.session' => {Rack::Csrf.csrf_key => 'right_token'},
|
28
28
|
:params => {Rack::Csrf.csrf_field => 'right_token'}
|
29
29
|
end
|
30
30
|
|
@@ -27,6 +27,11 @@ Given /^a rack with the anti\-CSRF middleware and the :field option$/ do
|
|
27
27
|
When 'I insert the anti-CSRF middleware with the :field option'
|
28
28
|
end
|
29
29
|
|
30
|
+
Given /^a rack with the anti\-CSRF middleware and the :key option$/ do
|
31
|
+
Given 'a rack with the session middleware'
|
32
|
+
When 'I insert the anti-CSRF middleware with the :key option'
|
33
|
+
end
|
34
|
+
|
30
35
|
# Yes, they're not as DRY as possible, but I think they're more readable than
|
31
36
|
# a single step definition with a few captures and more complex checkings.
|
32
37
|
|
@@ -55,6 +60,12 @@ When /^I insert the anti\-CSRF middleware with the :field option$/ do
|
|
55
60
|
@browser = Rack::Test::Session.new(Rack::MockSession.new(@app))
|
56
61
|
end
|
57
62
|
|
63
|
+
When /^I insert the anti\-CSRF middleware with the :key option$/ do
|
64
|
+
@rack_builder.use Rack::Csrf, :key => 'fantasy_name'
|
65
|
+
toy_app
|
66
|
+
@browser = Rack::Test::Session.new(Rack::MockSession.new(@app))
|
67
|
+
end
|
68
|
+
|
58
69
|
Then /^I get a fully functional rack$/ do
|
59
70
|
lambda {Rack::MockRequest.new(@app).get('/')}.should_not raise_error
|
60
71
|
end
|
data/features/support/env.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
Feature: Customization of the key name
|
2
|
+
|
3
|
+
Scenario: GET request with CSRF token stored in custom key
|
4
|
+
Given a rack with the anti-CSRF middleware and the :key option
|
5
|
+
When it receives a GET request with the CSRF token
|
6
|
+
Then it lets it pass untouched
|
7
|
+
|
8
|
+
Scenario Outline: Handling request with the right CSRF token stored in custom key
|
9
|
+
Given a rack with the anti-CSRF middleware and the :key option
|
10
|
+
When it receives a <method> request with the right CSRF token
|
11
|
+
Then it lets it pass untouched
|
12
|
+
|
13
|
+
Examples:
|
14
|
+
| method |
|
15
|
+
| POST |
|
16
|
+
| PUT |
|
17
|
+
| DELETE |
|
18
|
+
|
19
|
+
Scenario Outline: Handling request with the wrong CSRF token stored in custom key
|
20
|
+
Given a rack with the anti-CSRF middleware and the :key option
|
21
|
+
When it receives a <method> request with the wrong CSRF token
|
22
|
+
Then it responds with 403
|
23
|
+
And the response body is empty
|
24
|
+
|
25
|
+
Examples:
|
26
|
+
| method |
|
27
|
+
| POST |
|
28
|
+
| PUT |
|
29
|
+
| DELETE |
|
data/lib/rack/csrf.rb
CHANGED
@@ -11,6 +11,7 @@ module Rack
|
|
11
11
|
class InvalidCsrfToken < StandardError; end
|
12
12
|
|
13
13
|
@@field = '_csrf'
|
14
|
+
@@key = 'csrf.token'
|
14
15
|
|
15
16
|
def initialize(app, opts = {})
|
16
17
|
@app = app
|
@@ -18,6 +19,7 @@ module Rack
|
|
18
19
|
@raisable = opts[:raise] || false
|
19
20
|
@skippable = (opts[:skip] || []).map {|r| /\A#{r}\Z/i}
|
20
21
|
@@field = opts[:field] if opts[:field]
|
22
|
+
@@key = opts[:key] if opts[:key]
|
21
23
|
|
22
24
|
@http_verbs = %w(POST PUT DELETE)
|
23
25
|
end
|
@@ -29,7 +31,7 @@ module Rack
|
|
29
31
|
self.class.csrf_token(env)
|
30
32
|
req = Rack::Request.new(env)
|
31
33
|
untouchable = !@http_verbs.include?(req.request_method) ||
|
32
|
-
req.POST[self.class.csrf_field] == env['rack.session'][
|
34
|
+
req.POST[self.class.csrf_field] == env['rack.session'][self.class.csrf_key] ||
|
33
35
|
skip_checking(req)
|
34
36
|
if untouchable
|
35
37
|
@app.call(env)
|
@@ -39,12 +41,16 @@ module Rack
|
|
39
41
|
end
|
40
42
|
end
|
41
43
|
|
44
|
+
def self.csrf_key
|
45
|
+
@@key
|
46
|
+
end
|
47
|
+
|
42
48
|
def self.csrf_field
|
43
49
|
@@field
|
44
50
|
end
|
45
51
|
|
46
52
|
def self.csrf_token(env)
|
47
|
-
env['rack.session'][
|
53
|
+
env['rack.session'][csrf_key] ||= SecureRandom.base64(32)
|
48
54
|
end
|
49
55
|
|
50
56
|
def self.csrf_tag(env)
|
data/rack_csrf.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{rack_csrf}
|
8
|
-
s.version = "2.
|
8
|
+
s.version = "2.1.0"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Emanuele Vicentini"]
|
12
|
-
s.date = %q{2010-
|
12
|
+
s.date = %q{2010-10-11}
|
13
13
|
s.description = %q{Anti-CSRF Rack middleware}
|
14
14
|
s.email = %q{emanuele.vicentini@gmail.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -17,12 +17,16 @@ Gem::Specification.new do |s|
|
|
17
17
|
"README.rdoc"
|
18
18
|
]
|
19
19
|
s.files = [
|
20
|
-
"
|
20
|
+
".rspec",
|
21
|
+
"Changelog.md",
|
21
22
|
"LICENSE.rdoc",
|
22
23
|
"README.rdoc",
|
23
24
|
"Rakefile",
|
24
25
|
"VERSION",
|
25
26
|
"cucumber.yml",
|
27
|
+
"examples/camping/README.rdoc",
|
28
|
+
"examples/camping/app.rb",
|
29
|
+
"examples/camping/config.ru",
|
26
30
|
"examples/innate/README.rdoc",
|
27
31
|
"examples/innate/app.rb",
|
28
32
|
"examples/innate/start-with-raise.rb",
|
@@ -51,40 +55,40 @@ Gem::Specification.new do |s|
|
|
51
55
|
"features/support/env.rb",
|
52
56
|
"features/support/fake_session.rb",
|
53
57
|
"features/variation_on_field_name.feature",
|
58
|
+
"features/variation_on_key_name.feature",
|
54
59
|
"lib/rack/csrf.rb",
|
55
60
|
"lib/rack/vendor/securerandom.rb",
|
56
61
|
"rack_csrf.gemspec",
|
57
62
|
"spec/csrf_spec.rb",
|
58
|
-
"spec/spec.opts",
|
59
63
|
"spec/spec_helper.rb"
|
60
64
|
]
|
61
65
|
s.homepage = %q{http://github.com/baldowl/rack_csrf}
|
62
|
-
s.rdoc_options = ["--charset=UTF-8", "--line-numbers", "--inline-source", "--title", "Rack::Csrf 2.
|
66
|
+
s.rdoc_options = ["--charset=UTF-8", "--line-numbers", "--inline-source", "--title", "Rack::Csrf 2.1.0", "--main", "README.rdoc"]
|
63
67
|
s.require_paths = ["lib"]
|
64
68
|
s.rubyforge_project = %q{rackcsrf}
|
65
|
-
s.rubygems_version = %q{1.3.
|
69
|
+
s.rubygems_version = %q{1.3.7}
|
66
70
|
s.summary = %q{Anti-CSRF Rack middleware}
|
67
71
|
|
68
72
|
if s.respond_to? :specification_version then
|
69
73
|
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
70
74
|
s.specification_version = 3
|
71
75
|
|
72
|
-
if Gem::Version.new(Gem::
|
76
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
73
77
|
s.add_runtime_dependency(%q<rack>, [">= 0.9"])
|
74
78
|
s.add_development_dependency(%q<cucumber>, [">= 0.1.13"])
|
75
79
|
s.add_development_dependency(%q<rack-test>, [">= 0"])
|
76
|
-
s.add_development_dependency(%q<rspec>, [">= 0"])
|
80
|
+
s.add_development_dependency(%q<rspec>, [">= 2.0.0"])
|
77
81
|
else
|
78
82
|
s.add_dependency(%q<rack>, [">= 0.9"])
|
79
83
|
s.add_dependency(%q<cucumber>, [">= 0.1.13"])
|
80
84
|
s.add_dependency(%q<rack-test>, [">= 0"])
|
81
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
85
|
+
s.add_dependency(%q<rspec>, [">= 2.0.0"])
|
82
86
|
end
|
83
87
|
else
|
84
88
|
s.add_dependency(%q<rack>, [">= 0.9"])
|
85
89
|
s.add_dependency(%q<cucumber>, [">= 0.1.13"])
|
86
90
|
s.add_dependency(%q<rack-test>, [">= 0"])
|
87
|
-
s.add_dependency(%q<rspec>, [">= 0"])
|
91
|
+
s.add_dependency(%q<rspec>, [">= 2.0.0"])
|
88
92
|
end
|
89
93
|
end
|
90
94
|
|
data/spec/csrf_spec.rb
CHANGED
@@ -1,6 +1,18 @@
|
|
1
1
|
require File.join(File.dirname(__FILE__), 'spec_helper.rb')
|
2
2
|
|
3
3
|
describe Rack::Csrf do
|
4
|
+
describe '#csrf_key' do
|
5
|
+
it "should be 'csrf.token' by default" do
|
6
|
+
Rack::Csrf.csrf_key.should == 'csrf.token'
|
7
|
+
end
|
8
|
+
|
9
|
+
it "should be the value of the :key option" do
|
10
|
+
fakeapp = lambda {|env| [200, {}, []]}
|
11
|
+
Rack::Csrf.new fakeapp, :key => 'whatever'
|
12
|
+
Rack::Csrf.csrf_key.should == 'whatever'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
4
16
|
describe '#csrf_field' do
|
5
17
|
it "should be '_csrf' by default" do
|
6
18
|
Rack::Csrf.csrf_field.should == '_csrf'
|
@@ -14,58 +26,70 @@ describe Rack::Csrf do
|
|
14
26
|
end
|
15
27
|
|
16
28
|
describe '#csrf_token' do
|
17
|
-
|
18
|
-
@env = {'rack.session' => {}}
|
19
|
-
end
|
29
|
+
let(:env) { {'rack.session' => {}} }
|
20
30
|
|
21
|
-
|
22
|
-
|
31
|
+
specify {Rack::Csrf.csrf_token(env).should have_at_least(32).characters}
|
32
|
+
|
33
|
+
context 'when accessing/manipulating the session' do
|
34
|
+
before do
|
35
|
+
fakeapp = lambda {|env| [200, {}, []]}
|
36
|
+
Rack::Csrf.new fakeapp, :key => 'whatever'
|
37
|
+
end
|
38
|
+
|
39
|
+
it 'should use the key provided by csrf_key' do
|
40
|
+
env['rack.session'].should be_empty
|
41
|
+
Rack::Csrf.csrf_token env
|
42
|
+
env['rack.session'].should_not be_empty
|
43
|
+
env['rack.session'][Rack::Csrf.csrf_key].should_not be_nil
|
44
|
+
end
|
23
45
|
end
|
24
46
|
|
25
47
|
context 'when the session does not already contain the token' do
|
26
48
|
it 'should store the token inside the session' do
|
27
|
-
|
28
|
-
csrf_token = Rack::Csrf.csrf_token(
|
29
|
-
|
30
|
-
|
31
|
-
csrf_token.should ==
|
49
|
+
env['rack.session'].should be_empty
|
50
|
+
csrf_token = Rack::Csrf.csrf_token(env)
|
51
|
+
env['rack.session'].should_not be_empty
|
52
|
+
env['rack.session'][Rack::Csrf.csrf_key].should_not be_nil
|
53
|
+
csrf_token.should == env['rack.session'][Rack::Csrf.csrf_key]
|
32
54
|
end
|
33
55
|
end
|
34
56
|
|
35
57
|
context 'when the session already contains the token' do
|
36
58
|
before do
|
37
|
-
Rack::Csrf.csrf_token
|
59
|
+
Rack::Csrf.csrf_token env
|
38
60
|
end
|
61
|
+
|
39
62
|
it 'should get the token from the session' do
|
40
|
-
|
41
|
-
|
63
|
+
env['rack.session'].should_not be_empty
|
64
|
+
env['rack.session'][Rack::Csrf.csrf_key].should == Rack::Csrf.csrf_token(env)
|
42
65
|
end
|
43
66
|
end
|
44
67
|
end
|
45
68
|
|
46
69
|
describe '#csrf_tag' do
|
47
|
-
|
48
|
-
|
70
|
+
let(:env) { {'rack.session' => {}} }
|
71
|
+
|
72
|
+
let :tag do
|
49
73
|
fakeapp = lambda {|env| [200, {}, []]}
|
50
74
|
Rack::Csrf.new fakeapp, :field => 'whatever'
|
51
|
-
|
75
|
+
Rack::Csrf.csrf_tag env
|
52
76
|
end
|
53
77
|
|
54
78
|
it 'should be an input field' do
|
55
|
-
|
79
|
+
tag.should =~ /^<input/
|
56
80
|
end
|
57
81
|
|
58
82
|
it 'should be an hidden input field' do
|
59
|
-
|
83
|
+
tag.should =~ /type="hidden"/
|
60
84
|
end
|
61
85
|
|
62
86
|
it "should have the csrf_field's name" do
|
63
|
-
|
87
|
+
tag.should =~ /name="#{Rack::Csrf.csrf_field}"/
|
64
88
|
end
|
65
89
|
|
66
90
|
it "should have the csrf_token's output" do
|
67
|
-
quoted_value = Regexp.quote %Q(value="#{Rack::Csrf.csrf_token(
|
68
|
-
|
91
|
+
quoted_value = Regexp.quote %Q(value="#{Rack::Csrf.csrf_token(env)}")
|
92
|
+
tag.should =~ /#{quoted_value}/
|
69
93
|
end
|
70
94
|
end
|
71
95
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack_csrf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 11
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 2
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 2.1.0
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- Emanuele Vicentini
|
@@ -9,49 +15,70 @@ autorequire:
|
|
9
15
|
bindir: bin
|
10
16
|
cert_chain: []
|
11
17
|
|
12
|
-
date: 2010-
|
18
|
+
date: 2010-10-11 00:00:00 +02:00
|
13
19
|
default_executable:
|
14
20
|
dependencies:
|
15
21
|
- !ruby/object:Gem::Dependency
|
16
22
|
name: rack
|
17
|
-
|
18
|
-
|
19
|
-
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
20
26
|
requirements:
|
21
27
|
- - ">="
|
22
28
|
- !ruby/object:Gem::Version
|
29
|
+
hash: 25
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 9
|
23
33
|
version: "0.9"
|
24
|
-
|
34
|
+
type: :runtime
|
35
|
+
version_requirements: *id001
|
25
36
|
- !ruby/object:Gem::Dependency
|
26
37
|
name: cucumber
|
27
|
-
|
28
|
-
|
29
|
-
|
38
|
+
prerelease: false
|
39
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
30
41
|
requirements:
|
31
42
|
- - ">="
|
32
43
|
- !ruby/object:Gem::Version
|
44
|
+
hash: 1
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
- 1
|
48
|
+
- 13
|
33
49
|
version: 0.1.13
|
34
|
-
|
50
|
+
type: :development
|
51
|
+
version_requirements: *id002
|
35
52
|
- !ruby/object:Gem::Dependency
|
36
53
|
name: rack-test
|
37
|
-
|
38
|
-
|
39
|
-
|
54
|
+
prerelease: false
|
55
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
56
|
+
none: false
|
40
57
|
requirements:
|
41
58
|
- - ">="
|
42
59
|
- !ruby/object:Gem::Version
|
60
|
+
hash: 3
|
61
|
+
segments:
|
62
|
+
- 0
|
43
63
|
version: "0"
|
44
|
-
|
64
|
+
type: :development
|
65
|
+
version_requirements: *id003
|
45
66
|
- !ruby/object:Gem::Dependency
|
46
67
|
name: rspec
|
47
|
-
|
48
|
-
|
49
|
-
|
68
|
+
prerelease: false
|
69
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
70
|
+
none: false
|
50
71
|
requirements:
|
51
72
|
- - ">="
|
52
73
|
- !ruby/object:Gem::Version
|
53
|
-
|
54
|
-
|
74
|
+
hash: 15
|
75
|
+
segments:
|
76
|
+
- 2
|
77
|
+
- 0
|
78
|
+
- 0
|
79
|
+
version: 2.0.0
|
80
|
+
type: :development
|
81
|
+
version_requirements: *id004
|
55
82
|
description: Anti-CSRF Rack middleware
|
56
83
|
email: emanuele.vicentini@gmail.com
|
57
84
|
executables: []
|
@@ -62,12 +89,16 @@ extra_rdoc_files:
|
|
62
89
|
- LICENSE.rdoc
|
63
90
|
- README.rdoc
|
64
91
|
files:
|
92
|
+
- .rspec
|
65
93
|
- Changelog.md
|
66
94
|
- LICENSE.rdoc
|
67
95
|
- README.rdoc
|
68
96
|
- Rakefile
|
69
97
|
- VERSION
|
70
98
|
- cucumber.yml
|
99
|
+
- examples/camping/README.rdoc
|
100
|
+
- examples/camping/app.rb
|
101
|
+
- examples/camping/config.ru
|
71
102
|
- examples/innate/README.rdoc
|
72
103
|
- examples/innate/app.rb
|
73
104
|
- examples/innate/start-with-raise.rb
|
@@ -96,11 +127,11 @@ files:
|
|
96
127
|
- features/support/env.rb
|
97
128
|
- features/support/fake_session.rb
|
98
129
|
- features/variation_on_field_name.feature
|
130
|
+
- features/variation_on_key_name.feature
|
99
131
|
- lib/rack/csrf.rb
|
100
132
|
- lib/rack/vendor/securerandom.rb
|
101
133
|
- rack_csrf.gemspec
|
102
134
|
- spec/csrf_spec.rb
|
103
|
-
- spec/spec.opts
|
104
135
|
- spec/spec_helper.rb
|
105
136
|
has_rdoc: true
|
106
137
|
homepage: http://github.com/baldowl/rack_csrf
|
@@ -112,27 +143,33 @@ rdoc_options:
|
|
112
143
|
- --line-numbers
|
113
144
|
- --inline-source
|
114
145
|
- --title
|
115
|
-
- Rack::Csrf 2.
|
146
|
+
- Rack::Csrf 2.1.0
|
116
147
|
- --main
|
117
148
|
- README.rdoc
|
118
149
|
require_paths:
|
119
150
|
- lib
|
120
151
|
required_ruby_version: !ruby/object:Gem::Requirement
|
152
|
+
none: false
|
121
153
|
requirements:
|
122
154
|
- - ">="
|
123
155
|
- !ruby/object:Gem::Version
|
156
|
+
hash: 3
|
157
|
+
segments:
|
158
|
+
- 0
|
124
159
|
version: "0"
|
125
|
-
version:
|
126
160
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
161
|
+
none: false
|
127
162
|
requirements:
|
128
163
|
- - ">="
|
129
164
|
- !ruby/object:Gem::Version
|
165
|
+
hash: 3
|
166
|
+
segments:
|
167
|
+
- 0
|
130
168
|
version: "0"
|
131
|
-
version:
|
132
169
|
requirements: []
|
133
170
|
|
134
171
|
rubyforge_project: rackcsrf
|
135
|
-
rubygems_version: 1.3.
|
172
|
+
rubygems_version: 1.3.7
|
136
173
|
signing_key:
|
137
174
|
specification_version: 3
|
138
175
|
summary: Anti-CSRF Rack middleware
|
data/spec/spec.opts
DELETED