Potential fix for pull request finding 'CodeQL / Exposure of private information'

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
Adam Moussa 2026-06-18 12:32:46 -04:00 • committed by GitHub
parent 6655e57536
commit 216fcb2397
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,9 +18,26 @@ public class DevEmailService : IEmailService
string pdfUrl,
CancellationToken ct = default)
{
var maskedRecipient = MaskEmail(toEmail);
_logger.LogInformation(
"Dev mode - skipping email delivery: proposal {ProposalNumber} to {Recipient}, PDF link: {PdfUrl}",
proposalNumber, toEmail, pdfUrl);
proposalNumber, maskedRecipient, pdfUrl);
return Task.CompletedTask;
}
private static string MaskEmail(string email)
{
if (string.IsNullOrWhiteSpace(email))
{
return "[redacted]";
}
var atIndex = email.IndexOf('@');
if (atIndex <= 1)
{
return "[redacted]";
}
return $"{email[0]}***{email.Substring(atIndex)}";
}
}