angular_rails_csrf 7.0.1 → 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: 93c2203c523539847ce011752c0a50ba0662f1f05aef215343ad3dd8f576cf2c
4
- data.tar.gz: 19031ae6c4b9c5c9f4fcfdeadeb0853c7cc4c0fcd592768b833b06447d3ffdfe
3
+ metadata.gz: dafce49dccb5ccfc1c70272bbf1e8c5a6cf45a57ddaf16ddb7f355e7442a5c69
4
+ data.tar.gz: 58aa5c79657aedf11d21f7936e2983b924c01215a4f2e57fd90038000052768e
5
5
  SHA512:
6
- metadata.gz: 9a4a6a941ccb94e0cdcd18b51db96c3efccf2beecaec88a105cd88a377cf8e1700c92cfb9ba555f86cb0f24452ce80c299154cf2704356da37ab240482270e44
7
- data.tar.gz: 02431a3ecc99795abcd1d827cb3c1d058e285c12ccb2d3ecb4aa6f788cca4a9cf0e4796f516792aebacdd5d49047d8b077d8900ce4c154c74d420bac6225bb69
6
+ metadata.gz: 294008473393cd36c6a995eab98c9ea03a7091625ca6f667e461d29f42b840e059681588bd753a35b99dff0efb4441d1648ac388fcec89151eb2a4b3a3fe4887
7
+ data.tar.gz: 68a149f68b91c52c70efa49167fe92f6b1107f60479e15a79c2d28b5107a670a3faccb6464f2a520cf122b56c737cfc3db772d846962fd1a7f36c802c6494e59
data/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
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
+
8
+ ## 7.0.2 (01-Nov-25)
9
+
10
+ * Test with Ruby 3.5
11
+ * Remove deprecation message, put into passive maintenance mode
12
+
3
13
  ## 7.0.1 (11-May-25)
4
14
 
5
15
  * Test with Ruby 3.4
data/README.md CHANGED
@@ -2,9 +2,11 @@
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
- **Deprecation notice (2025)**
9
+ **This gem is in passive maintenance mode:**
8
10
 
9
11
  James and then me (@bodrovis) have been supporting this gem since 2013. It has been downloaded more than 10 million times and we're glad you guys found it useful. However, after discussing privately we've decided to put angular_rails_csrf under passive maintenance starting from June 2025.
10
12
 
@@ -14,10 +16,6 @@ In modern frontend–backend architectures (e.g., Angular, React, Vue + Rails AP
14
16
  - Serve frontend via Rails
15
17
  - Expect `XSRF-TOKEN` / `X-XSRF-TOKEN` pattern
16
18
 
17
- If you're actively using this gem and want to see it maintained or enhanced, please [open an issue](https://github.com/bodrovis/angular_rails_csrf/issues) describing your use case.
18
-
19
- Otherwise, this project may be archived in late 2025 or 2026. Thank you!
20
-
21
19
  ---
22
20
 
23
21
  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.
@@ -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,21 +4,10 @@ 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
12
-
13
- initializer 'angular-rails-csrf.deprecation_notice' do |_app|
14
- unless Rails.env.test? || ENV['ANGULAR_RAILS_CSRF_SILENCE']
15
- AngularRailsCsrf.deprecator.warn(
16
- '[angular_rails_csrf] This gem is under passive maintenance and may be sunset in the future. ' \
17
- 'Open an issue if you rely on it and want it to live on: ' \
18
- 'https://github.com/bodrovis/angular_rails_csrf/issues. ' \
19
- 'Set ANGULAR_RAILS_CSRF_SILENCE to silence this warning.'
20
- )
21
- end
22
- end
23
12
  end
24
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AngularRailsCsrf
4
- VERSION = '7.0.1'
4
+ VERSION = '8.0.0'
5
5
  end
@@ -3,7 +3,4 @@
3
3
  require 'angular_rails_csrf/railtie'
4
4
 
5
5
  module AngularRailsCsrf
6
- def self.deprecator
7
- @deprecator ||= ActiveSupport::Deprecation.new('7.0', 'angular_rails_csrf')
8
- end
9
- end
6
+ 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.1
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,7 +51,10 @@ licenses:
51
51
  - MIT
52
52
  metadata:
53
53
  rubygems_mfa_required: 'true'
54
- deprecation_warning: Passive maintenance; may be sunset in 2025-2026. See README.
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
55
58
  rdoc_options: []
56
59
  require_paths:
57
60
  - lib
@@ -66,7 +69,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
69
  - !ruby/object:Gem::Version
67
70
  version: '0'
68
71
  requirements: []
69
- rubygems_version: 3.6.8
72
+ rubygems_version: 4.0.19
70
73
  specification_version: 4
71
74
  summary: Support for AngularJS $http service style CSRF protection in Rails
72
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