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

Split out repositories to Infrastructure.Dapper / EntityFramework (#1759)

This commit is contained in:
Oscar Hinton
2022-01-11 10:40:51 +01:00
committed by GitHub
parent e2c6fc81f4
commit e4a10aae27
536 changed files with 1629 additions and 1589 deletions

View File

@ -1,7 +1,7 @@
using System;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Models.Table;
using Bit.Core.Utilities;
namespace Bit.Core.Context

View File

@ -1,9 +1,8 @@
using System;
using Bit.Core.Entities.Provider;
using Bit.Core.Enums;
using Bit.Core.Enums.Provider;
using Bit.Core.Models.Data;
using Bit.Core.Models.Table;
using Bit.Core.Models.Table.Provider;
using Bit.Core.Utilities;
namespace Bit.Core.Context

View File

@ -3,10 +3,10 @@ using System.Collections.Generic;
using System.Linq;
using System.Security.Claims;
using System.Threading.Tasks;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Enums.Provider;
using Bit.Core.Models.Data;
using Bit.Core.Models.Table;
using Bit.Core.Repositories;
using Bit.Core.Settings;
using Bit.Core.Utilities;

View File

@ -2,8 +2,8 @@
using System.Collections.Generic;
using System.Security.Claims;
using System.Threading.Tasks;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Table;
using Bit.Core.Repositories;
using Bit.Core.Settings;
using Microsoft.AspNetCore.Http;

View File

@ -19,7 +19,6 @@
</ItemGroup>
<ItemGroup>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="8.0.1" />
<PackageReference Include="AWSSDK.SimpleEmail" Version="3.3.101.182" />
<PackageReference Include="AWSSDK.SQS" Version="3.3.103.15" />
<PackageReference Include="Azure.Extensions.AspNetCore.DataProtection.Blobs" Version="1.2.1" />
@ -29,25 +28,21 @@
<PackageReference Include="Fido2.AspNet" Version="1.1.0" />
<PackageReference Include="Handlebars.Net" Version="1.10.1" />
<PackageReference Include="IdentityServer4.AccessTokenValidation" Version="3.0.1" />
<PackageReference Include="linq2db.EntityFrameworkCore" Version="5.2.1" />
<PackageReference Include="MailKit" Version="2.8.0" />
<PackageReference Include="Microsoft.AspNetCore.Authentication.JwtBearer" Version="5.0.9" />
<PackageReference Include="Microsoft.Azure.Cosmos.Table" Version="1.0.7" />
<PackageReference Include="Microsoft.Azure.NotificationHubs" Version="3.3.0" />
<PackageReference Include="Microsoft.Azure.ServiceBus" Version="5.1.3" />
<PackageReference Include="Microsoft.EntityFrameworkCore.Relational" Version="5.0.9" />
<PackageReference Include="Microsoft.Azure.Storage.Blob" Version="11.1.7" />
<PackageReference Include="Microsoft.Extensions.Configuration.EnvironmentVariables" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.UserSecrets" Version="5.0.0" />
<PackageReference Include="Microsoft.Extensions.Identity.Stores" Version="5.0.9" />
<PackageReference Include="Npgsql.EntityFrameworkCore.PostgreSQL" Version="5.0.2" />
<PackageReference Include="Pomelo.EntityFrameworkCore.MySql" Version="5.0.0" />
<PackageReference Include="Quartz" Version="3.1.0" />
<PackageReference Include="Serilog.AspNetCore" Version="3.4.0" />
<PackageReference Include="Serilog.Extensions.Logging" Version="3.0.1" />
<PackageReference Include="Serilog.Extensions.Logging.File" Version="2.0.0" />
<PackageReference Include="Sentry.Serilog" Version="2.1.5" />
<PackageReference Include="IdentityServer4" Version="4.0.4" />
<PackageReference Include="Dapper" Version="2.0.35" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
<PackageReference Include="Serilog.Sinks.AzureCosmosDB" Version="1.0.0" />
<PackageReference Include="Serilog.Sinks.SyslogMessages" Version="1.0.5" />
@ -58,7 +53,6 @@
<PackageReference Include="U2F.Core" Version="1.0.4" />
<PackageReference Include="Otp.NET" Version="1.2.2" />
<PackageReference Include="YubicoDotNetClient" Version="1.2.0" />
<PackageReference Include="System.Data.SqlClient" Version="4.8.2" />
<PackageReference Include="Microsoft.Extensions.Caching.Redis" Version="2.2.0" />
</ItemGroup>

View File

@ -4,7 +4,7 @@ using Bit.Core.Models.Data;
using Bit.Core.Utilities;
using Newtonsoft.Json;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class Cipher : ITableObject<Guid>, ICloneable
{
@ -18,9 +18,9 @@ namespace Bit.Core.Models.Table
public string Favorites { get; set; }
public string Folders { get; set; }
public string Attachments { get; set; }
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
public DateTime? DeletedDate { get; internal set; }
public DateTime CreationDate { get; set; } = DateTime.UtcNow;
public DateTime RevisionDate { get; set; } = DateTime.UtcNow;
public DateTime? DeletedDate { get; set; }
public Enums.CipherRepromptType? Reprompt { get; set; }
public void SetNewId()

View File

@ -2,7 +2,7 @@
using System.ComponentModel.DataAnnotations;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class Collection : ITableObject<Guid>
{
@ -11,8 +11,8 @@ namespace Bit.Core.Models.Table
public string Name { get; set; }
[MaxLength(300)]
public string ExternalId { get; set; }
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
public DateTime CreationDate { get; set; } = DateTime.UtcNow;
public DateTime RevisionDate { get; set; } = DateTime.UtcNow;
public void SetNewId()
{

View File

@ -1,6 +1,6 @@
using System;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class CollectionCipher
{

View File

@ -1,7 +1,6 @@
using System;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class CollectionGroup
{

View File

@ -1,7 +1,6 @@
using System;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class CollectionUser
{

View File

@ -2,7 +2,7 @@
using System.ComponentModel.DataAnnotations;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class Device : ITableObject<Guid>
{

View File

@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
using Bit.Core.Enums;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class EmergencyAccess : ITableObject<Guid>
{
@ -16,10 +16,10 @@ namespace Bit.Core.Models.Table
public EmergencyAccessType Type { get; set; }
public EmergencyAccessStatusType Status { get; set; }
public int WaitTimeDays { get; set; }
public DateTime? RecoveryInitiatedDate { get; internal set; }
public DateTime? LastNotificationDate { get; internal set; }
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
public DateTime? RecoveryInitiatedDate { get; set; }
public DateTime? LastNotificationDate { get; set; }
public DateTime CreationDate { get; set; } = DateTime.UtcNow;
public DateTime RevisionDate { get; set; } = DateTime.UtcNow;
public void SetNewId()
{

View File

@ -4,7 +4,7 @@ using Bit.Core.Enums;
using Bit.Core.Models.Data;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class Event : ITableObject<Guid>, IEvent
{

View File

@ -1,7 +1,7 @@
using System;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class Folder : ITableObject<Guid>
{

View File

@ -1,7 +1,7 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class Grant
{

View File

@ -1,8 +1,9 @@
using System;
using System.ComponentModel.DataAnnotations;
using Bit.Core.Models;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class Group : ITableObject<Guid>, IExternal
{

View File

@ -1,7 +1,6 @@
using System;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class GroupUser
{

View File

@ -1,6 +1,6 @@
using System;
namespace Bit.Core.Models
namespace Bit.Core.Entities
{
public interface IReferenceable
{

View File

@ -1,6 +1,6 @@
using System;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public interface IRevisable
{

View File

@ -1,4 +1,4 @@
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public interface IStorable
{

View File

@ -1,4 +1,4 @@
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public interface IStorableSubscriber : IStorable, ISubscriber
{ }

View File

@ -1,8 +1,7 @@
using System;
using Bit.Core.Enums;
using Bit.Core.Services;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public interface ISubscriber
{

View File

@ -1,6 +1,6 @@
using System;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public interface ITableObject<T> where T : IEquatable<T>
{

View File

@ -2,7 +2,7 @@
using System.ComponentModel.DataAnnotations;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class Installation : ITableObject<Guid>
{

View File

@ -3,10 +3,11 @@ using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using Bit.Core.Enums;
using Bit.Core.Models;
using Bit.Core.Utilities;
using Newtonsoft.Json;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class Organization : ITableObject<Guid>, ISubscriber, IStorable, IStorableSubscriber, IRevisable, IReferenceable
{
@ -65,8 +66,8 @@ namespace Bit.Core.Models.Table
public string PrivateKey { get; set; }
public string TwoFactorProviders { get; set; }
public DateTime? ExpirationDate { get; set; }
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
public DateTime CreationDate { get; set; } = DateTime.UtcNow;
public DateTime RevisionDate { get; set; } = DateTime.UtcNow;
public int? MaxAutoscaleSeats { get; set; } = null;
public DateTime? OwnersNotifiedOfAutoscaling { get; set; } = null;

View File

@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
using Bit.Core.Enums;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class OrganizationSponsorship : ITableObject<Guid>
{

View File

@ -1,9 +1,10 @@
using System;
using System.ComponentModel.DataAnnotations;
using Bit.Core.Enums;
using Bit.Core.Models;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class OrganizationUser : ITableObject<Guid>, IExternal
{

View File

@ -2,7 +2,7 @@
using Bit.Core.Enums;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class Policy : ITableObject<Guid>
{

View File

@ -2,7 +2,7 @@
using Bit.Core.Enums.Provider;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table.Provider
namespace Bit.Core.Entities.Provider
{
public class Provider : ITableObject<Guid>
{

View File

@ -1,7 +1,7 @@
using System;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table.Provider
namespace Bit.Core.Entities.Provider
{
public class ProviderOrganization : ITableObject<Guid>
{

View File

@ -2,7 +2,7 @@
using Bit.Core.Enums.Provider;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table.Provider
namespace Bit.Core.Entities.Provider
{
public class ProviderUser : ITableObject<Guid>
{

View File

@ -1,4 +1,4 @@
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
/// <summary>
/// This class is not used. It is implemented to make the Identity provider happy.

View File

@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
using Bit.Core.Enums;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class Send : ITableObject<Guid>
{

View File

@ -1,7 +1,7 @@
using System;
using Bit.Core.Models.Data;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class SsoConfig : ITableObject<long>
{

View File

@ -1,7 +1,7 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class SsoUser : ITableObject<long>
{

View File

@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class TaxRate : ITableObject<string>
{

View File

@ -3,7 +3,7 @@ using System.ComponentModel.DataAnnotations;
using Bit.Core.Enums;
using Bit.Core.Utilities;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class Transaction : ITableObject<Guid>
{

View File

@ -1,7 +1,7 @@
using System;
using System.ComponentModel.DataAnnotations;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class U2f : ITableObject<int>
{

View File

@ -2,11 +2,12 @@
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using Bit.Core.Enums;
using Bit.Core.Models;
using Bit.Core.Utilities;
using Microsoft.AspNetCore.Identity;
using Newtonsoft.Json;
namespace Bit.Core.Models.Table
namespace Bit.Core.Entities
{
public class User : ITableObject<Guid>, ISubscriber, IStorable, IStorableSubscriber, IRevisable, ITwoFactorProvidersUser, IReferenceable
{
@ -33,7 +34,7 @@ namespace Bit.Core.Models.Table
public string TwoFactorRecoveryCode { get; set; }
public string EquivalentDomains { get; set; }
public string ExcludedGlobalEquivalentDomains { get; set; }
public DateTime AccountRevisionDate { get; internal set; } = DateTime.UtcNow;
public DateTime AccountRevisionDate { get; set; } = DateTime.UtcNow;
public string Key { get; set; }
public string PublicKey { get; set; }
public string PrivateKey { get; set; }
@ -55,8 +56,8 @@ namespace Bit.Core.Models.Table
public string ApiKey { get; set; }
public KdfType Kdf { get; set; } = KdfType.PBKDF2_SHA256;
public int KdfIterations { get; set; } = 5000;
public DateTime CreationDate { get; internal set; } = DateTime.UtcNow;
public DateTime RevisionDate { get; internal set; } = DateTime.UtcNow;
public DateTime CreationDate { get; set; } = DateTime.UtcNow;
public DateTime RevisionDate { get; set; } = DateTime.UtcNow;
public bool ForcePasswordReset { get; set; }
public bool UsesKeyConnector { get; set; }

View File

@ -1,7 +1,7 @@
using System;
using System.Threading.Tasks;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Table;
using Bit.Core.Services;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;

View File

@ -1,8 +1,8 @@
using System;
using System.Threading.Tasks;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models;
using Bit.Core.Models.Table;
using Bit.Core.Services;
using Bit.Core.Settings;
using Bit.Core.Utilities.Duo;

View File

@ -1,8 +1,8 @@
using System;
using System.Threading.Tasks;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models;
using Bit.Core.Models.Table;
using Bit.Core.Services;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.DependencyInjection;

View File

@ -1,5 +1,5 @@
using System.Threading.Tasks;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
namespace Bit.Core.Identity
{

View File

@ -1,7 +1,7 @@
using System.Threading.Tasks;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models;
using Bit.Core.Models.Table;
using Bit.Core.Settings;
using Bit.Core.Utilities.Duo;

View File

@ -1,7 +1,7 @@
using System;
using System.Threading;
using System.Threading.Tasks;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
using Microsoft.AspNetCore.Identity;
namespace Bit.Core.Identity

View File

@ -1,4 +1,4 @@
using Bit.Core.Models.Table;
using Bit.Core.Entities;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Logging;

View File

@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models;
using Bit.Core.Models.Table;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Settings;

View File

@ -2,7 +2,7 @@
using System.Threading;
using System.Threading.Tasks;
using Bit.Core.Context;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Settings;

View File

@ -2,9 +2,9 @@
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models;
using Bit.Core.Models.Table;
using Bit.Core.Services;
using Bit.Core.Settings;
using Bit.Core.Utilities;

View File

@ -1,8 +1,8 @@
using System;
using System.Linq;
using System.Threading.Tasks;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Table;
using Bit.Core.Services;
using Bit.Core.Settings;
using Microsoft.AspNetCore.Identity;

View File

@ -7,12 +7,12 @@ using System.Security.Claims;
using System.Text.Json;
using System.Threading.Tasks;
using Bit.Core.Context;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Identity;
using Bit.Core.Models;
using Bit.Core.Models.Api;
using Bit.Core.Models.Data;
using Bit.Core.Models.Table;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Settings;

View File

@ -5,9 +5,9 @@ using System.Security.Claims;
using System.Text.Json;
using System.Threading.Tasks;
using Bit.Core.Context;
using Bit.Core.Entities;
using Bit.Core.Identity;
using Bit.Core.Models.Data;
using Bit.Core.Models.Table;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Settings;

View File

@ -4,6 +4,7 @@ using System.Threading.Tasks;
using Bit.Core.Repositories;
using IdentityServer4.Models;
using IdentityServer4.Stores;
using Grant = Bit.Core.Entities.Grant;
namespace Bit.Core.IdentityServer
{
@ -53,9 +54,9 @@ namespace Bit.Core.IdentityServer
await _grantRepository.SaveAsync(grant);
}
private Models.Table.Grant ToGrant(PersistedGrant pGrant)
private Grant ToGrant(PersistedGrant pGrant)
{
return new Models.Table.Grant
return new Grant
{
Key = pGrant.Key,
Type = pGrant.Type,
@ -70,7 +71,7 @@ namespace Bit.Core.IdentityServer
};
}
private PersistedGrant ToPersistedGrant(Models.Table.Grant grant)
private PersistedGrant ToPersistedGrant(Grant grant)
{
return new PersistedGrant
{

View File

@ -2,8 +2,8 @@
using System.Security.Claims;
using System.Threading.Tasks;
using Bit.Core.Context;
using Bit.Core.Entities;
using Bit.Core.Identity;
using Bit.Core.Models.Table;
using Bit.Core.Repositories;
using Bit.Core.Services;
using Bit.Core.Settings;

View File

@ -1,8 +1,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Table;
using Bit.Core.Utilities;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

View File

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Table;
using Stripe;
namespace Bit.Core.Models.Business

View File

@ -1,5 +1,5 @@
using System.Collections.Generic;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
namespace Bit.Core.Models.Business
{

View File

@ -4,8 +4,8 @@ using System.Reflection;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Table;
using Bit.Core.Services;
using Bit.Core.Settings;
using Newtonsoft.Json;

View File

@ -1,5 +1,5 @@
using Bit.Core.Enums;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
using Bit.Core.Enums;
namespace Bit.Core.Models.Business
{

View File

@ -1,4 +1,5 @@
using System;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Newtonsoft.Json;
using Newtonsoft.Json.Converters;

View File

@ -1,5 +1,5 @@
using System.Collections.Generic;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
using Stripe;
namespace Bit.Core.Models.Business

View File

@ -1,6 +1,6 @@
using System.Collections.Generic;
using System.Linq;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
using Stripe;
namespace Bit.Core.Models.Business

View File

@ -1,6 +1,6 @@
using System;
using System.Text.Json.Serialization;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
namespace Bit.Core.Models.Business.Tokenables
{

View File

@ -1,6 +1,6 @@
using System;
using System.Text.Json.Serialization;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
using Bit.Core.Tokens;
namespace Bit.Core.Models.Business.Tokenables

View File

@ -4,7 +4,7 @@ using System.Reflection;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
using System.Text;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
using Bit.Core.Services;
using Newtonsoft.Json;

View File

@ -1,4 +1,4 @@
using Bit.Core.Models.Table;
using Bit.Core.Entities;
namespace Bit.Core.Models.Data
{

View File

@ -1,4 +1,4 @@
using Bit.Core.Models.Table;
using Bit.Core.Entities;
namespace Core.Models.Data
{

View File

@ -1,4 +1,4 @@
using Bit.Core.Models.Table;
using Bit.Core.Entities;
namespace Bit.Core.Models.Data
{

View File

@ -1,4 +1,4 @@
using Bit.Core.Models.Table;
using Bit.Core.Entities;
namespace Bit.Core.Models.Data
{

View File

@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Table;
using Newtonsoft.Json;
namespace Bit.Core.Models.Data

View File

@ -1,5 +1,5 @@
using System.Collections.Generic;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
using Core.Models.Data;
namespace Bit.Core.Models.Data

View File

@ -1,5 +1,5 @@
using System.Data;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
namespace Bit.Core.Models.Data
{

View File

@ -1,5 +1,5 @@
using System;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
namespace Bit.Core.Models.Data
{

View File

@ -1,6 +1,6 @@
using System;
using Bit.Core.Entities;
using Bit.Core.Enums;
using Bit.Core.Models.Table;
namespace Bit.Core.Models.Data
{

View File

@ -1,5 +1,5 @@
using System.Data;
using Bit.Core.Models.Table;
using Bit.Core.Entities;
namespace Bit.Core.Models.Data
{

View File

@ -1,6 +1,5 @@
using System;
using Bit.Core.Models.Table;
using Bit.Core.Models.Table.Provider;
using Bit.Core.Entities.Provider;
namespace Bit.Core.Models.Data
{

View File

@ -1,21 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class Cipher : Table.Cipher
{
public virtual User User { get; set; }
public virtual Organization Organization { get; set; }
public virtual ICollection<CollectionCipher> CollectionCiphers { get; set; }
}
public class CipherMapperProfile : Profile
{
public CipherMapperProfile()
{
CreateMap<Table.Cipher, Cipher>().ReverseMap();
}
}
}

View File

@ -1,22 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class Collection : Table.Collection
{
public virtual Organization Organization { get; set; }
public virtual ICollection<CollectionUser> CollectionUsers { get; set; }
public virtual ICollection<CollectionCipher> CollectionCiphers { get; set; }
public virtual ICollection<CollectionGroup> CollectionGroups { get; set; }
}
public class CollectionMapperProfile : Profile
{
public CollectionMapperProfile()
{
CreateMap<Table.Collection, Collection>().ReverseMap();
}
}
}

View File

@ -1,20 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class CollectionCipher : Table.CollectionCipher
{
public virtual Cipher Cipher { get; set; }
public virtual Collection Collection { get; set; }
}
public class CollectionCipherMapperProfile : Profile
{
public CollectionCipherMapperProfile()
{
CreateMap<Table.CollectionCipher, CollectionCipher>().ReverseMap();
}
}
}

View File

@ -1,18 +0,0 @@
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class CollectionGroup : Table.CollectionGroup
{
public virtual Collection Collection { get; set; }
public virtual Group Group { get; set; }
}
public class CollectionGroupMapperProfile : Profile
{
public CollectionGroupMapperProfile()
{
CreateMap<Table.CollectionGroup, CollectionGroup>().ReverseMap();
}
}
}

View File

@ -1,18 +0,0 @@
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class CollectionUser : Table.CollectionUser
{
public virtual Collection Collection { get; set; }
public virtual OrganizationUser OrganizationUser { get; set; }
}
public class CollectionUserMapperProfile : Profile
{
public CollectionUserMapperProfile()
{
CreateMap<Table.CollectionUser, CollectionUser>().ReverseMap();
}
}
}

View File

@ -1,19 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class Device : Table.Device
{
public virtual User User { get; set; }
}
public class DeviceMapperProfile : Profile
{
public DeviceMapperProfile()
{
CreateMap<Table.Device, Device>().ReverseMap();
}
}
}

View File

@ -1,20 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class EmergencyAccess : Table.EmergencyAccess
{
public virtual User Grantee { get; set; }
public virtual User Grantor { get; set; }
}
public class EmergencyAccessMapperProfile : Profile
{
public EmergencyAccessMapperProfile()
{
CreateMap<Table.EmergencyAccess, EmergencyAccess>().ReverseMap();
}
}
}

View File

@ -1,16 +0,0 @@
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class Event : Table.Event
{
}
public class EventMapperProfile : Profile
{
public EventMapperProfile()
{
CreateMap<Table.Event, Event>().ReverseMap();
}
}
}

View File

@ -1,19 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class Folder : Table.Folder
{
public virtual User User { get; set; }
}
public class FolderMapperProfile : Profile
{
public FolderMapperProfile()
{
CreateMap<Table.Folder, Folder>().ReverseMap();
}
}
}

View File

@ -1,18 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class Grant : Table.Grant
{
}
public class GrantMapperProfile : Profile
{
public GrantMapperProfile()
{
CreateMap<Table.Grant, Grant>().ReverseMap();
}
}
}

View File

@ -1,20 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class Group : Table.Group
{
public virtual Organization Organization { get; set; }
public virtual ICollection<GroupUser> GroupUsers { get; set; }
}
public class GroupMapperProfile : Profile
{
public GroupMapperProfile()
{
CreateMap<Table.Group, Group>().ReverseMap();
}
}
}

View File

@ -1,21 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class GroupUser : Table.GroupUser
{
public virtual Group Group { get; set; }
public virtual OrganizationUser OrganizationUser { get; set; }
}
public class GroupUserMapperProfile : Profile
{
public GroupUserMapperProfile()
{
CreateMap<Table.GroupUser, GroupUser>().ReverseMap();
}
}
}

View File

@ -1,18 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class Installation : Table.Installation
{
}
public class InstallationMapperProfile : Profile
{
public InstallationMapperProfile()
{
CreateMap<Table.Installation, Installation>().ReverseMap();
}
}
}

View File

@ -1,24 +0,0 @@
using System.Collections.Generic;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class Organization : Table.Organization
{
public virtual ICollection<Cipher> Ciphers { get; set; }
public virtual ICollection<OrganizationUser> OrganizationUsers { get; set; }
public virtual ICollection<Group> Groups { get; set; }
public virtual ICollection<Policy> Policies { get; set; }
public virtual ICollection<SsoConfig> SsoConfigs { get; set; }
public virtual ICollection<SsoUser> SsoUsers { get; set; }
public virtual ICollection<Transaction> Transactions { get; set; }
}
public class OrganizationMapperProfile : Profile
{
public OrganizationMapperProfile()
{
CreateMap<Table.Organization, Organization>().ReverseMap();
}
}
}

View File

@ -1,20 +0,0 @@
using System.Collections.Generic;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class OrganizationSponsorship : Table.OrganizationSponsorship
{
public virtual Installation Installation { get; set; }
public virtual Organization SponsoringOrganization { get; set; }
public virtual Organization SponsoredOrganization { get; set; }
}
public class OrganizationSponsorshipMapperProfile : Profile
{
public OrganizationSponsorshipMapperProfile()
{
CreateMap<Table.OrganizationSponsorship, OrganizationSponsorship>().ReverseMap();
}
}
}

View File

@ -1,21 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class OrganizationUser : Table.OrganizationUser
{
public virtual Organization Organization { get; set; }
public virtual User User { get; set; }
public virtual ICollection<CollectionUser> CollectionUsers { get; set; }
}
public class OrganizationUserMapperProfile : Profile
{
public OrganizationUserMapperProfile()
{
CreateMap<Table.OrganizationUser, OrganizationUser>().ReverseMap();
}
}
}

View File

@ -1,19 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class Policy : Table.Policy
{
public virtual Organization Organization { get; set; }
}
public class PolicyMapperProfile : Profile
{
public PolicyMapperProfile()
{
CreateMap<Table.Policy, Policy>().ReverseMap();
}
}
}

View File

@ -1,16 +0,0 @@
using AutoMapper;
namespace Bit.Core.Models.EntityFramework.Provider
{
public class Provider : Table.Provider.Provider
{
}
public class ProviderMapperProfile : Profile
{
public ProviderMapperProfile()
{
CreateMap<Table.Provider.Provider, Provider>().ReverseMap();
}
}
}

View File

@ -1,18 +0,0 @@
using AutoMapper;
namespace Bit.Core.Models.EntityFramework.Provider
{
public class ProviderOrganization : Table.Provider.ProviderOrganization
{
public virtual Provider Provider { get; set; }
public virtual Organization Organization { get; set; }
}
public class ProviderOrganizationMapperProfile : Profile
{
public ProviderOrganizationMapperProfile()
{
CreateMap<Table.Provider.ProviderOrganization, ProviderOrganization>().ReverseMap();
}
}
}

View File

@ -1,18 +0,0 @@
using AutoMapper;
namespace Bit.Core.Models.EntityFramework.Provider
{
public class ProviderUser : Table.Provider.ProviderUser
{
public virtual User User { get; set; }
public virtual Provider Provider { get; set; }
}
public class ProviderUserMapperProfile : Profile
{
public ProviderUserMapperProfile()
{
CreateMap<Table.Provider.ProviderUser, ProviderUser>().ReverseMap();
}
}
}

View File

@ -1,18 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class Role : Table.Role
{
}
public class RoleMapperProfile : Profile
{
public RoleMapperProfile()
{
CreateMap<Table.Role, Role>().ReverseMap();
}
}
}

View File

@ -1,20 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class Send : Table.Send
{
public virtual Organization Organization { get; set; }
public virtual User User { get; set; }
}
public class SendMapperProfile : Profile
{
public SendMapperProfile()
{
CreateMap<Table.Send, Send>().ReverseMap();
}
}
}

View File

@ -1,19 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class SsoConfig : Table.SsoConfig
{
public virtual Organization Organization { get; set; }
}
public class SsoConfigMapperProfile : Profile
{
public SsoConfigMapperProfile()
{
CreateMap<Table.SsoConfig, SsoConfig>().ReverseMap();
}
}
}

View File

@ -1,20 +0,0 @@
using System.Collections.Generic;
using System.Text.Json;
using AutoMapper;
namespace Bit.Core.Models.EntityFramework
{
public class SsoUser : Table.SsoUser
{
public virtual Organization Organization { get; set; }
public virtual User User { get; set; }
}
public class SsoUserMapperProfile : Profile
{
public SsoUserMapperProfile()
{
CreateMap<Table.SsoUser, SsoUser>().ReverseMap();
}
}
}

Some files were not shown because too many files have changed in this diff Show More