Skip to content

Commit

Permalink
Rename .detect_sqli to .detect_sql_injection
Browse files Browse the repository at this point in the history
  • Loading branch information
y9v committed Nov 27, 2024
1 parent a25052d commit daa831f
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/datadog/appsec/contrib/active_record/instrumentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module ActiveRecord
module Instrumentation
module_function

def detect_sqli(sql, adapter_name)
def detect_sql_injection(sql, adapter_name)
scope = AppSec.active_scope
return unless scope

Expand Down Expand Up @@ -37,7 +37,7 @@ def detect_sqli(sql, adapter_name)
# patch for all adapters in ActiveRecord >= 7.1
module InternalExecQueryAdapterPatch
def internal_exec_query(sql, *args, **rest)
Instrumentation.detect_sqli(sql, adapter_name)
Instrumentation.detect_sql_injection(sql, adapter_name)

super
end
Expand All @@ -46,17 +46,17 @@ def internal_exec_query(sql, *args, **rest)
# patch for postgres adapter in ActiveRecord < 7.1
module ExecuteAndClearAdapterPatch
def execute_and_clear(sql, *args, **rest)
Instrumentation.detect_sqli(sql, adapter_name)
Instrumentation.detect_sql_injection(sql, adapter_name)

super
end
end

# patch for mysql2 and sqlite3 adapters in ActiveRecord < 7.1
# patch for mysql2 and sql_injectionte3 adapters in ActiveRecord < 7.1
# this patch is also used when using JDBC adapter
module ExecQueryAdapterPatch
def exec_query(sql, *args, **rest)
Instrumentation.detect_sqli(sql, adapter_name)
Instrumentation.detect_sql_injection(sql, adapter_name)

super
end
Expand Down

0 comments on commit daa831f

Please sign in to comment.