auth-centric-firewall 0.0.3 → 0.0.5

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: d85ee7f1ed70a3076225d36d0d710ec2002c71470b71027507c33277ba8f4873
4
- data.tar.gz: 76c24884be283054d538a26b7fd218838a979ef4a91b950c69dee2cc9c06d001
3
+ metadata.gz: be8d5d6f21ba348774f410c2c66a80a516e7833b84eb68159fd62724948686be
4
+ data.tar.gz: 5e13eb109177a7981bf116b5bbc59a4dabfc681bdbdf091d26cfb497a358b83f
5
5
  SHA512:
6
- metadata.gz: 3954a15c105f23f842c6141ab7f9ec92276e94aeee3872db1e4bf53988611750b320f33dfe05abe9e79889c65beaf32decaca35a1d163873a816bdcf1d33eb27
7
- data.tar.gz: b118cfa434622746cd8ccfa663ba90b911f3b8e7d71150108bb3bf22fba37de032426ef6bcaab5b492952ce64b1ccd84ecedb74ebb312f8f4144cb6472a50d84
6
+ metadata.gz: 85c407c6539d89c1d3bb9144225a761c9e76ae63e3c1ee424f2fbcf1548c376ed1ae77f15f13435e18e1d5d47cf12ab4b11960e99c34394eb6bcf18220b7d827
7
+ data.tar.gz: bad9f9f488115111ad70b46231b7e8b1b843cf378e9b429be1f9372b6b0f461cac382f33b7f3df8e6c0ea58e6b8ff86964f237b2d7709ea117934bb4cb859443
@@ -11,6 +11,7 @@ module Auth
11
11
 
12
12
  def as_json
13
13
  {
14
+ ip:,
14
15
  domain:,
15
16
  url:,
16
17
  query_string:,
@@ -19,11 +20,14 @@ module Auth
19
20
  user_agent:,
20
21
  language:,
21
22
  request_formats:,
22
- remote_ip:,
23
23
  headers:
24
24
  }
25
25
  end
26
26
 
27
+ def ip
28
+ @request.env['HTTP_X_FORWARDED_FOR'] || @request.remote_ip
29
+ end
30
+
27
31
  def domain
28
32
  @request.domain || @request.headers.env['HTTP_HOST']
29
33
  end
@@ -58,10 +62,6 @@ module Auth
58
62
  @request.formats.map(&:to_s)
59
63
  end
60
64
 
61
- def remote_ip
62
- @request.remote_ip
63
- end
64
-
65
65
  def headers
66
66
  data = @request.headers.env.reject { |key| key.to_s.include?('.') || IGNORE_HEADER_KEYS.include?(key) }
67
67
  data.as_json
@@ -3,7 +3,7 @@
3
3
  module Auth
4
4
  module Centric
5
5
  module Firewall
6
- VERSION = '0.0.3'
6
+ VERSION = '0.0.5'
7
7
  end
8
8
  end
9
9
  end
@@ -13,9 +13,11 @@ module Auth
13
13
  module Firewall
14
14
  class Error < StandardError; end
15
15
 
16
- def log_firewall(request)
17
- return true if IGNORE_IP.include?(request.remote_ip)
18
- return true if IGNORE_REQUEST.include?(request.original_fullpath)
16
+ def log_firewall(request, forced: false)
17
+ unless forced
18
+ return true if IGNORE_IP.include?(request.remote_ip)
19
+ return true if IGNORE_REQUEST.include?(request.original_fullpath)
20
+ end
19
21
 
20
22
  cr = CaptureRequest.new(request)
21
23
  payload = { request: cr.as_json }
@@ -10,6 +10,8 @@ module Auth
10
10
 
11
11
  def headers: -> { }
12
12
 
13
+ def ip: -> string
14
+
13
15
  def language: -> string
14
16
 
15
17
  def query_string: -> string
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.3
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Saimon Lovell
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-20 00:00:00.000000000 Z
10
+ date: 2025-03-22 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: http