angular_xss 0.2.2 → 0.4.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.
Files changed (98) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/test.yml +52 -0
  3. data/.rspec +1 -0
  4. data/.ruby-version +1 -0
  5. data/CHANGELOG.md +72 -0
  6. data/Gemfile +1 -0
  7. data/Gemfile.lock +1 -0
  8. data/Gemfile.rails-3.2 +9 -0
  9. data/Gemfile.rails-3.2.lock +91 -0
  10. data/Gemfile.rails-4.2.haml-4 +8 -0
  11. data/Gemfile.rails-4.2.haml-4.lock +88 -0
  12. data/Gemfile.rails-4.2.haml-5 +8 -0
  13. data/Gemfile.rails-4.2.haml-5.lock +90 -0
  14. data/Gemfile.rails-5.1.haml-4 +8 -0
  15. data/Gemfile.rails-5.1.haml-4.lock +85 -0
  16. data/Gemfile.rails-5.1.haml-5 +8 -0
  17. data/Gemfile.rails-5.1.haml-5.lock +87 -0
  18. data/Gemfile.rails-6.1.haml-5 +8 -0
  19. data/Gemfile.rails-6.1.haml-5.lock +90 -0
  20. data/README.md +12 -4
  21. data/Rakefile +3 -66
  22. data/lib/angular_xss/action_view.rb +2 -1
  23. data/lib/angular_xss/erb.rb +2 -1
  24. data/lib/angular_xss/escaper.rb +2 -2
  25. data/lib/angular_xss/haml.rb +27 -10
  26. data/lib/angular_xss/safe_buffer.rb +4 -3
  27. data/lib/angular_xss/version.rb +1 -1
  28. data/spec/{shared/tests → angular_xss}/erb_spec.rb +1 -1
  29. data/spec/{shared/tests → angular_xss}/haml_spec.rb +1 -1
  30. data/spec/angular_xss/safe_buffer_spec.rb +9 -0
  31. data/spec/spec_helper.rb +37 -0
  32. data/spec/{shared/support → support}/engine_preventing_angular_xss.rb +20 -8
  33. data/spec/{shared/app_root/app/views/test → templates}/_test_erb.erb +0 -0
  34. data/spec/{shared/app_root/app/views/test → templates}/_test_haml.haml +5 -3
  35. metadata +79 -204
  36. data/.travis.yml +0 -15
  37. data/spec/rails-2.3/Gemfile +0 -12
  38. data/spec/rails-2.3/Gemfile.lock +0 -62
  39. data/spec/rails-2.3/Rakefile +0 -11
  40. data/spec/rails-2.3/app_root/config/boot.rb +0 -129
  41. data/spec/rails-2.3/app_root/config/database.yml +0 -4
  42. data/spec/rails-2.3/app_root/config/environment.rb +0 -14
  43. data/spec/rails-2.3/app_root/config/environments/test.rb +0 -28
  44. data/spec/rails-2.3/app_root/config/preinitializer.rb +0 -20
  45. data/spec/rails-2.3/app_root/config/routes.rb +0 -4
  46. data/spec/rails-2.3/app_root/lib/console_with_fixtures.rb +0 -4
  47. data/spec/rails-2.3/app_root/log/.gitignore +0 -1
  48. data/spec/rails-2.3/app_root/script/console +0 -7
  49. data/spec/rails-2.3/rcov.opts +0 -2
  50. data/spec/rails-2.3/spec/spec_helper.rb +0 -20
  51. data/spec/rails-2.3/spec.opts +0 -4
  52. data/spec/rails-3.2/.rspec +0 -2
  53. data/spec/rails-3.2/Gemfile +0 -10
  54. data/spec/rails-3.2/Gemfile.lock +0 -129
  55. data/spec/rails-3.2/Rakefile +0 -10
  56. data/spec/rails-3.2/app_root/.gitignore +0 -4
  57. data/spec/rails-3.2/app_root/config/application.rb +0 -32
  58. data/spec/rails-3.2/app_root/config/boot.rb +0 -13
  59. data/spec/rails-3.2/app_root/config/database.yml +0 -4
  60. data/spec/rails-3.2/app_root/config/environment.rb +0 -5
  61. data/spec/rails-3.2/app_root/config/environments/test.rb +0 -35
  62. data/spec/rails-3.2/app_root/config/initializers/backtrace_silencers.rb +0 -7
  63. data/spec/rails-3.2/app_root/config/initializers/inflections.rb +0 -10
  64. data/spec/rails-3.2/app_root/config/initializers/mime_types.rb +0 -5
  65. data/spec/rails-3.2/app_root/config/initializers/secret_token.rb +0 -7
  66. data/spec/rails-3.2/app_root/config/initializers/session_store.rb +0 -8
  67. data/spec/rails-3.2/app_root/config/routes.rb +0 -58
  68. data/spec/rails-3.2/app_root/lib/tasks/.gitkeep +0 -0
  69. data/spec/rails-3.2/app_root/log/.gitkeep +0 -0
  70. data/spec/rails-3.2/app_root/script/rails +0 -6
  71. data/spec/rails-3.2/rcov.opts +0 -2
  72. data/spec/rails-3.2/spec/spec_helper.rb +0 -20
  73. data/spec/rails-4.2/.rspec +0 -2
  74. data/spec/rails-4.2/Gemfile +0 -10
  75. data/spec/rails-4.2/Gemfile.lock +0 -157
  76. data/spec/rails-4.2/Rakefile +0 -10
  77. data/spec/rails-4.2/app_root/.gitignore +0 -4
  78. data/spec/rails-4.2/app_root/config/application.rb +0 -34
  79. data/spec/rails-4.2/app_root/config/boot.rb +0 -13
  80. data/spec/rails-4.2/app_root/config/database.yml +0 -4
  81. data/spec/rails-4.2/app_root/config/environment.rb +0 -5
  82. data/spec/rails-4.2/app_root/config/environments/test.rb +0 -35
  83. data/spec/rails-4.2/app_root/config/initializers/backtrace_silencers.rb +0 -7
  84. data/spec/rails-4.2/app_root/config/initializers/inflections.rb +0 -10
  85. data/spec/rails-4.2/app_root/config/initializers/mime_types.rb +0 -5
  86. data/spec/rails-4.2/app_root/config/initializers/secret_token.rb +0 -7
  87. data/spec/rails-4.2/app_root/config/initializers/session_store.rb +0 -8
  88. data/spec/rails-4.2/app_root/config/routes.rb +0 -3
  89. data/spec/rails-4.2/app_root/lib/tasks/.gitkeep +0 -0
  90. data/spec/rails-4.2/app_root/log/.gitkeep +0 -0
  91. data/spec/rails-4.2/app_root/script/rails +0 -6
  92. data/spec/rails-4.2/rcov.opts +0 -2
  93. data/spec/rails-4.2/spec/spec_helper.rb +0 -27
  94. data/spec/shared/app_root/app/controllers/application_controller.rb +0 -2
  95. data/spec/shared/app_root/app/helpers/application_helper.rb +0 -3
  96. data/spec/shared/app_root/app/models/.gitkeep +0 -0
  97. data/spec/shared/app_root/config/database.yml +0 -4
  98. data/spec/shared/app_root/db/migrate/.gitkeep +0 -0
@@ -1,4 +0,0 @@
1
- .bundle
2
- db/*.sqlite3
3
- log/*.log
4
- tmp/**/*
@@ -1,34 +0,0 @@
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.eager_load = false
18
-
19
- config.consider_all_requests_local = true
20
- config.action_controller.perform_caching = false
21
-
22
- config.action_dispatch.show_exceptions = false
23
-
24
- config.action_controller.allow_forgery_protection = false
25
-
26
- config.action_mailer.delivery_method = :test
27
-
28
- config.active_support.deprecation = :stderr
29
-
30
- config.root = File.expand_path('../..', __FILE__)
31
-
32
- # railties.plugins << Rails::Plugin.new(File.expand_path('../../../../..', __FILE__))
33
- end
34
- end
@@ -1,13 +0,0 @@
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)
@@ -1,4 +0,0 @@
1
- test:
2
- adapter: sqlite3
3
- database: ":memory:"
4
- verbosity: quiet
@@ -1,5 +0,0 @@
1
- # Load the rails application
2
- require File.expand_path('../application', __FILE__)
3
-
4
- # Initialize the rails application
5
- SpecApp::Application.initialize!
@@ -1,35 +0,0 @@
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
@@ -1,7 +0,0 @@
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!
@@ -1,10 +0,0 @@
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
@@ -1,5 +0,0 @@
1
- # Be sure to restart your server when you modify this file.
2
-
3
- # Add new mime types for use in respond_to blocks:
4
- # Mime::Type.register "text/richtext", :rtf
5
- # Mime::Type.register_alias "text/html", :iphone
@@ -1,7 +0,0 @@
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_key_base = 'cb014a08a45243e7143f31e04774c342c1fba329fd594ae1a480d8283b1a851f425dc08044311fb4be6d000b6e6681de7c76d19148419a5ffa0a9f84556d3b33'
@@ -1,8 +0,0 @@
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
@@ -1,3 +0,0 @@
1
- SpecApp::Application.routes.draw do
2
- get ':controller(/:action(/:id(.:format)))'
3
- end
File without changes
File without changes
@@ -1,6 +0,0 @@
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'
@@ -1,2 +0,0 @@
1
- --exclude "spec/*,gems/*"
2
- --rails
@@ -1,27 +0,0 @@
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
-
21
- config.mock_with :rspec do |c|
22
- c.syntax = [:should, :expect]
23
- end
24
- config.expect_with :rspec do |c|
25
- c.syntax = [:should, :expect]
26
- end
27
- end
@@ -1,2 +0,0 @@
1
- class ApplicationController < ActionController::Base
2
- end
@@ -1,3 +0,0 @@
1
- module ApplicationHelper
2
-
3
- end
File without changes
@@ -1,4 +0,0 @@
1
- test:
2
- adapter: sqlite3
3
- database: ":memory:"
4
- verbosity: quiet
File without changes