audit: Fix panic in LogRequest method #1258

Merged
dstepanov-yadro merged 1 commit from aarifullin/frostfs-node:fix/audit_logreq into master 2024-07-19 09:11:40 +00:00

View file

@ -18,7 +18,11 @@ type Target interface {
}
func LogRequest(log *logger.Logger, operation string, req Request, target Target, status bool) {
LogRequestWithKey(log, operation, req.GetVerificationHeader().GetBodySignature().GetKey(), target, status)
var key []byte
if req != nil {
key = req.GetVerificationHeader().GetBodySignature().GetKey()
}
LogRequestWithKey(log, operation, key, target, status)
}
func LogRequestWithKey(log *logger.Logger, operation string, key []byte, target Target, status bool) {