angular_xss 0.1.0
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/.gitignore +5 -0
- data/LICENSE +22 -0
- data/README.md +43 -0
- data/Rakefile +62 -0
- data/assignable_values.gemspec +20 -0
- data/lib/angular_xss.rb +5 -0
- data/lib/angular_xss/erb.rb +25 -0
- data/lib/angular_xss/escaper.rb +10 -0
- data/lib/angular_xss/haml.rb +15 -0
- data/lib/angular_xss/version.rb +3 -0
- data/spec/rails-2.3/Gemfile +10 -0
- data/spec/rails-2.3/Gemfile.lock +56 -0
- data/spec/rails-2.3/Rakefile +11 -0
- data/spec/rails-2.3/app_root/config/boot.rb +129 -0
- data/spec/rails-2.3/app_root/config/database.yml +4 -0
- data/spec/rails-2.3/app_root/config/environment.rb +14 -0
- data/spec/rails-2.3/app_root/config/environments/test.rb +28 -0
- data/spec/rails-2.3/app_root/config/preinitializer.rb +20 -0
- data/spec/rails-2.3/app_root/config/routes.rb +4 -0
- data/spec/rails-2.3/app_root/lib/console_with_fixtures.rb +4 -0
- data/spec/rails-2.3/app_root/log/.gitignore +1 -0
- data/spec/rails-2.3/app_root/script/console +7 -0
- data/spec/rails-2.3/rcov.opts +2 -0
- data/spec/rails-2.3/spec.opts +4 -0
- data/spec/rails-2.3/spec/spec_helper.rb +20 -0
- data/spec/rails-3.2/.rspec +2 -0
- data/spec/rails-3.2/Gemfile +9 -0
- data/spec/rails-3.2/Gemfile.lock +128 -0
- data/spec/rails-3.2/Rakefile +10 -0
- data/spec/rails-3.2/app_root/.gitignore +4 -0
- data/spec/rails-3.2/app_root/config/application.rb +32 -0
- data/spec/rails-3.2/app_root/config/boot.rb +13 -0
- data/spec/rails-3.2/app_root/config/database.yml +4 -0
- data/spec/rails-3.2/app_root/config/environment.rb +5 -0
- data/spec/rails-3.2/app_root/config/environments/test.rb +35 -0
- data/spec/rails-3.2/app_root/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails-3.2/app_root/config/initializers/inflections.rb +10 -0
- data/spec/rails-3.2/app_root/config/initializers/mime_types.rb +5 -0
- data/spec/rails-3.2/app_root/config/initializers/secret_token.rb +7 -0
- data/spec/rails-3.2/app_root/config/initializers/session_store.rb +8 -0
- data/spec/rails-3.2/app_root/config/routes.rb +58 -0
- data/spec/rails-3.2/app_root/lib/tasks/.gitkeep +0 -0
- data/spec/rails-3.2/app_root/log/.gitkeep +0 -0
- data/spec/rails-3.2/app_root/script/rails +6 -0
- data/spec/rails-3.2/rcov.opts +2 -0
- data/spec/rails-3.2/spec/spec_helper.rb +20 -0
- data/spec/shared/app_root/app/controllers/application_controller.rb +2 -0
- data/spec/shared/app_root/app/helpers/application_helper.rb +3 -0
- data/spec/shared/app_root/app/models/.gitkeep +0 -0
- data/spec/shared/app_root/app/views/test/_test_erb.erb +2 -0
- data/spec/shared/app_root/app/views/test/_test_haml.haml +3 -0
- data/spec/shared/app_root/config/database.yml +4 -0
- data/spec/shared/app_root/db/migrate/.gitkeep +0 -0
- data/spec/shared/support/engine_preventing_angular_xss.rb +12 -0
- data/spec/shared/tests/erb_spec.rb +7 -0
- data/spec/shared/tests/haml_spec.rb +7 -0
- metadata +194 -0
data/LICENSE
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 Henning Koch
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,43 @@
|
|
1
|
+
angular_xss
|
2
|
+
===========
|
3
|
+
|
4
|
+
When rendering AngularJS templates with a server-side templating engine like ERB or Haml it is easy to introduce XSS vulnerabilities. These vulnerabilities are enabled by AngularJS evaluating user-provided strings containing interpolation symbols (default symbols are `{{` and `}}`).
|
5
|
+
|
6
|
+
This gem patches ERB/rails_xss and Haml so Angular interpolation symbols are auto-escaped in unsafe strings. And by auto-escaped we mean replacing `{{` with ` { { `.
|
7
|
+
|
8
|
+
**This is an unsatisfactory hack.** A better solution is very much desired, but might not be possible without significant refactoring of AngularJS. See the [related AngularJS issue](https://github.com/angular/angular.js/issues/5601).
|
9
|
+
|
10
|
+
|
11
|
+
Installation
|
12
|
+
------------
|
13
|
+
|
14
|
+
0. Read the code so you know what you're getting into.
|
15
|
+
|
16
|
+
1. Put this into your Gemfile **after other templating engines** like Haml or Erubis:
|
17
|
+
|
18
|
+
gem 'angular_xss' # put me after Haml, Erubis and other templating engines
|
19
|
+
|
20
|
+
2. Run `bundle install`.
|
21
|
+
|
22
|
+
3. Run your test suite to find the places that broke.
|
23
|
+
|
24
|
+
4. Mark any string that is allowed to contain Angular expressions as `#html_safe`.
|
25
|
+
|
26
|
+
|
27
|
+
Known issues
|
28
|
+
------------
|
29
|
+
- Requires Haml. Could be refactored to only patch ERB/rails_xss.
|
30
|
+
|
31
|
+
|
32
|
+
Development
|
33
|
+
-----------
|
34
|
+
|
35
|
+
- Fork the repository.
|
36
|
+
- Push your changes with specs. There is a Rails 3 test application in `spec/app_root` if you need to test integration with a live Rails app.
|
37
|
+
- Send a pull request.
|
38
|
+
|
39
|
+
|
40
|
+
Credits
|
41
|
+
-------
|
42
|
+
|
43
|
+
[Henning Koch](mailto:henning.koch@makandra.de) from [makandra](http://makandra.com/).
|
data/Rakefile
ADDED
@@ -0,0 +1,62 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'bundler/gem_tasks'
|
3
|
+
|
4
|
+
desc 'Default: Run all specs.'
|
5
|
+
task :default => 'all:spec'
|
6
|
+
|
7
|
+
|
8
|
+
namespace :travis do
|
9
|
+
|
10
|
+
desc 'Run tests on Travis CI'
|
11
|
+
task :run => ['slimgems', 'all:bundle:install', 'all:spec']
|
12
|
+
|
13
|
+
desc 'Install slimgems'
|
14
|
+
task :slimgems do
|
15
|
+
system('gem install slimgems')
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
namespace :all do
|
21
|
+
|
22
|
+
desc "Run specs on all spec apps"
|
23
|
+
task :spec do
|
24
|
+
success = true
|
25
|
+
for_each_directory_of('spec/**/Rakefile') do |directory|
|
26
|
+
env = "SPEC=../../#{ENV['SPEC']} " if ENV['SPEC']
|
27
|
+
success &= system("cd #{directory} && #{env} bundle exec rake spec")
|
28
|
+
end
|
29
|
+
fail "Tests failed" unless success
|
30
|
+
end
|
31
|
+
|
32
|
+
namespace :bundle do
|
33
|
+
|
34
|
+
desc "Bundle all spec apps"
|
35
|
+
task :install do
|
36
|
+
for_each_directory_of('spec/**/Gemfile') do |directory|
|
37
|
+
Bundler.with_clean_env do
|
38
|
+
system("cd #{directory} && bundle install")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
desc "Update all gems, or a list of gem given by the GEM environment variable"
|
44
|
+
task :update do
|
45
|
+
for_each_directory_of('spec/**/Gemfile') do |directory|
|
46
|
+
Bundler.with_clean_env do
|
47
|
+
system("cd #{directory} && bundle update #{ENV['GEM']}")
|
48
|
+
end
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
end
|
55
|
+
|
56
|
+
def for_each_directory_of(path, &block)
|
57
|
+
Dir[path].sort.each do |rakefile|
|
58
|
+
directory = File.dirname(rakefile)
|
59
|
+
puts '', "\033[44m#{directory}\033[0m", ''
|
60
|
+
block.call(directory)
|
61
|
+
end
|
62
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
$:.push File.expand_path("../lib", __FILE__)
|
2
|
+
require "angular_xss/version"
|
3
|
+
|
4
|
+
Gem::Specification.new do |s|
|
5
|
+
s.name = 'angular_xss'
|
6
|
+
s.version = AngularXss::VERSION
|
7
|
+
s.authors = ["Henning Koch"]
|
8
|
+
s.email = 'henning.koch@makandra.de'
|
9
|
+
s.homepage = 'https://github.com/makandra/angular_xss'
|
10
|
+
s.summary = 'Patches rails_xss and Haml so AngularJS interpolations are auto-escaped in unsafe strings.'
|
11
|
+
s.description = s.summary
|
12
|
+
s.license = 'MIT'
|
13
|
+
|
14
|
+
s.files = `git ls-files`.split($\)
|
15
|
+
s.test_files = s.files.grep(%r{^spec/})
|
16
|
+
s.require_paths = ["lib"]
|
17
|
+
|
18
|
+
s.add_dependency('activesupport')
|
19
|
+
s.add_dependency('haml')
|
20
|
+
end
|
data/lib/angular_xss.rb
ADDED
@@ -0,0 +1,25 @@
|
|
1
|
+
# Use module_eval so we crash when ERB::Util has not yet been loaded.
|
2
|
+
ERB::Util.module_eval do
|
3
|
+
|
4
|
+
def html_escape_with_escaping_angular_expressions(s)
|
5
|
+
s = s.to_s
|
6
|
+
if s.html_safe?
|
7
|
+
s
|
8
|
+
else
|
9
|
+
html_escape_without_escaping_angular_expressions(AngularXss::Escaper.escape(s))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
alias_method_chain :html_escape, :escaping_angular_expressions
|
14
|
+
|
15
|
+
# Aliasing twice issues a warning "discarding old...". Remove first to avoid it.
|
16
|
+
remove_method(:h)
|
17
|
+
alias h html_escape
|
18
|
+
|
19
|
+
module_function :h
|
20
|
+
|
21
|
+
singleton_class.send(:remove_method, :html_escape)
|
22
|
+
module_function :html_escape
|
23
|
+
module_function :html_escape_without_escaping_angular_expressions
|
24
|
+
|
25
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# Use module_eval so we crash when Haml::Helpers has not yet been loaded.
|
2
|
+
Haml::Helpers.module_eval do
|
3
|
+
|
4
|
+
def html_escape_with_escaping_angular_expressions(s)
|
5
|
+
s = s.to_s
|
6
|
+
if s.html_safe?
|
7
|
+
s
|
8
|
+
else
|
9
|
+
html_escape_without_escaping_angular_expressions(AngularXss::Escaper.escape(s))
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
alias_method_chain :html_escape, :escaping_angular_expressions
|
14
|
+
|
15
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../..
|
3
|
+
specs:
|
4
|
+
angular_xss (0.1.0)
|
5
|
+
activesupport
|
6
|
+
haml
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionmailer (2.3.18)
|
12
|
+
actionpack (= 2.3.18)
|
13
|
+
actionpack (2.3.18)
|
14
|
+
activesupport (= 2.3.18)
|
15
|
+
rack (~> 1.1.0)
|
16
|
+
activerecord (2.3.18)
|
17
|
+
activesupport (= 2.3.18)
|
18
|
+
activeresource (2.3.18)
|
19
|
+
activesupport (= 2.3.18)
|
20
|
+
activesupport (2.3.18)
|
21
|
+
erubis (2.7.0)
|
22
|
+
haml (3.0.25)
|
23
|
+
rack (1.1.6)
|
24
|
+
rails (2.3.18)
|
25
|
+
actionmailer (= 2.3.18)
|
26
|
+
actionpack (= 2.3.18)
|
27
|
+
activerecord (= 2.3.18)
|
28
|
+
activeresource (= 2.3.18)
|
29
|
+
activesupport (= 2.3.18)
|
30
|
+
rake (>= 0.8.3)
|
31
|
+
rails_xss (0.5.1)
|
32
|
+
erubis (>= 2.6.5)
|
33
|
+
rake (10.1.1)
|
34
|
+
rspec (1.3.2)
|
35
|
+
rspec-rails (1.3.4)
|
36
|
+
rack (>= 1.0.0)
|
37
|
+
rspec (~> 1.3.1)
|
38
|
+
rspec_candy (0.3.1)
|
39
|
+
rspec
|
40
|
+
sneaky-save
|
41
|
+
sneaky-save (0.0.2)
|
42
|
+
activerecord (>= 2.3.2)
|
43
|
+
sqlite3 (1.3.8)
|
44
|
+
|
45
|
+
PLATFORMS
|
46
|
+
ruby
|
47
|
+
|
48
|
+
DEPENDENCIES
|
49
|
+
angular_xss!
|
50
|
+
haml (= 3.0.25)
|
51
|
+
rails (~> 2.3.10)
|
52
|
+
rails_xss
|
53
|
+
rspec (< 2)
|
54
|
+
rspec-rails (< 2)
|
55
|
+
rspec_candy
|
56
|
+
sqlite3
|
@@ -0,0 +1,11 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'spec/rake/spectask'
|
3
|
+
|
4
|
+
desc 'Default: Run all specs for a specific rails version.'
|
5
|
+
task :default => :spec
|
6
|
+
|
7
|
+
desc "Run all specs for a specific rails version"
|
8
|
+
Spec::Rake::SpecTask.new() do |t|
|
9
|
+
t.spec_opts = ['--options', "\"spec.opts\""]
|
10
|
+
t.spec_files = defined?(SPEC) ? SPEC : FileList['**/*_spec.rb', '../shared/**/*_spec.rb']
|
11
|
+
end
|
@@ -0,0 +1,129 @@
|
|
1
|
+
# Allow customization of the rails framework path
|
2
|
+
RAILS_FRAMEWORK_ROOT = (ENV['RAILS_FRAMEWORK_ROOT'] || "#{File.dirname(__FILE__)}/../../../../../../vendor/rails") unless defined?(RAILS_FRAMEWORK_ROOT)
|
3
|
+
|
4
|
+
# Don't change this file!
|
5
|
+
# Configure your app in config/environment.rb and config/environments/*.rb
|
6
|
+
|
7
|
+
RAILS_ROOT = "#{File.dirname(__FILE__)}/.." unless defined?(RAILS_ROOT)
|
8
|
+
|
9
|
+
module Rails
|
10
|
+
class << self
|
11
|
+
def boot!
|
12
|
+
unless booted?
|
13
|
+
preinitialize
|
14
|
+
pick_boot.run
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def booted?
|
19
|
+
defined? Rails::Initializer
|
20
|
+
end
|
21
|
+
|
22
|
+
def pick_boot
|
23
|
+
(vendor_rails? ? VendorBoot : GemBoot).new
|
24
|
+
end
|
25
|
+
|
26
|
+
def vendor_rails?
|
27
|
+
File.exist?(RAILS_FRAMEWORK_ROOT)
|
28
|
+
end
|
29
|
+
|
30
|
+
def preinitialize
|
31
|
+
load(preinitializer_path) if File.exist?(preinitializer_path)
|
32
|
+
end
|
33
|
+
|
34
|
+
def preinitializer_path
|
35
|
+
"#{RAILS_ROOT}/config/preinitializer.rb"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
class Boot
|
40
|
+
def run
|
41
|
+
load_initializer
|
42
|
+
Rails::Initializer.run(:set_load_path)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
class VendorBoot < Boot
|
47
|
+
def load_initializer
|
48
|
+
require "#{RAILS_FRAMEWORK_ROOT}/railties/lib/initializer"
|
49
|
+
Rails::Initializer.run(:install_gem_spec_stubs)
|
50
|
+
end
|
51
|
+
end
|
52
|
+
|
53
|
+
class GemBoot < Boot
|
54
|
+
def load_initializer
|
55
|
+
self.class.load_rubygems
|
56
|
+
load_rails_gem
|
57
|
+
require 'initializer'
|
58
|
+
end
|
59
|
+
|
60
|
+
def load_rails_gem
|
61
|
+
if version = self.class.gem_version
|
62
|
+
gem 'rails', version
|
63
|
+
else
|
64
|
+
gem 'rails'
|
65
|
+
end
|
66
|
+
rescue Gem::LoadError => load_error
|
67
|
+
$stderr.puts %(Missing the Rails #{version} gem. Please `gem install -v=#{version} rails`, update your RAILS_GEM_VERSION setting in config/environment.rb for the Rails version you do have installed, or comment out RAILS_GEM_VERSION to use the latest version installed.)
|
68
|
+
exit 1
|
69
|
+
end
|
70
|
+
|
71
|
+
class << self
|
72
|
+
def rubygems_version
|
73
|
+
Gem::RubyGemsVersion rescue nil
|
74
|
+
end
|
75
|
+
|
76
|
+
def gem_version
|
77
|
+
if defined? RAILS_GEM_VERSION
|
78
|
+
RAILS_GEM_VERSION
|
79
|
+
elsif ENV.include?('RAILS_GEM_VERSION')
|
80
|
+
ENV['RAILS_GEM_VERSION']
|
81
|
+
else
|
82
|
+
parse_gem_version(read_environment_rb)
|
83
|
+
end
|
84
|
+
end
|
85
|
+
|
86
|
+
def load_rubygems
|
87
|
+
require 'rubygems'
|
88
|
+
min_version = '1.1.1'
|
89
|
+
unless rubygems_version >= min_version
|
90
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version} (you have #{rubygems_version}). Please `gem update --system` and try again.)
|
91
|
+
exit 1
|
92
|
+
end
|
93
|
+
|
94
|
+
rescue LoadError
|
95
|
+
$stderr.puts %Q(Rails requires RubyGems >= #{min_version}. Please install RubyGems and try again: http://rubygems.rubyforge.org)
|
96
|
+
exit 1
|
97
|
+
end
|
98
|
+
|
99
|
+
def parse_gem_version(text)
|
100
|
+
$1 if text =~ /^[^#]*RAILS_GEM_VERSION\s*=\s*["']([!~<>=]*\s*[\d.]+)["']/
|
101
|
+
end
|
102
|
+
|
103
|
+
private
|
104
|
+
def read_environment_rb
|
105
|
+
environment_rb = "#{RAILS_ROOT}/config/environment.rb"
|
106
|
+
environment_rb = "#{HELPER_RAILS_ROOT}/config/environment.rb" unless File.exists?(environment_rb)
|
107
|
+
File.read(environment_rb)
|
108
|
+
end
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
113
|
+
|
114
|
+
class Rails::Boot
|
115
|
+
def run
|
116
|
+
load_initializer
|
117
|
+
|
118
|
+
Rails::Initializer.class_eval do
|
119
|
+
def load_gems
|
120
|
+
@bundler_loaded ||= Bundler.require :default, Rails.env
|
121
|
+
end
|
122
|
+
end
|
123
|
+
|
124
|
+
Rails::Initializer.run(:set_load_path)
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
# All that for this:
|
129
|
+
Rails.boot!
|
@@ -0,0 +1,14 @@
|
|
1
|
+
require File.join(File.dirname(__FILE__), 'boot')
|
2
|
+
|
3
|
+
Rails::Initializer.run do |config|
|
4
|
+
config.cache_classes = false
|
5
|
+
config.whiny_nils = true
|
6
|
+
config.action_controller.session = { :key => "_myapp_session", :secret => "gwirofjweroijger8924rt2zfwehfuiwehb1378rifowenfoqwphf23" }
|
7
|
+
#config.plugin_locators.unshift(
|
8
|
+
# Class.new(Rails::Plugin::Locator) do
|
9
|
+
# def plugins
|
10
|
+
# [Rails::Plugin.new(File.expand_path('.'))]
|
11
|
+
# end
|
12
|
+
# end
|
13
|
+
#) unless defined?(PluginTestHelper::PluginLocator)
|
14
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
# Settings specified here will take precedence over those in config/environment.rb
|
2
|
+
|
3
|
+
# The test environment is used exclusively to run your application's
|
4
|
+
# test suite. You never need to work with it otherwise. Remember that
|
5
|
+
# your test database is "scratch space" for the test suite and is wiped
|
6
|
+
# and recreated between test runs. Don't rely on the data there!
|
7
|
+
config.cache_classes = true
|
8
|
+
|
9
|
+
# Log error messages when you accidentally call methods on nil.
|
10
|
+
config.whiny_nils = true
|
11
|
+
|
12
|
+
# Show full error reports and disable caching
|
13
|
+
config.action_controller.consider_all_requests_local = true
|
14
|
+
config.action_controller.perform_caching = false
|
15
|
+
config.action_view.cache_template_loading = true
|
16
|
+
|
17
|
+
# Disable request forgery protection in test environment
|
18
|
+
config.action_controller.allow_forgery_protection = false
|
19
|
+
|
20
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
21
|
+
# The :test delivery method accumulates sent emails in the
|
22
|
+
# ActionMailer::Base.deliveries array.
|
23
|
+
config.action_mailer.delivery_method = :test
|
24
|
+
|
25
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
26
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
27
|
+
# like if you have constraints or database-specific column types
|
28
|
+
# config.active_record.schema_format = :sql
|
@@ -0,0 +1,20 @@
|
|
1
|
+
begin
|
2
|
+
require "rubygems"
|
3
|
+
require "bundler"
|
4
|
+
rescue LoadError
|
5
|
+
raise "Could not load the bundler gem. Install it with `gem install bundler`."
|
6
|
+
end
|
7
|
+
|
8
|
+
if Gem::Version.new(Bundler::VERSION) <= Gem::Version.new("0.9.24")
|
9
|
+
raise RuntimeError, "Your bundler version is too old for Rails 2.3." +
|
10
|
+
"Run `gem install bundler` to upgrade."
|
11
|
+
end
|
12
|
+
|
13
|
+
begin
|
14
|
+
# Set up load paths for all bundled gems
|
15
|
+
ENV["BUNDLE_GEMFILE"] = File.expand_path("../../Gemfile", __FILE__)
|
16
|
+
Bundler.setup
|
17
|
+
rescue Bundler::GemNotFound
|
18
|
+
raise RuntimeError, "Bundler couldn't find some gems." +
|
19
|
+
"Did you run `bundle install`?"
|
20
|
+
end
|
@@ -0,0 +1,4 @@
|
|
1
|
+
# Loads fixtures into the database when running the test app via the console
|
2
|
+
(ENV['FIXTURES'] ? ENV['FIXTURES'].split(/,/) : Dir.glob(File.join(Rails.root, '../fixtures/*.{yml,csv}'))).each do |fixture_file|
|
3
|
+
Fixtures.create_fixtures(File.join(Rails.root, '../fixtures'), File.basename(fixture_file, '.*'))
|
4
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
*.log
|
@@ -0,0 +1,20 @@
|
|
1
|
+
$: << File.join(File.dirname(__FILE__), "/../../lib" )
|
2
|
+
|
3
|
+
ENV['RAILS_ENV'] = 'test'
|
4
|
+
ENV['RAILS_ROOT'] = 'app_root'
|
5
|
+
|
6
|
+
# Load the Rails environment and testing framework
|
7
|
+
require "#{File.dirname(__FILE__)}/../app_root/config/environment"
|
8
|
+
require 'spec/rails'
|
9
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
10
|
+
require 'rspec_candy/all'
|
11
|
+
|
12
|
+
# Run the migrations
|
13
|
+
print "\033[30m" # dark gray text
|
14
|
+
ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
|
15
|
+
print "\033[0m"
|
16
|
+
|
17
|
+
Spec::Runner.configure do |config|
|
18
|
+
config.use_transactional_fixtures = true
|
19
|
+
config.use_instantiated_fixtures = false
|
20
|
+
end
|
@@ -0,0 +1,128 @@
|
|
1
|
+
PATH
|
2
|
+
remote: ../..
|
3
|
+
specs:
|
4
|
+
angular_xss (0.1.0)
|
5
|
+
activesupport
|
6
|
+
haml
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: http://rubygems.org/
|
10
|
+
specs:
|
11
|
+
actionmailer (3.2.16)
|
12
|
+
actionpack (= 3.2.16)
|
13
|
+
mail (~> 2.5.4)
|
14
|
+
actionpack (3.2.16)
|
15
|
+
activemodel (= 3.2.16)
|
16
|
+
activesupport (= 3.2.16)
|
17
|
+
builder (~> 3.0.0)
|
18
|
+
erubis (~> 2.7.0)
|
19
|
+
journey (~> 1.0.4)
|
20
|
+
rack (~> 1.4.5)
|
21
|
+
rack-cache (~> 1.2)
|
22
|
+
rack-test (~> 0.6.1)
|
23
|
+
sprockets (~> 2.2.1)
|
24
|
+
activemodel (3.2.16)
|
25
|
+
activesupport (= 3.2.16)
|
26
|
+
builder (~> 3.0.0)
|
27
|
+
activerecord (3.2.16)
|
28
|
+
activemodel (= 3.2.16)
|
29
|
+
activesupport (= 3.2.16)
|
30
|
+
arel (~> 3.0.2)
|
31
|
+
tzinfo (~> 0.3.29)
|
32
|
+
activeresource (3.2.16)
|
33
|
+
activemodel (= 3.2.16)
|
34
|
+
activesupport (= 3.2.16)
|
35
|
+
activesupport (3.2.16)
|
36
|
+
i18n (~> 0.6, >= 0.6.4)
|
37
|
+
multi_json (~> 1.0)
|
38
|
+
arel (3.0.3)
|
39
|
+
builder (3.0.4)
|
40
|
+
diff-lcs (1.2.5)
|
41
|
+
erubis (2.7.0)
|
42
|
+
haml (4.0.4)
|
43
|
+
tilt
|
44
|
+
haml-rails (0.4)
|
45
|
+
actionpack (>= 3.1, < 4.1)
|
46
|
+
activesupport (>= 3.1, < 4.1)
|
47
|
+
haml (>= 3.1, < 4.1)
|
48
|
+
railties (>= 3.1, < 4.1)
|
49
|
+
hike (1.2.3)
|
50
|
+
i18n (0.6.9)
|
51
|
+
journey (1.0.4)
|
52
|
+
json (1.8.1)
|
53
|
+
mail (2.5.4)
|
54
|
+
mime-types (~> 1.16)
|
55
|
+
treetop (~> 1.4.8)
|
56
|
+
mime-types (1.25.1)
|
57
|
+
multi_json (1.8.2)
|
58
|
+
polyglot (0.3.3)
|
59
|
+
rack (1.4.5)
|
60
|
+
rack-cache (1.2)
|
61
|
+
rack (>= 0.4)
|
62
|
+
rack-ssl (1.3.3)
|
63
|
+
rack
|
64
|
+
rack-test (0.6.2)
|
65
|
+
rack (>= 1.0)
|
66
|
+
rails (3.2.16)
|
67
|
+
actionmailer (= 3.2.16)
|
68
|
+
actionpack (= 3.2.16)
|
69
|
+
activerecord (= 3.2.16)
|
70
|
+
activeresource (= 3.2.16)
|
71
|
+
activesupport (= 3.2.16)
|
72
|
+
bundler (~> 1.0)
|
73
|
+
railties (= 3.2.16)
|
74
|
+
railties (3.2.16)
|
75
|
+
actionpack (= 3.2.16)
|
76
|
+
activesupport (= 3.2.16)
|
77
|
+
rack-ssl (~> 1.3.2)
|
78
|
+
rake (>= 0.8.7)
|
79
|
+
rdoc (~> 3.4)
|
80
|
+
thor (>= 0.14.6, < 2.0)
|
81
|
+
rake (10.1.1)
|
82
|
+
rdoc (3.12.2)
|
83
|
+
json (~> 1.4)
|
84
|
+
rspec (2.14.1)
|
85
|
+
rspec-core (~> 2.14.0)
|
86
|
+
rspec-expectations (~> 2.14.0)
|
87
|
+
rspec-mocks (~> 2.14.0)
|
88
|
+
rspec-core (2.14.7)
|
89
|
+
rspec-expectations (2.14.4)
|
90
|
+
diff-lcs (>= 1.1.3, < 2.0)
|
91
|
+
rspec-mocks (2.14.4)
|
92
|
+
rspec-rails (2.14.1)
|
93
|
+
actionpack (>= 3.0)
|
94
|
+
activemodel (>= 3.0)
|
95
|
+
activesupport (>= 3.0)
|
96
|
+
railties (>= 3.0)
|
97
|
+
rspec-core (~> 2.14.0)
|
98
|
+
rspec-expectations (~> 2.14.0)
|
99
|
+
rspec-mocks (~> 2.14.0)
|
100
|
+
rspec_candy (0.3.1)
|
101
|
+
rspec
|
102
|
+
sneaky-save
|
103
|
+
sneaky-save (0.0.4)
|
104
|
+
activerecord (>= 3.2.0)
|
105
|
+
sprockets (2.2.2)
|
106
|
+
hike (~> 1.2)
|
107
|
+
multi_json (~> 1.0)
|
108
|
+
rack (~> 1.0)
|
109
|
+
tilt (~> 1.1, != 1.3.0)
|
110
|
+
sqlite3 (1.3.8)
|
111
|
+
thor (0.18.1)
|
112
|
+
tilt (1.4.1)
|
113
|
+
treetop (1.4.15)
|
114
|
+
polyglot
|
115
|
+
polyglot (>= 0.3.1)
|
116
|
+
tzinfo (0.3.38)
|
117
|
+
|
118
|
+
PLATFORMS
|
119
|
+
ruby
|
120
|
+
|
121
|
+
DEPENDENCIES
|
122
|
+
angular_xss!
|
123
|
+
haml-rails (= 0.4)
|
124
|
+
rails (~> 3.2)
|
125
|
+
rspec
|
126
|
+
rspec-rails
|
127
|
+
rspec_candy
|
128
|
+
sqlite3
|
@@ -0,0 +1,10 @@
|
|
1
|
+
require 'rake'
|
2
|
+
require 'rspec/core/rake_task'
|
3
|
+
|
4
|
+
desc 'Default: Run all specs for a specific rails version.'
|
5
|
+
task :default => :spec
|
6
|
+
|
7
|
+
desc "Run all specs for a specific rails version"
|
8
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
9
|
+
t.pattern = defined?(SPEC) ? SPEC : ['**/*_spec.rb', '../shared/**/*_spec.rb']
|
10
|
+
end
|
@@ -0,0 +1,32 @@
|
|
1
|
+
require File.expand_path('../boot', __FILE__)
|
2
|
+
|
3
|
+
require 'rails/all'
|
4
|
+
|
5
|
+
# If you have a Gemfile, require the gems listed there, including any gems
|
6
|
+
# you've limited to :test, :development, or :production.
|
7
|
+
Bundler.require(:default, Rails.env) if defined?(Bundler)
|
8
|
+
|
9
|
+
|
10
|
+
module SpecApp
|
11
|
+
class Application < Rails::Application
|
12
|
+
config.encoding = "utf-8"
|
13
|
+
|
14
|
+
config.cache_classes = true
|
15
|
+
config.whiny_nils = true
|
16
|
+
|
17
|
+
config.consider_all_requests_local = true
|
18
|
+
config.action_controller.perform_caching = false
|
19
|
+
|
20
|
+
config.action_dispatch.show_exceptions = false
|
21
|
+
|
22
|
+
config.action_controller.allow_forgery_protection = false
|
23
|
+
|
24
|
+
config.action_mailer.delivery_method = :test
|
25
|
+
|
26
|
+
config.active_support.deprecation = :stderr
|
27
|
+
|
28
|
+
config.root = File.expand_path('../..', __FILE__)
|
29
|
+
|
30
|
+
# railties.plugins << Rails::Plugin.new(File.expand_path('../../../../..', __FILE__))
|
31
|
+
end
|
32
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
require 'rubygems'
|
2
|
+
|
3
|
+
# Set up gems listed in the Gemfile.
|
4
|
+
gemfile = File.expand_path('../../Gemfile', __FILE__)
|
5
|
+
begin
|
6
|
+
ENV['BUNDLE_GEMFILE'] = gemfile
|
7
|
+
require 'bundler'
|
8
|
+
Bundler.setup
|
9
|
+
rescue Bundler::GemNotFound => e
|
10
|
+
STDERR.puts e.message
|
11
|
+
STDERR.puts "Try running `bundle install`."
|
12
|
+
exit!
|
13
|
+
end if File.exist?(gemfile)
|
@@ -0,0 +1,35 @@
|
|
1
|
+
SpecApp::Application.configure do
|
2
|
+
# Settings specified here will take precedence over those in config/application.rb
|
3
|
+
|
4
|
+
# The test environment is used exclusively to run your application's
|
5
|
+
# test suite. You never need to work with it otherwise. Remember that
|
6
|
+
# your test database is "scratch space" for the test suite and is wiped
|
7
|
+
# and recreated between test runs. Don't rely on the data there!
|
8
|
+
config.cache_classes = true
|
9
|
+
|
10
|
+
# Log error messages when you accidentally call methods on nil.
|
11
|
+
config.whiny_nils = true
|
12
|
+
|
13
|
+
# Show full error reports and disable caching
|
14
|
+
config.consider_all_requests_local = true
|
15
|
+
config.action_controller.perform_caching = false
|
16
|
+
|
17
|
+
# Raise exceptions instead of rendering exception templates
|
18
|
+
config.action_dispatch.show_exceptions = false
|
19
|
+
|
20
|
+
# Disable request forgery protection in test environment
|
21
|
+
config.action_controller.allow_forgery_protection = false
|
22
|
+
|
23
|
+
# Tell Action Mailer not to deliver emails to the real world.
|
24
|
+
# The :test delivery method accumulates sent emails in the
|
25
|
+
# ActionMailer::Base.deliveries array.
|
26
|
+
config.action_mailer.delivery_method = :test
|
27
|
+
|
28
|
+
# Use SQL instead of Active Record's schema dumper when creating the test database.
|
29
|
+
# This is necessary if your schema can't be completely dumped by the schema dumper,
|
30
|
+
# like if you have constraints or database-specific column types
|
31
|
+
# config.active_record.schema_format = :sql
|
32
|
+
|
33
|
+
# Print deprecation notices to the stderr
|
34
|
+
config.active_support.deprecation = :stderr
|
35
|
+
end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# You can add backtrace silencers for libraries that you're using but don't wish to see in your backtraces.
|
4
|
+
# Rails.backtrace_cleaner.add_silencer { |line| line =~ /my_noisy_library/ }
|
5
|
+
|
6
|
+
# You can also remove all the silencers if you're trying to debug a problem that might stem from framework code.
|
7
|
+
# Rails.backtrace_cleaner.remove_silencers!
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Add new inflection rules using the following format
|
4
|
+
# (all these examples are active by default):
|
5
|
+
# ActiveSupport::Inflector.inflections do |inflect|
|
6
|
+
# inflect.plural /^(ox)$/i, '\1en'
|
7
|
+
# inflect.singular /^(ox)en/i, '\1'
|
8
|
+
# inflect.irregular 'person', 'people'
|
9
|
+
# inflect.uncountable %w( fish sheep )
|
10
|
+
# end
|
@@ -0,0 +1,7 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
# Your secret key for verifying the integrity of signed cookies.
|
4
|
+
# If you change this key, all old signed cookies will become invalid!
|
5
|
+
# Make sure the secret is at least 30 characters and all random,
|
6
|
+
# no regular words or you'll be exposed to dictionary attacks.
|
7
|
+
SpecApp::Application.config.secret_token = 'cb014a08a45243e7143f31e04774c342c1fba329fd594ae1a480d8283b1a851f425dc08044311fb4be6d000b6e6681de7c76d19148419a5ffa0a9f84556d3b33'
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# Be sure to restart your server when you modify this file.
|
2
|
+
|
3
|
+
SpecApp::Application.config.session_store :cookie_store, :key => '_app_root_session'
|
4
|
+
|
5
|
+
# Use the database for sessions instead of the cookie-based default,
|
6
|
+
# which shouldn't be used to store highly confidential information
|
7
|
+
# (create the session table with "rails generate session_migration")
|
8
|
+
# SpecApp::Application.config.session_store :active_record_store
|
@@ -0,0 +1,58 @@
|
|
1
|
+
SpecApp::Application.routes.draw do
|
2
|
+
# The priority is based upon order of creation:
|
3
|
+
# first created -> highest priority.
|
4
|
+
|
5
|
+
# Sample of regular route:
|
6
|
+
# match 'products/:id' => 'catalog#view'
|
7
|
+
# Keep in mind you can assign values other than :controller and :action
|
8
|
+
|
9
|
+
# Sample of named route:
|
10
|
+
# match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
|
11
|
+
# This route can be invoked with purchase_url(:id => product.id)
|
12
|
+
|
13
|
+
# Sample resource route (maps HTTP verbs to controller actions automatically):
|
14
|
+
# resources :products
|
15
|
+
|
16
|
+
# Sample resource route with options:
|
17
|
+
# resources :products do
|
18
|
+
# member do
|
19
|
+
# get 'short'
|
20
|
+
# post 'toggle'
|
21
|
+
# end
|
22
|
+
#
|
23
|
+
# collection do
|
24
|
+
# get 'sold'
|
25
|
+
# end
|
26
|
+
# end
|
27
|
+
|
28
|
+
# Sample resource route with sub-resources:
|
29
|
+
# resources :products do
|
30
|
+
# resources :comments, :sales
|
31
|
+
# resource :seller
|
32
|
+
# end
|
33
|
+
|
34
|
+
# Sample resource route with more complex sub-resources
|
35
|
+
# resources :products do
|
36
|
+
# resources :comments
|
37
|
+
# resources :sales do
|
38
|
+
# get 'recent', :on => :collection
|
39
|
+
# end
|
40
|
+
# end
|
41
|
+
|
42
|
+
# Sample resource route within a namespace:
|
43
|
+
# namespace :admin do
|
44
|
+
# # Directs /admin/products/* to Admin::ProductsController
|
45
|
+
# # (app/controllers/admin/products_controller.rb)
|
46
|
+
# resources :products
|
47
|
+
# end
|
48
|
+
|
49
|
+
# You can have the root of your site routed with "root"
|
50
|
+
# just remember to delete public/index.html.
|
51
|
+
# root :to => "welcome#index"
|
52
|
+
|
53
|
+
# See how all your routes lay out with "rake routes"
|
54
|
+
|
55
|
+
# This is a legacy wild controller route that's not recommended for RESTful applications.
|
56
|
+
# Note: This route will make all actions in every controller accessible via GET requests.
|
57
|
+
match ':controller(/:action(/:id(.:format)))'
|
58
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,6 @@
|
|
1
|
+
#!/usr/bin/env ruby1.8
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.
|
3
|
+
|
4
|
+
APP_PATH = File.expand_path('../../config/application', __FILE__)
|
5
|
+
require File.expand_path('../../config/boot', __FILE__)
|
6
|
+
require 'rails/commands'
|
@@ -0,0 +1,20 @@
|
|
1
|
+
$: << File.join(File.dirname(__FILE__), "/../../lib" )
|
2
|
+
|
3
|
+
ENV['RAILS_ENV'] = 'test'
|
4
|
+
ENV['RAILS_ROOT'] = 'app_root'
|
5
|
+
|
6
|
+
# Load the Rails environment and testing framework
|
7
|
+
require "#{File.dirname(__FILE__)}/../app_root/config/environment"
|
8
|
+
require 'rspec/rails'
|
9
|
+
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each {|f| require f}
|
10
|
+
require 'rspec_candy/all'
|
11
|
+
|
12
|
+
# Run the migrations
|
13
|
+
print "\033[30m" # dark gray text
|
14
|
+
ActiveRecord::Migrator.migrate("#{Rails.root}/db/migrate")
|
15
|
+
print "\033[0m"
|
16
|
+
|
17
|
+
RSpec.configure do |config|
|
18
|
+
config.use_transactional_fixtures = true
|
19
|
+
config.use_instantiated_fixtures = false
|
20
|
+
end
|
File without changes
|
File without changes
|
@@ -0,0 +1,12 @@
|
|
1
|
+
shared_examples_for 'engine preventing Angular XSS' do
|
2
|
+
|
3
|
+
it 'escapes Angular interpolation marks iff a string is unsafe' do
|
4
|
+
engine = respond_to?(:view) ? view : template
|
5
|
+
html = engine.render(partial)
|
6
|
+
html.should include(" { { unsafe}}")
|
7
|
+
html.should_not include("{{unsafe}}")
|
8
|
+
html.should include("{{safe}}")
|
9
|
+
html.should_not include(" { { safe}}")
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
metadata
ADDED
@@ -0,0 +1,194 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: angular_xss
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Henning Koch
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2014-01-03 00:00:00 +01:00
|
19
|
+
default_executable:
|
20
|
+
dependencies:
|
21
|
+
- !ruby/object:Gem::Dependency
|
22
|
+
name: activesupport
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 3
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
version: "0"
|
33
|
+
type: :runtime
|
34
|
+
version_requirements: *id001
|
35
|
+
- !ruby/object:Gem::Dependency
|
36
|
+
name: haml
|
37
|
+
prerelease: false
|
38
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ">="
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
hash: 3
|
44
|
+
segments:
|
45
|
+
- 0
|
46
|
+
version: "0"
|
47
|
+
type: :runtime
|
48
|
+
version_requirements: *id002
|
49
|
+
description: Patches rails_xss and Haml so AngularJS interpolations are auto-escaped in unsafe strings.
|
50
|
+
email: henning.koch@makandra.de
|
51
|
+
executables: []
|
52
|
+
|
53
|
+
extensions: []
|
54
|
+
|
55
|
+
extra_rdoc_files: []
|
56
|
+
|
57
|
+
files:
|
58
|
+
- .gitignore
|
59
|
+
- LICENSE
|
60
|
+
- README.md
|
61
|
+
- Rakefile
|
62
|
+
- assignable_values.gemspec
|
63
|
+
- lib/angular_xss.rb
|
64
|
+
- lib/angular_xss/erb.rb
|
65
|
+
- lib/angular_xss/escaper.rb
|
66
|
+
- lib/angular_xss/haml.rb
|
67
|
+
- lib/angular_xss/version.rb
|
68
|
+
- spec/rails-2.3/Gemfile
|
69
|
+
- spec/rails-2.3/Gemfile.lock
|
70
|
+
- spec/rails-2.3/Rakefile
|
71
|
+
- spec/rails-2.3/app_root/config/boot.rb
|
72
|
+
- spec/rails-2.3/app_root/config/database.yml
|
73
|
+
- spec/rails-2.3/app_root/config/environment.rb
|
74
|
+
- spec/rails-2.3/app_root/config/environments/test.rb
|
75
|
+
- spec/rails-2.3/app_root/config/preinitializer.rb
|
76
|
+
- spec/rails-2.3/app_root/config/routes.rb
|
77
|
+
- spec/rails-2.3/app_root/lib/console_with_fixtures.rb
|
78
|
+
- spec/rails-2.3/app_root/log/.gitignore
|
79
|
+
- spec/rails-2.3/app_root/script/console
|
80
|
+
- spec/rails-2.3/rcov.opts
|
81
|
+
- spec/rails-2.3/spec.opts
|
82
|
+
- spec/rails-2.3/spec/spec_helper.rb
|
83
|
+
- spec/rails-3.2/.rspec
|
84
|
+
- spec/rails-3.2/Gemfile
|
85
|
+
- spec/rails-3.2/Gemfile.lock
|
86
|
+
- spec/rails-3.2/Rakefile
|
87
|
+
- spec/rails-3.2/app_root/.gitignore
|
88
|
+
- spec/rails-3.2/app_root/config/application.rb
|
89
|
+
- spec/rails-3.2/app_root/config/boot.rb
|
90
|
+
- spec/rails-3.2/app_root/config/database.yml
|
91
|
+
- spec/rails-3.2/app_root/config/environment.rb
|
92
|
+
- spec/rails-3.2/app_root/config/environments/test.rb
|
93
|
+
- spec/rails-3.2/app_root/config/initializers/backtrace_silencers.rb
|
94
|
+
- spec/rails-3.2/app_root/config/initializers/inflections.rb
|
95
|
+
- spec/rails-3.2/app_root/config/initializers/mime_types.rb
|
96
|
+
- spec/rails-3.2/app_root/config/initializers/secret_token.rb
|
97
|
+
- spec/rails-3.2/app_root/config/initializers/session_store.rb
|
98
|
+
- spec/rails-3.2/app_root/config/routes.rb
|
99
|
+
- spec/rails-3.2/app_root/lib/tasks/.gitkeep
|
100
|
+
- spec/rails-3.2/app_root/log/.gitkeep
|
101
|
+
- spec/rails-3.2/app_root/script/rails
|
102
|
+
- spec/rails-3.2/rcov.opts
|
103
|
+
- spec/rails-3.2/spec/spec_helper.rb
|
104
|
+
- spec/shared/app_root/app/controllers/application_controller.rb
|
105
|
+
- spec/shared/app_root/app/helpers/application_helper.rb
|
106
|
+
- spec/shared/app_root/app/models/.gitkeep
|
107
|
+
- spec/shared/app_root/app/views/test/_test_erb.erb
|
108
|
+
- spec/shared/app_root/app/views/test/_test_haml.haml
|
109
|
+
- spec/shared/app_root/config/database.yml
|
110
|
+
- spec/shared/app_root/db/migrate/.gitkeep
|
111
|
+
- spec/shared/support/engine_preventing_angular_xss.rb
|
112
|
+
- spec/shared/tests/erb_spec.rb
|
113
|
+
- spec/shared/tests/haml_spec.rb
|
114
|
+
has_rdoc: true
|
115
|
+
homepage: https://github.com/makandra/angular_xss
|
116
|
+
licenses:
|
117
|
+
- MIT
|
118
|
+
post_install_message:
|
119
|
+
rdoc_options: []
|
120
|
+
|
121
|
+
require_paths:
|
122
|
+
- lib
|
123
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
124
|
+
none: false
|
125
|
+
requirements:
|
126
|
+
- - ">="
|
127
|
+
- !ruby/object:Gem::Version
|
128
|
+
hash: 3
|
129
|
+
segments:
|
130
|
+
- 0
|
131
|
+
version: "0"
|
132
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
133
|
+
none: false
|
134
|
+
requirements:
|
135
|
+
- - ">="
|
136
|
+
- !ruby/object:Gem::Version
|
137
|
+
hash: 3
|
138
|
+
segments:
|
139
|
+
- 0
|
140
|
+
version: "0"
|
141
|
+
requirements: []
|
142
|
+
|
143
|
+
rubyforge_project:
|
144
|
+
rubygems_version: 1.3.9.5
|
145
|
+
signing_key:
|
146
|
+
specification_version: 3
|
147
|
+
summary: Patches rails_xss and Haml so AngularJS interpolations are auto-escaped in unsafe strings.
|
148
|
+
test_files:
|
149
|
+
- spec/rails-2.3/Gemfile
|
150
|
+
- spec/rails-2.3/Gemfile.lock
|
151
|
+
- spec/rails-2.3/Rakefile
|
152
|
+
- spec/rails-2.3/app_root/config/boot.rb
|
153
|
+
- spec/rails-2.3/app_root/config/database.yml
|
154
|
+
- spec/rails-2.3/app_root/config/environment.rb
|
155
|
+
- spec/rails-2.3/app_root/config/environments/test.rb
|
156
|
+
- spec/rails-2.3/app_root/config/preinitializer.rb
|
157
|
+
- spec/rails-2.3/app_root/config/routes.rb
|
158
|
+
- spec/rails-2.3/app_root/lib/console_with_fixtures.rb
|
159
|
+
- spec/rails-2.3/app_root/log/.gitignore
|
160
|
+
- spec/rails-2.3/app_root/script/console
|
161
|
+
- spec/rails-2.3/rcov.opts
|
162
|
+
- spec/rails-2.3/spec.opts
|
163
|
+
- spec/rails-2.3/spec/spec_helper.rb
|
164
|
+
- spec/rails-3.2/.rspec
|
165
|
+
- spec/rails-3.2/Gemfile
|
166
|
+
- spec/rails-3.2/Gemfile.lock
|
167
|
+
- spec/rails-3.2/Rakefile
|
168
|
+
- spec/rails-3.2/app_root/.gitignore
|
169
|
+
- spec/rails-3.2/app_root/config/application.rb
|
170
|
+
- spec/rails-3.2/app_root/config/boot.rb
|
171
|
+
- spec/rails-3.2/app_root/config/database.yml
|
172
|
+
- spec/rails-3.2/app_root/config/environment.rb
|
173
|
+
- spec/rails-3.2/app_root/config/environments/test.rb
|
174
|
+
- spec/rails-3.2/app_root/config/initializers/backtrace_silencers.rb
|
175
|
+
- spec/rails-3.2/app_root/config/initializers/inflections.rb
|
176
|
+
- spec/rails-3.2/app_root/config/initializers/mime_types.rb
|
177
|
+
- spec/rails-3.2/app_root/config/initializers/secret_token.rb
|
178
|
+
- spec/rails-3.2/app_root/config/initializers/session_store.rb
|
179
|
+
- spec/rails-3.2/app_root/config/routes.rb
|
180
|
+
- spec/rails-3.2/app_root/lib/tasks/.gitkeep
|
181
|
+
- spec/rails-3.2/app_root/log/.gitkeep
|
182
|
+
- spec/rails-3.2/app_root/script/rails
|
183
|
+
- spec/rails-3.2/rcov.opts
|
184
|
+
- spec/rails-3.2/spec/spec_helper.rb
|
185
|
+
- spec/shared/app_root/app/controllers/application_controller.rb
|
186
|
+
- spec/shared/app_root/app/helpers/application_helper.rb
|
187
|
+
- spec/shared/app_root/app/models/.gitkeep
|
188
|
+
- spec/shared/app_root/app/views/test/_test_erb.erb
|
189
|
+
- spec/shared/app_root/app/views/test/_test_haml.haml
|
190
|
+
- spec/shared/app_root/config/database.yml
|
191
|
+
- spec/shared/app_root/db/migrate/.gitkeep
|
192
|
+
- spec/shared/support/engine_preventing_angular_xss.rb
|
193
|
+
- spec/shared/tests/erb_spec.rb
|
194
|
+
- spec/shared/tests/haml_spec.rb
|