Module: TCellAgent::Instrumentation::Rails
- Defined in:
- lib/tcell_agent/rails/routes.rb,
lib/tcell_agent/rails/dlp_handler.rb,
lib/tcell_agent/rails/js_agent_insert.rb,
lib/tcell_agent/rails/tcell_body_proxy.rb,
lib/tcell_agent/rails/settings_reporter.rb,
lib/tcell_agent/rails/middleware/global_middleware.rb,
lib/tcell_agent/rails/middleware/context_middleware.rb,
lib/tcell_agent/rails/middleware/headers_middleware.rb,
lib/tcell_agent/rails/middleware/body_filter_middleware.rb
Defined Under Namespace
Modules: DLPHandler, JSAgent, Middleware
Classes: TCellBodyProxy, TCellRoute, TCellRoute4, TCellRoute5
Class Method Summary
collapse
Class Method Details
.create_tcell_route(route) ⇒ Object
79
80
81
82
83
84
|
# File 'lib/tcell_agent/rails/routes.rb', line 79
def self.create_tcell_route(route)
return TCellRoute5.new(route) if route && ::Rails::VERSION::MAJOR >= 5
return TCellRoute4.new(route) if route && ::Rails::VERSION::MAJOR < 5
TCellRoute.new
end
|
.instrument_route(route) ⇒ Object
.instrument_routes ⇒ Object
86
87
88
89
90
91
92
93
94
|
# File 'lib/tcell_agent/rails/routes.rb', line 86
def self.instrument_routes
return unless TCellAgent.configuration.should_instrument?
return unless ::Rails.application
::Rails.application.routes.routes.each do |route|
instrument_route(route)
end
end
|
.send_framework_info ⇒ Object
.send_settings ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
# File 'lib/tcell_agent/rails/settings_reporter.rb', line 17
def self.send_settings
TCellAgent::Instrumentation.safe_block('Reporting Rails settings') do
rails_config = ::Rails.application.config
csrf_protection = rails_config.action_controller.allow_forgery_protection || true
TCellAgent.send_event(
TCellAgent::SensorEvents::AppConfigSettingEvent.new(
'Rails', 'core', '', 'csrf_protection', csrf_protection
)
)
mass_assignment_allowed = rails_config.action_controller.permit_all_parameters || false
TCellAgent.send_event(
TCellAgent::SensorEvents::AppConfigSettingEvent.new(
'Rails', 'core', '', 'mass_assignment_allowed', mass_assignment_allowed
)
)
session_expire = rails_config.session_options[:expire_after] || -1
TCellAgent.send_event(
TCellAgent::SensorEvents::AppConfigSettingEvent.new(
'Rails', 'session', '', 'timeout', session_expire
)
)
end
end
|