Sha256: 340693bfc8a0e7aa5b7f368067c44d91f9c011ef2a1c9e1e49734731635972ac
Contents?: true
Size: 696 Bytes
Versions: 5
Compression:
Stored size: 696 Bytes
Contents
require 'active_support/concern' require 'active_support/lazy_load_hooks' module CryptKeeperProviders module PostgresPgpLogSubscriber extend ActiveSupport::Concern included do alias_method_chain :sql, :postgres_pgp end # Public: Prevents sensitive data from being logged def sql_with_postgres_pgp(event) filter = /(pgp_sym_(encrypt|decrypt))\(((.|\n)*?)\)/i event.payload[:sql] = event.payload[:sql].gsub(filter) do |_| "#{$1}([FILTERED])" end sql_without_postgres_pgp(event) end end end ActiveSupport.on_load :active_record do ActiveRecord::LogSubscriber.send :include, CryptKeeperProviders::PostgresPgpLogSubscriber end
Version data entries
5 entries across 5 versions & 1 rubygems