Wire file.Service into api.Config, delete pkg/filesign

Replace the FileSign field in api.Config and server.Config with File
(*file.Service). Pass the new file.Service and other required deps to
files_v1.NewMux. Remove the now-redundant filesign package. Update
the favicon URL path to /api/files/v1/public/ in server.go.

Signed-off-by: Ludovic Vielle <ludovic@probo.com>
This commit is contained in:
Ludovic Vielle
2026-06-08 19:57:39 +02:00
parent e51382ce70
commit c6c35a542e
4 changed files with 12 additions and 73 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/filesign"
"go.probo.inc/probo/pkg/file"
"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
FileSign *filesign.Service
File *file.Service
IAM *iam.Service
Trust *trust.Service
ESign *esign.Service
@@ -210,7 +210,11 @@ func NewServer(cfg Config) (*Server, error) {
),
filesHandler: files_v1.NewMux(
cfg.Logger.Named("files.v1"),
cfg.FileSign,
cfg.File,
cfg.Probo,
cfg.IAM,
cfg.Cookie,
cfg.TokenSecret,
),
mcpHandler: mcp_v1.NewMux(
cfg.Logger.Named("mcp.v1"),

View File

@@ -31,7 +31,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/filesign"
"go.probo.inc/probo/pkg/file"
"go.probo.inc/probo/pkg/geoloc"
"go.probo.inc/probo/pkg/iam"
"go.probo.inc/probo/pkg/iam/oauth2server"
@@ -55,7 +55,7 @@ type Config struct {
AllowedOrigins []string
ExtraHeaderFields map[string]string
Probo *probo.Service
FileSign *filesign.Service
File *file.Service
IAM *iam.Service
Trust *trust.Service
ESign *esign.Service
@@ -94,7 +94,7 @@ func NewServer(cfg Config) (*Server, error) {
BaseURL: cfg.BaseURL,
AllowedOrigins: cfg.AllowedOrigins,
Probo: cfg.Probo,
FileSign: cfg.FileSign,
File: cfg.File,
IAM: cfg.IAM,
Trust: cfg.Trust,
ESign: cfg.ESign,
@@ -278,7 +278,7 @@ func compliancePageHeadData(baseURL *baseurl.BaseURL, trustService *trust.Servic
}
if tc.LogoFileID != nil {
faviconURL, err := baseURL.WithPath("/api/files/v1/" + tc.LogoFileID.String()).String()
faviconURL, err := baseURL.WithPath("/api/files/v1/public/" + tc.LogoFileID.String()).String()
if err == nil {
headData.FaviconURL = faviconURL
}