Class TlsTrustEvaluator

java.lang.Object
com.cloudforgeci.api.core.TlsTrustEvaluator

public final class TlsTrustEvaluator extends Object
Single source of truth for whether a deployment's ALB HTTPS listener uses a publicly trusted certificate. Mirrors the three-way choice FargateRuntimeConfiguration makes when provisioning a certificate (imported ARN, DNS-validated public certificate, or the untrusted AWS Private CA fallback) so that ContainerFactory can report the result to the application (e.g. cloudforge-manager) without duplicating the logic.

A pure function of deployment-context values rather than CDK constructs or SystemContext slots: FargateRuntimeConfiguration resolves its decision asynchronously, but the outcome is fully determined by the inputs configured up front. This lets ContainerFactory compute it synchronously and lets TlsTrustEvaluatorTest verify it without synthesizing a stack.

  • Method Details

    • isPubliclyTrusted

      public static boolean isPubliclyTrusted(boolean sslEnabled, String domain, String fqdn, String certificateArn)
      Parameters:
      sslEnabled - enableSsl deployment-context value
      domain - domain deployment-context value
      fqdn - fqdn deployment-context value (subdomain+domain, or an explicit override — see DeploymentConfig#fqdn's javadoc)
      certificateArn - certificateArn deployment-context value — an already-issued/ imported ACM certificate, see DeploymentConfig#certificateArn
      Returns:
      true only when the resulting certificate would be one a real browser already trusts: an imported/existing ACM cert (assumed public — that's the documented contract of the certificateArn field), or ACM's own DNS-validated public path (SSL enabled with a domain, and a Route53 zone this deployment controls). false for SSL disabled entirely, AND for SSL-enabled-with-no-domain — that combination takes FargateRuntimeConfiguration's AWS Private CA fallback path, which the code that provisions it explicitly logs is NOT trusted by browsers.