fix(grpc-data): X0 inert all-unknown export rule no longer lowers the principal's limits; ValidateDeployed doc
This commit is contained in:
+29
@@ -140,6 +140,35 @@ public sealed class GrpcDataUnknownOperationToleranceTests
|
||||
catalog.ExportOperations("other").ShouldBe(DataOperations.None);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void An_inert_all_unknown_export_does_not_lower_the_principals_limits_on_its_other_exports()
|
||||
{
|
||||
using var fixture = new LocalDataFixture();
|
||||
var snapshot = new DraftSnapshot
|
||||
{
|
||||
GenerationId = 1, ClusterId = "cluster",
|
||||
ServerClusters = [new() { ClusterId = "cluster", Name = "Cluster", Enterprise = "Enterprise", Site = "Site", CreatedBy = "test", RedundancyMode = RedundancyMode.None }],
|
||||
RawFolders = [new() { RawFolderId = "folder", ClusterId = "cluster", Name = "Plant" }],
|
||||
DataExports =
|
||||
[
|
||||
new() { DataExportId = "live", ClusterId = "cluster", Enabled = true, Realm = DataRealm.Raw, RootKind = "Cluster",
|
||||
RootEntityId = "cluster", PrincipalId = "peer", AllowedOperations = DataOperations.Browse | DataOperations.Read,
|
||||
MaxBatchItems = 100, MaxPageItems = 100, MaxMonitoredItems = 100, MaxStreams = 10 },
|
||||
new() { DataExportId = "future-only", ClusterId = "cluster", Enabled = true, Realm = DataRealm.Uns, RootKind = "Cluster",
|
||||
RootEntityId = "cluster", PrincipalId = "peer", AllowedOperations = DataOperations.HistoryRead | (DataOperations)(1 << 30),
|
||||
MaxBatchItems = 1, MaxPageItems = 1, MaxMonitoredItems = 1, MaxStreams = 1 },
|
||||
],
|
||||
};
|
||||
var catalog = LocalExportCatalog.Compile(snapshot, fixture.Serving, fixture.Activation.CaptureAuthority());
|
||||
var limits = new DataLimits(1000, 1000, 1_000_000, 1000, 100, 1_000_000, TimeSpan.FromSeconds(15), TimeSpan.FromHours(1), TimeSpan.FromMinutes(1));
|
||||
var effective = catalog.LimitsFor("peer", limits);
|
||||
effective.MaxBatchItems.ShouldBe(100);
|
||||
effective.MaxPageItems.ShouldBe(100);
|
||||
effective.MaxMonitoredItems.ShouldBe(100);
|
||||
effective.MaxStreams.ShouldBe(10);
|
||||
catalog.ExportOperations("peer").ShouldBe(DataOperations.Browse | DataOperations.Read);
|
||||
}
|
||||
|
||||
private static async Task<DataOperations> Lease(DataConnectionDeploymentRuntime runtime, string id)
|
||||
{
|
||||
DataConnectionDeploymentLease? lease = null;
|
||||
|
||||
Reference in New Issue
Block a user