Class ManagerEndpointSupport

java.lang.Object
com.cloudforge.core.manager.ManagerEndpointSupport

public final class ManagerEndpointSupport extends Object
Resolves LocalStack / MiniStack gateway URLs from env or system properties. Defaults to http://localhost:4566 when unset.
  • Field Details

  • Method Details

    • resolveLocalEmulatorEndpoint

      public static String resolveLocalEmulatorEndpoint(DeploymentTarget target)
      The one authoritative, target-gated answer to "should this call be redirected to a local emulator instead of real AWS" — null immediately for DeploymentTarget.AWS OR an unresolved/null target, without even reading the env vars, otherwise the same LOCALSTACK_ENDPOINT then AWS_ENDPOINT_URL fallback chain resolveLocalStackEndpoint() already used. null target fails closed to "real AWS" rather than falling through to the env-var chain — an installation that never explicitly chose a local target shouldn't have its calls silently redirected just because some env var happens to be present, same fail-closed shape as this codebase's other target-based gates (see StripeConfiguration).

      Exists because, before this method, several call sites across cloudforge-api and cloudforge-manager each independently re-derived "are we local" from env-var presence alone, with no target check at all — so a real target=aws production install would happily route Cognito/STS/Service Catalog SDK calls to whatever AWS_ENDPOINT_URL happened to be set to, an SSRF-adjacent risk on the customer's own AWS credentials. target should always be the caller's own already-known, validated DeploymentTarget (the per-request target for a deploy, or the installation's own ManagerRuntimeConfiguration.Target for Manager's own dev/test-loop calls) — never re-derived from these same env vars, or this gate would just move one level up instead of closing.

      MINISTACK and LOCALSTACK deliberately check different dedicated env vars first (MINISTACK_ENDPOINT / LOCALSTACK_ENDPOINT respectively) before the shared AWS_ENDPOINT_URL fallback — an installation running both emulators side by side needs a MINISTACK-targeted call to reach MiniStack, not silently fall through to whichever one LOCALSTACK_ENDPOINT happens to point at.

    • resolveLocalStackEndpoint

      public static String resolveLocalStackEndpoint()
    • resolveMiniStackEndpoint

      public static String resolveMiniStackEndpoint()
    • resolveRegion

      public static String resolveRegion()