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:
4
pkg/thirdparty/service.go
vendored
4
pkg/thirdparty/service.go
vendored
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user