1
0
mirror of https://github.com/bitwarden/server synced 2025-12-24 20:23:21 +00:00

chore: move Installation and Push to platform's domain folders (#5085)

* chore: set up a `CODEOWNERS` space for platform

* chore: move sql objects for `Installation` to platform's domain

* chore: move `Installation` and `PushRelay` code to platform's domain
This commit is contained in:
Addison Beck
2025-01-06 12:10:53 -05:00
committed by GitHub
parent 217b86ba9e
commit cd7c4bf6ce
73 changed files with 152 additions and 93 deletions

View File

@@ -1,6 +1,6 @@
using AutoMapper;
using Bit.Infrastructure.EntityFramework.AdminConsole.Models;
using Bit.Infrastructure.EntityFramework.Models;
using Bit.Infrastructure.EntityFramework.Platform;
namespace Bit.Infrastructure.EntityFramework.Billing.Models;

View File

@@ -4,6 +4,7 @@ using Bit.Core.Billing.Repositories;
using Bit.Core.Enums;
using Bit.Core.KeyManagement.Repositories;
using Bit.Core.NotificationCenter.Repositories;
using Bit.Core.Platform.Installations;
using Bit.Core.Repositories;
using Bit.Core.SecretsManager.Repositories;
using Bit.Core.Tools.Repositories;
@@ -13,6 +14,7 @@ using Bit.Infrastructure.EntityFramework.Auth.Repositories;
using Bit.Infrastructure.EntityFramework.Billing.Repositories;
using Bit.Infrastructure.EntityFramework.KeyManagement.Repositories;
using Bit.Infrastructure.EntityFramework.NotificationCenter.Repositories;
using Bit.Infrastructure.EntityFramework.Platform;
using Bit.Infrastructure.EntityFramework.Repositories;
using Bit.Infrastructure.EntityFramework.SecretsManager.Repositories;
using Bit.Infrastructure.EntityFramework.Tools.Repositories;

View File

@@ -1,8 +1,9 @@
using AutoMapper;
using C = Bit.Core.Platform.Installations;
namespace Bit.Infrastructure.EntityFramework.Models;
namespace Bit.Infrastructure.EntityFramework.Platform;
public class Installation : Core.Entities.Installation
public class Installation : C.Installation
{
// Shadow property - to be introduced by https://bitwarden.atlassian.net/browse/PM-11129
// This isn't a value or entity used by self hosted servers, but it's
@@ -14,10 +15,10 @@ public class InstallationMapperProfile : Profile
{
public InstallationMapperProfile()
{
CreateMap<Core.Entities.Installation, Installation>()
CreateMap<C.Installation, Installation>()
// Shadow property - to be introduced by https://bitwarden.atlassian.net/browse/PM-11129
.ForMember(i => i.LastActivityDate, opt => opt.Ignore())
.ReverseMap();
CreateMap<Core.Entities.Installation, Installation>().ReverseMap();
CreateMap<C.Installation, Installation>().ReverseMap();
}
}

View File

@@ -0,0 +1,16 @@
using AutoMapper;
using Bit.Infrastructure.EntityFramework.Repositories;
using Microsoft.Extensions.DependencyInjection;
using C = Bit.Core.Platform.Installations;
using Ef = Bit.Infrastructure.EntityFramework.Platform;
#nullable enable
namespace Bit.Infrastructure.EntityFramework.Platform;
public class InstallationRepository : Repository<C.Installation, Ef.Installation, Guid>, C.IInstallationRepository
{
public InstallationRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper)
: base(serviceScopeFactory, mapper, (DatabaseContext context) => context.Installations)
{ }
}

View File

@@ -6,6 +6,7 @@ using Bit.Infrastructure.EntityFramework.Billing.Models;
using Bit.Infrastructure.EntityFramework.Converters;
using Bit.Infrastructure.EntityFramework.Models;
using Bit.Infrastructure.EntityFramework.NotificationCenter.Models;
using Bit.Infrastructure.EntityFramework.Platform;
using Bit.Infrastructure.EntityFramework.SecretsManager.Models;
using Bit.Infrastructure.EntityFramework.Tools.Models;
using Bit.Infrastructure.EntityFramework.Vault.Models;

View File

@@ -1,15 +0,0 @@
using AutoMapper;
using Bit.Core.Repositories;
using Bit.Infrastructure.EntityFramework.Models;
using Microsoft.Extensions.DependencyInjection;
#nullable enable
namespace Bit.Infrastructure.EntityFramework.Repositories;
public class InstallationRepository : Repository<Core.Entities.Installation, Installation, Guid>, IInstallationRepository
{
public InstallationRepository(IServiceScopeFactory serviceScopeFactory, IMapper mapper)
: base(serviceScopeFactory, mapper, (DatabaseContext context) => context.Installations)
{ }
}