auth-centric-firewall 0.0.8 → 0.1.0

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: 2ca931e9e27524abe35c770b392bf989fbeef9fa314e411beb5863cbe565b013
4
- data.tar.gz: 1665611b78e7e35d8ccd25aefa51ed99d6758ac0d7a370dc116d533f6c52dc1a
3
+ metadata.gz: 669fd19673965861241121a8c8a1744f298e19b7116b0d96a6c2337d9a9b6a0c
4
+ data.tar.gz: d13c16055743036a648bfe7a27844924da16c8a0099e0a45569b6da3752a1238
5
5
  SHA512:
6
- metadata.gz: c952b34b519168cdcc7dd129863b935d9588c6f8d535778eb2d11b7555ea96b5a11aeb8fe4abd1cd8c2c230277944b1ec1104bbeb737c7c61e60feeca98eed4b
7
- data.tar.gz: 7d947fad93a6f8ac03434787b9aa1a258122915633217ece5c6db9b28e93d922f876069532f3d6da3aa4ef1b3e707b5d00e53e555543010d544d08bbf188169c
6
+ metadata.gz: 2d5efc53a5a8bb3dee51368aa9720282ea44ed7aea60c412fcdb007e93945f8f6907a0581d71b5f1cc29860323996161b52c9bb2f6bc058cdfcb734c829e566d
7
+ data.tar.gz: e85bacf437f529c59e17ad92518b2cc662d2516f943a38a30cd70493c843b3e3f6a4d701a27cb11bf2674b075aae09ecccc0be41e749f533e7b8a05d0db3acf3
data/.rubocop.yml CHANGED
@@ -32,3 +32,9 @@ Layout/CaseIndentation:
32
32
  Description: 'Indentation of when in a case/when/[else/]end.'
33
33
  StyleGuide: '#indent-when-to-case'
34
34
  Enabled: false
35
+
36
+ Metrics/CyclomaticComplexity:
37
+ Max: 32
38
+
39
+ Metrics/AbcSize:
40
+ Max: 32
data/CHANGELOG.md CHANGED
@@ -1,4 +1,8 @@
1
- ## [Unreleased]
1
+ ## [Released]
2
+
3
+ ## [0.1.0] - 2025-04-14
4
+
5
+ - Pass exception that has occurred
2
6
 
3
7
  ## [0.0.8] - 2025-03-29
4
8
 
@@ -3,7 +3,7 @@
3
3
  module Auth
4
4
  module Centric
5
5
  module Firewall
6
- VERSION = '0.0.8'
6
+ VERSION = '0.1.0'
7
7
  end
8
8
  end
9
9
  end
@@ -13,7 +13,7 @@ module Auth
13
13
  module Firewall
14
14
  class Error < StandardError; end
15
15
 
16
- def log_firewall(request, forced: false)
16
+ def log_firewall(request, forced: false, exception: nil)
17
17
  return true unless enabled?
18
18
 
19
19
  unless forced
@@ -22,7 +22,7 @@ module Auth
22
22
  end
23
23
 
24
24
  cr = CaptureRequest.new(request)
25
- payload = { request: cr.as_json }
25
+ payload = { request: cr.as_json, exception: }
26
26
 
27
27
  http = HTTP
28
28
  .timeout(timeout_seconds)
@@ -34,11 +34,11 @@ module Auth
34
34
  true
35
35
  end
36
36
 
37
- def valid_ip?(request)
37
+ def valid_ip?(request, forced: false)
38
38
  return true unless enabled?
39
39
 
40
40
  ip_address = request.env['HTTP_X_FORWARDED_FOR'] || request.remote_ip
41
- return true if IGNORE_IP.include?(ip_address)
41
+ return true if !forced && IGNORE_IP.include?(ip_address)
42
42
 
43
43
  http = HTTP
44
44
  .timeout(timeout_seconds)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth-centric-firewall
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saimon Lovell
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-29 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: http
@@ -72,7 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  requirements: []
75
- rubygems_version: 3.6.6
75
+ rubygems_version: 3.6.8
76
76
  specification_version: 4
77
77
  summary: Use artificial intelligence to find hackers.
78
78
  test_files: []