Rename GenerateFileTempURL to GenerateFileURL, remove S3 presign duplication

Replace the inline PresignGetObject logic in probo.FileService with a
call to fileManager.GenerateFileUrl. Update the two callers.

Signed-off-by: Ludovic Vielle <ludovic@probo.com>
This commit is contained in:
Ludovic Vielle
2026-06-08 19:53:38 +02:00
parent 14c500b1b2
commit 6f83d9be48
3 changed files with 7 additions and 25 deletions

View File

@@ -18,12 +18,12 @@ import (
// DownloadURL is the resolver for the downloadUrl field.
func (r *fileResolver) DownloadURL(ctx context.Context, obj *types.File) (string, error) {
scope, err := r.authorize(ctx, obj.ID, probo.ActionFileDownloadUrl)
scope, err := r.authorize(ctx, obj.ID, probo.ActionFileGet)
if err != nil {
return "", err
}
downloadUrl, err := r.probo.Files.GenerateFileTempURL(ctx, scope, obj.ID, 60*time.Second)
downloadUrl, err := r.probo.Files.GenerateFileURL(ctx, scope, obj.ID, 60*time.Second)
if err != nil {
r.logger.ErrorCtx(ctx, "cannot generate download URL", log.Error(err))
return "", gqlutils.Internal(ctx)