Zhou
Zhou MingxuanHead of R&D
Quality gate blocked
  • Coverage rate is 48%, below 60%

Complete audit-log fields and configuration

hanvault-corechore/audit-logLu Heng · 2026-06-04 10:55
vault/audit.py+82
1-def log(user_id, action):
2- writer.append({"u": user_id, "a": action})
1+def log(user_id, action, ip=None):
A
AI reviewerAIMinor
Defaulting ip to None leaves many audit records without a source. Require the caller to provide it.
2+ writer.append({
3+ "u": user_id,
4+ "a": action,
5+ "ip": ip,
6+ "ts": time.time(),
7+ })
8+ print("audit:", user_id, action)
A
AI reviewerAIMajor
Printing audit data to stdout can persist user identifiers in container logs. Remove or redact PII and emit structured audit records instead.