Use stable files API URLs for vendor logo fields

CommonThirdParty.logoUrl and TrustCenterReference.logoUrl were
returning expiring S3 presigned URLs, which break if cached or
shared past their TTL.

Replace with stable /api/files/v1/{id} application URLs.
file.Service now generates these via baseurl; a new filesign
package owns presigning for the files/v1 HTTP handler that
does the internal redirect.

Signed-off-by: Ludovic Vielle <ludovic@probo.com>
This commit is contained in:
Ludovic Vielle
2026-06-03 10:21:02 +02:00
parent 383ea5a2d4
commit 6c072a2f7b
14 changed files with 115 additions and 116 deletions

View File

@@ -17,7 +17,6 @@ package thirdparty
import (
"context"
"fmt"
"time"
"go.gearno.de/kit/pg"
"go.probo.inc/probo/pkg/coredata"
@@ -46,9 +45,8 @@ func NewService(pgClient *pg.Client, fileSvc *file.Service, vetter Vetter) *Serv
func (s *Service) GenerateLogoURL(
ctx context.Context,
logoFileID gid.GID,
expiresIn time.Duration,
) (*string, error) {
url, err := s.file.GetPublicFileURL(ctx, logoFileID, expiresIn)
url, err := s.file.GenerateFileURL(ctx, logoFileID)
if err != nil {
return nil, fmt.Errorf("cannot generate logo URL: %w", err)
}