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 +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/action_ip_filter/version.rb +1 -1
- data/sig/external/activesupport.rbs +7 -0
- data/sig/external/rails.rbs +9 -0
- data/sig/generated/action_ip_filter/configuration.rbs +51 -0
- data/sig/generated/action_ip_filter/ip_filterable.rbs +30 -0
- data/sig/generated/action_ip_filter/ip_matcher.rbs +19 -0
- data/sig/generated/action_ip_filter/railtie.rbs +6 -0
- data/sig/generated/action_ip_filter/test_helpers.rbs +17 -0
- data/sig/generated/action_ip_filter/version.rbs +5 -0
- data/sig/generated/action_ip_filter.rbs +12 -0
- metadata +11 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3f3237522d860498e2a02ad616f8ddfbe42f8d062e0e5ac7eb3c547ef18426a5
|
|
4
|
+
data.tar.gz: d28ae74335a2e4a1374c9208e68a28d476ffe2aa9c4cbf57a5f1d0c2b1acd693
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d3d82c6998f16518dcd4a438d3f57672f9f6db28f8d25e579ea058e407f23de07292e5186f30b1440fe4a13fd3f23a96fb93dc12560245cc66ac1f8e84ab957a
|
|
7
|
+
data.tar.gz: ecb248f1e1232c35cb695b2ad9d023de5cc279f10661a61619fcdd63bec1dde1a38c81a8f1a3ee2ef263b0d84f16f23b8508eb4761fc7b1bab97e0ac9e5b7e61
|
data/CHANGELOG.md
CHANGED
|
@@ -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,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
|
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.
|
|
4
|
+
version: 0.5.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- SmartBank, Inc.
|
|
8
|
-
bindir:
|
|
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
|