diff --git a/src/Api/Dirt/Controllers/OrganizationReportsController.cs b/src/Api/Dirt/Controllers/OrganizationReportsController.cs index 28b89fb391ef..59cbe29bceb1 100644 --- a/src/Api/Dirt/Controllers/OrganizationReportsController.cs +++ b/src/Api/Dirt/Controllers/OrganizationReportsController.cs @@ -97,12 +97,8 @@ public async Task CreateOrganizationReportAsync( await AuthorizeAsync(organizationId); - // File storage only exists under the new architecture, so gate the file path on the (stable) - // AccessIntelligenceNewArchitecture flag. Within that, select the path from the request shape - // rather than the file-storage flag (AccessIntelligenceVersion2): the client chooses its shape - // from that flag via a config cache that can lag the server by up to an hour (pronounced in - // self-hosted), so branching on it here would 500 whenever the two disagree. Honoring the shape - // lets file-storage flag staleness degrade gracefully. + // File storage only exists under the new architecture, so gate the file path on the + // AccessIntelligenceNewArchitecture flag. Within that, select the path from the request shape. var isNewArchitecture = _featureService.IsEnabled(FeatureFlagKeys.AccessIntelligenceNewArchitecture); if (isNewArchitecture && request.FileSize.HasValue) { diff --git a/src/Core/Constants.cs b/src/Core/Constants.cs index 4e6e2c7a8f1f..5ba2f23c1996 100644 --- a/src/Core/Constants.cs +++ b/src/Core/Constants.cs @@ -283,7 +283,6 @@ public static partial class FeatureFlagKeys public const string WindowsNativeCredentialSync = "windows-native-credential-sync"; /* DIRT Team */ - public const string AccessIntelligenceVersion2 = "pm-31920-access-intelligence-azure-file-storage"; public const string EventManagementForBlumira = "event-management-for-blumira"; public const string EventManagementForDataDogAndCrowdStrike = "event-management-for-datadog-and-crowdstrike"; public const string EventDiagnosticLogging = "pm-27666-siem-event-log-debugging"; diff --git a/test/Api.Test/Dirt/OrganizationReportsControllerTests.cs b/test/Api.Test/Dirt/OrganizationReportsControllerTests.cs index c10ec6a6d7a3..5f48c7c5a909 100644 --- a/test/Api.Test/Dirt/OrganizationReportsControllerTests.cs +++ b/test/Api.Test/Dirt/OrganizationReportsControllerTests.cs @@ -250,7 +250,7 @@ await sutProvider.GetDependency() } // CreateOrganizationReportAsync - the file path is gated on the new architecture, then selected by - // request shape (FileSize); it is never selected by the file-storage flag. + // request shape (FileSize). [Theory, BitAutoData] public async Task CreateOrganizationReportAsync_NewArchOn_WithoutFileSize_TakesInlinePath( @@ -358,85 +358,6 @@ await sutProvider.GetDependency() .CreateAsync(Arg.Any()); } - // Under the new architecture, path selection must be independent of the file-storage flag: the - // client chooses its request shape from that flag via a config cache that can lag the server, so - // branching on it here would fail whenever the client and server disagree. - - [Theory, BitAutoData] - public async Task CreateOrganizationReportAsync_NewArchOn_WithFileSize_FileStorageFlagOff_StillTakesFileCreatePath( - SutProvider sutProvider, - Guid orgId, - AddOrganizationReportRequestModel request, - OrganizationReport expectedReport, - string uploadUrl) - { - // Arrange - client sent a file-shaped body while the server's file-storage flag is off. - request.FileSize = 1024; - - var reportFile = new ReportFile { Id = "file-id", FileName = "report.json", Size = 1024, Validated = false }; - expectedReport.SetReportFile(reportFile); - - SetupAuthorization(sutProvider, orgId); - SetupNewArchitecture(sutProvider, enabled: true); - - sutProvider.GetDependency() - .IsEnabled(FeatureFlagKeys.AccessIntelligenceVersion2) - .Returns(false); - - sutProvider.GetDependency() - .CreateAsync(Arg.Any()) - .Returns(expectedReport); - - sutProvider.GetDependency() - .GetReportFileUploadUrlAsync(expectedReport, Arg.Any()) - .Returns(uploadUrl); - - // Act - var result = await sutProvider.Sut.CreateOrganizationReportAsync(orgId, request); - - // Assert - var okResult = Assert.IsType(result); - Assert.IsType(okResult.Value); - - await sutProvider.GetDependency() - .Received(1) - .CreateAsync(Arg.Any()); - } - - [Theory, BitAutoData] - public async Task CreateOrganizationReportAsync_NewArchOn_WithoutFileSize_FileStorageFlagOn_StillTakesInlinePath( - SutProvider sutProvider, - Guid orgId, - AddOrganizationReportRequestModel request, - OrganizationReport expectedReport) - { - // Arrange - client sent an inline body while the server's file-storage flag is on. - request.FileSize = null; - expectedReport.ReportFile = null; - - SetupAuthorization(sutProvider, orgId); - SetupNewArchitecture(sutProvider, enabled: true); - - sutProvider.GetDependency() - .IsEnabled(FeatureFlagKeys.AccessIntelligenceVersion2) - .Returns(true); - - sutProvider.GetDependency() - .AddOrganizationReportAsync(Arg.Any()) - .Returns(expectedReport); - - // Act - var result = await sutProvider.Sut.CreateOrganizationReportAsync(orgId, request); - - // Assert - var okResult = Assert.IsType(result); - Assert.IsType(okResult.Value); - - await sutProvider.GetDependency() - .Received(1) - .AddOrganizationReportAsync(Arg.Any()); - } - [Theory, BitAutoData] public async Task CreateOrganizationReportAsync_EmptyOrgId_ThrowsBadRequestException( SutProvider sutProvider,