strongroom-rails 0.5.0 → 0.5.1

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: eff1ffd8da620844d98a61ce2bdea990af1c2466269c2b4684141016b5a50aea
4
- data.tar.gz: 39cefca8d430c6de20198811d1a2bda0fb330d53f3e151a71eeac26b109a68e2
3
+ metadata.gz: b88bdc97033bd0b6f93bbe7cdadc65d7f5874d405dd01cc777a44c21c7887913
4
+ data.tar.gz: c19bf601209285252a93fce614c3c1d21d9c75ab440113dc392495a3b0aa180d
5
5
  SHA512:
6
- metadata.gz: 30c068a451c3a097895d237977d4224772cab793b294f26afd666c377ee6ee2f6ec9928a0babea6627d932ad23f8d46a1bbdf0d0ec01eb51a2a60f1024bd7214
7
- data.tar.gz: efa6f25d3220d2651509b4de8a73a8e64ff3f0c053c1fe76a8b824b70ef93731bb8d96149025d29dad35eadc38dd9b233a95b8b6d9d585d716ec85170e41c179
6
+ metadata.gz: ad054bbcc04975ba97dee7585dfffe1aaae660090b25e953bbe3e86ee6240244b2afe8bb0dad7401ecac15b21e680c30638d9dfb5fd336cf0585645ff922593e
7
+ data.tar.gz: 578c236380ea2ab5a5cef2bcc82c26ac2c6dc8b7579a083cd67be6c8e44cc5fc107dabfe121f356fa00164de8ce32ecc3cb745ab91c957b8ea457147044a9ac8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.5.1](https://github.com/seuros/strongroom/compare/strongroom-rails-v0.5.0...strongroom-rails-v0.5.1) (2026-11-08)
4
+
5
+
6
+ ### Bug Fixes
7
+
8
+ * **strongroom-rails:** raise InvalidCrossOriginRequest where Rails deprecates InvalidAuthenticityToken ([#8](https://github.com/seuros/strongroom/issues/8)) ([626015d](https://github.com/seuros/strongroom/commit/626015d484b05767f41129b1600e317631b4c130))
9
+
3
10
  ## [0.5.0](https://github.com/seuros/strongroom/compare/strongroom-rails-v0.4.0...strongroom-rails-v0.5.0) (2026-11-08)
4
11
 
5
12
 
data/README.md CHANGED
@@ -198,7 +198,9 @@ wildcards. An API-mode app must also provide:
198
198
  - HTTPS and a cookie scope that fits the deployment (Secure, SameSite=Lax:
199
199
  same-site subdomains work, cross-site frontends do not).
200
200
 
201
- Refusals raise `ActionController::InvalidAuthenticityToken` (422) on both paths.
201
+ Refusals raise `ActionController::InvalidAuthenticityToken` (422) on both paths;
202
+ on Rails versions that deprecate it, `ActionController::InvalidCrossOriginRequest`
203
+ (also 422). `Strongroom::Rails::Authentication::MUTATION_REFUSED` names the one in use.
202
204
  The Railtie maps `Strongroom::InvalidRequest` to 400, `Unauthorized` to 401,
203
205
  `RateLimited` to 429 and `Busy`/`ProtocolError`/`Unavailable` to 503 for
204
206
  controllers that do not `rescue_from` them.
@@ -9,6 +9,12 @@ module Strongroom
9
9
  extend ActiveSupport::Concern
10
10
 
11
11
  INTENT_HEADER = "HTTP_X_STRONGROOM_REQUEST"
12
+ # Rails main deprecates InvalidAuthenticityToken (no longer defined, only proxied) for InvalidCrossOriginRequest.
13
+ MUTATION_REFUSED = if ::ActionController.const_defined?(:InvalidAuthenticityToken, false)
14
+ ::ActionController::InvalidAuthenticityToken
15
+ else
16
+ ::ActionController::InvalidCrossOriginRequest
17
+ end
12
18
 
13
19
  def self.origin(value)
14
20
  NetHTTPTransport.endpoint(value)
@@ -93,7 +99,7 @@ module Strongroom
93
99
 
94
100
  def strongroom_verify_mutation!(verb)
95
101
  unless request.request_method == verb.to_s.upcase && strongroom_mutation_intended?
96
- raise ::ActionController::InvalidAuthenticityToken, "verified mutation intent required"
102
+ raise MUTATION_REFUSED, "verified mutation intent required"
97
103
  end
98
104
  end
99
105
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Strongroom
4
4
  module Rails
5
- VERSION = "0.5.0" # x-release-please-version
5
+ VERSION = "0.5.1" # x-release-please-version
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strongroom-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Seuros