Sha256: c51a1e3f2ba70b570f54ff193d6a84c316bc1359d477f416e4ca235a7a553320
Contents?: true
Size: 739 Bytes
Versions: 9
Compression:
Stored size: 739 Bytes
Contents
require 'active_support/concern' require 'active_support/lazy_load_hooks' module CryptKeeper module LogSubscriber module PostgresPgp 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 end ActiveSupport.on_load :crypt_keeper_posgres_pgp_log do ActiveRecord::LogSubscriber.send :include, CryptKeeper::LogSubscriber::PostgresPgp end
Version data entries
9 entries across 9 versions & 1 rubygems