Class: Shamu::Auditing::AuditingService

Inherits:
Services::Service show all
Defined in:
lib/shamu/auditing/auditing_service.rb

Overview

Records audit 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.

Direct Known Subclasses

LoggingAuditingService

Constant Summary collapse

STANDARD_FILTER_KEYS =
[
    :password,
    :password_confirmation,
    :access_token,
    :auth_token,
    :token
].freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Services::Service

#cache_for, #cached_lookup, #entity_list, #entity_lookup_list, #find_by_lookup, #lazy_association, #lookup_association

Class Method Details

.create(scorpion, *args) ⇒ Object



23
24
25
# File 'lib/shamu/auditing/auditing_service.rb', line 23

def self.create( scorpion, *args )
  scorpion.fetch Shamu::Auditing::NullAuditingService, *args
end

Instance Method Details

#commit(transaction) ⇒ Result

Records an auditable event in persistent storage.

Parameters:

Returns:

  • (Result)

    indicates if logging was successful



30
31
32
# File 'lib/shamu/auditing/auditing_service.rb', line 30

def commit( transaction )
  fail NotImplementedError
end

#filter_keysObject

the logged changes.



36
37
38
# File 'lib/shamu/auditing/auditing_service.rb', line 36

def filter_keys
  STANDARD_FILTER_KEYS
end