Rewire IAM, mailman, and probod for the portal

Wire the certificate manager and trust center base domain into IAM so
organization creation provisions a managed default domain and certificate
atomically. Email presenters in IAM and mailman resolve public URLs
through the compliance portal resolver and read profile fields from the
trust center. probod initializes the certmanager service and injects the
new management and visitor services.

Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
Bryan Frimin
2026-07-10 15:13:46 +02:00
parent 44ad34561e
commit a9a126899e
7 changed files with 234 additions and 208 deletions

View File

@@ -34,6 +34,8 @@ import (
"go.probo.inc/probo/pkg/accessreview"
"go.probo.inc/probo/pkg/agentrun"
"go.probo.inc/probo/pkg/baseurl"
"go.probo.inc/probo/pkg/complianceportal/management"
trust "go.probo.inc/probo/pkg/complianceportal/visitor"
"go.probo.inc/probo/pkg/connector"
"go.probo.inc/probo/pkg/connector/provider"
"go.probo.inc/probo/pkg/cookiebanner"
@@ -56,7 +58,6 @@ import (
"go.probo.inc/probo/pkg/server/gqlutils"
"go.probo.inc/probo/pkg/slack"
"go.probo.inc/probo/pkg/thirdparty"
"go.probo.inc/probo/pkg/trust"
)
type (
@@ -69,6 +70,7 @@ type (
IAM *iam.Service
Trust *trust.Service
ESign *esign.Service
CustomDomain *management.Service
AccessReview *accessreview.Service
AgentRun *agentrun.Service
Slack *slack.Service
@@ -204,6 +206,7 @@ func NewServer(cfg Config) (*Server, error) {
cfg.ResourceAlias,
cfg.IAM,
cfg.ESign,
cfg.CustomDomain,
cfg.AccessReview,
cfg.AgentRun,
cfg.Mailman,
@@ -236,6 +239,7 @@ func NewServer(cfg Config) (*Server, error) {
mcpHandler: mcp_v1.NewMux(
cfg.Logger.Named("mcp.v1"),
cfg.Probo,
cfg.CustomDomain,
cfg.ResourceAlias,
cfg.ThirdParty,
cfg.IAM,
@@ -263,12 +267,12 @@ func NewServer(cfg Config) (*Server, error) {
return true
}
_, err := cfg.Trust.GetByDomainName(ctx, host)
_, err := cfg.Trust.GetPortalByDomainName(ctx, host)
return err == nil
},
func(ctx context.Context, host string) bool {
_, err := cfg.Trust.GetByDomainName(ctx, host)
_, err := cfg.Trust.GetPortalByDomainName(ctx, host)
return err == nil
},
cfg.GraphQLLimits,
@@ -314,7 +318,6 @@ func (s *Server) ServeHTTP(w http.ResponseWriter, r *http.Request) {
r.Mount("/console/v1", http.StripPrefix("/console/v1", s.consoleHandler))
r.Mount("/connect/v1", http.StripPrefix("/connect/v1", s.connectHandler))
r.Mount("/files/v1", http.StripPrefix("/files/v1", s.filesHandler))
r.Mount("/trust/v1", http.StripPrefix("/trust/v1", s.compliancePageHandler))
r.Mount("/mcp/v1", http.StripPrefix("/mcp/v1", s.mcpHandler))
r.Mount("/slack/v1", http.StripPrefix("/slack/v1", s.slackHandler))
})