lib/crypt_keeper/log_subscriber/mysql_aes.rb
# Public: Prevents sensitive data from being logged
Prevents sensitive data from being logged
Prevents sensitive data from being logged
def sql_with_mysql_aes(event)
        filter  = /(aes_(encrypt|decrypt))\(.*\)/i
        payload = event.payload[:sql]
          .encode('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
        event.payload[:sql] = payload.gsub(filter) do |_|
          "#{$1}([FILTERED])"
        end
        sql_without_mysql_aes(event)
      end
def sql_with_mysql_aes ( event ) filter = / (aes_(encrypt|decrypt)) \( .* \) /i payload = event . payload [ :sql ] . encode ( 'UTF-8' , 'binary' , invalid : :replace , undef : :replace , replace : '' ) event . payload [ :sql ] = payload . gsub ( filter ) do | _ | "#{$1}([FILTERED])" end sql_without_mysql_aes ( event ) end
Public: Prevents sensitive data from being logged
Public : Prevents sensitive data from being logged
event
<not_specific>