Rename visitor import and management wiring

Drop the misleading trust alias for complianceportal/visitor
and rename the CustomDomain config field to Management so
service wiring matches the package it points at.

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-07-17 12:29:20 +02:00
parent 36bc636a08
commit 802a36bbf4
16 changed files with 90 additions and 88 deletions

View File

@@ -30,11 +30,11 @@ import (
"github.com/99designs/gqlgen/graphql"
"github.com/vektah/gqlparser/v2/gqlerror"
"go.gearno.de/kit/httpserver"
trust "go.probo.inc/probo/pkg/complianceportal/visitor"
"go.probo.inc/probo/pkg/complianceportal/visitor"
"go.probo.inc/probo/pkg/server/gqlutils"
)
func NewSNIMiddleware(trustSvc *trust.Service) func(next http.Handler) http.Handler {
func NewSNIMiddleware(trustSvc *visitor.Service) func(next http.Handler) http.Handler {
return func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ctx := r.Context()
@@ -46,7 +46,7 @@ func NewSNIMiddleware(trustSvc *trust.Service) func(next http.Handler) http.Hand
compliancePage, err := trustSvc.GetPortalByDomainName(ctx, r.TLS.ServerName)
if err != nil {
if errors.Is(err, trust.ErrPageNotFound) {
if errors.Is(err, visitor.ErrPageNotFound) {
next.ServeHTTP(w, r)
return
}
@@ -91,7 +91,7 @@ func NewSNIMiddleware(trustSvc *trust.Service) func(next http.Handler) http.Hand
RawQuery: r.URL.RawQuery,
}
http.Redirect(w, r, target.String(), http.StatusMovedPermanently)
http.Redirect(w, r, target.String(), http.StatusPermanentRedirect)
return
}