Skip to content

Commit

Permalink
SC-18436: Adjusted zone generation to 4-level for internal endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
yuklia committed Feb 1, 2024
1 parent bbf7993 commit aad4b6c
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions generator/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -341,13 +341,16 @@ static function ($endpoint) use ($projectData) {
];
}

foreach ($applicationData['endpoints'] ?? [] as $endpoint => $endpointData) {

if (isset($applicationData['endpoints']) && is_array($applicationData['endpoints'])) {
foreach ($applicationData['endpoints'] ?? [] as $endpoint => $endpointData) {
$internal = isset($endpointData['internal']) && $endpointData['internal'] === true;
$host = strtok($endpoint, ':');
$zone = $internal ? getFrontendZoneByDomainLevel($host, 4) : getFrontendZoneByDomainLevel($host, 2);

$frontend[$host] = [
'zone' => getFrontendZoneByDomainLevel($host),
'zone' => $zone,
'type' => $applicationName,
'internal' => (bool)($endpointData['internal'] ?? false),
'internal' => $internal,
];

$authEngine = $endpointData['auth']['engine'] ?? 'none';
Expand Down Expand Up @@ -440,6 +443,7 @@ static function ($endpoint) use ($projectData) {
}

$envVarEncoder->setIsActive(false);
}
}
}
}
Expand Down

0 comments on commit aad4b6c

Please sign in to comment.