rack-sanitize 0.0.2 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -1
- data/Gemfile +3 -9
- data/Rakefile +1 -53
- data/lib/rack-sanitize.rb +2 -0
- data/lib/rack-sanitize/version.rb +5 -0
- data/rack-sanitize.gemspec +20 -63
- data/spec/rack/sanitize_spec.rb +5 -5
- data/spec/spec_helper.rb +2 -3
- metadata +80 -98
- data/Gemfile.lock +0 -23
- data/VERSION +0 -1
data/.gitignore
CHANGED
data/Gemfile
CHANGED
@@ -1,10 +1,4 @@
|
|
1
|
-
source
|
1
|
+
source "http://rubygems.org"
|
2
2
|
|
3
|
-
gem
|
4
|
-
|
5
|
-
group :test do
|
6
|
-
gem "rspec", "~>1.3.0"
|
7
|
-
gem "rack-test", "~>0.5.4"
|
8
|
-
gem "sinatra", "~>1.0"
|
9
|
-
gem "activesupport", "~>3.0.0.rc2"
|
10
|
-
end
|
3
|
+
# Specify your gem's dependencies in rack-sanitize.gemspec
|
4
|
+
gemspec
|
data/Rakefile
CHANGED
@@ -1,53 +1 @@
|
|
1
|
-
require
|
2
|
-
require 'rake'
|
3
|
-
|
4
|
-
begin
|
5
|
-
require 'jeweler'
|
6
|
-
Jeweler::Tasks.new do |gem|
|
7
|
-
gem.name = "rack-sanitize"
|
8
|
-
gem.summary = %Q{Rack middleware to sanitize GET and POST parameters}
|
9
|
-
gem.description = %Q{Remove all malicious HTML from your request before it reaches your application}
|
10
|
-
gem.email = "pherph@gmail.com"
|
11
|
-
gem.homepage = "http://github.com/robotapocalypse/rack-sanitize"
|
12
|
-
gem.authors = ["robotapocalypse"]
|
13
|
-
gem.add_dependency "sanitize", "~>1.2.0"
|
14
|
-
gem.add_development_dependency "rspec", "~>1.3.0"
|
15
|
-
gem.add_development_dependency "rack-test", "~>0.5.4"
|
16
|
-
gem.add_development_dependency "sinatra", "~>1.0"
|
17
|
-
gem.add_development_dependency "activesupport", "~>3.0.0.rc2"
|
18
|
-
# gem is a Gem::Specification... see http://www.rubygems.org/read/chapter/20 for additional settings
|
19
|
-
end
|
20
|
-
Jeweler::GemcutterTasks.new
|
21
|
-
rescue LoadError
|
22
|
-
puts "Jeweler (or a dependency) not available. Install it with: sudo gem install jeweler"
|
23
|
-
end
|
24
|
-
|
25
|
-
require 'spec/rake/spectask'
|
26
|
-
Spec::Rake::SpecTask.new(:spec) do |spec|
|
27
|
-
spec.libs << 'lib' << 'spec'
|
28
|
-
spec.spec_files = FileList['spec/**/*_spec.rb']
|
29
|
-
end
|
30
|
-
|
31
|
-
Spec::Rake::SpecTask.new(:rcov) do |spec|
|
32
|
-
spec.libs << 'lib' << 'spec'
|
33
|
-
spec.pattern = 'spec/**/*_spec.rb'
|
34
|
-
spec.rcov = true
|
35
|
-
end
|
36
|
-
|
37
|
-
task :spec => :check_dependencies
|
38
|
-
|
39
|
-
task :default => :spec
|
40
|
-
|
41
|
-
require 'rake/rdoctask'
|
42
|
-
Rake::RDocTask.new do |rdoc|
|
43
|
-
if File.exist?('VERSION')
|
44
|
-
version = File.read('VERSION')
|
45
|
-
else
|
46
|
-
version = ""
|
47
|
-
end
|
48
|
-
|
49
|
-
rdoc.rdoc_dir = 'rdoc'
|
50
|
-
rdoc.title = "rack-sanitize #{version}"
|
51
|
-
rdoc.rdoc_files.include('README*')
|
52
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
53
|
-
end
|
1
|
+
require "bundler/gem_tasks"
|
data/rack-sanitize.gemspec
CHANGED
@@ -1,70 +1,27 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
1
|
# -*- encoding: utf-8 -*-
|
2
|
+
$:.push File.expand_path("../lib", __FILE__)
|
3
|
+
require "rack-sanitize/version"
|
5
4
|
|
6
5
|
Gem::Specification.new do |s|
|
7
|
-
s.name
|
8
|
-
s.version
|
9
|
-
|
10
|
-
s.
|
11
|
-
s.
|
12
|
-
s.
|
6
|
+
s.name = "rack-sanitize"
|
7
|
+
s.version = Rack::Sanitize::VERSION
|
8
|
+
s.authors = ["Christopher Durtschi"]
|
9
|
+
s.email = ["christopher.durtschi@gmail.com"]
|
10
|
+
s.homepage = "https://www.github.com/chrisdurtschi/rack-sanitize"
|
11
|
+
s.summary = %q{Rack middleware to sanitize GET and POST parameters}
|
13
12
|
s.description = %q{Remove all malicious HTML from your request before it reaches your application}
|
14
|
-
s.email = %q{pherph@gmail.com}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".document",
|
21
|
-
".gitignore",
|
22
|
-
"Gemfile",
|
23
|
-
"Gemfile.lock",
|
24
|
-
"LICENSE",
|
25
|
-
"README.rdoc",
|
26
|
-
"Rakefile",
|
27
|
-
"VERSION",
|
28
|
-
"lib/rack/sanitize.rb",
|
29
|
-
"rack-sanitize.gemspec",
|
30
|
-
"spec/fixtures/gnu.png",
|
31
|
-
"spec/rack/sanitize_spec.rb",
|
32
|
-
"spec/spec.opts",
|
33
|
-
"spec/spec_helper.rb"
|
34
|
-
]
|
35
|
-
s.homepage = %q{http://github.com/robotapocalypse/rack-sanitize}
|
36
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
37
|
-
s.require_paths = ["lib"]
|
38
|
-
s.rubygems_version = %q{1.3.7}
|
39
|
-
s.summary = %q{Rack middleware to sanitize GET and POST parameters}
|
40
|
-
s.test_files = [
|
41
|
-
"spec/rack/sanitize_spec.rb",
|
42
|
-
"spec/spec_helper.rb"
|
43
|
-
]
|
44
13
|
|
45
|
-
|
46
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
47
|
-
s.specification_version = 3
|
14
|
+
s.rubyforge_project = "rack-sanitize"
|
48
15
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
s.add_development_dependency(%q<sinatra>, ["~> 1.0"])
|
54
|
-
s.add_development_dependency(%q<activesupport>, ["~> 3.0.0.rc2"])
|
55
|
-
else
|
56
|
-
s.add_dependency(%q<sanitize>, ["~> 1.2.0"])
|
57
|
-
s.add_dependency(%q<rspec>, ["~> 1.3.0"])
|
58
|
-
s.add_dependency(%q<rack-test>, ["~> 0.5.4"])
|
59
|
-
s.add_dependency(%q<sinatra>, ["~> 1.0"])
|
60
|
-
s.add_dependency(%q<activesupport>, ["~> 3.0.0.rc2"])
|
61
|
-
end
|
62
|
-
else
|
63
|
-
s.add_dependency(%q<sanitize>, ["~> 1.2.0"])
|
64
|
-
s.add_dependency(%q<rspec>, ["~> 1.3.0"])
|
65
|
-
s.add_dependency(%q<rack-test>, ["~> 0.5.4"])
|
66
|
-
s.add_dependency(%q<sinatra>, ["~> 1.0"])
|
67
|
-
s.add_dependency(%q<activesupport>, ["~> 3.0.0.rc2"])
|
68
|
-
end
|
69
|
-
end
|
16
|
+
s.files = `git ls-files`.split("\n")
|
17
|
+
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
+
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.require_paths = ["lib"]
|
70
20
|
|
21
|
+
s.add_runtime_dependency "sanitize", "~> 2.0.0"
|
22
|
+
s.add_development_dependency "rake"
|
23
|
+
s.add_development_dependency "rspec", "~> 1.3.0"
|
24
|
+
s.add_development_dependency "rack-test", "~> 0.5.4"
|
25
|
+
s.add_development_dependency "sinatra", "~> 1.0"
|
26
|
+
s.add_development_dependency "activesupport", "~> 3.0.0"
|
27
|
+
end
|
data/spec/rack/sanitize_spec.rb
CHANGED
@@ -38,10 +38,10 @@ describe Rack::Sanitize do
|
|
38
38
|
}
|
39
39
|
|
40
40
|
get '/get', params
|
41
|
-
last_response.body.should == "GETs:
|
41
|
+
last_response.body.should == "GETs: beer[]=porter&beer[]=pilsner&person[pets][][cat]=meow&person[pets][][dog]=woof"
|
42
42
|
|
43
43
|
post '/post', params
|
44
|
-
last_response.body.should == "POSTs:
|
44
|
+
last_response.body.should == "POSTs: beer[]=porter&beer[]=pilsner&person[pets][][cat]=meow&person[pets][][dog]=woof"
|
45
45
|
end
|
46
46
|
|
47
47
|
it "should allow the sanitize configuration to be set" do
|
@@ -50,13 +50,13 @@ describe Rack::Sanitize do
|
|
50
50
|
run PotentialVictim
|
51
51
|
end
|
52
52
|
|
53
|
-
params = {"image" => %Q{<img src="/hello.jpg"
|
53
|
+
params = {"image" => %Q{<img src="/hello.jpg">}}
|
54
54
|
|
55
55
|
get '/get', params
|
56
|
-
last_response.body.should == %Q{GETs: image=<img src="/hello.jpg"
|
56
|
+
last_response.body.should == %Q{GETs: image=<img src="/hello.jpg">}
|
57
57
|
|
58
58
|
post '/post', params
|
59
|
-
last_response.body.should == %Q{POSTs: image=<img src="/hello.jpg"
|
59
|
+
last_response.body.should == %Q{POSTs: image=<img src="/hello.jpg">}
|
60
60
|
end
|
61
61
|
|
62
62
|
it "should sanitize if the path matches" do
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,153 +1,135 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: rack-sanitize
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
- 0
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
version: 0.0.2
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
prerelease:
|
10
6
|
platform: ruby
|
11
|
-
authors:
|
12
|
-
-
|
7
|
+
authors:
|
8
|
+
- Christopher Durtschi
|
13
9
|
autorequire:
|
14
10
|
bindir: bin
|
15
11
|
cert_chain: []
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
dependencies:
|
20
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2011-09-19 00:00:00.000000000Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
21
15
|
name: sanitize
|
22
|
-
|
23
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &70282400515000 !ruby/object:Gem::Requirement
|
24
17
|
none: false
|
25
|
-
requirements:
|
18
|
+
requirements:
|
26
19
|
- - ~>
|
27
|
-
- !ruby/object:Gem::Version
|
28
|
-
|
29
|
-
- 1
|
30
|
-
- 2
|
31
|
-
- 0
|
32
|
-
version: 1.2.0
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: 2.0.0
|
33
22
|
type: :runtime
|
34
|
-
version_requirements: *id001
|
35
|
-
- !ruby/object:Gem::Dependency
|
36
|
-
name: rspec
|
37
23
|
prerelease: false
|
38
|
-
|
24
|
+
version_requirements: *70282400515000
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rake
|
27
|
+
requirement: &70282400511720 !ruby/object:Gem::Requirement
|
39
28
|
none: false
|
40
|
-
requirements:
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
32
|
+
version: '0'
|
33
|
+
type: :development
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *70282400511720
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: rspec
|
38
|
+
requirement: &70282400507080 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
41
|
- - ~>
|
42
|
-
- !ruby/object:Gem::Version
|
43
|
-
segments:
|
44
|
-
- 1
|
45
|
-
- 3
|
46
|
-
- 0
|
42
|
+
- !ruby/object:Gem::Version
|
47
43
|
version: 1.3.0
|
48
44
|
type: :development
|
49
|
-
version_requirements: *id002
|
50
|
-
- !ruby/object:Gem::Dependency
|
51
|
-
name: rack-test
|
52
45
|
prerelease: false
|
53
|
-
|
46
|
+
version_requirements: *70282400507080
|
47
|
+
- !ruby/object:Gem::Dependency
|
48
|
+
name: rack-test
|
49
|
+
requirement: &70282400501580 !ruby/object:Gem::Requirement
|
54
50
|
none: false
|
55
|
-
requirements:
|
51
|
+
requirements:
|
56
52
|
- - ~>
|
57
|
-
- !ruby/object:Gem::Version
|
58
|
-
segments:
|
59
|
-
- 0
|
60
|
-
- 5
|
61
|
-
- 4
|
53
|
+
- !ruby/object:Gem::Version
|
62
54
|
version: 0.5.4
|
63
55
|
type: :development
|
64
|
-
version_requirements: *id003
|
65
|
-
- !ruby/object:Gem::Dependency
|
66
|
-
name: sinatra
|
67
56
|
prerelease: false
|
68
|
-
|
57
|
+
version_requirements: *70282400501580
|
58
|
+
- !ruby/object:Gem::Dependency
|
59
|
+
name: sinatra
|
60
|
+
requirement: &70282400499480 !ruby/object:Gem::Requirement
|
69
61
|
none: false
|
70
|
-
requirements:
|
62
|
+
requirements:
|
71
63
|
- - ~>
|
72
|
-
- !ruby/object:Gem::Version
|
73
|
-
|
74
|
-
- 1
|
75
|
-
- 0
|
76
|
-
version: "1.0"
|
64
|
+
- !ruby/object:Gem::Version
|
65
|
+
version: '1.0'
|
77
66
|
type: :development
|
78
|
-
version_requirements: *id004
|
79
|
-
- !ruby/object:Gem::Dependency
|
80
|
-
name: activesupport
|
81
67
|
prerelease: false
|
82
|
-
|
68
|
+
version_requirements: *70282400499480
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activesupport
|
71
|
+
requirement: &70282400498220 !ruby/object:Gem::Requirement
|
83
72
|
none: false
|
84
|
-
requirements:
|
73
|
+
requirements:
|
85
74
|
- - ~>
|
86
|
-
- !ruby/object:Gem::Version
|
87
|
-
|
88
|
-
- 3
|
89
|
-
- 0
|
90
|
-
- 0
|
91
|
-
- rc2
|
92
|
-
version: 3.0.0.rc2
|
75
|
+
- !ruby/object:Gem::Version
|
76
|
+
version: 3.0.0
|
93
77
|
type: :development
|
94
|
-
|
78
|
+
prerelease: false
|
79
|
+
version_requirements: *70282400498220
|
95
80
|
description: Remove all malicious HTML from your request before it reaches your application
|
96
|
-
email:
|
81
|
+
email:
|
82
|
+
- christopher.durtschi@gmail.com
|
97
83
|
executables: []
|
98
|
-
|
99
84
|
extensions: []
|
100
|
-
|
101
|
-
|
102
|
-
- LICENSE
|
103
|
-
- README.rdoc
|
104
|
-
files:
|
85
|
+
extra_rdoc_files: []
|
86
|
+
files:
|
105
87
|
- .document
|
106
88
|
- .gitignore
|
107
89
|
- Gemfile
|
108
|
-
- Gemfile.lock
|
109
90
|
- LICENSE
|
110
91
|
- README.rdoc
|
111
92
|
- Rakefile
|
112
|
-
-
|
93
|
+
- lib/rack-sanitize.rb
|
94
|
+
- lib/rack-sanitize/version.rb
|
113
95
|
- lib/rack/sanitize.rb
|
114
96
|
- rack-sanitize.gemspec
|
115
97
|
- spec/fixtures/gnu.png
|
116
98
|
- spec/rack/sanitize_spec.rb
|
117
99
|
- spec/spec.opts
|
118
100
|
- spec/spec_helper.rb
|
119
|
-
|
120
|
-
homepage: http://github.com/robotapocalypse/rack-sanitize
|
101
|
+
homepage: https://www.github.com/chrisdurtschi/rack-sanitize
|
121
102
|
licenses: []
|
122
|
-
|
123
103
|
post_install_message:
|
124
|
-
rdoc_options:
|
125
|
-
|
126
|
-
require_paths:
|
104
|
+
rdoc_options: []
|
105
|
+
require_paths:
|
127
106
|
- lib
|
128
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
107
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
129
108
|
none: false
|
130
|
-
requirements:
|
131
|
-
- -
|
132
|
-
- !ruby/object:Gem::Version
|
133
|
-
|
109
|
+
requirements:
|
110
|
+
- - ! '>='
|
111
|
+
- !ruby/object:Gem::Version
|
112
|
+
version: '0'
|
113
|
+
segments:
|
134
114
|
- 0
|
135
|
-
|
136
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
115
|
+
hash: 1434907685913058139
|
116
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
137
117
|
none: false
|
138
|
-
requirements:
|
139
|
-
- -
|
140
|
-
- !ruby/object:Gem::Version
|
141
|
-
|
118
|
+
requirements:
|
119
|
+
- - ! '>='
|
120
|
+
- !ruby/object:Gem::Version
|
121
|
+
version: '0'
|
122
|
+
segments:
|
142
123
|
- 0
|
143
|
-
|
124
|
+
hash: 1434907685913058139
|
144
125
|
requirements: []
|
145
|
-
|
146
|
-
|
147
|
-
rubygems_version: 1.3.7
|
126
|
+
rubyforge_project: rack-sanitize
|
127
|
+
rubygems_version: 1.8.6
|
148
128
|
signing_key:
|
149
129
|
specification_version: 3
|
150
130
|
summary: Rack middleware to sanitize GET and POST parameters
|
151
|
-
test_files:
|
131
|
+
test_files:
|
132
|
+
- spec/fixtures/gnu.png
|
152
133
|
- spec/rack/sanitize_spec.rb
|
134
|
+
- spec/spec.opts
|
153
135
|
- spec/spec_helper.rb
|
data/Gemfile.lock
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: http://rubygems.org/
|
3
|
-
specs:
|
4
|
-
activesupport (3.0.0.rc2)
|
5
|
-
nokogiri (1.4.3.1)
|
6
|
-
rack (1.2.1)
|
7
|
-
rack-test (0.5.4)
|
8
|
-
rack (>= 1.0)
|
9
|
-
rspec (1.3.0)
|
10
|
-
sanitize (1.2.0)
|
11
|
-
nokogiri (~> 1.4.1)
|
12
|
-
sinatra (1.0)
|
13
|
-
rack (>= 1.0)
|
14
|
-
|
15
|
-
PLATFORMS
|
16
|
-
ruby
|
17
|
-
|
18
|
-
DEPENDENCIES
|
19
|
-
activesupport (~> 3.0.0.rc2)
|
20
|
-
rack-test (~> 0.5.4)
|
21
|
-
rspec (~> 1.3.0)
|
22
|
-
sanitize (~> 1.2.0)
|
23
|
-
sinatra (~> 1.0)
|
data/VERSION
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
0.0.2
|