Class: RivetCms::AuditEvent

Inherits:
Struct
  • Object
show all
Defined in:
lib/rivet_cms/audit.rb

Overview

One observability stream over every admin mutation, fired as the :audit hook. Named events (:publish, :prune) are behavior hooks carrying rich domain objects for a specific moment; :audit is uniform who/what/when data for consumers that want all of it (audit logs, activity feeds, SIEM pipelines).

RivetCms.on(:audit) do |event|
AuditRow.create!(action: event.action, subject: event.subject_id, ...)
end

The payload is plain values plus the actor object; subscribers must tolerate unknown actions, since the vocabulary grows in minor releases. CE audits admin UI mutations; console and seed changes are not recorded.

Instance Attribute Summary collapse

Instance Attribute Details

#actionObject

Returns the value of attribute action

Returns:

  • (Object)

    the current value of action



15
16
17
# File 'lib/rivet_cms/audit.rb', line 15

def action
  @action
end

#actorObject

Returns the value of attribute actor

Returns:

  • (Object)

    the current value of actor



15
16
17
# File 'lib/rivet_cms/audit.rb', line 15

def actor
  @actor
end

#atObject

Returns the value of attribute at

Returns:

  • (Object)

    the current value of at



15
16
17
# File 'lib/rivet_cms/audit.rb', line 15

def at
  @at
end

#metadataObject

Returns the value of attribute metadata

Returns:

  • (Object)

    the current value of metadata



15
16
17
# File 'lib/rivet_cms/audit.rb', line 15

def 
  @metadata
end

#organization_idObject

Returns the value of attribute organization_id

Returns:

  • (Object)

    the current value of organization_id



15
16
17
# File 'lib/rivet_cms/audit.rb', line 15

def organization_id
  @organization_id
end

#subject_idObject

Returns the value of attribute subject_id

Returns:

  • (Object)

    the current value of subject_id



15
16
17
# File 'lib/rivet_cms/audit.rb', line 15

def subject_id
  @subject_id
end

#subject_labelObject

Returns the value of attribute subject_label

Returns:

  • (Object)

    the current value of subject_label



15
16
17
# File 'lib/rivet_cms/audit.rb', line 15

def subject_label
  @subject_label
end

#subject_typeObject

Returns the value of attribute subject_type

Returns:

  • (Object)

    the current value of subject_type



15
16
17
# File 'lib/rivet_cms/audit.rb', line 15

def subject_type
  @subject_type
end