bizside 2.2.2 → 2.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/bizside/audit_log.rb +8 -8
- data/lib/bizside/railtie.rb +4 -2
- data/lib/bizside/user_agent/controller_helper.rb +1 -1
- data/lib/bizside/version.rb +1 -1
- metadata +2 -6
- data/lib/bizside/user_agent/action_view/action_view_4.rb +0 -56
- data/lib/bizside/user_agent/action_view/action_view_6.rb +0 -50
- data/lib/bizside/user_agent/action_view/use_variant.rb +0 -4
- data/lib/bizside/user_agent/action_view.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4c22002eada30e8bb21db240f3c28c346c7049ccc375ff6f7afd3cfb8fb713e
|
4
|
+
data.tar.gz: 6357dee7fe2d59e8619cc0937d6fd0ccc204dcf7387cbc0cf4871681e0cf22bd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd28798fd692aef8e7fe202a5de9375362d29a226b19517f1ada70f39f69d94110a260b4cb4c14c3b7c5b6f0d5f92f223f33cd01aff19176b310e491b2de2040
|
7
|
+
data.tar.gz: b32b86fa1b621e70b37cf237dfcf7c09dc4fb868fde37727f5f19214f12e207ffc5d9db697ab3210083fd2c1c7dc3c67470e99dac7167460475d9a7d5c8fa4d4
|
data/lib/bizside/audit_log.rb
CHANGED
@@ -24,12 +24,12 @@ module Bizside
|
|
24
24
|
|
25
25
|
def call(env)
|
26
26
|
start = Time.now.strftime('%Y-%m-%dT%H:%M:%S.%3N%z')
|
27
|
-
|
27
|
+
status, headers, response = @app.call(env)
|
28
28
|
stop = Time.now.strftime('%Y-%m-%dT%H:%M:%S.%3N%z')
|
29
29
|
exception = env[Bizside::ShowExceptions::BIZSIDE_EXCEPTION_ENV_KEY]
|
30
30
|
|
31
31
|
if env['BIZSIDE_SUPPRESS_AUDIT']
|
32
|
-
return
|
32
|
+
return status, headers, response
|
33
33
|
end
|
34
34
|
|
35
35
|
if @@ignore_paths.any? do |path|
|
@@ -40,25 +40,25 @@ module Bizside
|
|
40
40
|
env['REQUEST_URI'] == path
|
41
41
|
end
|
42
42
|
end
|
43
|
-
return
|
43
|
+
return status, headers, response
|
44
44
|
end
|
45
45
|
|
46
46
|
if Bizside.rails_env&.development?
|
47
|
-
return
|
47
|
+
return status, headers, response if env['REQUEST_URI'] =~ /\/[^\/]+\/assets\/.*/
|
48
48
|
elsif Bizside.rails_env&.test?
|
49
|
-
return
|
49
|
+
return status, headers, response
|
50
50
|
end
|
51
51
|
|
52
|
-
info = build_loginfo(env, start, stop,
|
52
|
+
info = build_loginfo(env, start, stop, status, exception)
|
53
53
|
logger.record(info)
|
54
54
|
|
55
|
-
return
|
55
|
+
return status, headers, response
|
56
56
|
end
|
57
57
|
|
58
58
|
private
|
59
59
|
|
60
60
|
def logger
|
61
|
-
|
61
|
+
Bizside::Audit::Logger.logger
|
62
62
|
end
|
63
63
|
|
64
64
|
def build_loginfo(env, start, stop, status, exception)
|
data/lib/bizside/railtie.rb
CHANGED
@@ -33,11 +33,13 @@ module Bizside
|
|
33
33
|
end
|
34
34
|
|
35
35
|
if Bizside.config.user_agent.enabled?
|
36
|
+
if Bizside.config.user_agent.to_h.has_key?('use_variant')
|
37
|
+
raise "ERROR: 'use_variant' is obsolete. Delete it from config/bizside.yml"
|
38
|
+
end
|
39
|
+
|
36
40
|
require_relative 'user_agent'
|
37
41
|
|
38
42
|
initializer 'user_agent' do
|
39
|
-
require_relative 'user_agent/action_view'
|
40
|
-
|
41
43
|
ActiveSupport.on_load(:action_controller) do
|
42
44
|
include Bizside::UserAgent::ControllerHelper
|
43
45
|
end
|
data/lib/bizside/version.rb
CHANGED
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.
|
4
|
+
version: 2.3.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: 2022-12-
|
11
|
+
date: 2022-12-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -442,10 +442,6 @@ files:
|
|
442
442
|
- lib/bizside/uploader/extension_whitelist.rb
|
443
443
|
- lib/bizside/uploader/filename_validator.rb
|
444
444
|
- lib/bizside/user_agent.rb
|
445
|
-
- lib/bizside/user_agent/action_view.rb
|
446
|
-
- lib/bizside/user_agent/action_view/action_view_4.rb
|
447
|
-
- lib/bizside/user_agent/action_view/action_view_6.rb
|
448
|
-
- lib/bizside/user_agent/action_view/use_variant.rb
|
449
445
|
- lib/bizside/user_agent/controller_helper.rb
|
450
446
|
- lib/bizside/validations.rb
|
451
447
|
- lib/bizside/version.rb
|
@@ -1,56 +0,0 @@
|
|
1
|
-
require 'action_view'
|
2
|
-
|
3
|
-
class ActionView::TemplateRenderer
|
4
|
-
|
5
|
-
def render(context, options)
|
6
|
-
@view = context
|
7
|
-
@details = extract_details(options)
|
8
|
-
template = get_template_by_user_agent(context, options)
|
9
|
-
context = @lookup_context
|
10
|
-
|
11
|
-
prepend_formats(template.formats)
|
12
|
-
|
13
|
-
unless context.rendered_format
|
14
|
-
context.rendered_format = template.formats.first || formats.first
|
15
|
-
end
|
16
|
-
|
17
|
-
render_template(template, options[:layout], options[:locals])
|
18
|
-
end
|
19
|
-
|
20
|
-
private
|
21
|
-
|
22
|
-
def get_user_agent(context)
|
23
|
-
if context.respond_to?(:user_agent)
|
24
|
-
if context.respond_to?(:controller)
|
25
|
-
if context.controller.respond_to?(:session)
|
26
|
-
context.user_agent
|
27
|
-
end
|
28
|
-
end
|
29
|
-
end
|
30
|
-
end
|
31
|
-
|
32
|
-
def get_template_by_user_agent(context, options)
|
33
|
-
ret = nil
|
34
|
-
option_for_template = options[:template]
|
35
|
-
|
36
|
-
ua = get_user_agent(context)
|
37
|
-
if ua
|
38
|
-
ua.priorities.each do |priority|
|
39
|
-
begin
|
40
|
-
options[:template] = option_for_template + '.' + priority
|
41
|
-
ret = determine_template(options)
|
42
|
-
break
|
43
|
-
rescue ActionView::MissingTemplate
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|
47
|
-
|
48
|
-
unless ret
|
49
|
-
options[:template] = option_for_template
|
50
|
-
ret = determine_template(options)
|
51
|
-
end
|
52
|
-
|
53
|
-
Rails.logger.debug "UserAgent: #{ua ? ua.name : 'unknown'} => #{ret.identifier}"
|
54
|
-
ret
|
55
|
-
end
|
56
|
-
end
|
@@ -1,50 +0,0 @@
|
|
1
|
-
require 'action_view'
|
2
|
-
|
3
|
-
class ActionView::TemplateRenderer
|
4
|
-
|
5
|
-
def render(context, options)
|
6
|
-
@details = extract_details(options)
|
7
|
-
template = get_template_by_user_agent(context, options)
|
8
|
-
|
9
|
-
prepend_formats(template.format)
|
10
|
-
|
11
|
-
render_template(context, template, options[:layout], options[:locals] || {})
|
12
|
-
end
|
13
|
-
|
14
|
-
private
|
15
|
-
|
16
|
-
def get_user_agent(context)
|
17
|
-
if context.respond_to?(:user_agent)
|
18
|
-
if context.respond_to?(:controller)
|
19
|
-
if context.controller.respond_to?(:session)
|
20
|
-
context.user_agent
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
def get_template_by_user_agent(context, options)
|
27
|
-
ret = nil
|
28
|
-
option_for_template = options[:template]
|
29
|
-
|
30
|
-
ua = get_user_agent(context)
|
31
|
-
if ua
|
32
|
-
ua.priorities.each do |priority|
|
33
|
-
begin
|
34
|
-
options[:template] = option_for_template + '.' + priority
|
35
|
-
ret = determine_template(options)
|
36
|
-
break
|
37
|
-
rescue ActionView::MissingTemplate
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
unless ret
|
43
|
-
options[:template] = option_for_template
|
44
|
-
ret = determine_template(options)
|
45
|
-
end
|
46
|
-
|
47
|
-
Rails.logger.debug "UserAgent: #{ua ? ua.name : 'unknown'} => #{ret.identifier}"
|
48
|
-
ret
|
49
|
-
end
|
50
|
-
end
|
@@ -1,16 +0,0 @@
|
|
1
|
-
case Rails::VERSION::MAJOR
|
2
|
-
when 5
|
3
|
-
if Bizside.config.user_agent.use_variant?
|
4
|
-
load File.expand_path(File.join('action_view', 'use_variant.rb'), __dir__)
|
5
|
-
else
|
6
|
-
load File.expand_path(File.join('action_view', 'action_view_4.rb'), __dir__)
|
7
|
-
end
|
8
|
-
when 6
|
9
|
-
if Bizside.config.user_agent.use_variant?
|
10
|
-
load File.expand_path(File.join('action_view', 'use_variant.rb'), __dir__)
|
11
|
-
else
|
12
|
-
load File.expand_path(File.join('action_view', 'action_view_6.rb'), __dir__)
|
13
|
-
end
|
14
|
-
else
|
15
|
-
raise "Rails#{Rails::VERSION::MAJOR} はサポートしていません。"
|
16
|
-
end
|