pub fn run(
integration: &str,
hook_type: &str,
event: &str,
elapsed_ms: Option<f64>,
detail: Option<&str>,
) -> i32 {
let project = tirith_core::redact::redact_blocked_output;
let integration = project(integration);
let hook_type = project(hook_type);
let event = project(event);
let detail = detail.map(project);
tirith_core::audit::log_hook_event(
&integration,
&hook_type,
&event,
elapsed_ms,
detail.as_deref(),
);
0
}
#[cfg(test)]
mod tests {
#[test]
fn hidden_hook_event_arguments_use_the_conservative_privacy_projection() {
let canary = format!("ghp_canary_{}", "D".repeat(30));
let scalar = format!("{}1", "0".repeat(63));
for value in [canary, scalar] {
let projected = tirith_core::redact::redact_blocked_output(&value);
assert!(!projected.contains(&value), "{projected}");
assert!(projected.contains("REDACTED"), "{projected}");
}
}
}