1
0
mirror of https://github.com/bitwarden/server.git synced 2025-06-13 14:30:50 -05:00

PM-22564 Fix Namespaces from Tools to Dirt (#5947)

* PM-22564 fixing namespaces

* PM-22564 fixing namespace in integration test

* PM-22564 fixing .sqlproj file
This commit is contained in:
Graham Walker 2025-06-10 12:36:49 -05:00 committed by GitHub
parent 021e69bc5d
commit 4277f435ab
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
36 changed files with 127 additions and 124 deletions

View File

@ -8,7 +8,7 @@ using Bit.Core.Utilities;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace Bit.Api.Tools.Controllers; namespace Bit.Api.Dirt.Controllers;
[Route("hibp")] [Route("hibp")]
[Authorize("Application")] [Authorize("Application")]

View File

@ -1,16 +1,16 @@
using Bit.Api.Tools.Models; using Bit.Api.Dirt.Models;
using Bit.Api.Tools.Models.Response; using Bit.Api.Dirt.Models.Response;
using Bit.Core.Context; using Bit.Core.Context;
using Bit.Core.Dirt.Reports.Entities;
using Bit.Core.Dirt.Reports.Models.Data;
using Bit.Core.Dirt.Reports.ReportFeatures.Interfaces;
using Bit.Core.Dirt.Reports.ReportFeatures.OrganizationReportMembers.Interfaces;
using Bit.Core.Dirt.Reports.ReportFeatures.Requests;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Tools.Entities;
using Bit.Core.Tools.Models.Data;
using Bit.Core.Tools.ReportFeatures.Interfaces;
using Bit.Core.Tools.ReportFeatures.OrganizationReportMembers.Interfaces;
using Bit.Core.Tools.ReportFeatures.Requests;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace Bit.Api.Tools.Controllers; namespace Bit.Api.Dirt.Controllers;
[Route("reports")] [Route("reports")]
[Authorize("Application")] [Authorize("Application")]
@ -47,7 +47,7 @@ public class ReportsController : Controller
[HttpGet("member-cipher-details/{orgId}")] [HttpGet("member-cipher-details/{orgId}")]
public async Task<IEnumerable<MemberCipherDetailsResponseModel>> GetMemberCipherDetails(Guid orgId) public async Task<IEnumerable<MemberCipherDetailsResponseModel>> GetMemberCipherDetails(Guid orgId)
{ {
// Using the AccessReports permission here until new permissions // Using the AccessReports permission here until new permissions
// are needed for more control over reports // are needed for more control over reports
if (!await _currentContext.AccessReports(orgId)) if (!await _currentContext.AccessReports(orgId))
{ {
@ -84,7 +84,7 @@ public class ReportsController : Controller
} }
/// <summary> /// <summary>
/// Contains the organization member info, the cipher ids associated with the member, /// Contains the organization member info, the cipher ids associated with the member,
/// and details on their collections, groups, and permissions /// and details on their collections, groups, and permissions
/// </summary> /// </summary>
/// <param name="request">Request to the MemberAccessCipherDetailsQuery</param> /// <param name="request">Request to the MemberAccessCipherDetailsQuery</param>

View File

@ -1,4 +1,4 @@
namespace Bit.Api.Tools.Models; namespace Bit.Api.Dirt.Models;
public class PasswordHealthReportApplicationModel public class PasswordHealthReportApplicationModel
{ {

View File

@ -1,10 +1,10 @@
using Bit.Core.Tools.Models.Data; using Bit.Core.Dirt.Reports.Models.Data;
namespace Bit.Api.Tools.Models.Response; namespace Bit.Api.Dirt.Models.Response;
/// <summary> /// <summary>
/// Contains the collections and group collections a user has access to including /// Contains the collections and group collections a user has access to including
/// the permission level for the collection and group collection. /// the permission level for the collection and group collection.
/// </summary> /// </summary>
public class MemberAccessReportResponseModel public class MemberAccessReportResponseModel
{ {

View File

@ -1,6 +1,6 @@
using Bit.Core.Tools.Models.Data; using Bit.Core.Dirt.Reports.Models.Data;
namespace Bit.Api.Tools.Models.Response; namespace Bit.Api.Dirt.Models.Response;
public class MemberCipherDetailsResponseModel public class MemberCipherDetailsResponseModel
{ {

View File

@ -31,8 +31,8 @@ using Bit.Api.Billing;
using Bit.Core.Auth.Models.Data; using Bit.Core.Auth.Models.Data;
using Bit.Core.Auth.Identity.TokenProviders; using Bit.Core.Auth.Identity.TokenProviders;
using Bit.Core.Tools.ImportFeatures; using Bit.Core.Tools.ImportFeatures;
using Bit.Core.Tools.ReportFeatures;
using Bit.Core.Auth.Models.Api.Request; using Bit.Core.Auth.Models.Api.Request;
using Bit.Core.Dirt.Reports.ReportFeatures;
using Bit.Core.Tools.SendFeatures; using Bit.Core.Tools.SendFeatures;
#if !OSS #if !OSS

View File

@ -1,9 +1,9 @@
using Bit.Core.Entities; #nullable enable
using Bit.Core.Entities;
using Bit.Core.Utilities; using Bit.Core.Utilities;
#nullable enable namespace Bit.Core.Dirt.Reports.Entities;
namespace Bit.Core.Tools.Entities;
public class PasswordHealthReportApplication : ITableObject<Guid>, IRevisable public class PasswordHealthReportApplication : ITableObject<Guid>, IRevisable
{ {

View File

@ -1,4 +1,4 @@
namespace Bit.Core.Tools.Models.Data; namespace Bit.Core.Dirt.Reports.Models.Data;
public class MemberAccessDetails public class MemberAccessDetails
{ {
@ -30,13 +30,13 @@ public class MemberAccessCipherDetails
public bool UsesKeyConnector { get; set; } public bool UsesKeyConnector { get; set; }
/// <summary> /// <summary>
/// The details for the member's collection access depending /// The details for the member's collection access depending
/// on the collections and groups they are assigned to /// on the collections and groups they are assigned to
/// </summary> /// </summary>
public IEnumerable<MemberAccessDetails> AccessDetails { get; set; } public IEnumerable<MemberAccessDetails> AccessDetails { get; set; }
/// <summary> /// <summary>
/// A distinct list of the cipher ids associated with /// A distinct list of the cipher ids associated with
/// the organization member /// the organization member
/// </summary> /// </summary>
public IEnumerable<string> CipherIds { get; set; } public IEnumerable<string> CipherIds { get; set; }

View File

@ -1,11 +1,11 @@
using Bit.Core.Exceptions; using Bit.Core.Dirt.Reports.Entities;
using Bit.Core.Dirt.Reports.ReportFeatures.Interfaces;
using Bit.Core.Dirt.Reports.ReportFeatures.Requests;
using Bit.Core.Dirt.Reports.Repositories;
using Bit.Core.Exceptions;
using Bit.Core.Repositories; using Bit.Core.Repositories;
using Bit.Core.Tools.Entities;
using Bit.Core.Tools.ReportFeatures.Interfaces;
using Bit.Core.Tools.ReportFeatures.Requests;
using Bit.Core.Tools.Repositories;
namespace Bit.Core.Tools.ReportFeatures; namespace Bit.Core.Dirt.Reports.ReportFeatures;
public class AddPasswordHealthReportApplicationCommand : IAddPasswordHealthReportApplicationCommand public class AddPasswordHealthReportApplicationCommand : IAddPasswordHealthReportApplicationCommand
{ {

View File

@ -1,9 +1,9 @@
using Bit.Core.Exceptions; using Bit.Core.Dirt.Reports.ReportFeatures.Interfaces;
using Bit.Core.Tools.ReportFeatures.Interfaces; using Bit.Core.Dirt.Reports.ReportFeatures.Requests;
using Bit.Core.Tools.ReportFeatures.Requests; using Bit.Core.Dirt.Reports.Repositories;
using Bit.Core.Tools.Repositories; using Bit.Core.Exceptions;
namespace Bit.Core.Tools.ReportFeatures; namespace Bit.Core.Dirt.Reports.ReportFeatures;
public class DropPasswordHealthReportApplicationCommand : IDropPasswordHealthReportApplicationCommand public class DropPasswordHealthReportApplicationCommand : IDropPasswordHealthReportApplicationCommand
{ {

View File

@ -1,9 +1,9 @@
using Bit.Core.Exceptions; using Bit.Core.Dirt.Reports.Entities;
using Bit.Core.Tools.Entities; using Bit.Core.Dirt.Reports.ReportFeatures.Interfaces;
using Bit.Core.Tools.ReportFeatures.Interfaces; using Bit.Core.Dirt.Reports.Repositories;
using Bit.Core.Tools.Repositories; using Bit.Core.Exceptions;
namespace Bit.Core.Tools.ReportFeatures; namespace Bit.Core.Dirt.Reports.ReportFeatures;
public class GetPasswordHealthReportApplicationQuery : IGetPasswordHealthReportApplicationQuery public class GetPasswordHealthReportApplicationQuery : IGetPasswordHealthReportApplicationQuery
{ {

View File

@ -1,7 +1,7 @@
using Bit.Core.Tools.Entities; using Bit.Core.Dirt.Reports.Entities;
using Bit.Core.Tools.ReportFeatures.Requests; using Bit.Core.Dirt.Reports.ReportFeatures.Requests;
namespace Bit.Core.Tools.ReportFeatures.Interfaces; namespace Bit.Core.Dirt.Reports.ReportFeatures.Interfaces;
public interface IAddPasswordHealthReportApplicationCommand public interface IAddPasswordHealthReportApplicationCommand
{ {

View File

@ -1,6 +1,6 @@
using Bit.Core.Tools.ReportFeatures.Requests; using Bit.Core.Dirt.Reports.ReportFeatures.Requests;
namespace Bit.Core.Tools.ReportFeatures.Interfaces; namespace Bit.Core.Dirt.Reports.ReportFeatures.Interfaces;
public interface IDropPasswordHealthReportApplicationCommand public interface IDropPasswordHealthReportApplicationCommand
{ {

View File

@ -1,6 +1,6 @@
using Bit.Core.Tools.Entities; using Bit.Core.Dirt.Reports.Entities;
namespace Bit.Core.Tools.ReportFeatures.Interfaces; namespace Bit.Core.Dirt.Reports.ReportFeatures.Interfaces;
public interface IGetPasswordHealthReportApplicationQuery public interface IGetPasswordHealthReportApplicationQuery
{ {

View File

@ -2,21 +2,21 @@
using Bit.Core.AdminConsole.Entities; using Bit.Core.AdminConsole.Entities;
using Bit.Core.AdminConsole.Repositories; using Bit.Core.AdminConsole.Repositories;
using Bit.Core.Auth.UserFeatures.TwoFactorAuth.Interfaces; using Bit.Core.Auth.UserFeatures.TwoFactorAuth.Interfaces;
using Bit.Core.Dirt.Reports.Models.Data;
using Bit.Core.Dirt.Reports.ReportFeatures.OrganizationReportMembers.Interfaces;
using Bit.Core.Dirt.Reports.ReportFeatures.Requests;
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Models.Data; using Bit.Core.Models.Data;
using Bit.Core.Models.Data.Organizations; using Bit.Core.Models.Data.Organizations;
using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Models.Data.Organizations.OrganizationUsers;
using Bit.Core.Repositories; using Bit.Core.Repositories;
using Bit.Core.Services; using Bit.Core.Services;
using Bit.Core.Tools.Models.Data;
using Bit.Core.Tools.ReportFeatures.OrganizationReportMembers.Interfaces;
using Bit.Core.Tools.ReportFeatures.Requests;
using Bit.Core.Vault.Models.Data; using Bit.Core.Vault.Models.Data;
using Bit.Core.Vault.Queries; using Bit.Core.Vault.Queries;
using Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; using Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces;
using Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Requests; using Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Requests;
namespace Bit.Core.Tools.ReportFeatures; namespace Bit.Core.Dirt.Reports.ReportFeatures;
public class MemberAccessCipherDetailsQuery : IMemberAccessCipherDetailsQuery public class MemberAccessCipherDetailsQuery : IMemberAccessCipherDetailsQuery
{ {

View File

@ -1,7 +1,7 @@
using Bit.Core.Tools.Models.Data; using Bit.Core.Dirt.Reports.Models.Data;
using Bit.Core.Tools.ReportFeatures.Requests; using Bit.Core.Dirt.Reports.ReportFeatures.Requests;
namespace Bit.Core.Tools.ReportFeatures.OrganizationReportMembers.Interfaces; namespace Bit.Core.Dirt.Reports.ReportFeatures.OrganizationReportMembers.Interfaces;
public interface IMemberAccessCipherDetailsQuery public interface IMemberAccessCipherDetailsQuery
{ {

View File

@ -1,8 +1,8 @@
using Bit.Core.Tools.ReportFeatures.Interfaces; using Bit.Core.Dirt.Reports.ReportFeatures.Interfaces;
using Bit.Core.Tools.ReportFeatures.OrganizationReportMembers.Interfaces; using Bit.Core.Dirt.Reports.ReportFeatures.OrganizationReportMembers.Interfaces;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
namespace Bit.Core.Tools.ReportFeatures; namespace Bit.Core.Dirt.Reports.ReportFeatures;
public static class ReportingServiceCollectionExtensions public static class ReportingServiceCollectionExtensions
{ {

View File

@ -1,4 +1,4 @@
namespace Bit.Core.Tools.ReportFeatures.Requests; namespace Bit.Core.Dirt.Reports.ReportFeatures.Requests;
public class AddPasswordHealthReportApplicationRequest public class AddPasswordHealthReportApplicationRequest
{ {

View File

@ -1,4 +1,4 @@
namespace Bit.Core.Tools.ReportFeatures.Requests; namespace Bit.Core.Dirt.Reports.ReportFeatures.Requests;
public class DropPasswordHealthReportApplicationRequest public class DropPasswordHealthReportApplicationRequest
{ {

View File

@ -1,4 +1,4 @@
namespace Bit.Core.Tools.ReportFeatures.Requests; namespace Bit.Core.Dirt.Reports.ReportFeatures.Requests;
public class MemberAccessCipherDetailsRequest public class MemberAccessCipherDetailsRequest
{ {

View File

@ -1,7 +1,7 @@
using Bit.Core.Repositories; using Bit.Core.Dirt.Reports.Entities;
using Bit.Core.Tools.Entities; using Bit.Core.Repositories;
namespace Bit.Core.Tools.Repositories; namespace Bit.Core.Dirt.Reports.Repositories;
public interface IPasswordHealthReportApplicationRepository : IRepository<PasswordHealthReportApplication, Guid> public interface IPasswordHealthReportApplicationRepository : IRepository<PasswordHealthReportApplication, Guid>
{ {

View File

@ -2,6 +2,7 @@
using Bit.Core.Auth.Repositories; using Bit.Core.Auth.Repositories;
using Bit.Core.Billing.Providers.Repositories; using Bit.Core.Billing.Providers.Repositories;
using Bit.Core.Billing.Repositories; using Bit.Core.Billing.Repositories;
using Bit.Core.Dirt.Reports.Repositories;
using Bit.Core.KeyManagement.Repositories; using Bit.Core.KeyManagement.Repositories;
using Bit.Core.NotificationCenter.Repositories; using Bit.Core.NotificationCenter.Repositories;
using Bit.Core.Platform.Installations; using Bit.Core.Platform.Installations;
@ -12,6 +13,7 @@ using Bit.Core.Vault.Repositories;
using Bit.Infrastructure.Dapper.AdminConsole.Repositories; using Bit.Infrastructure.Dapper.AdminConsole.Repositories;
using Bit.Infrastructure.Dapper.Auth.Repositories; using Bit.Infrastructure.Dapper.Auth.Repositories;
using Bit.Infrastructure.Dapper.Billing.Repositories; using Bit.Infrastructure.Dapper.Billing.Repositories;
using Bit.Infrastructure.Dapper.Dirt;
using Bit.Infrastructure.Dapper.KeyManagement.Repositories; using Bit.Infrastructure.Dapper.KeyManagement.Repositories;
using Bit.Infrastructure.Dapper.NotificationCenter.Repositories; using Bit.Infrastructure.Dapper.NotificationCenter.Repositories;
using Bit.Infrastructure.Dapper.Platform; using Bit.Infrastructure.Dapper.Platform;

View File

@ -1,14 +1,14 @@
using System.Data; using System.Data;
using Bit.Core.Dirt.Reports.Entities;
using Bit.Core.Dirt.Reports.Repositories;
using Bit.Core.Settings; using Bit.Core.Settings;
using Bit.Core.Tools.Repositories;
using Bit.Infrastructure.Dapper.Repositories; using Bit.Infrastructure.Dapper.Repositories;
using Dapper; using Dapper;
using Microsoft.Data.SqlClient; using Microsoft.Data.SqlClient;
using ToolsEntities = Bit.Core.Tools.Entities;
namespace Bit.Infrastructure.Dapper.Tools.Repositories; namespace Bit.Infrastructure.Dapper.Dirt;
public class PasswordHealthReportApplicationRepository : Repository<ToolsEntities.PasswordHealthReportApplication, Guid>, IPasswordHealthReportApplicationRepository public class PasswordHealthReportApplicationRepository : Repository<PasswordHealthReportApplication, Guid>, IPasswordHealthReportApplicationRepository
{ {
public PasswordHealthReportApplicationRepository(GlobalSettings globalSettings) public PasswordHealthReportApplicationRepository(GlobalSettings globalSettings)
: this(globalSettings.SqlServer.ConnectionString, globalSettings.SqlServer.ReadOnlyConnectionString) : this(globalSettings.SqlServer.ConnectionString, globalSettings.SqlServer.ReadOnlyConnectionString)
@ -18,11 +18,11 @@ public class PasswordHealthReportApplicationRepository : Repository<ToolsEntitie
: base(connectionString, readOnlyConnectionString) : base(connectionString, readOnlyConnectionString)
{ } { }
public async Task<ICollection<ToolsEntities.PasswordHealthReportApplication>> GetByOrganizationIdAsync(Guid organizationId) public async Task<ICollection<PasswordHealthReportApplication>> GetByOrganizationIdAsync(Guid organizationId)
{ {
using (var connection = new SqlConnection(ReadOnlyConnectionString)) using (var connection = new SqlConnection(ReadOnlyConnectionString))
{ {
var results = await connection.QueryAsync<ToolsEntities.PasswordHealthReportApplication>( var results = await connection.QueryAsync<PasswordHealthReportApplication>(
$"[{Schema}].[PasswordHealthReportApplication_ReadByOrganizationId]", $"[{Schema}].[PasswordHealthReportApplication_ReadByOrganizationId]",
new { OrganizationId = organizationId }, new { OrganizationId = organizationId },
commandType: CommandType.StoredProcedure); commandType: CommandType.StoredProcedure);

View File

@ -1,8 +1,8 @@
using Bit.Infrastructure.EntityFramework.Tools.Models; using Bit.Infrastructure.EntityFramework.Dirt.Models;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders; using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace Bit.Infrastructure.EntityFramework.Tools.Configurations; namespace Bit.Infrastructure.EntityFramework.Dirt.Configurations;
public class PasswordHealthReportApplicationEntityTypeConfiguration : IEntityTypeConfiguration<PasswordHealthReportApplication> public class PasswordHealthReportApplicationEntityTypeConfiguration : IEntityTypeConfiguration<PasswordHealthReportApplication>
{ {

View File

@ -1,9 +1,9 @@
using AutoMapper; using AutoMapper;
using Bit.Infrastructure.EntityFramework.AdminConsole.Models; using Bit.Infrastructure.EntityFramework.AdminConsole.Models;
namespace Bit.Infrastructure.EntityFramework.Tools.Models; namespace Bit.Infrastructure.EntityFramework.Dirt.Models;
public class PasswordHealthReportApplication : Core.Tools.Entities.PasswordHealthReportApplication public class PasswordHealthReportApplication : Core.Dirt.Reports.Entities.PasswordHealthReportApplication
{ {
public virtual Organization Organization { get; set; } public virtual Organization Organization { get; set; }
} }
@ -12,7 +12,7 @@ public class PasswordHealthReportApplicationProfile : Profile
{ {
public PasswordHealthReportApplicationProfile() public PasswordHealthReportApplicationProfile()
{ {
CreateMap<Core.Tools.Entities.PasswordHealthReportApplication, PasswordHealthReportApplication>() CreateMap<Core.Dirt.Reports.Entities.PasswordHealthReportApplication, PasswordHealthReportApplication>()
.ReverseMap(); .ReverseMap();
} }
} }

View File

@ -1,22 +1,21 @@
using AutoMapper; using AutoMapper;
using Bit.Core.Tools.Repositories; using Bit.Core.Dirt.Reports.Repositories;
using Bit.Infrastructure.EntityFramework.Dirt.Models;
using Bit.Infrastructure.EntityFramework.Repositories; using Bit.Infrastructure.EntityFramework.Repositories;
using Bit.Infrastructure.EntityFramework.Tools.Models;
using LinqToDB; using LinqToDB;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using AdminConsoleEntities = Bit.Core.Tools.Entities;
namespace Bit.Infrastructure.EntityFramework.Tools.Repositories; namespace Bit.Infrastructure.EntityFramework.Dirt.Repositories;
public class PasswordHealthReportApplicationRepository : public class PasswordHealthReportApplicationRepository :
Repository<AdminConsoleEntities.PasswordHealthReportApplication, PasswordHealthReportApplication, Guid>, Repository<Core.Dirt.Reports.Entities.PasswordHealthReportApplication, PasswordHealthReportApplication, Guid>,
IPasswordHealthReportApplicationRepository IPasswordHealthReportApplicationRepository
{ {
public PasswordHealthReportApplicationRepository(IServiceScopeFactory serviceScopeFactory, public PasswordHealthReportApplicationRepository(IServiceScopeFactory serviceScopeFactory,
IMapper mapper) : base(serviceScopeFactory, mapper, (DatabaseContext context) => context.PasswordHealthReportApplications) IMapper mapper) : base(serviceScopeFactory, mapper, (DatabaseContext context) => context.PasswordHealthReportApplications)
{ } { }
public async Task<ICollection<AdminConsoleEntities.PasswordHealthReportApplication>> GetByOrganizationIdAsync(Guid organizationId) public async Task<ICollection<Core.Dirt.Reports.Entities.PasswordHealthReportApplication>> GetByOrganizationIdAsync(Guid organizationId)
{ {
using (var scope = ServiceScopeFactory.CreateScope()) using (var scope = ServiceScopeFactory.CreateScope())
{ {
@ -24,7 +23,7 @@ public class PasswordHealthReportApplicationRepository :
var results = await dbContext.PasswordHealthReportApplications var results = await dbContext.PasswordHealthReportApplications
.Where(p => p.OrganizationId == organizationId) .Where(p => p.OrganizationId == organizationId)
.ToListAsync(); .ToListAsync();
return Mapper.Map<ICollection<AdminConsoleEntities.PasswordHealthReportApplication>>(results); return Mapper.Map<ICollection<Core.Dirt.Reports.Entities.PasswordHealthReportApplication>>(results);
} }
} }
} }

View File

@ -2,6 +2,7 @@
using Bit.Core.Auth.Repositories; using Bit.Core.Auth.Repositories;
using Bit.Core.Billing.Providers.Repositories; using Bit.Core.Billing.Providers.Repositories;
using Bit.Core.Billing.Repositories; using Bit.Core.Billing.Repositories;
using Bit.Core.Dirt.Reports.Repositories;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.KeyManagement.Repositories; using Bit.Core.KeyManagement.Repositories;
using Bit.Core.NotificationCenter.Repositories; using Bit.Core.NotificationCenter.Repositories;
@ -13,6 +14,7 @@ using Bit.Core.Vault.Repositories;
using Bit.Infrastructure.EntityFramework.AdminConsole.Repositories; using Bit.Infrastructure.EntityFramework.AdminConsole.Repositories;
using Bit.Infrastructure.EntityFramework.Auth.Repositories; using Bit.Infrastructure.EntityFramework.Auth.Repositories;
using Bit.Infrastructure.EntityFramework.Billing.Repositories; using Bit.Infrastructure.EntityFramework.Billing.Repositories;
using Bit.Infrastructure.EntityFramework.Dirt.Repositories;
using Bit.Infrastructure.EntityFramework.KeyManagement.Repositories; using Bit.Infrastructure.EntityFramework.KeyManagement.Repositories;
using Bit.Infrastructure.EntityFramework.NotificationCenter.Repositories; using Bit.Infrastructure.EntityFramework.NotificationCenter.Repositories;
using Bit.Infrastructure.EntityFramework.Platform; using Bit.Infrastructure.EntityFramework.Platform;

View File

@ -4,11 +4,11 @@ using Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider;
using Bit.Infrastructure.EntityFramework.Auth.Models; using Bit.Infrastructure.EntityFramework.Auth.Models;
using Bit.Infrastructure.EntityFramework.Billing.Models; using Bit.Infrastructure.EntityFramework.Billing.Models;
using Bit.Infrastructure.EntityFramework.Converters; using Bit.Infrastructure.EntityFramework.Converters;
using Bit.Infrastructure.EntityFramework.Dirt.Models;
using Bit.Infrastructure.EntityFramework.Models; using Bit.Infrastructure.EntityFramework.Models;
using Bit.Infrastructure.EntityFramework.NotificationCenter.Models; using Bit.Infrastructure.EntityFramework.NotificationCenter.Models;
using Bit.Infrastructure.EntityFramework.Platform; using Bit.Infrastructure.EntityFramework.Platform;
using Bit.Infrastructure.EntityFramework.SecretsManager.Models; using Bit.Infrastructure.EntityFramework.SecretsManager.Models;
using Bit.Infrastructure.EntityFramework.Tools.Models;
using Bit.Infrastructure.EntityFramework.Vault.Models; using Bit.Infrastructure.EntityFramework.Vault.Models;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure; using Microsoft.EntityFrameworkCore.Infrastructure;

View File

@ -23,6 +23,7 @@ using Bit.Core.Auth.UserFeatures;
using Bit.Core.Billing.Services; using Bit.Core.Billing.Services;
using Bit.Core.Billing.Services.Implementations; using Bit.Core.Billing.Services.Implementations;
using Bit.Core.Billing.TrialInitiation; using Bit.Core.Billing.TrialInitiation;
using Bit.Core.Dirt.Reports.ReportFeatures;
using Bit.Core.Entities; using Bit.Core.Entities;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.HostedServices; using Bit.Core.HostedServices;
@ -43,7 +44,6 @@ using Bit.Core.Services;
using Bit.Core.Settings; using Bit.Core.Settings;
using Bit.Core.Tokens; using Bit.Core.Tokens;
using Bit.Core.Tools.ImportFeatures; using Bit.Core.Tools.ImportFeatures;
using Bit.Core.Tools.ReportFeatures;
using Bit.Core.Tools.SendFeatures; using Bit.Core.Tools.SendFeatures;
using Bit.Core.Tools.Services; using Bit.Core.Tools.Services;
using Bit.Core.Utilities; using Bit.Core.Utilities;

View File

@ -1,15 +1,16 @@
using AutoFixture; using AutoFixture;
using Bit.Api.Tools.Controllers; using Bit.Api.Dirt.Controllers;
using Bit.Api.Dirt.Models;
using Bit.Core.Context; using Bit.Core.Context;
using Bit.Core.Dirt.Reports.ReportFeatures.Interfaces;
using Bit.Core.Dirt.Reports.ReportFeatures.Requests;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Tools.ReportFeatures.Interfaces;
using Bit.Core.Tools.ReportFeatures.Requests;
using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture;
using Bit.Test.Common.AutoFixture.Attributes; using Bit.Test.Common.AutoFixture.Attributes;
using NSubstitute; using NSubstitute;
using Xunit; using Xunit;
namespace Bit.Api.Test.Tools.Controllers; namespace Bit.Api.Test.Dirt;
[ControllerCustomize(typeof(ReportsController))] [ControllerCustomize(typeof(ReportsController))]
@ -54,7 +55,7 @@ public class ReportsControllerTests
sutProvider.GetDependency<ICurrentContext>().AccessReports(Arg.Any<Guid>()).Returns(true); sutProvider.GetDependency<ICurrentContext>().AccessReports(Arg.Any<Guid>()).Returns(true);
// Act // Act
var request = new Api.Tools.Models.PasswordHealthReportApplicationModel var request = new PasswordHealthReportApplicationModel
{ {
OrganizationId = Guid.NewGuid(), OrganizationId = Guid.NewGuid(),
Url = "https://example.com", Url = "https://example.com",
@ -77,7 +78,7 @@ public class ReportsControllerTests
// Act // Act
var fixture = new Fixture(); var fixture = new Fixture();
var request = fixture.CreateMany<Api.Tools.Models.PasswordHealthReportApplicationModel>(2); var request = fixture.CreateMany<PasswordHealthReportApplicationModel>(2);
await sutProvider.Sut.AddPasswordHealthReportApplications(request); await sutProvider.Sut.AddPasswordHealthReportApplications(request);
// Assert // Assert
@ -93,7 +94,7 @@ public class ReportsControllerTests
sutProvider.GetDependency<ICurrentContext>().AccessReports(Arg.Any<Guid>()).Returns(false); sutProvider.GetDependency<ICurrentContext>().AccessReports(Arg.Any<Guid>()).Returns(false);
// Act // Act
var request = new Api.Tools.Models.PasswordHealthReportApplicationModel var request = new PasswordHealthReportApplicationModel
{ {
OrganizationId = Guid.NewGuid(), OrganizationId = Guid.NewGuid(),
Url = "https://example.com", Url = "https://example.com",
@ -114,7 +115,7 @@ public class ReportsControllerTests
// Act // Act
var fixture = new Fixture(); var fixture = new Fixture();
var request = fixture.Create<Api.Tools.Models.PasswordHealthReportApplicationModel>(); var request = fixture.Create<PasswordHealthReportApplicationModel>();
await Assert.ThrowsAsync<NotFoundException>(async () => await Assert.ThrowsAsync<NotFoundException>(async () =>
await sutProvider.Sut.AddPasswordHealthReportApplication(request)); await sutProvider.Sut.AddPasswordHealthReportApplication(request));

View File

@ -1,17 +1,17 @@
using AutoFixture; using AutoFixture;
using Bit.Core.AdminConsole.Entities; using Bit.Core.AdminConsole.Entities;
using Bit.Core.Dirt.Reports.Entities;
using Bit.Core.Dirt.Reports.ReportFeatures;
using Bit.Core.Dirt.Reports.ReportFeatures.Requests;
using Bit.Core.Dirt.Reports.Repositories;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Repositories; using Bit.Core.Repositories;
using Bit.Core.Tools.Entities;
using Bit.Core.Tools.ReportFeatures;
using Bit.Core.Tools.ReportFeatures.Requests;
using Bit.Core.Tools.Repositories;
using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture;
using Bit.Test.Common.AutoFixture.Attributes; using Bit.Test.Common.AutoFixture.Attributes;
using NSubstitute; using NSubstitute;
using Xunit; using Xunit;
namespace Bit.Core.Test.Tools.ReportFeatures; namespace Bit.Core.Test.Dirt.ReportFeatures;
[SutProviderCustomize] [SutProviderCustomize]
public class AddPasswordHealthReportApplicationCommandTests public class AddPasswordHealthReportApplicationCommandTests

View File

@ -1,15 +1,15 @@
using AutoFixture; using AutoFixture;
using Bit.Core.Dirt.Reports.Entities;
using Bit.Core.Dirt.Reports.ReportFeatures;
using Bit.Core.Dirt.Reports.ReportFeatures.Requests;
using Bit.Core.Dirt.Reports.Repositories;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Tools.Entities;
using Bit.Core.Tools.ReportFeatures;
using Bit.Core.Tools.ReportFeatures.Requests;
using Bit.Core.Tools.Repositories;
using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture;
using Bit.Test.Common.AutoFixture.Attributes; using Bit.Test.Common.AutoFixture.Attributes;
using NSubstitute; using NSubstitute;
using Xunit; using Xunit;
namespace Bit.Core.Test.Tools.ReportFeatures; namespace Bit.Core.Test.Dirt.ReportFeatures;
[SutProviderCustomize] [SutProviderCustomize]
public class DeletePasswordHealthReportApplicationCommandTests public class DeletePasswordHealthReportApplicationCommandTests

View File

@ -1,14 +1,14 @@
using AutoFixture; using AutoFixture;
using Bit.Core.Dirt.Reports.Entities;
using Bit.Core.Dirt.Reports.ReportFeatures;
using Bit.Core.Dirt.Reports.Repositories;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.Tools.Entities;
using Bit.Core.Tools.ReportFeatures;
using Bit.Core.Tools.Repositories;
using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture;
using Bit.Test.Common.AutoFixture.Attributes; using Bit.Test.Common.AutoFixture.Attributes;
using NSubstitute; using NSubstitute;
using Xunit; using Xunit;
namespace Bit.Core.Test.Tools.ReportFeatures; namespace Bit.Core.Test.Dirt.ReportFeatures;
[SutProviderCustomize] [SutProviderCustomize]
public class GetPasswordHealthReportApplicationQueryTests public class GetPasswordHealthReportApplicationQueryTests

View File

@ -7,10 +7,10 @@ using Bit.Infrastructure.EFIntegration.Test.Helpers;
using Bit.Infrastructure.EntityFramework.AdminConsole.Models; using Bit.Infrastructure.EntityFramework.AdminConsole.Models;
using Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider; using Bit.Infrastructure.EntityFramework.AdminConsole.Models.Provider;
using Bit.Infrastructure.EntityFramework.Auth.Models; using Bit.Infrastructure.EntityFramework.Auth.Models;
using Bit.Infrastructure.EntityFramework.Dirt.Models;
using Bit.Infrastructure.EntityFramework.Models; using Bit.Infrastructure.EntityFramework.Models;
using Bit.Infrastructure.EntityFramework.Platform; using Bit.Infrastructure.EntityFramework.Platform;
using Bit.Infrastructure.EntityFramework.Repositories; using Bit.Infrastructure.EntityFramework.Repositories;
using Bit.Infrastructure.EntityFramework.Tools.Models;
using Bit.Infrastructure.EntityFramework.Vault.Models; using Bit.Infrastructure.EntityFramework.Vault.Models;
using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;

View File

@ -1,9 +1,9 @@
using AutoFixture; using AutoFixture;
using AutoFixture.Kernel; using AutoFixture.Kernel;
using Bit.Core.Tools.Entities; using Bit.Core.Dirt.Reports.Entities;
using Bit.Infrastructure.EntityFramework.AdminConsole.Repositories; using Bit.Infrastructure.EntityFramework.AdminConsole.Repositories;
using Bit.Infrastructure.EntityFramework.Dirt.Repositories;
using Bit.Infrastructure.EntityFramework.Repositories; using Bit.Infrastructure.EntityFramework.Repositories;
using Bit.Infrastructure.EntityFramework.Tools.Repositories;
using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture;
using Bit.Test.Common.AutoFixture.Attributes; using Bit.Test.Common.AutoFixture.Attributes;

View File

@ -1,17 +1,16 @@
using AutoFixture; using AutoFixture;
using Bit.Core.AdminConsole.Entities; using Bit.Core.AdminConsole.Entities;
using Bit.Core.Dirt.Reports.Entities;
using Bit.Core.Dirt.Reports.Repositories;
using Bit.Core.Repositories; using Bit.Core.Repositories;
using Bit.Core.Test.AutoFixture.Attributes; using Bit.Core.Test.AutoFixture.Attributes;
using Bit.Core.Tools.Entities; using Bit.Infrastructure.Dapper.Dirt;
using Bit.Core.Tools.Repositories;
using Bit.Infrastructure.EFIntegration.Test.AutoFixture; using Bit.Infrastructure.EFIntegration.Test.AutoFixture;
using Xunit; using Xunit;
using EfRepo = Bit.Infrastructure.EntityFramework.Repositories; using EfRepo = Bit.Infrastructure.EntityFramework.Repositories;
using EfToolsRepo = Bit.Infrastructure.EntityFramework.Tools.Repositories;
using SqlAdminConsoleRepo = Bit.Infrastructure.Dapper.Tools.Repositories;
using SqlRepo = Bit.Infrastructure.Dapper.Repositories; using SqlRepo = Bit.Infrastructure.Dapper.Repositories;
namespace Bit.Infrastructure.EFIntegration.Test.Tools.Repositories; namespace Bit.Infrastructure.EFIntegration.Test.Dirt.Repositories;
public class PasswordHealthReportApplicationRepositoryTests public class PasswordHealthReportApplicationRepositoryTests
{ {
@ -19,9 +18,9 @@ public class PasswordHealthReportApplicationRepositoryTests
public async Task CreateAsync_Works_DataMatches( public async Task CreateAsync_Works_DataMatches(
PasswordHealthReportApplication passwordHealthReportApplication, PasswordHealthReportApplication passwordHealthReportApplication,
Organization organization, Organization organization,
List<EfToolsRepo.PasswordHealthReportApplicationRepository> suts, List<EntityFramework.Dirt.Repositories.PasswordHealthReportApplicationRepository> suts,
List<EfRepo.OrganizationRepository> efOrganizationRepos, List<EfRepo.OrganizationRepository> efOrganizationRepos,
SqlAdminConsoleRepo.PasswordHealthReportApplicationRepository sqlPasswordHealthReportApplicationRepo, PasswordHealthReportApplicationRepository sqlPasswordHealthReportApplicationRepo,
SqlRepo.OrganizationRepository sqlOrganizationRepo SqlRepo.OrganizationRepository sqlOrganizationRepo
) )
{ {
@ -53,7 +52,7 @@ public class PasswordHealthReportApplicationRepositoryTests
[CiSkippedTheory, EfPasswordHealthReportApplicationAutoData] [CiSkippedTheory, EfPasswordHealthReportApplicationAutoData]
public async Task RetrieveByOrganisation_Works( public async Task RetrieveByOrganisation_Works(
SqlAdminConsoleRepo.PasswordHealthReportApplicationRepository sqlPasswordHealthReportApplicationRepo, PasswordHealthReportApplicationRepository sqlPasswordHealthReportApplicationRepo,
SqlRepo.OrganizationRepository sqlOrganizationRepo) SqlRepo.OrganizationRepository sqlOrganizationRepo)
{ {
var (firstOrg, firstRecord) = await CreateSampleRecord(sqlOrganizationRepo, sqlPasswordHealthReportApplicationRepo); var (firstOrg, firstRecord) = await CreateSampleRecord(sqlOrganizationRepo, sqlPasswordHealthReportApplicationRepo);
@ -68,9 +67,9 @@ public class PasswordHealthReportApplicationRepositoryTests
[CiSkippedTheory, EfPasswordHealthReportApplicationAutoData] [CiSkippedTheory, EfPasswordHealthReportApplicationAutoData]
public async Task ReplaceQuery_Works( public async Task ReplaceQuery_Works(
List<EfToolsRepo.PasswordHealthReportApplicationRepository> suts, List<EntityFramework.Dirt.Repositories.PasswordHealthReportApplicationRepository> suts,
List<EfRepo.OrganizationRepository> efOrganizationRepos, List<EfRepo.OrganizationRepository> efOrganizationRepos,
SqlAdminConsoleRepo.PasswordHealthReportApplicationRepository sqlPasswordHealthReportApplicationRepo, PasswordHealthReportApplicationRepository sqlPasswordHealthReportApplicationRepo,
SqlRepo.OrganizationRepository sqlOrganizationRepo) SqlRepo.OrganizationRepository sqlOrganizationRepo)
{ {
var (org, pwdRecord) = await CreateSampleRecord(sqlOrganizationRepo, sqlPasswordHealthReportApplicationRepo); var (org, pwdRecord) = await CreateSampleRecord(sqlOrganizationRepo, sqlPasswordHealthReportApplicationRepo);
@ -127,9 +126,9 @@ public class PasswordHealthReportApplicationRepositoryTests
[CiSkippedTheory, EfPasswordHealthReportApplicationAutoData] [CiSkippedTheory, EfPasswordHealthReportApplicationAutoData]
public async Task Upsert_Works( public async Task Upsert_Works(
List<EfToolsRepo.PasswordHealthReportApplicationRepository> suts, List<EntityFramework.Dirt.Repositories.PasswordHealthReportApplicationRepository> suts,
List<EfRepo.OrganizationRepository> efOrganizationRepos, List<EfRepo.OrganizationRepository> efOrganizationRepos,
SqlAdminConsoleRepo.PasswordHealthReportApplicationRepository sqlPasswordHealthReportApplicationRepo, PasswordHealthReportApplicationRepository sqlPasswordHealthReportApplicationRepo,
SqlRepo.OrganizationRepository sqlOrganizationRepo) SqlRepo.OrganizationRepository sqlOrganizationRepo)
{ {
var fixture = new Fixture(); var fixture = new Fixture();
@ -204,9 +203,9 @@ public class PasswordHealthReportApplicationRepositoryTests
[CiSkippedTheory, EfPasswordHealthReportApplicationAutoData] [CiSkippedTheory, EfPasswordHealthReportApplicationAutoData]
public async Task Delete_Works( public async Task Delete_Works(
List<EfToolsRepo.PasswordHealthReportApplicationRepository> suts, List<EntityFramework.Dirt.Repositories.PasswordHealthReportApplicationRepository> suts,
List<EfRepo.OrganizationRepository> efOrganizationRepos, List<EfRepo.OrganizationRepository> efOrganizationRepos,
SqlAdminConsoleRepo.PasswordHealthReportApplicationRepository sqlPasswordHealthReportApplicationRepo, PasswordHealthReportApplicationRepository sqlPasswordHealthReportApplicationRepo,
SqlRepo.OrganizationRepository sqlOrganizationRepo) SqlRepo.OrganizationRepository sqlOrganizationRepo)
{ {
var fixture = new Fixture(); var fixture = new Fixture();