Merge remote-tracking branch 'refs/remotes/pr/3269' into maint/stewardship-batch-2026-09-30

# Conflicts:
#	manifests/context-packs/skill-triggers@1.json
This commit is contained in:
haelyra
2026-09-30 13:21:12 -04:00
2 changed files with 10 additions and 10 deletions
+5 -5
View File
@@ -779,13 +779,13 @@ $path = $request->file('document')->store('documents', 'local');
// Use signed URLs for temporary file access
use Illuminate\Support\Facades\Storage;
public function download(Request $request, string $path)
public function download(Document $document)
{
// Generate temporary signed URL (expires in 15 minutes)
$url = Storage::temporaryUrl($path, now()->addMinutes(15));
// Authorize against the model that owns the file, never a path taken from the request
$this->authorize('download', $document);
// Validate user has permission
$this->authorize('download', $path);
// Generate the temporary signed URL (expires in 15 minutes) only after authorization
$url = Storage::disk('s3')->temporaryUrl($document->path, now()->addMinutes(15));
return redirect($url);
}
+5 -5
View File
@@ -779,13 +779,13 @@ $path = $request->file('document')->store('documents', 'local');
// Use signed URLs for temporary file access
use Illuminate\Support\Facades\Storage;
public function download(Request $request, string $path)
public function download(Document $document)
{
// Generate temporary signed URL (expires in 15 minutes)
$url = Storage::temporaryUrl($path, now()->addMinutes(15));
// Authorize against the model that owns the file, never a path taken from the request
$this->authorize('download', $document);
// Validate user has permission
$this->authorize('download', $path);
// Generate the temporary signed URL (expires in 15 minutes) only after authorization
$url = Storage::disk('s3')->temporaryUrl($document->path, now()->addMinutes(15));
return redirect($url);
}