mirror of
https://github.com/Sea-Haven-Industries/proposal-system.git
synced 2026-10-07 16:18:57 +00:00
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:
parent
56be56ca1d
commit
220ca0f53d
1 changed files with 2 additions and 19 deletions
|
|
@ -18,26 +18,9 @@ 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, maskedRecipient, pdfUrl);
|
||||
"Dev mode - skipping email delivery: proposal {ProposalNumber}, PDF link: {PdfUrl}",
|
||||
proposalNumber, 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)}";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue