Resolve custom domain SSL via certificate
Replace flattened SSL fields with a certificate relation loaded through certmanager, and resolve domain slots from IDs already on the trust center instead of reloading the compliance page. Signed-off-by: Bryan Frimin <bryan@probo.com>
This commit is contained in:
@@ -5306,15 +5306,20 @@ func (r *Resolver) DeleteCustomDomainTool(ctx context.Context, req *mcp.CallTool
|
||||
return nil, types.DeleteCustomDomainOutput{}, err
|
||||
}
|
||||
|
||||
domain, err := r.management.GetCustomDomain(ctx, scope, input.TrustCenterID)
|
||||
compliancePage, err := r.management.Get(ctx, scope, input.TrustCenterID)
|
||||
if err != nil {
|
||||
return nil, types.DeleteCustomDomainOutput{}, fmt.Errorf("cannot get custom domain: %w", err)
|
||||
return nil, types.DeleteCustomDomainOutput{}, fmt.Errorf("cannot load compliance page: %w", err)
|
||||
}
|
||||
|
||||
if domain == nil {
|
||||
if compliancePage.CustomDomainID == nil {
|
||||
return nil, types.DeleteCustomDomainOutput{}, fmt.Errorf("compliance page has no custom domain")
|
||||
}
|
||||
|
||||
domain, err := r.management.GetDomain(ctx, scope, *compliancePage.CustomDomainID)
|
||||
if err != nil {
|
||||
return nil, types.DeleteCustomDomainOutput{}, fmt.Errorf("cannot get custom domain: %w", err)
|
||||
}
|
||||
|
||||
var cert *coredata.Certificate
|
||||
if domain.CertificateID != nil {
|
||||
cert, err = r.certManager.Get(ctx, scope, *domain.CertificateID)
|
||||
|
||||
Reference in New Issue
Block a user