Module: Datadog::AppSec::Contrib::Excon::Patcher

Defined in:
lib/datadog/appsec/contrib/excon/patcher.rb

Overview

AppSec patcher module for Excon

Class Method Summary collapse

Class Method Details

.patchObject



19
20
21
22
23
# File 'lib/datadog/appsec/contrib/excon/patcher.rb', line 19

def patch
  require_relative 'ssrf_detection_middleware'

  ::Excon.defaults[:middlewares].insert(0, SSRFDetectionMiddleware)
end

.patched?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/datadog/appsec/contrib/excon/patcher.rb', line 11

def patched?
  Patcher.instance_variable_get(:@patched)
end

.target_versionObject



15
16
17
# File 'lib/datadog/appsec/contrib/excon/patcher.rb', line 15

def target_version
  Integration.version
end