angular_rails_csrf 7.0.2 → 8.0.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b95a1805f70aa59f51398e31bc1fb65fad1c8a60291442a0b94a8573ebb2eaf0
4
- data.tar.gz: 29b4dd1b60f5ae0ede924169d786fa9e9eb2dfc14b750c3c56a42837f88a0492
3
+ metadata.gz: dafce49dccb5ccfc1c70272bbf1e8c5a6cf45a57ddaf16ddb7f355e7442a5c69
4
+ data.tar.gz: 58aa5c79657aedf11d21f7936e2983b924c01215a4f2e57fd90038000052768e
5
5
  SHA512:
6
- metadata.gz: e3cb2f32d02c664e5a4a5f94529944fb3cda0504964b5b83ce3781698d754b5420fb537f2a68cc1b43003fd3d50541296160c317ffae05f2e8861fb2d723c6f0
7
- data.tar.gz: 5c07d1e18cc33dab0819003596635887c52bc3df47cb601abf27983ab44feff5a459a7b49ddd50f9d84a1c9a88dcd6769b7b9c9818efc9130b9a7f5c8a890c99
6
+ metadata.gz: 294008473393cd36c6a995eab98c9ea03a7091625ca6f667e461d29f42b840e059681588bd753a35b99dff0efb4441d1648ac388fcec89151eb2a4b3a3fe4887
7
+ data.tar.gz: 68a149f68b91c52c70efa49167fe92f6b1107f60479e15a79c2d28b5107a670a3faccb6464f2a520cf122b56c737cfc3db772d846962fd1a7f36c802c6494e59
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Changelog
2
2
 
3
+ ## 8.0.0 (31-Aug-26)
4
+
5
+ * Test with Ruby 4
6
+ * Drop support for Rails 6 and below
7
+
3
8
  ## 7.0.2 (01-Nov-25)
4
9
 
5
10
  * Test with Ruby 3.5
data/README.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ![Gem](https://img.shields.io/gem/v/angular_rails_csrf)
4
4
  ![CI](https://github.com/bodrovis/angular_rails_csrf/actions/workflows/ci.yml/badge.svg)
5
+ [![Code Coverage](https://qlty.sh/gh/bodrovis/projects/angular_rails_csrf/coverage.svg)](https://qlty.sh/gh/bodrovis/projects/angular_rails_csrf)
6
+ [![Maintainability](https://qlty.sh/gh/bodrovis/projects/angular_rails_csrf/maintainability.svg)](https://qlty.sh/gh/bodrovis/projects/angular_rails_csrf)
5
7
  ![Downloads total](https://img.shields.io/gem/dt/angular_rails_csrf)
6
8
 
7
9
  **This gem is in passive maintenance mode:**
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'lib/angular_rails_csrf/version'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = 'angular_rails_csrf'
7
+ s.version = AngularRailsCsrf::VERSION
8
+ s.authors = ['James Sanders', 'Ilya Krukowski']
9
+ s.email = ['sanderjd@gmail.com', 'golosizpru@gmail.com']
10
+ s.homepage = 'https://github.com/bodrovis/angular_rails_csrf'
11
+ s.summary = 'Support for AngularJS $http service style CSRF protection in Rails'
12
+ s.description = 'AngularJS style CSRF protection for Rails'
13
+ s.license = 'MIT'
14
+
15
+ s.files = Dir['lib/**/*.rb', 'LICENSE.md', 'README.md', 'CHANGELOG.md', 'angular_rails_csrf.gemspec']
16
+ s.require_paths = ['lib']
17
+
18
+ s.required_ruby_version = '>= 3.2'
19
+
20
+ s.add_dependency 'railties', '>= 7', '< 9'
21
+
22
+ s.metadata = {
23
+ 'rubygems_mfa_required' => 'true',
24
+ 'bug_tracker_uri' => 'https://github.com/bodrovis/angular_rails_csrf/issues',
25
+ 'changelog_uri' => 'https://github.com/bodrovis/angular_rails_csrf/blob/master/CHANGELOG.md',
26
+ 'documentation_uri' => 'https://github.com/bodrovis/angular_rails_csrf/blob/master/README.md',
27
+ 'homepage_uri' => s.homepage
28
+ }
29
+ end
@@ -20,8 +20,8 @@ module AngularRailsCsrf
20
20
  cookies[cookie_name] = cookie_options_from(config)
21
21
  end
22
22
 
23
- def verified_request?
24
- super || valid_authenticity_token?(session, request.headers['X-XSRF-TOKEN'])
23
+ def request_authenticity_tokens
24
+ [*super, request.headers['X-XSRF-TOKEN']]
25
25
  end
26
26
 
27
27
  private
@@ -44,7 +44,7 @@ module AngularRailsCsrf
44
44
  def option_from(config, option, default = nil)
45
45
  return default if config.nil?
46
46
 
47
- config.respond_to?(option) ? config.send(option) : default
47
+ config.respond_to?(option) ? config.public_send(option) : default
48
48
  end
49
49
 
50
50
  def forgery_protection_enabled?
@@ -4,8 +4,8 @@ require 'angular_rails_csrf/concern'
4
4
 
5
5
  module AngularRailsCsrf
6
6
  class Railtie < ::Rails::Railtie
7
- initializer 'angular-rails-csrf' do |_app|
8
- ActiveSupport.on_load(:action_controller) do
7
+ initializer 'angular-rails-csrf' do
8
+ ActiveSupport.on_load(:action_controller_base) do
9
9
  include AngularRailsCsrf::Concern
10
10
  end
11
11
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AngularRailsCsrf
4
- VERSION = '7.0.2'
4
+ VERSION = '8.0.0'
5
5
  end
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: 7.0.2
4
+ version: 8.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Sanders
@@ -16,7 +16,7 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '3'
19
+ version: '7'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
22
  version: '9'
@@ -26,7 +26,7 @@ dependencies:
26
26
  requirements:
27
27
  - - ">="
28
28
  - !ruby/object:Gem::Version
29
- version: '3'
29
+ version: '7'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '9'
@@ -41,7 +41,7 @@ files:
41
41
  - CHANGELOG.md
42
42
  - LICENSE.md
43
43
  - README.md
44
- - Rakefile
44
+ - angular_rails_csrf.gemspec
45
45
  - lib/angular_rails_csrf.rb
46
46
  - lib/angular_rails_csrf/concern.rb
47
47
  - lib/angular_rails_csrf/railtie.rb
@@ -51,6 +51,10 @@ licenses:
51
51
  - MIT
52
52
  metadata:
53
53
  rubygems_mfa_required: 'true'
54
+ bug_tracker_uri: https://github.com/bodrovis/angular_rails_csrf/issues
55
+ changelog_uri: https://github.com/bodrovis/angular_rails_csrf/blob/master/CHANGELOG.md
56
+ documentation_uri: https://github.com/bodrovis/angular_rails_csrf/blob/master/README.md
57
+ homepage_uri: https://github.com/bodrovis/angular_rails_csrf
54
58
  rdoc_options: []
55
59
  require_paths:
56
60
  - lib
@@ -65,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
65
69
  - !ruby/object:Gem::Version
66
70
  version: '0'
67
71
  requirements: []
68
- rubygems_version: 3.7.2
72
+ rubygems_version: 4.0.19
69
73
  specification_version: 4
70
74
  summary: Support for AngularJS $http service style CSRF protection in Rails
71
75
  test_files: []
data/Rakefile DELETED
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- begin
4
- require 'bundler/setup'
5
- rescue LoadError
6
- puts 'You must `gem install bundler` and `bundle install` to run rake tasks'
7
- end
8
-
9
- require 'rdoc/task'
10
-
11
- RDoc::Task.new(:rdoc) do |rdoc|
12
- rdoc.rdoc_dir = 'rdoc'
13
- rdoc.title = 'AngularRailsCsrf'
14
- rdoc.options << '--line-numbers'
15
- rdoc.rdoc_files.include('README.rdoc')
16
- rdoc.rdoc_files.include('lib/**/*.rb')
17
- end
18
-
19
- Bundler::GemHelper.install_tasks
20
-
21
- require 'rake/testtask'
22
-
23
- Rake::TestTask.new(:test) do |t|
24
- t.libs = %w[lib test]
25
- t.pattern = 'test/**/*_test.rb'
26
- t.verbose = false
27
- end
28
-
29
- task default: :test