feat: protect feedback screenshots
This commit is contained in:
@@ -19,6 +19,14 @@ public record FeedbackMetadataDto(
|
||||
int? ViewportHeight,
|
||||
string? AppVersion);
|
||||
|
||||
public record FeedbackScreenshotDto(
|
||||
Guid Id,
|
||||
string FileName,
|
||||
string ContentType,
|
||||
long SizeBytes,
|
||||
string DownloadPath,
|
||||
DateTimeOffset CreatedAt);
|
||||
|
||||
public record FeedbackReportDto(
|
||||
Guid Id,
|
||||
string Type,
|
||||
@@ -29,6 +37,7 @@ public record FeedbackReportDto(
|
||||
string ReporterEmail,
|
||||
FeedbackMetadataDto Metadata,
|
||||
FeedbackContextDto Context,
|
||||
FeedbackScreenshotDto? Screenshot,
|
||||
IReadOnlyCollection<string> Tags,
|
||||
DateTimeOffset CreatedAt,
|
||||
DateTimeOffset LastActivityAt,
|
||||
@@ -62,6 +71,15 @@ public static class FeedbackDtoMapper
|
||||
report.ProjectName,
|
||||
report.ContentItemId,
|
||||
report.ContentItemTitle),
|
||||
report.Screenshot is null
|
||||
? null
|
||||
: new FeedbackScreenshotDto(
|
||||
report.Screenshot.Id,
|
||||
report.Screenshot.FileName,
|
||||
report.Screenshot.ContentType,
|
||||
report.Screenshot.SizeBytes,
|
||||
$"/api/feedback/{report.Id}/screenshot",
|
||||
report.Screenshot.CreatedAt),
|
||||
report.Tags.OrderBy(tag => tag.Name).Select(tag => tag.Name).ToArray(),
|
||||
report.CreatedAt,
|
||||
report.LastActivityAt,
|
||||
|
||||
Reference in New Issue
Block a user