class TCellAgent::Policies::JsAgentPolicy

Attributes

enabled[RW]

Public Class Methods

api_identifier() click to toggle source
# File lib/tcell_agent/policies/js_agent_policy.rb, line 6
def self.api_identifier
  'jsagentinjection'
end
new(native_agent, enablements) click to toggle source
# File lib/tcell_agent/policies/js_agent_policy.rb, line 12
def initialize(native_agent, enablements)
  @native_agent = native_agent
  @enabled = enablements['jsagentinjection'] || false
end

Public Instance Methods

get_js_agent_script_tag(tcell_context) click to toggle source
# File lib/tcell_agent/policies/js_agent_policy.rb, line 17
def get_js_agent_script_tag(tcell_context)
  return nil unless @enabled

  response = @native_agent.get_js_agent_script_tag(
    tcell_context
  )
  response['script_tag']
end