TsgcWSAPIKeyManagerEvents › OnAuditEvent

OnAuditEvent Event

Fired for every audit entry; carries the full TsgcAPIKeyAuditEntry for SIEM forwarding.

Syntax

property OnAuditEvent: TsgcAPIKeyOnAuditEvent;
// TsgcAPIKeyOnAuditEvent = procedure(Sender: TObject; const aEntry: TsgcAPIKeyAuditEntry) of object

Default Value

Remarks

Fires synchronously for every audit entry the manager records — one per key-lifecycle action (kaaIssued, kaaValidated, kaaRevoked, kaaRotated, kaaExpired, kaaScopeGranted, kaaScopeRevoked, kaaValidationFailed). The TsgcAPIKeyAuditEntry record exposes Timestamp, KeyPrefix, Action, IP and Details (non-empty when Audit.IncludePayload is True). Ideal for shipping the stream to a SIEM, message bus or Kafka topic; do not block the handler with slow I/O — enqueue into a background worker instead. Does not fire when Audit.Enabled is False.

Example

procedure TForm1.sgcWSAPIKeyManager1AuditEvent(Sender: TObject;
  const aEntry: TsgcAPIKeyAuditEntry);
begin
  // Push asynchronously to the SIEM — do not block the caller
  FAuditQueue.Enqueue(aEntry);
end;

Back to Events