angular_rails_csrf 4.0.0 → 4.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +2 -1
- data/Rakefile +2 -4
- data/lib/angular_rails_csrf.rb +2 -0
- data/lib/angular_rails_csrf/concern.rb +9 -7
- data/lib/angular_rails_csrf/railtie.rb +2 -0
- data/lib/angular_rails_csrf/version.rb +3 -1
- data/test/angular_rails_csrf_exception_test.rb +4 -2
- data/test/angular_rails_csrf_test.rb +20 -12
- data/test/dummy/app/assets/config/manifest.js +4 -0
- data/test/dummy/app/controllers/application_controller.rb +9 -2
- data/test/dummy/app/controllers/exclusions_controller.rb +6 -2
- data/test/dummy/config.ru +3 -1
- data/test/dummy/config/application.rb +5 -4
- data/test/dummy/config/boot.rb +3 -1
- data/test/dummy/config/environment.rb +3 -1
- data/test/dummy/config/routes.rb +2 -0
- data/test/dummy/log/test.log +148 -0
- data/test/test_helper.rb +16 -3
- metadata +65 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9550b1153d6fc3681ca5ab87e090a89e5e9749ed1970e615cc9de966d40443d
|
4
|
+
data.tar.gz: 1fdee9f015377a53a7b214fb6ceea26bf5662775c683a8adcc09c73b477bd9b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fff34c1250992f66d5c6f7fd77aa46f1747aa6b8436e05590c92df76deeb7996fe1d3f172b1dc13608be7849d8d2454d0631d8e57b20f5babca9f3cbea0787c
|
7
|
+
data.tar.gz: 6514ee06c8126a9f095df879a0240d790d33d421925c3c0718fce7161cd6e00690ddf82d8fced4e3b32a9fd7d76d0f35659a2a0b6db6c4258253f1bf7c1a47de
|
data/README.md
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
|
3
3
|
[![Gem Version](https://badge.fury.io/rb/angular_rails_csrf.svg)](https://badge.fury.io/rb/angular_rails_csrf)
|
4
4
|
[![Build Status](https://travis-ci.org/jsanders/angular_rails_csrf.svg)](https://travis-ci.org/jsanders/angular_rails_csrf)
|
5
|
+
[![Test Coverage](https://codecov.io/gh/jsanders/angular_rails_csrf/graph/badge.svg)](https://codecov.io/gh/jsanders/angular_rails_csrf)
|
5
6
|
|
6
7
|
The AngularJS [ng.$http](http://docs.angularjs.org/api/ng.$http) service has built-in CSRF protection. By default, it looks for a cookie named `XSRF-TOKEN` and, if found, writes its value into an `X-XSRF-TOKEN` header, which the server compares with the CSRF token saved in the user's session.
|
7
8
|
|
@@ -9,7 +10,7 @@ This project adds direct support for this scheme to your Rails application witho
|
|
9
10
|
|
10
11
|
Note that there is nothing AngularJS specific here, and this will work with any other front-end that implements the same scheme.
|
11
12
|
|
12
|
-
|
13
|
+
Check [version compatibility](https://github.com/jsanders/angular_rails_csrf/wiki/Version-Compatability) to learn which Rails/Rubies are currently supported.
|
13
14
|
|
14
15
|
## Installation
|
15
16
|
|
data/Rakefile
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
begin
|
2
4
|
require 'bundler/setup'
|
3
5
|
rescue LoadError
|
@@ -14,9 +16,6 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
14
16
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
17
|
end
|
16
18
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
19
|
Bundler::GemHelper.install_tasks
|
21
20
|
|
22
21
|
require 'rake/testtask'
|
@@ -28,5 +27,4 @@ Rake::TestTask.new(:test) do |t|
|
|
28
27
|
t.verbose = false
|
29
28
|
end
|
30
29
|
|
31
|
-
|
32
30
|
task default: :test
|
data/lib/angular_rails_csrf.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
module AngularRailsCsrf
|
2
4
|
module Concern
|
3
5
|
extend ActiveSupport::Concern
|
@@ -7,12 +9,12 @@ module AngularRailsCsrf
|
|
7
9
|
end
|
8
10
|
|
9
11
|
def set_xsrf_token_cookie
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
12
|
+
return unless protect_against_forgery? && !respond_to?(:__exclude_xsrf_token_cookie?)
|
13
|
+
|
14
|
+
config = Rails.application.config
|
15
|
+
domain = config.respond_to?(:angular_rails_csrf_domain) ? config.angular_rails_csrf_domain : nil
|
16
|
+
cookie_name = config.respond_to?(:angular_rails_csrf_cookie_name) ? config.angular_rails_csrf_cookie_name : 'XSRF-TOKEN'
|
17
|
+
cookies[cookie_name] = {value: form_authenticity_token, domain: domain}
|
16
18
|
end
|
17
19
|
|
18
20
|
def verified_request?
|
@@ -25,7 +27,7 @@ module AngularRailsCsrf
|
|
25
27
|
|
26
28
|
module ClassMethods
|
27
29
|
def exclude_xsrf_token_cookie
|
28
|
-
|
30
|
+
class_eval do
|
29
31
|
def __exclude_xsrf_token_cookie?
|
30
32
|
true
|
31
33
|
end
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_helper'
|
2
4
|
|
3
5
|
class AngularRailsCsrfExceptionTest < ActionController::TestCase
|
@@ -8,9 +10,9 @@ class AngularRailsCsrfExceptionTest < ActionController::TestCase
|
|
8
10
|
@correct_token = @controller.send(:form_authenticity_token)
|
9
11
|
end
|
10
12
|
|
11
|
-
test
|
13
|
+
test 'a get does not set the XSRF-TOKEN cookie' do
|
12
14
|
get :index
|
13
15
|
assert_not_equal @correct_token, cookies['XSRF-TOKEN']
|
14
16
|
assert_response :success
|
15
17
|
end
|
16
|
-
end
|
18
|
+
end
|
@@ -1,37 +1,41 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'test_helper'
|
2
4
|
|
3
5
|
class AngularRailsCsrfTest < ActionController::TestCase
|
4
6
|
tests ApplicationController
|
5
7
|
|
6
|
-
test
|
8
|
+
test 'a get sets the XSRF-TOKEN cookie but does not require the X-XSRF-TOKEN header' do
|
7
9
|
get :index
|
8
10
|
assert_valid_cookie
|
9
11
|
assert_response :success
|
10
12
|
end
|
11
13
|
|
12
|
-
test
|
14
|
+
test 'a post raises an error without the X-XSRF-TOKEN header set' do
|
13
15
|
assert_raises ActionController::InvalidAuthenticityToken do
|
14
16
|
post :create
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|
18
|
-
test
|
19
|
-
|
20
|
+
test 'a post raises an error with the X-XSRF-TOKEN header set to the wrong value' do
|
21
|
+
header_to 'garbage'
|
20
22
|
assert_raises ActionController::InvalidAuthenticityToken do
|
21
23
|
post :create
|
22
24
|
end
|
23
25
|
end
|
24
26
|
|
25
|
-
test
|
26
|
-
|
27
|
+
test 'a post is accepted if X-XSRF-TOKEN is set properly' do
|
28
|
+
header_to @controller.send(:form_authenticity_token)
|
27
29
|
post :create
|
28
30
|
assert_valid_cookie
|
29
31
|
assert_response :success
|
30
32
|
end
|
31
33
|
|
32
|
-
test
|
34
|
+
test 'the domain is used if present' do
|
33
35
|
config = Rails.application.config
|
34
|
-
def config.angular_rails_csrf_domain
|
36
|
+
def config.angular_rails_csrf_domain
|
37
|
+
:all
|
38
|
+
end
|
35
39
|
|
36
40
|
get :index
|
37
41
|
assert @response.headers['Set-Cookie'].include?('.test.host')
|
@@ -39,7 +43,7 @@ class AngularRailsCsrfTest < ActionController::TestCase
|
|
39
43
|
assert_response :success
|
40
44
|
end
|
41
45
|
|
42
|
-
test
|
46
|
+
test 'a custom name is used if present' do
|
43
47
|
use_custom_cookie_name do
|
44
48
|
get :index
|
45
49
|
assert @response.headers['Set-Cookie'].include?('CUSTOM-COOKIE-NAME')
|
@@ -52,7 +56,7 @@ class AngularRailsCsrfTest < ActionController::TestCase
|
|
52
56
|
|
53
57
|
# Helpers
|
54
58
|
|
55
|
-
def
|
59
|
+
def header_to(value)
|
56
60
|
@request.headers['X-XSRF-TOKEN'] = value
|
57
61
|
end
|
58
62
|
|
@@ -66,9 +70,13 @@ class AngularRailsCsrfTest < ActionController::TestCase
|
|
66
70
|
|
67
71
|
def use_custom_cookie_name
|
68
72
|
config = Rails.application.config
|
69
|
-
def config.angular_rails_csrf_cookie_name
|
73
|
+
def config.angular_rails_csrf_cookie_name
|
74
|
+
'CUSTOM-COOKIE-NAME'
|
75
|
+
end
|
70
76
|
yield
|
71
77
|
ensure
|
72
|
-
|
78
|
+
eval <<-RUBY, binding, __FILE__, __LINE__ + 1
|
79
|
+
config.instance_eval('undef :angular_rails_csrf_cookie_name')
|
80
|
+
RUBY
|
73
81
|
end
|
74
82
|
end
|
@@ -1,6 +1,13 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
class ApplicationController < ActionController::Base
|
2
4
|
protect_from_forgery with: :exception
|
3
5
|
|
4
|
-
def index
|
5
|
-
|
6
|
+
def index
|
7
|
+
head :ok
|
8
|
+
end
|
9
|
+
|
10
|
+
def create
|
11
|
+
head :ok
|
12
|
+
end
|
6
13
|
end
|
data/test/dummy/config.ru
CHANGED
@@ -1,9 +1,11 @@
|
|
1
|
-
|
1
|
+
# frozen_string_literal: true
|
2
2
|
|
3
|
-
require
|
3
|
+
require File.expand_path('boot', __dir__)
|
4
|
+
|
5
|
+
require 'action_controller/railtie'
|
4
6
|
|
5
7
|
Bundler.require(:default, Rails.env)
|
6
|
-
require
|
8
|
+
require 'angular_rails_csrf'
|
7
9
|
|
8
10
|
module Dummy
|
9
11
|
class Application < Rails::Application
|
@@ -12,4 +14,3 @@ module Dummy
|
|
12
14
|
config.active_support.test_order = :random
|
13
15
|
end
|
14
16
|
end
|
15
|
-
|
data/test/dummy/config/boot.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Set up gems listed in the Gemfile.
|
2
|
-
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('
|
4
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../../Gemfile', __dir__)
|
3
5
|
|
4
6
|
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
data/test/dummy/config/routes.rb
CHANGED
data/test/dummy/log/test.log
CHANGED
@@ -553,3 +553,151 @@ AngularRailsCsrfTest: test_a_custom_name_is_used_if_present
|
|
553
553
|
-----------------------------------------------------------
|
554
554
|
Processing by ApplicationController#index as HTML
|
555
555
|
Completed 200 OK in 0ms (Allocations: 116)
|
556
|
+
----------------------------------------------------------------------------
|
557
|
+
AngularRailsCsrfExceptionTest: test_a_get_does_not_set_the_XSRF-TOKEN_cookie
|
558
|
+
----------------------------------------------------------------------------
|
559
|
+
Processing by ExclusionsController#index as HTML
|
560
|
+
Completed 200 OK in 0ms (Allocations: 128)
|
561
|
+
--------------------------------------------------------------------------------------------------------
|
562
|
+
AngularRailsCsrfTest: test_a_get_sets_the_XSRF-TOKEN_cookie_but_does_not_require_the_X-XSRF-TOKEN_header
|
563
|
+
--------------------------------------------------------------------------------------------------------
|
564
|
+
Processing by ApplicationController#index as HTML
|
565
|
+
Completed 200 OK in 0ms (Allocations: 110)
|
566
|
+
-----------------------------------------------------------------------------
|
567
|
+
AngularRailsCsrfTest: test_a_post_is_accepted_if_X-XSRF-TOKEN_is_set_properly
|
568
|
+
-----------------------------------------------------------------------------
|
569
|
+
Processing by ApplicationController#create as HTML
|
570
|
+
Completed 200 OK in 0ms (Allocations: 135)
|
571
|
+
--------------------------------------------------------
|
572
|
+
AngularRailsCsrfTest: test_the_domain_is_used_if_present
|
573
|
+
--------------------------------------------------------
|
574
|
+
Processing by ApplicationController#index as HTML
|
575
|
+
Completed 200 OK in 0ms (Allocations: 120)
|
576
|
+
-------------------------------------------------------------------------------------
|
577
|
+
AngularRailsCsrfTest: test_a_post_raises_an_error_without_the_X-XSRF-TOKEN_header_set
|
578
|
+
-------------------------------------------------------------------------------------
|
579
|
+
Processing by ApplicationController#create as HTML
|
580
|
+
Can't verify CSRF token authenticity.
|
581
|
+
Completed 422 Unprocessable Entity in 0ms (Allocations: 106)
|
582
|
+
-----------------------------------------------------------
|
583
|
+
AngularRailsCsrfTest: test_a_custom_name_is_used_if_present
|
584
|
+
-----------------------------------------------------------
|
585
|
+
Processing by ApplicationController#index as HTML
|
586
|
+
Completed 200 OK in 0ms (Allocations: 118)
|
587
|
+
-----------------------------------------------------------------------------------------------------
|
588
|
+
AngularRailsCsrfTest: test_a_post_raises_an_error_with_the_X-XSRF-TOKEN_header_set_to_the_wrong_value
|
589
|
+
-----------------------------------------------------------------------------------------------------
|
590
|
+
Processing by ApplicationController#create as HTML
|
591
|
+
Can't verify CSRF token authenticity.
|
592
|
+
Completed 422 Unprocessable Entity in 0ms (Allocations: 104)
|
593
|
+
--------------------------------------------------------------------------------------------------------
|
594
|
+
AngularRailsCsrfTest: test_a_get_sets_the_XSRF-TOKEN_cookie_but_does_not_require_the_X-XSRF-TOKEN_header
|
595
|
+
--------------------------------------------------------------------------------------------------------
|
596
|
+
Processing by ApplicationController#index as HTML
|
597
|
+
Completed 200 OK in 0ms (Allocations: 172)
|
598
|
+
--------------------------------------------------------
|
599
|
+
AngularRailsCsrfTest: test_the_domain_is_used_if_present
|
600
|
+
--------------------------------------------------------
|
601
|
+
Processing by ApplicationController#index as HTML
|
602
|
+
Completed 200 OK in 0ms (Allocations: 119)
|
603
|
+
-----------------------------------------------------------
|
604
|
+
AngularRailsCsrfTest: test_a_custom_name_is_used_if_present
|
605
|
+
-----------------------------------------------------------
|
606
|
+
Processing by ApplicationController#index as HTML
|
607
|
+
Completed 200 OK in 0ms (Allocations: 117)
|
608
|
+
-----------------------------------------------------------------------------------------------------
|
609
|
+
AngularRailsCsrfTest: test_a_post_raises_an_error_with_the_X-XSRF-TOKEN_header_set_to_the_wrong_value
|
610
|
+
-----------------------------------------------------------------------------------------------------
|
611
|
+
Processing by ApplicationController#create as HTML
|
612
|
+
Can't verify CSRF token authenticity.
|
613
|
+
Completed 422 Unprocessable Entity in 0ms (Allocations: 116)
|
614
|
+
-----------------------------------------------------------------------------
|
615
|
+
AngularRailsCsrfTest: test_a_post_is_accepted_if_X-XSRF-TOKEN_is_set_properly
|
616
|
+
-----------------------------------------------------------------------------
|
617
|
+
Processing by ApplicationController#create as HTML
|
618
|
+
Completed 200 OK in 0ms (Allocations: 136)
|
619
|
+
-------------------------------------------------------------------------------------
|
620
|
+
AngularRailsCsrfTest: test_a_post_raises_an_error_without_the_X-XSRF-TOKEN_header_set
|
621
|
+
-------------------------------------------------------------------------------------
|
622
|
+
Processing by ApplicationController#create as HTML
|
623
|
+
Can't verify CSRF token authenticity.
|
624
|
+
Completed 422 Unprocessable Entity in 0ms (Allocations: 98)
|
625
|
+
----------------------------------------------------------------------------
|
626
|
+
AngularRailsCsrfExceptionTest: test_a_get_does_not_set_the_XSRF-TOKEN_cookie
|
627
|
+
----------------------------------------------------------------------------
|
628
|
+
Processing by ExclusionsController#index as HTML
|
629
|
+
Completed 200 OK in 0ms (Allocations: 71)
|
630
|
+
--------------------------------------------------------
|
631
|
+
AngularRailsCsrfTest: test_the_domain_is_used_if_present
|
632
|
+
--------------------------------------------------------
|
633
|
+
Processing by ApplicationController#index as HTML
|
634
|
+
Completed 200 OK in 0ms (Allocations: 183)
|
635
|
+
-------------------------------------------------------------------------------------
|
636
|
+
AngularRailsCsrfTest: test_a_post_raises_an_error_without_the_X-XSRF-TOKEN_header_set
|
637
|
+
-------------------------------------------------------------------------------------
|
638
|
+
Processing by ApplicationController#create as HTML
|
639
|
+
Can't verify CSRF token authenticity.
|
640
|
+
Completed 422 Unprocessable Entity in 0ms (Allocations: 111)
|
641
|
+
-----------------------------------------------------------------------------
|
642
|
+
AngularRailsCsrfTest: test_a_post_is_accepted_if_X-XSRF-TOKEN_is_set_properly
|
643
|
+
-----------------------------------------------------------------------------
|
644
|
+
Processing by ApplicationController#create as HTML
|
645
|
+
Completed 200 OK in 0ms (Allocations: 136)
|
646
|
+
-----------------------------------------------------------------------------------------------------
|
647
|
+
AngularRailsCsrfTest: test_a_post_raises_an_error_with_the_X-XSRF-TOKEN_header_set_to_the_wrong_value
|
648
|
+
-----------------------------------------------------------------------------------------------------
|
649
|
+
Processing by ApplicationController#create as HTML
|
650
|
+
Can't verify CSRF token authenticity.
|
651
|
+
Completed 422 Unprocessable Entity in 0ms (Allocations: 103)
|
652
|
+
--------------------------------------------------------------------------------------------------------
|
653
|
+
AngularRailsCsrfTest: test_a_get_sets_the_XSRF-TOKEN_cookie_but_does_not_require_the_X-XSRF-TOKEN_header
|
654
|
+
--------------------------------------------------------------------------------------------------------
|
655
|
+
Processing by ApplicationController#index as HTML
|
656
|
+
Completed 200 OK in 0ms (Allocations: 117)
|
657
|
+
-----------------------------------------------------------
|
658
|
+
AngularRailsCsrfTest: test_a_custom_name_is_used_if_present
|
659
|
+
-----------------------------------------------------------
|
660
|
+
Processing by ApplicationController#index as HTML
|
661
|
+
Completed 200 OK in 0ms (Allocations: 117)
|
662
|
+
----------------------------------------------------------------------------
|
663
|
+
AngularRailsCsrfExceptionTest: test_a_get_does_not_set_the_XSRF-TOKEN_cookie
|
664
|
+
----------------------------------------------------------------------------
|
665
|
+
Processing by ExclusionsController#index as HTML
|
666
|
+
Completed 200 OK in 0ms (Allocations: 71)
|
667
|
+
----------------------------------------------------------------------------
|
668
|
+
AngularRailsCsrfExceptionTest: test_a_get_does_not_set_the_XSRF-TOKEN_cookie
|
669
|
+
----------------------------------------------------------------------------
|
670
|
+
Processing by ExclusionsController#index as HTML
|
671
|
+
Completed 200 OK in 0ms (Allocations: 128)
|
672
|
+
-----------------------------------------------------------
|
673
|
+
AngularRailsCsrfTest: test_a_custom_name_is_used_if_present
|
674
|
+
-----------------------------------------------------------
|
675
|
+
Processing by ApplicationController#index as HTML
|
676
|
+
Completed 200 OK in 0ms (Allocations: 109)
|
677
|
+
--------------------------------------------------------
|
678
|
+
AngularRailsCsrfTest: test_the_domain_is_used_if_present
|
679
|
+
--------------------------------------------------------
|
680
|
+
Processing by ApplicationController#index as HTML
|
681
|
+
Completed 200 OK in 0ms (Allocations: 119)
|
682
|
+
-------------------------------------------------------------------------------------
|
683
|
+
AngularRailsCsrfTest: test_a_post_raises_an_error_without_the_X-XSRF-TOKEN_header_set
|
684
|
+
-------------------------------------------------------------------------------------
|
685
|
+
Processing by ApplicationController#create as HTML
|
686
|
+
Can't verify CSRF token authenticity.
|
687
|
+
Completed 422 Unprocessable Entity in 0ms (Allocations: 111)
|
688
|
+
--------------------------------------------------------------------------------------------------------
|
689
|
+
AngularRailsCsrfTest: test_a_get_sets_the_XSRF-TOKEN_cookie_but_does_not_require_the_X-XSRF-TOKEN_header
|
690
|
+
--------------------------------------------------------------------------------------------------------
|
691
|
+
Processing by ApplicationController#index as HTML
|
692
|
+
Completed 200 OK in 0ms (Allocations: 117)
|
693
|
+
-----------------------------------------------------------------------------------------------------
|
694
|
+
AngularRailsCsrfTest: test_a_post_raises_an_error_with_the_X-XSRF-TOKEN_header_set_to_the_wrong_value
|
695
|
+
-----------------------------------------------------------------------------------------------------
|
696
|
+
Processing by ApplicationController#create as HTML
|
697
|
+
Can't verify CSRF token authenticity.
|
698
|
+
Completed 422 Unprocessable Entity in 0ms (Allocations: 103)
|
699
|
+
-----------------------------------------------------------------------------
|
700
|
+
AngularRailsCsrfTest: test_a_post_is_accepted_if_X-XSRF-TOKEN_is_set_properly
|
701
|
+
-----------------------------------------------------------------------------
|
702
|
+
Processing by ApplicationController#create as HTML
|
703
|
+
Completed 200 OK in 0ms (Allocations: 136)
|
data/test/test_helper.rb
CHANGED
@@ -1,5 +1,18 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
# Configure Rails Environment
|
2
|
-
ENV[
|
4
|
+
ENV['RAILS_ENV'] = 'test'
|
5
|
+
|
6
|
+
require 'simplecov'
|
7
|
+
SimpleCov.start do
|
8
|
+
add_filter 'test/'
|
9
|
+
add_filter '.github/'
|
10
|
+
end
|
11
|
+
|
12
|
+
if ENV['CI'] == 'true'
|
13
|
+
require 'codecov'
|
14
|
+
SimpleCov.formatter = SimpleCov::Formatter::Codecov
|
15
|
+
end
|
3
16
|
|
4
|
-
require File.expand_path(
|
5
|
-
require
|
17
|
+
require File.expand_path('dummy/config/environment.rb', __dir__)
|
18
|
+
require 'rails/test_help'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: angular_rails_csrf
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 4.0.
|
4
|
+
version: 4.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Sanders
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2019-
|
12
|
+
date: 2019-12-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -17,14 +17,14 @@ dependencies:
|
|
17
17
|
requirements:
|
18
18
|
- - "~>"
|
19
19
|
- !ruby/object:Gem::Version
|
20
|
-
version: '
|
20
|
+
version: '13.0'
|
21
21
|
type: :development
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
25
|
- - "~>"
|
26
26
|
- !ruby/object:Gem::Version
|
27
|
-
version: '
|
27
|
+
version: '13.0'
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: test-unit
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,14 +45,14 @@ dependencies:
|
|
45
45
|
requirements:
|
46
46
|
- - '='
|
47
47
|
- !ruby/object:Gem::Version
|
48
|
-
version: 6.0.
|
48
|
+
version: 6.0.2.1
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
53
|
- - '='
|
54
54
|
- !ruby/object:Gem::Version
|
55
|
-
version: 6.0.
|
55
|
+
version: 6.0.2.1
|
56
56
|
- !ruby/object:Gem::Dependency
|
57
57
|
name: railties
|
58
58
|
requirement: !ruby/object:Gem::Requirement
|
@@ -73,6 +73,62 @@ dependencies:
|
|
73
73
|
- - "<"
|
74
74
|
- !ruby/object:Gem::Version
|
75
75
|
version: '7'
|
76
|
+
- !ruby/object:Gem::Dependency
|
77
|
+
name: codecov
|
78
|
+
requirement: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.1'
|
83
|
+
type: :development
|
84
|
+
prerelease: false
|
85
|
+
version_requirements: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0.1'
|
90
|
+
- !ruby/object:Gem::Dependency
|
91
|
+
name: rubocop
|
92
|
+
requirement: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0.60'
|
97
|
+
type: :development
|
98
|
+
prerelease: false
|
99
|
+
version_requirements: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - "~>"
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: '0.60'
|
104
|
+
- !ruby/object:Gem::Dependency
|
105
|
+
name: rubocop-performance
|
106
|
+
requirement: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - "~>"
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '1.5'
|
111
|
+
type: :development
|
112
|
+
prerelease: false
|
113
|
+
version_requirements: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '1.5'
|
118
|
+
- !ruby/object:Gem::Dependency
|
119
|
+
name: simplecov
|
120
|
+
requirement: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '0.16'
|
125
|
+
type: :development
|
126
|
+
prerelease: false
|
127
|
+
version_requirements: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - "~>"
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0.16'
|
76
132
|
description: AngularJS style CSRF protection for Rails
|
77
133
|
email:
|
78
134
|
- sanderjd@gmail.com
|
@@ -89,6 +145,7 @@ files:
|
|
89
145
|
- lib/angular_rails_csrf/version.rb
|
90
146
|
- test/angular_rails_csrf_exception_test.rb
|
91
147
|
- test/angular_rails_csrf_test.rb
|
148
|
+
- test/dummy/app/assets/config/manifest.js
|
92
149
|
- test/dummy/app/controllers/application_controller.rb
|
93
150
|
- test/dummy/app/controllers/exclusions_controller.rb
|
94
151
|
- test/dummy/config.ru
|
@@ -117,13 +174,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
117
174
|
- !ruby/object:Gem::Version
|
118
175
|
version: '0'
|
119
176
|
requirements: []
|
120
|
-
rubygems_version: 3.
|
177
|
+
rubygems_version: 3.1.2
|
121
178
|
signing_key:
|
122
179
|
specification_version: 4
|
123
180
|
summary: Support for AngularJS $http service style CSRF protection in Rails
|
124
181
|
test_files:
|
125
182
|
- test/angular_rails_csrf_exception_test.rb
|
126
183
|
- test/angular_rails_csrf_test.rb
|
184
|
+
- test/dummy/app/assets/config/manifest.js
|
127
185
|
- test/dummy/app/controllers/application_controller.rb
|
128
186
|
- test/dummy/app/controllers/exclusions_controller.rb
|
129
187
|
- test/dummy/config/application.rb
|