Migrate all callers to unified filemanager.Service

Signed-off-by: Ludovic Vielle <ludovic@probo.com>
This commit is contained in:
Ludovic Vielle
2026-06-09 18:56:43 +02:00
parent 6f8af6f62e
commit b679107fa5
19 changed files with 41 additions and 52 deletions

View File

@@ -32,7 +32,7 @@ import (
"go.probo.inc/probo/pkg/connector/provider"
"go.probo.inc/probo/pkg/cookiebanner"
"go.probo.inc/probo/pkg/esign"
"go.probo.inc/probo/pkg/file"
"go.probo.inc/probo/pkg/filemanager"
"go.probo.inc/probo/pkg/geoloc"
"go.probo.inc/probo/pkg/iam"
"go.probo.inc/probo/pkg/mailman"
@@ -56,7 +56,7 @@ type (
BaseURL *baseurl.BaseURL
AllowedOrigins []string
Probo *probo.Service
File *file.Service
File *filemanager.Service
IAM *iam.Service
Trust *trust.Service
ESign *esign.Service

View File

@@ -25,7 +25,7 @@ import (
"go.gearno.de/kit/log"
"go.probo.inc/probo/pkg/brand"
"go.probo.inc/probo/pkg/coredata"
"go.probo.inc/probo/pkg/file"
"go.probo.inc/probo/pkg/filemanager"
"go.probo.inc/probo/pkg/gid"
"go.probo.inc/probo/pkg/iam"
"go.probo.inc/probo/pkg/probo"
@@ -38,14 +38,14 @@ const presignedURLExpiry = 1 * time.Hour
type Handler struct {
logger *log.Logger
fileSvc *file.Service
fileSvc *filemanager.Service
probo *probo.Service
iamSvc *iam.Service
}
func NewMux(
logger *log.Logger,
fileSvc *file.Service,
fileSvc *filemanager.Service,
proboSvc *probo.Service,
iamSvc *iam.Service,
cookieConfig securecookie.Config,
@@ -94,7 +94,7 @@ func (h *Handler) handleGetPublicFile(w http.ResponseWriter, r *http.Request) {
return
}
presignedURL, err := h.fileSvc.GeneratePublicPresignedURL(r.Context(), fileID, presignedURLExpiry)
presignedURL, err := h.fileSvc.GeneratePublicPresignedFileURL(r.Context(), fileID, presignedURLExpiry)
if err != nil {
if errors.Is(err, coredata.ErrResourceNotFound) {
jsonutil.RenderNotFound(w, fmt.Errorf("file not found"))
@@ -157,7 +157,7 @@ func (h *Handler) handleGetFile(w http.ResponseWriter, r *http.Request) {
return
}
presignedURL, err := h.fileSvc.GeneratePresignedURL(ctx, f, presignedURLExpiry)
presignedURL, err := h.fileSvc.GeneratePresignedFileURL(ctx, f, presignedURLExpiry)
if err != nil {
h.logger.ErrorCtx(ctx, "cannot generate file URL", log.Error(err), log.String("file_id", fileIDStr))
jsonutil.RenderInternalServerError(w)