feat: granular file access audit logging (viewed/opened/downloaded)
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
Some checks failed
Build and Push Docker Image / build (push) Has been cancelled
Replace single FILE_DOWNLOADED action with three granular actions: - FILE_VIEWED: inline preview loaded in the UI - FILE_OPENED: file opened in a new browser tab - FILE_DOWNLOADED: explicit download button clicked Add 'purpose' field to getDownloadUrl input (preview/open/download). All client callers updated to pass the appropriate purpose. Audit page updated with new filter options and color mappings. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -46,11 +46,11 @@ const fileTypeLabels: Record<string, string> = {
|
||||
|
||||
function FileActionButtons({ bucket, objectKey, fileName }: { bucket: string; objectKey: string; fileName: string }) {
|
||||
const { data: viewData } = trpc.file.getDownloadUrl.useQuery(
|
||||
{ bucket, objectKey, forDownload: false },
|
||||
{ bucket, objectKey, forDownload: false, purpose: 'open' as const },
|
||||
{ staleTime: 10 * 60 * 1000 }
|
||||
)
|
||||
const { data: dlData } = trpc.file.getDownloadUrl.useQuery(
|
||||
{ bucket, objectKey, forDownload: true, fileName },
|
||||
{ bucket, objectKey, forDownload: true, fileName, purpose: 'download' as const },
|
||||
{ staleTime: 10 * 60 * 1000 }
|
||||
)
|
||||
const viewUrl = typeof viewData === 'string' ? viewData : viewData?.url
|
||||
|
||||
Reference in New Issue
Block a user