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
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0d7d2dcd19075eb585a144cfbf52e22e61031155dd20e2350bef4df1e213a1d6
4
+ data.tar.gz: 06cfba2593dc1c67ba5407575eac8ef032c746cfa127deaaf743f6e752ef85b4
5
+ SHA512:
6
+ metadata.gz: 19c422e8f23f5e914dd184ffdf443ba2fffcd6785b86347823de54e71e07a0481f5fc7ef594c9de9f0d701983864fa06f90f402ee94e889e71e4e3cca2d72cdb
7
+ data.tar.gz: ba840f913b4b842217b8056d9da914f7fc56e324fe94dbb6d42e0fbec3dc225ae17bc385ec737b836ac7b4e487726b4b6f1d957e9cbb5e727408d4d22d1ab7eb
@@ -0,0 +1,52 @@
1
+ ---
2
+ name: Tests
3
+ 'on':
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ branches:
9
+ - master
10
+ jobs:
11
+ test:
12
+ runs-on: ubuntu-20.04
13
+ strategy:
14
+ fail-fast: false
15
+ matrix:
16
+ include:
17
+ - ruby: 2.3.5
18
+ gemfile: Gemfile.rails-3.2
19
+ - ruby: 2.3.5
20
+ gemfile: Gemfile.rails-4.2.haml-4
21
+ - ruby: 2.3.5
22
+ gemfile: Gemfile.rails-4.2.haml-5
23
+ - ruby: 2.3.5
24
+ gemfile: Gemfile.rails-5.1.haml-4
25
+ - ruby: 2.3.5
26
+ gemfile: Gemfile.rails-5.1.haml-5
27
+ - ruby: 2.7.2
28
+ gemfile: Gemfile.rails-5.1.haml-4
29
+ - ruby: 2.7.2
30
+ gemfile: Gemfile.rails-5.1.haml-5
31
+ - ruby: 2.7.2
32
+ gemfile: Gemfile.rails-6.1.haml-5
33
+ - ruby: 3.0.1
34
+ gemfile: Gemfile.rails-5.1.haml-4
35
+ - ruby: 3.0.1
36
+ gemfile: Gemfile.rails-5.1.haml-5
37
+ - ruby: 3.0.1
38
+ gemfile: Gemfile.rails-6.1.haml-5
39
+ env:
40
+ BUNDLE_GEMFILE: "${{ matrix.gemfile }}"
41
+ steps:
42
+ - uses: actions/checkout@v2
43
+ - name: Install ruby
44
+ uses: ruby/setup-ruby@v1
45
+ with:
46
+ ruby-version: "${{ matrix.ruby }}"
47
+ - name: Bundle
48
+ run: |
49
+ gem install bundler:2.1.4
50
+ bundle install --no-deployment
51
+ - name: Run tests
52
+ run: bundle exec rspec
data/.rspec ADDED
@@ -0,0 +1 @@
1
+ --require spec_helper
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 2.7.2
data/CHANGELOG.md ADDED
@@ -0,0 +1,72 @@
1
+ # Changelog
2
+ All notable changes to this project will be documented in this file.
3
+
4
+ This project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
5
+
6
+ ## Unreleased
7
+
8
+ ### Compatible changes
9
+
10
+ ### Breaking changes
11
+
12
+
13
+ ## 0.4.0 2021-08-23
14
+
15
+ ### Compatible changes
16
+
17
+ - Add compatibility with Rails 6
18
+ - Add compatibility with Haml > 5.2
19
+ - Add compatibility with Ruby 2.7 and Ruby 3
20
+
21
+ ## 0.3.1 2017-11-21
22
+
23
+ ### Compatible Changes
24
+
25
+ - Add compatibility with Rails 5
26
+ - Add compatibility with Haml 5
27
+
28
+ ## 0.3.0 2017-07-31
29
+
30
+ ### Breaking changes
31
+
32
+ - Changed the way Angular XSS escapes double braces from ` { { ` to
33
+ `{{ $root.DOUBLE_LEFT_CURLY_BRACE }}`. This requires a change in the
34
+ application code. Check the [README](https://github.com/makandra/angular_xss/blob/master/README.md#installation)
35
+ for details.
36
+
37
+ ## 0.2.3 2015-04-17
38
+
39
+ ### Compatible changes
40
+
41
+ - Fix a bug where an unexpected nil value would cause problems
42
+
43
+ ## 0.2.2 2015-04-17
44
+
45
+ ### Compatible changes
46
+
47
+ - Support Rails 4.2
48
+
49
+ ## 0.2.1 2015-04-13
50
+
51
+ ### Compatible changes
52
+
53
+ - Fix escaping of precompiled attributes in Haml templates
54
+
55
+ ## 0.2.0 2015-04-13
56
+
57
+ ### Compatible changes
58
+
59
+ - Add option to disable escaping temporarily via `AngularXss.disable do ... end`
60
+
61
+ ## 0.1.1 2014-01-04
62
+
63
+ ### Compatible changes
64
+
65
+ - Require Haml >= 3.1.5 (lower Hamls don't escape element attribute values)
66
+
67
+ ## 0.1.0 2014-01-03
68
+
69
+ ### Compatible changes
70
+
71
+ - First version.
72
+
data/Gemfile ADDED
@@ -0,0 +1 @@
1
+ ./Gemfile.rails-5.1.haml-5
data/Gemfile.lock ADDED
@@ -0,0 +1 @@
1
+ ./Gemfile.rails-5.1.haml-5.lock
data/Gemfile.rails-3.2 ADDED
@@ -0,0 +1,9 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'railties', '~>3.2'
4
+ gem 'actionpack', '~>3.2'
5
+ gem 'rspec'
6
+ gem 'haml', '=4.0.2'
7
+ gem 'angular_xss', :path => '.'
8
+ gem 'gemika'
9
+ gem 'rake'
@@ -0,0 +1,91 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ angular_xss (0.4.0)
5
+ activesupport
6
+ haml (>= 3.1.5)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ actionpack (3.2.22.5)
12
+ activemodel (= 3.2.22.5)
13
+ activesupport (= 3.2.22.5)
14
+ builder (~> 3.0.0)
15
+ erubis (~> 2.7.0)
16
+ journey (~> 1.0.4)
17
+ rack (~> 1.4.5)
18
+ rack-cache (~> 1.2)
19
+ rack-test (~> 0.6.1)
20
+ sprockets (~> 2.2.1)
21
+ activemodel (3.2.22.5)
22
+ activesupport (= 3.2.22.5)
23
+ builder (~> 3.0.0)
24
+ activesupport (3.2.22.5)
25
+ i18n (~> 0.6, >= 0.6.4)
26
+ multi_json (~> 1.0)
27
+ builder (3.0.4)
28
+ concurrent-ruby (1.0.5)
29
+ diff-lcs (1.3)
30
+ erubis (2.7.0)
31
+ gemika (0.6.1)
32
+ haml (4.0.2)
33
+ tilt
34
+ hike (1.2.3)
35
+ i18n (0.9.1)
36
+ concurrent-ruby (~> 1.0)
37
+ journey (1.0.4)
38
+ json (1.8.6)
39
+ multi_json (1.12.2)
40
+ rack (1.4.7)
41
+ rack-cache (1.7.1)
42
+ rack (>= 0.4)
43
+ rack-ssl (1.3.4)
44
+ rack
45
+ rack-test (0.6.3)
46
+ rack (>= 1.0)
47
+ railties (3.2.22.5)
48
+ actionpack (= 3.2.22.5)
49
+ activesupport (= 3.2.22.5)
50
+ rack-ssl (~> 1.3.2)
51
+ rake (>= 0.8.7)
52
+ rdoc (~> 3.4)
53
+ thor (>= 0.14.6, < 2.0)
54
+ rake (12.3.0)
55
+ rdoc (3.12.2)
56
+ json (~> 1.4)
57
+ rspec (3.7.0)
58
+ rspec-core (~> 3.7.0)
59
+ rspec-expectations (~> 3.7.0)
60
+ rspec-mocks (~> 3.7.0)
61
+ rspec-core (3.7.0)
62
+ rspec-support (~> 3.7.0)
63
+ rspec-expectations (3.7.0)
64
+ diff-lcs (>= 1.2.0, < 2.0)
65
+ rspec-support (~> 3.7.0)
66
+ rspec-mocks (3.7.0)
67
+ diff-lcs (>= 1.2.0, < 2.0)
68
+ rspec-support (~> 3.7.0)
69
+ rspec-support (3.7.0)
70
+ sprockets (2.2.3)
71
+ hike (~> 1.2)
72
+ multi_json (~> 1.0)
73
+ rack (~> 1.0)
74
+ tilt (~> 1.1, != 1.3.0)
75
+ thor (0.20.0)
76
+ tilt (1.4.1)
77
+
78
+ PLATFORMS
79
+ ruby
80
+
81
+ DEPENDENCIES
82
+ actionpack (~> 3.2)
83
+ angular_xss!
84
+ gemika
85
+ haml (= 4.0.2)
86
+ railties (~> 3.2)
87
+ rake
88
+ rspec
89
+
90
+ BUNDLED WITH
91
+ 1.17.3
@@ -0,0 +1,8 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'actionpack', '~>4.2'
4
+ gem 'rspec'
5
+ gem 'haml', '<5'
6
+ gem 'angular_xss', :path => '.'
7
+ gem 'gemika'
8
+ gem 'rake'
@@ -0,0 +1,88 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ angular_xss (0.4.0)
5
+ activesupport
6
+ haml (>= 3.1.5)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ actionpack (4.2.10)
12
+ actionview (= 4.2.10)
13
+ activesupport (= 4.2.10)
14
+ rack (~> 1.6)
15
+ rack-test (~> 0.6.2)
16
+ rails-dom-testing (~> 1.0, >= 1.0.5)
17
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
18
+ actionview (4.2.10)
19
+ activesupport (= 4.2.10)
20
+ builder (~> 3.1)
21
+ erubis (~> 2.7.0)
22
+ rails-dom-testing (~> 1.0, >= 1.0.5)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
24
+ activesupport (4.2.10)
25
+ i18n (~> 0.7)
26
+ minitest (~> 5.1)
27
+ thread_safe (~> 0.3, >= 0.3.4)
28
+ tzinfo (~> 1.1)
29
+ builder (3.2.3)
30
+ concurrent-ruby (1.0.5)
31
+ crass (1.0.3)
32
+ diff-lcs (1.3)
33
+ erubis (2.7.0)
34
+ gemika (0.6.1)
35
+ haml (4.0.7)
36
+ tilt
37
+ i18n (0.9.1)
38
+ concurrent-ruby (~> 1.0)
39
+ loofah (2.1.1)
40
+ crass (~> 1.0.2)
41
+ nokogiri (>= 1.5.9)
42
+ mini_portile2 (2.3.0)
43
+ minitest (5.10.3)
44
+ nokogiri (1.8.1)
45
+ mini_portile2 (~> 2.3.0)
46
+ rack (1.6.8)
47
+ rack-test (0.6.3)
48
+ rack (>= 1.0)
49
+ rails-deprecated_sanitizer (1.0.3)
50
+ activesupport (>= 4.2.0.alpha)
51
+ rails-dom-testing (1.0.8)
52
+ activesupport (>= 4.2.0.beta, < 5.0)
53
+ nokogiri (~> 1.6)
54
+ rails-deprecated_sanitizer (>= 1.0.1)
55
+ rails-html-sanitizer (1.0.3)
56
+ loofah (~> 2.0)
57
+ rake (12.3.0)
58
+ rspec (3.7.0)
59
+ rspec-core (~> 3.7.0)
60
+ rspec-expectations (~> 3.7.0)
61
+ rspec-mocks (~> 3.7.0)
62
+ rspec-core (3.7.0)
63
+ rspec-support (~> 3.7.0)
64
+ rspec-expectations (3.7.0)
65
+ diff-lcs (>= 1.2.0, < 2.0)
66
+ rspec-support (~> 3.7.0)
67
+ rspec-mocks (3.7.0)
68
+ diff-lcs (>= 1.2.0, < 2.0)
69
+ rspec-support (~> 3.7.0)
70
+ rspec-support (3.7.0)
71
+ thread_safe (0.3.6)
72
+ tilt (2.0.8)
73
+ tzinfo (1.2.4)
74
+ thread_safe (~> 0.1)
75
+
76
+ PLATFORMS
77
+ ruby
78
+
79
+ DEPENDENCIES
80
+ actionpack (~> 4.2)
81
+ angular_xss!
82
+ gemika
83
+ haml (< 5)
84
+ rake
85
+ rspec
86
+
87
+ BUNDLED WITH
88
+ 1.17.3
@@ -0,0 +1,8 @@
1
+ source 'http://rubygems.org'
2
+
3
+ gem 'actionpack', '~>4.2'
4
+ gem 'rspec'
5
+ gem 'haml', '~> 5'
6
+ gem 'angular_xss', :path => '.'
7
+ gem 'gemika'
8
+ gem 'rake'
@@ -0,0 +1,90 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ angular_xss (0.4.0)
5
+ activesupport
6
+ haml (>= 3.1.5)
7
+
8
+ GEM
9
+ remote: http://rubygems.org/
10
+ specs:
11
+ actionpack (4.2.10)
12
+ actionview (= 4.2.10)
13
+ activesupport (= 4.2.10)
14
+ rack (~> 1.6)
15
+ rack-test (~> 0.6.2)
16
+ rails-dom-testing (~> 1.0, >= 1.0.5)
17
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
18
+ actionview (4.2.10)
19
+ activesupport (= 4.2.10)
20
+ builder (~> 3.1)
21
+ erubis (~> 2.7.0)
22
+ rails-dom-testing (~> 1.0, >= 1.0.5)
23
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
24
+ activesupport (4.2.10)
25
+ i18n (~> 0.7)
26
+ minitest (~> 5.1)
27
+ thread_safe (~> 0.3, >= 0.3.4)
28
+ tzinfo (~> 1.1)
29
+ builder (3.2.3)
30
+ concurrent-ruby (1.0.5)
31
+ crass (1.0.3)
32
+ diff-lcs (1.3)
33
+ erubis (2.7.0)
34
+ gemika (0.6.1)
35
+ haml (5.0.4)
36
+ temple (>= 0.8.0)
37
+ tilt
38
+ i18n (0.9.1)
39
+ concurrent-ruby (~> 1.0)
40
+ loofah (2.1.1)
41
+ crass (~> 1.0.2)
42
+ nokogiri (>= 1.5.9)
43
+ mini_portile2 (2.3.0)
44
+ minitest (5.10.3)
45
+ nokogiri (1.8.1)
46
+ mini_portile2 (~> 2.3.0)
47
+ rack (1.6.8)
48
+ rack-test (0.6.3)
49
+ rack (>= 1.0)
50
+ rails-deprecated_sanitizer (1.0.3)
51
+ activesupport (>= 4.2.0.alpha)
52
+ rails-dom-testing (1.0.8)
53
+ activesupport (>= 4.2.0.beta, < 5.0)
54
+ nokogiri (~> 1.6)
55
+ rails-deprecated_sanitizer (>= 1.0.1)
56
+ rails-html-sanitizer (1.0.3)
57
+ loofah (~> 2.0)
58
+ rake (12.3.0)
59
+ rspec (3.7.0)
60
+ rspec-core (~> 3.7.0)
61
+ rspec-expectations (~> 3.7.0)
62
+ rspec-mocks (~> 3.7.0)
63
+ rspec-core (3.7.0)
64
+ rspec-support (~> 3.7.0)
65
+ rspec-expectations (3.7.0)
66
+ diff-lcs (>= 1.2.0, < 2.0)
67
+ rspec-support (~> 3.7.0)
68
+ rspec-mocks (3.7.0)
69
+ diff-lcs (>= 1.2.0, < 2.0)
70
+ rspec-support (~> 3.7.0)
71
+ rspec-support (3.7.0)
72
+ temple (0.8.0)
73
+ thread_safe (0.3.6)
74
+ tilt (2.0.8)
75
+ tzinfo (1.2.4)
76
+ thread_safe (~> 0.1)
77
+
78
+ PLATFORMS
79
+ ruby
80
+
81
+ DEPENDENCIES
82
+ actionpack (~> 4.2)
83
+ angular_xss!
84
+ gemika
85
+ haml (~> 5)
86
+ rake
87
+ rspec
88
+
89
+ BUNDLED WITH
90
+ 1.17.3