Class: Confium::Audit::Sink
- Inherits:
-
Object
- Object
- Confium::Audit::Sink
- Defined in:
- lib/confium/audit.rb
Overview
Direct Known Subclasses
Instance Method Summary collapse
-
#call(record) ⇒ Object
Treat the Sink as a callable — delegates to #write.
- #close ⇒ Object
-
#write(_record) ⇒ Object
Persist an audit record Hash.
Instance Method Details
#call(record) ⇒ Object
Treat the Sink as a callable — delegates to #write. The Rust
extension's audit module fires events by calling .call(record)
on whatever is in Confium::Audit.sink, so this lets both
Proc-based and Object-based sinks work through the same
dispatch point.
47 48 49 |
# File 'lib/confium/audit.rb', line 47 def call(record) write(record) end |
#close ⇒ Object
51 52 53 |
# File 'lib/confium/audit.rb', line 51 def close # default no-op end |
#write(_record) ⇒ Object
Persist an audit record Hash. The Hash has these keys (all Strings):
"timestamp"— ISO8601 UTC, e.g."2026-07-30T22:00:00Z""operation"— short slug like"composite_sign""actor"— optional String"algorithm"— optional String"payload_hash"— hex SHA-256 of the signed bytes"result"—"success"or"failure""error"— optional String
38 39 40 |
# File 'lib/confium/audit.rb', line 38 def write(_record) raise NotImplementedError, "#{self.class} must implement #write" end |