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 +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +3 -1
- data/lib/strongroom/rails/authentication.rb +7 -1
- data/lib/strongroom/rails/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: b88bdc97033bd0b6f93bbe7cdadc65d7f5874d405dd01cc777a44c21c7887913
|
|
4
|
+
data.tar.gz: c19bf601209285252a93fce614c3c1d21d9c75ab440113dc392495a3b0aa180d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
102
|
+
raise MUTATION_REFUSED, "verified mutation intent required"
|
|
97
103
|
end
|
|
98
104
|
end
|
|
99
105
|
|