bizside 2.3.9 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 46b9cdead64c8e2f35b91ed65a21ec4e78331522211421a6e75015a75124bcc1
4
- data.tar.gz: e2fc1dd98565f9e20e362b229035f6b5a9b38a2e6c1abad95eb0c58e55493c77
3
+ metadata.gz: 81dbebe065d4091665ab663600a57a56e54c97b2cde5d0b18f8fc78197c4ddbe
4
+ data.tar.gz: f80003853d525d8c79faa245008dd8ec4ca613bf2ec02f8d58a8b5128d12e68a
5
5
  SHA512:
6
- metadata.gz: 87fc2260a1eaafd7af65e708a6574a3f28fada1673103ba1ab9c0a70f70168eaeacb56bea82be997d92580dc9d2ec4e94327d838625aacf3dcfe89e24d5e8364
7
- data.tar.gz: fb05cc1b9a8db6ffc9aa42a676a25424d9625aa1b9156c22197f4af52e0314a280775301b83fb3ef922e79956bc5d23fae0b30bee713d6c67632e6b50de1c7f8
6
+ metadata.gz: 0026f469b9d2d81d63b506c9667561cac3bd842e18bc6f327885f6ce8e3460e5eecf3ba89ba55079cab3a7eb257f84437c555ffa8044a918d3f2ea0e0c83b74d
7
+ data.tar.gz: 559dd6e411c386a5497542f87923d257342d89b0a4278e32db7811520df50e396a49e689c4556ace10789613d45b8629958b2bc43607de13eaaab4f8452594b5
@@ -1,23 +1,15 @@
1
- require 'ipaddr'
2
1
  require_relative 'audit/logger'
3
2
 
4
3
  module Bizside
5
4
  class AuditLog
6
5
 
7
6
  @@ignore_paths = []
8
- @@trusted_proxy_cidrs = []
9
- @@trusted_proxy_cidr_objects = {}
10
7
  @@truncate_length = 8192
11
8
 
12
9
  def self.ignore_paths
13
10
  @@ignore_paths
14
11
  end
15
12
 
16
- # 192.168.0.0/24 といったCIDR表記の文字列を複数指定可能
17
- def self.trusted_proxy_cidrs
18
- @@trusted_proxy_cidrs
19
- end
20
-
21
13
  def self.truncate_length
22
14
  @@truncate_length
23
15
  end
@@ -33,7 +25,7 @@ module Bizside
33
25
  def call(env)
34
26
  start = Time.now.strftime('%Y-%m-%dT%H:%M:%S.%3N%z')
35
27
  status, headers, response = @app.call(env)
36
- stop = Time.now.strftime('%Y-%m-%dT%H:%M:%S.%3N%z')
28
+ stop = Time.now.strftime('%Y-%m-%dT%H:%M:%S.%3N%z')
37
29
  exception = env[Bizside::ShowExceptions::BIZSIDE_EXCEPTION_ENV_KEY]
38
30
 
39
31
  if env['BIZSIDE_SUPPRESS_AUDIT']
@@ -90,7 +82,7 @@ module Bizside
90
82
  referrer: env['HTTP_REFERER'],
91
83
  request_method: env['REQUEST_METHOD'],
92
84
  request_uri: env['BIZSIDE_REQUEST_URI'].presence || env['REQUEST_URI'],
93
- remote_address: to_client_ip(env['HTTP_X_FORWARDED_FOR']) || to_client_ip(env['HTTP_CLIENT_IP']) || env['REMOTE_ADDR'],
85
+ remote_address: env['REMOTE_ADDR'],
94
86
  status: status,
95
87
  started_at: start,
96
88
  finished_at: stop,
@@ -188,24 +180,5 @@ module Bizside
188
180
  exception.backtrace.join("\n")[0...truncate_length]
189
181
  end
190
182
 
191
- # 信頼のおけるロードバランサーがプロキシーになっている前提で、各HTTPヘッダの最後のIPをクライアントIPとして取得する
192
- def to_client_ip(header_value)
193
- ips = header_value ? header_value.strip.split(/[,\s]+/) : []
194
- ips.reverse.each do |ip|
195
- return ip unless proxy?(ip)
196
- end
197
-
198
- nil
199
- end
200
-
201
- def proxy?(ip)
202
- @@trusted_proxy_cidrs.each do |cidr|
203
- cidr_obj = @@trusted_proxy_cidr_objects[cidr] ||= IPAddr.new(cidr)
204
- return true if cidr_obj.include?(ip)
205
- end
206
-
207
- false
208
- end
209
-
210
183
  end
211
184
  end
@@ -1,3 +1,3 @@
1
1
  module Bizside
2
- VERSION = '2.3.9'
2
+ VERSION = '3.0.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bizside
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.3.9
4
+ version: 3.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - bizside-developers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-10-24 00:00:00.000000000 Z
11
+ date: 2024-01-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -62,16 +62,22 @@ dependencies:
62
62
  name: carrierwave
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - "~>"
65
+ - - ">="
66
+ - !ruby/object:Gem::Version
67
+ version: 2.2.0
68
+ - - "<"
66
69
  - !ruby/object:Gem::Version
67
- version: '2.2'
70
+ version: 4.0.0
68
71
  type: :runtime
69
72
  prerelease: false
70
73
  version_requirements: !ruby/object:Gem::Requirement
71
74
  requirements:
72
- - - "~>"
75
+ - - ">="
73
76
  - !ruby/object:Gem::Version
74
- version: '2.2'
77
+ version: 2.2.0
78
+ - - "<"
79
+ - !ruby/object:Gem::Version
80
+ version: 4.0.0
75
81
  - !ruby/object:Gem::Dependency
76
82
  name: carrierwave-magic
77
83
  requirement: !ruby/object:Gem::Requirement
@@ -217,9 +223,6 @@ dependencies:
217
223
  - - "~>"
218
224
  - !ruby/object:Gem::Version
219
225
  version: '3.0'
220
- - - "<"
221
- - !ruby/object:Gem::Version
222
- version: '3.36'
223
226
  type: :development
224
227
  prerelease: false
225
228
  version_requirements: !ruby/object:Gem::Requirement
@@ -227,9 +230,6 @@ dependencies:
227
230
  - - "~>"
228
231
  - !ruby/object:Gem::Version
229
232
  version: '3.0'
230
- - - "<"
231
- - !ruby/object:Gem::Version
232
- version: '3.36'
233
233
  - !ruby/object:Gem::Dependency
234
234
  name: cucumber
235
235
  requirement: !ruby/object:Gem::Requirement
@@ -368,7 +368,7 @@ dependencies:
368
368
  version: 1.5.0
369
369
  description: Bizside is an utilities to assist building web application.
370
370
  email:
371
- - bizside-developers@bizside.biz
371
+ - bizside-developers@lab.acs-jp.com
372
372
  executables: []
373
373
  extensions: []
374
374
  extra_rdoc_files: []
@@ -468,14 +468,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
468
468
  requirements:
469
469
  - - ">="
470
470
  - !ruby/object:Gem::Version
471
- version: 2.5.0
471
+ version: 2.7.0
472
472
  required_rubygems_version: !ruby/object:Gem::Requirement
473
473
  requirements:
474
474
  - - ">="
475
475
  - !ruby/object:Gem::Version
476
476
  version: '0'
477
477
  requirements: []
478
- rubygems_version: 3.3.26
478
+ rubygems_version: 3.1.6
479
479
  signing_key:
480
480
  specification_version: 4
481
481
  summary: Bizside is an utilities for web application.