action_ip_filter 0.5.1 → 0.5.2

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: 89a56e3e93ef8dd25c9aae21185810b83cdf6c27662db6ba5749ee8ccc12976e
4
- data.tar.gz: 674e5ce2970c6fe3e91469d856b6052a2eaa26e4a83ada61d5214f4ad49df7e9
3
+ metadata.gz: 3f3237522d860498e2a02ad616f8ddfbe42f8d062e0e5ac7eb3c547ef18426a5
4
+ data.tar.gz: d28ae74335a2e4a1374c9208e68a28d476ffe2aa9c4cbf57a5f1d0c2b1acd693
5
5
  SHA512:
6
- metadata.gz: badbaf5b413e15360b998db3aa662233219a5de020a588e06912aae2abc487fd45059aeb91445afe0a33c1b25b0886b0486ba7866346488d295835f78a42e2e5
7
- data.tar.gz: 51194a577f7885a3a63e48acb10210bd3b4ad8b33d059449a3525d22b7ca25d5b8d6a8bdf0132bfb7163872b436ac9054459c2ba8b8c30409b6b5fbc65e70eff
6
+ metadata.gz: d3d82c6998f16518dcd4a438d3f57672f9f6db28f8d25e579ea058e407f23de07292e5186f30b1440fe4a13fd3f23a96fb93dc12560245cc66ac1f8e84ab957a
7
+ data.tar.gz: ecb248f1e1232c35cb695b2ad9d023de5cc279f10661a61619fcdd63bec1dde1a38c81a8f1a3ee2ef263b0d84f16f23b8508eb4761fc7b1bab97e0ac9e5b7e61
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.5.2] - 2025-12-15
4
+
5
+ - Bundle the rbs files
6
+
3
7
  ## [0.5.1] - 2025-12-15
4
8
 
5
9
  There are no changes in core logic. Only the release toolchain has been changed.
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActionIpFilter
4
- VERSION = "0.5.1" #: String
4
+ VERSION = "0.5.2" #: String
5
5
  end
@@ -0,0 +1,7 @@
1
+ # External type stubs for ActiveSupport
2
+
3
+ module ActiveSupport
4
+ module Concern
5
+ def class_methods: () ?{ () -> void } -> void
6
+ end
7
+ end
@@ -0,0 +1,9 @@
1
+ # External type stubs for Rails
2
+
3
+ module Rails
4
+ def self.logger: () -> Logger?
5
+
6
+ class Railtie
7
+ def self.initializer: (String, ?Hash[Symbol, untyped]) { () -> void } -> void
8
+ end
9
+ end
@@ -0,0 +1,51 @@
1
+ # Generated from lib/action_ip_filter/configuration.rb with RBS::Inline
2
+
3
+ module ActionIpFilter
4
+ class Configuration
5
+ @ip_resolver: ^() -> String?
6
+
7
+ @on_denied: ^() -> void
8
+
9
+ @logger: Logger?
10
+
11
+ @log_denials: bool
12
+
13
+ @log_denial_message: ^(Logger, String?) -> void
14
+
15
+ interface _Request
16
+ def remote_ip: () -> String
17
+ end
18
+
19
+ def action_name: () -> String
20
+
21
+ def controller_name: () -> String
22
+
23
+ def head: (Symbol) -> void
24
+
25
+ def request: () -> _Request
26
+
27
+ attr_accessor ip_resolver: ^() -> String?
28
+
29
+ attr_accessor on_denied: ^() -> void
30
+
31
+ attr_accessor logger: Logger?
32
+
33
+ attr_accessor log_denials: bool
34
+
35
+ attr_accessor log_denial_message: ^(Logger, String?) -> void
36
+
37
+ # @rbs return: void
38
+ def initialize: () -> void
39
+ end
40
+
41
+ @configuration: Configuration?
42
+
43
+ # @rbs return: Configuration
44
+ def self.configuration: () -> Configuration
45
+
46
+ # @rbs () { (Configuration) -> void } -> void
47
+ def self.configure: () { (Configuration) -> void } -> void
48
+
49
+ # @rbs return: void
50
+ def self.reset_configuration!: () -> void
51
+ end
@@ -0,0 +1,30 @@
1
+ # Generated from lib/action_ip_filter/ip_filterable.rb with RBS::Inline
2
+
3
+ module ActionIpFilter
4
+ module IpFilterable
5
+ extend ActiveSupport::Concern
6
+
7
+ def instance_exec: [T] () { () -> T } -> T
8
+ | (Logger, String?) { (Logger, String?) -> void } -> void
9
+
10
+ def before_action: (*untyped, **untyped) -> void
11
+
12
+ # @rbs allowed_ips: String | Array[String] | ^() -> Array[String]
13
+ # @rbs on_denied: (^() -> void)?
14
+ # @rbs only: Array[Symbol]?
15
+ # @rbs except: Array[Symbol]?
16
+ # @rbs return: void
17
+ def filter_ip: (*untyped allowed_ips, ?on_denied: (^() -> void)?, ?only: Array[Symbol]?, ?except: Array[Symbol]?) -> void
18
+
19
+ private
20
+
21
+ # @rbs allowed_ips: Array[String | Array[String] | ^() -> Array[String]]
22
+ # @rbs on_denied: (^() -> void)?
23
+ # @rbs return: void
24
+ def verify_ip_access: (allowed_ips: Array[String | Array[String] | ^() -> Array[String]], on_denied: (^() -> void)?) -> void
25
+
26
+ # @rbs client_ip: String?
27
+ # @rbs return: void
28
+ def log_ip_denial: (String? client_ip) -> void
29
+ end
30
+ end
@@ -0,0 +1,19 @@
1
+ # Generated from lib/action_ip_filter/ip_matcher.rb with RBS::Inline
2
+
3
+ module ActionIpFilter
4
+ module IpMatcher
5
+ # @rbs client_ip: String?
6
+ # @rbs allowed_ips: Array[String]
7
+ # @rbs return: bool
8
+ def self.allowed?: (String? client_ip, Array[String] allowed_ips) -> bool
9
+
10
+ # @rbs ip_string: String
11
+ # @rbs return: IPAddr?
12
+ private def self.parse_ip: (String ip_string) -> IPAddr?
13
+
14
+ # @rbs client_addr: IPAddr
15
+ # @rbs allowed_ip: String
16
+ # @rbs return: bool
17
+ private def self.match?: (IPAddr client_addr, String allowed_ip) -> bool
18
+ end
19
+ end
@@ -0,0 +1,6 @@
1
+ # Generated from lib/action_ip_filter/railtie.rb with RBS::Inline
2
+
3
+ module ActionIpFilter
4
+ class Railtie < Rails::Railtie
5
+ end
6
+ end
@@ -0,0 +1,17 @@
1
+ # Generated from lib/action_ip_filter/test_helpers.rb with RBS::Inline
2
+
3
+ module ActionIpFilter
4
+ module TestHelpers
5
+ # @rbs [T] () { () -> T } -> T
6
+ def without_ip_filter: [T] () { () -> T } -> T
7
+
8
+ # @rbs [T] () { () -> T } -> T
9
+ def with_ip_filter: [T] () { () -> T } -> T
10
+
11
+ # @rbs return: void
12
+ def enable_ip_filter_test_mode!: () -> void
13
+
14
+ # @rbs return: void
15
+ def disable_ip_filter_test_mode!: () -> void
16
+ end
17
+ end
@@ -0,0 +1,5 @@
1
+ # Generated from lib/action_ip_filter/version.rb with RBS::Inline
2
+
3
+ module ActionIpFilter
4
+ VERSION: String
5
+ end
@@ -0,0 +1,12 @@
1
+ # Generated from lib/action_ip_filter.rb with RBS::Inline
2
+
3
+ module ActionIpFilter
4
+ def self.test_mode=: (bool) -> bool
5
+
6
+ @test_mode: bool
7
+
8
+ attr_accessor test_mode: bool
9
+
10
+ # @rbs return: bool
11
+ def self.test_mode?: () -> bool
12
+ end
metadata CHANGED
@@ -1,11 +1,11 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_ip_filter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - SmartBank, Inc.
8
- bindir: exe
8
+ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
@@ -129,6 +129,15 @@ files:
129
129
  - lib/action_ip_filter/railtie.rb
130
130
  - lib/action_ip_filter/test_helpers.rb
131
131
  - lib/action_ip_filter/version.rb
132
+ - sig/external/activesupport.rbs
133
+ - sig/external/rails.rbs
134
+ - sig/generated/action_ip_filter.rbs
135
+ - sig/generated/action_ip_filter/configuration.rbs
136
+ - sig/generated/action_ip_filter/ip_filterable.rbs
137
+ - sig/generated/action_ip_filter/ip_matcher.rbs
138
+ - sig/generated/action_ip_filter/railtie.rbs
139
+ - sig/generated/action_ip_filter/test_helpers.rbs
140
+ - sig/generated/action_ip_filter/version.rbs
132
141
  homepage: https://github.com/smartbank-inc/action_ip_filter
133
142
  licenses:
134
143
  - MIT