action_ip_filter 0.3.0 → 0.3.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 +5 -1
- data/README.md +1 -1
- data/lib/action_ip_filter/ip_matcher.rb +2 -7
- data/lib/action_ip_filter/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: a00718ef1f7bccb16f52d1b8a1e5f9e746e9ba15f933795be419ff3c0d303c3d
|
|
4
|
+
data.tar.gz: 5c0f2e216e5481ec40f6156dd512d6a5ea5af39de88d64e7c06504faa5966fd7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ed618b5060effa6e112c7cfce1616f5f43467728971503779caff3230ec1b3506c18585766d41df45088e45c74e1b3756522341e5ca873b96d0f73284e15ee4b
|
|
7
|
+
data.tar.gz: 355e3c64444d092f466166c11c2d9afad5dfedab274e4a80f56e47d6d724a64b63dc21774e781496889d07e435c675d1b528bd017e9c79ef7f568fb59e9a49e0
|
data/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
## [Unreleased]
|
|
2
2
|
|
|
3
|
+
## [0.3.1] - 2025-12-01
|
|
4
|
+
|
|
5
|
+
- Simplify IpMatcher#match? by removing unnecessary branching [#3](https://github.com/smartbank-inc/action_ip_filter/pull/3)
|
|
6
|
+
|
|
3
7
|
## [0.3.0] - 2025-11-29
|
|
4
8
|
|
|
5
9
|
### Breaking Changes
|
|
6
10
|
|
|
7
|
-
#### Change `ip_resolver` to use controller context instead of request parameter
|
|
11
|
+
#### Change `ip_resolver` to use controller context instead of request parameter [#1](https://github.com/smartbank-inc/action_ip_filter/pull/1)
|
|
8
12
|
|
|
9
13
|
Usage has changed. The `request` parameter in the Proc was previously required, but it is no longer needed. You can now access controller methods (`request`, `params`, etc.) directly instead of receiving `request` as an argument.
|
|
10
14
|
|
data/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# action_ip_filter
|
|
1
|
+
# action_ip_filter [](https://github.com/smartbank-inc/action_ip_filter/actions/workflows/ci.yml) [](https://rubygems.org/gems/action_ip_filter)
|
|
2
2
|
|
|
3
3
|
A lightweight gem that provides IP address restrictions for Rails controllers at the action level.
|
|
4
4
|
|
|
@@ -33,13 +33,8 @@ module ActionIpFilter
|
|
|
33
33
|
# @rbs allowed_ip: String
|
|
34
34
|
# @rbs return: bool
|
|
35
35
|
def match?(client_addr, allowed_ip)
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
range.include?(client_addr)
|
|
39
|
-
else
|
|
40
|
-
allowed_addr = IPAddr.new(allowed_ip)
|
|
41
|
-
client_addr == allowed_addr
|
|
42
|
-
end
|
|
36
|
+
allowed_addr = IPAddr.new(allowed_ip)
|
|
37
|
+
allowed_addr.include?(client_addr)
|
|
43
38
|
rescue IPAddr::InvalidAddressError
|
|
44
39
|
false
|
|
45
40
|
end
|