module Mongo::Monitoring::Event::Secure

Provides behaviour to redact sensitive information from commands and replies.

@since 2.1.0

Constants

REDACTED_COMMANDS

The list of commands that has the data redacted for security.

@since 2.1.0

Public Instance Methods

redacted(command_name, document) click to toggle source

Redact secure information from the document if it's command is in the list.

@example Get the redacted document.

secure.redacted(command_name, document)

@param [ String, Symbol ] command_name The command name. @param [ BSON::Document ] document The document.

@return [ BSON::Document ] The redacted document.

@since 2.1.0

# File lib/mongo/monitoring/event/secure.rb, line 52
def redacted(command_name, document)
  REDACTED_COMMANDS.include?(command_name.to_s) ? BSON::Document.new : document
end