class Shamu::Auditing::AuditingService

Records audit {Transaction transactions} to record change requests made to a {Services::Service} that includes auditing {Support}.

> **Security Note** the audit service does not enforce any security policies > for reading or writing. It is expected that audit transactions should be > recordable by any service and that reading those audits will be limited by > some admin only accessible resource. To expose the audit records via a web > interface, create a proxy AuditingService that has it's own > {Security::Policy} but delegates the actual reading and writing.

Constants

STANDARD_FILTER_KEYS

Public Class Methods

create( scorpion, *args ) click to toggle source
# File lib/shamu/auditing/auditing_service.rb, line 23
def self.create( scorpion, *args )
  scorpion.fetch Shamu::Auditing::NullAuditingService, *args
end

Public Instance Methods

commit( transaction ) click to toggle source

Records an auditable event in persistent storage. @param [Transaction] transaction @return [Result] indicates if logging was successful

# File lib/shamu/auditing/auditing_service.rb, line 30
def commit( transaction )
  fail NotImplementedError
end
filter_keys() click to toggle source

@!return [Array<Symbol>] the list of keys that should be filtered in the logged changes.

# File lib/shamu/auditing/auditing_service.rb, line 36
def filter_keys
  STANDARD_FILTER_KEYS
end

Private Instance Methods

filter_changes( changes ) click to toggle source
# File lib/shamu/auditing/auditing_service.rb, line 42
def filter_changes( changes )
  filter_keys.each_with_object( changes.dup ) do |key, filtered|
    filtered[ key ] = "FILTERED" if filter_key?( key )
  end
end
filter_key?( key ) click to toggle source
# File lib/shamu/auditing/auditing_service.rb, line 48
def filter_key?( key )
  filter_keys.include?( key.to_sym )
end