whc4: deploy PHP tenant edge controls
This commit is contained in:
@@ -981,6 +981,39 @@ public sealed class FleetManifestLintTests
|
||||
gatewayManifest.Should().Contain("port: 5400");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gx10PhpTenantRoutes_HaveEdgeControlSubstrate()
|
||||
{
|
||||
var appRoot = Path.Combine(Inventory.BluejayRoot, "apps-gx10", "fc-php");
|
||||
using var configMap = JsonDocument.Parse(File.ReadAllText(Path.Combine(appRoot, "configmap-php-web-config.json")));
|
||||
var settingsJson = configMap.RootElement
|
||||
.GetProperty("data")
|
||||
.GetProperty("appsettings.Production.json")
|
||||
.GetString();
|
||||
settingsJson.Should().NotBeNullOrWhiteSpace();
|
||||
|
||||
using var settings = JsonDocument.Parse(settingsJson!);
|
||||
var ingress = settings.RootElement.GetProperty("PhpManager").GetProperty("Ingress");
|
||||
ingress.GetProperty("DefaultMiddlewares")
|
||||
.EnumerateArray()
|
||||
.Select(item => item.GetProperty("Name").GetString())
|
||||
.Should()
|
||||
.Equal("php-tenant-rate-limit", "php-tenant-secure-headers");
|
||||
ingress.GetProperty("TlsOption").GetProperty("Name").GetString().Should().Be("php-tenant-tls13");
|
||||
|
||||
using var rateLimit = JsonDocument.Parse(File.ReadAllText(Path.Combine(appRoot, "middleware-php-tenant-rate-limit.json")));
|
||||
rateLimit.RootElement.GetProperty("kind").GetString().Should().Be("Middleware");
|
||||
rateLimit.RootElement.GetProperty("spec").GetProperty("rateLimit").GetProperty("average").GetInt32().Should().Be(120);
|
||||
|
||||
using var headers = JsonDocument.Parse(File.ReadAllText(Path.Combine(appRoot, "middleware-php-tenant-secure-headers.json")));
|
||||
headers.RootElement.GetProperty("kind").GetString().Should().Be("Middleware");
|
||||
headers.RootElement.GetProperty("spec").GetProperty("headers").GetProperty("contentTypeNosniff").GetBoolean().Should().BeTrue();
|
||||
|
||||
using var tlsOption = JsonDocument.Parse(File.ReadAllText(Path.Combine(appRoot, "tlsoption-php-tenant-tls13.json")));
|
||||
tlsOption.RootElement.GetProperty("kind").GetString().Should().Be("TLSOption");
|
||||
tlsOption.RootElement.GetProperty("spec").GetProperty("minVersion").GetString().Should().Be("VersionTLS13");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Gx10HostingManagers_ProvisioningCrdsAndRbacMustBeGitOpsOwned()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user