send_audit

Function send_audit 

Source
pub async fn send_audit(
    kafka: &Kafka,
    token: &str,
    message: impl Into<String>,
    host: Option<Value>,
    group: Option<Value>,
)
Expand description

Build and send an audit message to Kafka.

Extracts user identity from the JWT token (falling back to empty strings on parse failure) and constructs a JSON message with the provided fields.

Both host and group are optional — they are only included in the JSON if Some.