fix(security): enforce audited account, network and resource boundaries

Implement B01-B06 with regression coverage and retained validation evidence. Preserve the production ingress preflight; F04 runtime verification remains open.
This commit is contained in:
cesnimda
2026-09-09 18:21:47 +02:00
parent 7d641edc7b
commit 0954876295
116 changed files with 10101 additions and 122 deletions
+16 -14
View File
@@ -83,6 +83,7 @@ namespace JobTrackerApi.Controllers
var q = s.Replace("\"", "\"\"");
return needs ? $"\"{q}\"" : q;
}
static string Text(string? s) => Esc(CsvCellSafety.SpreadsheetText(s));
var sb = new StringBuilder();
sb.AppendLine(string.Join(",",
@@ -108,27 +109,28 @@ namespace JobTrackerApi.Controllers
foreach (var j in jobs)
{
sb.AppendLine(string.Join(",",
Esc(j.Company?.Name),
Esc(j.Company?.Location),
Esc(j.Company?.Source),
Esc(j.JobTitle),
Esc(j.Status),
Text(j.Company?.Name),
Text(j.Company?.Location),
Text(j.Company?.Source),
Text(j.JobTitle),
Text(j.Status),
Esc(j.DateApplied?.ToString("o")),
Esc(j.Location),
Esc(j.Salary),
Text(j.Location),
Text(j.Salary),
Esc(j.SalaryMin?.ToString(System.Globalization.CultureInfo.InvariantCulture)),
Esc(j.SalaryMax?.ToString(System.Globalization.CultureInfo.InvariantCulture)),
Esc(j.SalaryCurrency),
Esc(j.SalaryPeriod),
Esc(j.NextAction),
Text(j.SalaryCurrency),
Text(j.SalaryPeriod),
Text(j.NextAction),
Esc(j.FollowUpAt?.ToString("o")),
Esc(j.JobUrl),
Esc(j.Notes),
Esc(j.CoverLetterText)
Text(j.JobUrl),
Text(j.Notes),
Text(j.CoverLetterText)
));
}
return File(Encoding.UTF8.GetBytes(sb.ToString()), "text/csv", $"job-tracker-export-{stamp}.csv");
// Excel's direct CSV open needs the UTF-8 BOM to preserve Norwegian text.
return File([.. Encoding.UTF8.GetPreamble(), .. Encoding.UTF8.GetBytes(sb.ToString())], "text/csv; charset=utf-8", $"job-tracker-export-{stamp}.csv");
}
return File(System.Text.Json.JsonSerializer.SerializeToUtf8Bytes(jobs), "application/json", $"job-tracker-export-{stamp}.json");