Module: CryptKeeper::LogSubscriber::PostgresPgp

Included in:
Provider::PostgresBase
Defined in:
lib/crypt_keeper/log_subscriber/postgres_pgp.rb

Constant Summary collapse

FILTER =
/(\(*)(?<operation>pgp_sym_encrypt|pgp_sym_decrypt|pgp_pub_encrypt|pgp_pub_decrypt|pgp_key_id)(\(+.*\)+)/im

Instance Method Summary collapse

Instance Method Details

#sql(event) ⇒ Object

Public: Prevents sensitive data from being logged

event - An ActiveSupport::Notifications::Event

Returns a boolean.


14
15
16
17
18
# File 'lib/crypt_keeper/log_subscriber/postgres_pgp.rb', line 14

def sql(event)
  payload = crypt_keeper_payload_parse(event.payload[:sql])
  event.payload[:sql] = crypt_keeper_filter_postgres_log(payload)
  super(event)
end