2022-06-30 01:46:41 +02:00
using System.Text.Json ;
2022-01-11 10:40:51 +01:00
using Bit.Core.Entities ;
using Bit.Core.Entities.Provider ;
2021-09-27 22:54:28 +02:00
using Bit.Core.Enums ;
using Bit.Core.Models.Data ;
Postgres & MySql Support For Self-Hosted Installations (#1386)
* EF Database Support Init (#1221)
* scaffolding for ef support
* deleted old postgres repos
* added tables to oncreate
* updated all the things to .NET 5
* Addition to #1221: Migrated DockerFiles from dotnet/3.1 to 5.0 (#1223)
* Migrated DockerFiles from dotnet/3.1 to 5.0
* Migrated SSO/Dockerfile from dotnet 3.1 to 5.0
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* EFDatabaseSupport: Updated links and description in README.md and SETUP.md (#1232)
* Updated requirements in README.md
* Updated link to documentation of app-secrets
* upgraded dotnet version to 5.0
* Ef database support implementation examples (#1265)
* mostly finished testing the user repo
* finished testing user repo
* finished org, user, ssoconfig, and ssouser ef implementations
* removed unused prop
* fixed a sql file
* fixed a spacing issue
* fixed a spacing issue
* removed extra database creation
* refactoring
* MsSql => SqlServer
* refactoring
* code review fixes
* build fix
* code review
* continued attempts to fix the the build
* skipped another test
* finished all create test
* initial pass at several repos
* continued building out repos
* initial pass at several repos
* initial pass at device repo
* initial pass at collection repo
* initial run of all Entity Framework implementations
* signup, signin, create/edit ciphers works
* sync working
* all web vault pages seem to load with 100% 200s
* bulkcopy, folders, and favorites
* group and collection management
* sso, groups, emergency access, send
* get basic creates matching on all repos
* got everything building again post merge
* removed some IDE config files
* cleanup
* no more notimplemented methods in the cipher repo
* no more not implementeds everywhere
* cleaned up schema/navigation properties and fixed tests
* removed a sql comment that was written in c# style
* fixed build issues from merge
* removed unsupported db providers
* formatting
* code review refactors
* naming cleanup for queries
* added provider methods
* cipher repo cleanup
* implemented several missing procedures from the EF implementation surround account revision dates, keys, and storage
* fixed the build
* added a null check
* consolidated some cipher repo methods
* formatting fix
* cleaned up indentation of queries
* removed .idea file
* generated postgres migrations
* added mysql migrations
* formatting
* Bug Fixes & Formatting
* Formatting
* fixed a bug with bulk import when using MySql
* code review fixes
* fixed the build
* implemented new methods
* formatting
* fixed the build
* cleaned up select statements in ef queries
* formatting
* formatting
* formatting
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2021-07-08 18:35:48 +02:00
using Bit.Core.Repositories ;
using Bit.Core.Test.AutoFixture.Attributes ;
2022-08-29 15:40:59 +02:00
using Bit.Infrastructure.EFIntegration.Test.AutoFixture ;
using Bit.Infrastructure.EFIntegration.Test.Repositories.EqualityComparers ;
Postgres & MySql Support For Self-Hosted Installations (#1386)
* EF Database Support Init (#1221)
* scaffolding for ef support
* deleted old postgres repos
* added tables to oncreate
* updated all the things to .NET 5
* Addition to #1221: Migrated DockerFiles from dotnet/3.1 to 5.0 (#1223)
* Migrated DockerFiles from dotnet/3.1 to 5.0
* Migrated SSO/Dockerfile from dotnet 3.1 to 5.0
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* EFDatabaseSupport: Updated links and description in README.md and SETUP.md (#1232)
* Updated requirements in README.md
* Updated link to documentation of app-secrets
* upgraded dotnet version to 5.0
* Ef database support implementation examples (#1265)
* mostly finished testing the user repo
* finished testing user repo
* finished org, user, ssoconfig, and ssouser ef implementations
* removed unused prop
* fixed a sql file
* fixed a spacing issue
* fixed a spacing issue
* removed extra database creation
* refactoring
* MsSql => SqlServer
* refactoring
* code review fixes
* build fix
* code review
* continued attempts to fix the the build
* skipped another test
* finished all create test
* initial pass at several repos
* continued building out repos
* initial pass at several repos
* initial pass at device repo
* initial pass at collection repo
* initial run of all Entity Framework implementations
* signup, signin, create/edit ciphers works
* sync working
* all web vault pages seem to load with 100% 200s
* bulkcopy, folders, and favorites
* group and collection management
* sso, groups, emergency access, send
* get basic creates matching on all repos
* got everything building again post merge
* removed some IDE config files
* cleanup
* no more notimplemented methods in the cipher repo
* no more not implementeds everywhere
* cleaned up schema/navigation properties and fixed tests
* removed a sql comment that was written in c# style
* fixed build issues from merge
* removed unsupported db providers
* formatting
* code review refactors
* naming cleanup for queries
* added provider methods
* cipher repo cleanup
* implemented several missing procedures from the EF implementation surround account revision dates, keys, and storage
* fixed the build
* added a null check
* consolidated some cipher repo methods
* formatting fix
* cleaned up indentation of queries
* removed .idea file
* generated postgres migrations
* added mysql migrations
* formatting
* Bug Fixes & Formatting
* Formatting
* fixed a bug with bulk import when using MySql
* code review fixes
* fixed the build
* implemented new methods
* formatting
* fixed the build
* cleaned up select statements in ef queries
* formatting
* formatting
* formatting
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2021-07-08 18:35:48 +02:00
using Xunit ;
2022-01-11 10:40:51 +01:00
using EfRepo = Bit . Infrastructure . EntityFramework . Repositories ;
using Policy = Bit . Core . Entities . Policy ;
using SqlRepo = Bit . Infrastructure . Dapper . Repositories ;
Postgres & MySql Support For Self-Hosted Installations (#1386)
* EF Database Support Init (#1221)
* scaffolding for ef support
* deleted old postgres repos
* added tables to oncreate
* updated all the things to .NET 5
* Addition to #1221: Migrated DockerFiles from dotnet/3.1 to 5.0 (#1223)
* Migrated DockerFiles from dotnet/3.1 to 5.0
* Migrated SSO/Dockerfile from dotnet 3.1 to 5.0
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* EFDatabaseSupport: Updated links and description in README.md and SETUP.md (#1232)
* Updated requirements in README.md
* Updated link to documentation of app-secrets
* upgraded dotnet version to 5.0
* Ef database support implementation examples (#1265)
* mostly finished testing the user repo
* finished testing user repo
* finished org, user, ssoconfig, and ssouser ef implementations
* removed unused prop
* fixed a sql file
* fixed a spacing issue
* fixed a spacing issue
* removed extra database creation
* refactoring
* MsSql => SqlServer
* refactoring
* code review fixes
* build fix
* code review
* continued attempts to fix the the build
* skipped another test
* finished all create test
* initial pass at several repos
* continued building out repos
* initial pass at several repos
* initial pass at device repo
* initial pass at collection repo
* initial run of all Entity Framework implementations
* signup, signin, create/edit ciphers works
* sync working
* all web vault pages seem to load with 100% 200s
* bulkcopy, folders, and favorites
* group and collection management
* sso, groups, emergency access, send
* get basic creates matching on all repos
* got everything building again post merge
* removed some IDE config files
* cleanup
* no more notimplemented methods in the cipher repo
* no more not implementeds everywhere
* cleaned up schema/navigation properties and fixed tests
* removed a sql comment that was written in c# style
* fixed build issues from merge
* removed unsupported db providers
* formatting
* code review refactors
* naming cleanup for queries
* added provider methods
* cipher repo cleanup
* implemented several missing procedures from the EF implementation surround account revision dates, keys, and storage
* fixed the build
* added a null check
* consolidated some cipher repo methods
* formatting fix
* cleaned up indentation of queries
* removed .idea file
* generated postgres migrations
* added mysql migrations
* formatting
* Bug Fixes & Formatting
* Formatting
* fixed a bug with bulk import when using MySql
* code review fixes
* fixed the build
* implemented new methods
* formatting
* fixed the build
* cleaned up select statements in ef queries
* formatting
* formatting
* formatting
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2021-07-08 18:35:48 +02:00
2022-08-29 15:40:59 +02:00
namespace Bit.Infrastructure.EFIntegration.Test.Repositories ;
2022-08-29 22:06:55 +02:00
2022-08-29 15:40:59 +02:00
public class PolicyRepositoryTests
Postgres & MySql Support For Self-Hosted Installations (#1386)
* EF Database Support Init (#1221)
* scaffolding for ef support
* deleted old postgres repos
* added tables to oncreate
* updated all the things to .NET 5
* Addition to #1221: Migrated DockerFiles from dotnet/3.1 to 5.0 (#1223)
* Migrated DockerFiles from dotnet/3.1 to 5.0
* Migrated SSO/Dockerfile from dotnet 3.1 to 5.0
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* EFDatabaseSupport: Updated links and description in README.md and SETUP.md (#1232)
* Updated requirements in README.md
* Updated link to documentation of app-secrets
* upgraded dotnet version to 5.0
* Ef database support implementation examples (#1265)
* mostly finished testing the user repo
* finished testing user repo
* finished org, user, ssoconfig, and ssouser ef implementations
* removed unused prop
* fixed a sql file
* fixed a spacing issue
* fixed a spacing issue
* removed extra database creation
* refactoring
* MsSql => SqlServer
* refactoring
* code review fixes
* build fix
* code review
* continued attempts to fix the the build
* skipped another test
* finished all create test
* initial pass at several repos
* continued building out repos
* initial pass at several repos
* initial pass at device repo
* initial pass at collection repo
* initial run of all Entity Framework implementations
* signup, signin, create/edit ciphers works
* sync working
* all web vault pages seem to load with 100% 200s
* bulkcopy, folders, and favorites
* group and collection management
* sso, groups, emergency access, send
* get basic creates matching on all repos
* got everything building again post merge
* removed some IDE config files
* cleanup
* no more notimplemented methods in the cipher repo
* no more not implementeds everywhere
* cleaned up schema/navigation properties and fixed tests
* removed a sql comment that was written in c# style
* fixed build issues from merge
* removed unsupported db providers
* formatting
* code review refactors
* naming cleanup for queries
* added provider methods
* cipher repo cleanup
* implemented several missing procedures from the EF implementation surround account revision dates, keys, and storage
* fixed the build
* added a null check
* consolidated some cipher repo methods
* formatting fix
* cleaned up indentation of queries
* removed .idea file
* generated postgres migrations
* added mysql migrations
* formatting
* Bug Fixes & Formatting
* Formatting
* fixed a bug with bulk import when using MySql
* code review fixes
* fixed the build
* implemented new methods
* formatting
* fixed the build
* cleaned up select statements in ef queries
* formatting
* formatting
* formatting
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2021-07-08 18:35:48 +02:00
{
[CiSkippedTheory, EfPolicyAutoData]
public async void CreateAsync_Works_DataMatches (
Policy policy ,
Organization organization ,
PolicyCompare equalityComparer ,
List < EfRepo . PolicyRepository > suts ,
List < EfRepo . OrganizationRepository > efOrganizationRepos ,
SqlRepo . PolicyRepository sqlPolicyRepo ,
SqlRepo . OrganizationRepository sqlOrganizationRepo
2022-08-29 22:06:55 +02:00
)
Postgres & MySql Support For Self-Hosted Installations (#1386)
* EF Database Support Init (#1221)
* scaffolding for ef support
* deleted old postgres repos
* added tables to oncreate
* updated all the things to .NET 5
* Addition to #1221: Migrated DockerFiles from dotnet/3.1 to 5.0 (#1223)
* Migrated DockerFiles from dotnet/3.1 to 5.0
* Migrated SSO/Dockerfile from dotnet 3.1 to 5.0
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* EFDatabaseSupport: Updated links and description in README.md and SETUP.md (#1232)
* Updated requirements in README.md
* Updated link to documentation of app-secrets
* upgraded dotnet version to 5.0
* Ef database support implementation examples (#1265)
* mostly finished testing the user repo
* finished testing user repo
* finished org, user, ssoconfig, and ssouser ef implementations
* removed unused prop
* fixed a sql file
* fixed a spacing issue
* fixed a spacing issue
* removed extra database creation
* refactoring
* MsSql => SqlServer
* refactoring
* code review fixes
* build fix
* code review
* continued attempts to fix the the build
* skipped another test
* finished all create test
* initial pass at several repos
* continued building out repos
* initial pass at several repos
* initial pass at device repo
* initial pass at collection repo
* initial run of all Entity Framework implementations
* signup, signin, create/edit ciphers works
* sync working
* all web vault pages seem to load with 100% 200s
* bulkcopy, folders, and favorites
* group and collection management
* sso, groups, emergency access, send
* get basic creates matching on all repos
* got everything building again post merge
* removed some IDE config files
* cleanup
* no more notimplemented methods in the cipher repo
* no more not implementeds everywhere
* cleaned up schema/navigation properties and fixed tests
* removed a sql comment that was written in c# style
* fixed build issues from merge
* removed unsupported db providers
* formatting
* code review refactors
* naming cleanup for queries
* added provider methods
* cipher repo cleanup
* implemented several missing procedures from the EF implementation surround account revision dates, keys, and storage
* fixed the build
* added a null check
* consolidated some cipher repo methods
* formatting fix
* cleaned up indentation of queries
* removed .idea file
* generated postgres migrations
* added mysql migrations
* formatting
* Bug Fixes & Formatting
* Formatting
* fixed a bug with bulk import when using MySql
* code review fixes
* fixed the build
* implemented new methods
* formatting
* fixed the build
* cleaned up select statements in ef queries
* formatting
* formatting
* formatting
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2021-07-08 18:35:48 +02:00
{
var savedPolicys = new List < Policy > ( ) ;
foreach ( var sut in suts )
{
var i = suts . IndexOf ( sut ) ;
var efOrganization = await efOrganizationRepos [ i ] . CreateAsync ( organization ) ;
sut . ClearChangeTracking ( ) ;
policy . OrganizationId = efOrganization . Id ;
var postEfPolicy = await sut . CreateAsync ( policy ) ;
sut . ClearChangeTracking ( ) ;
var savedPolicy = await sut . GetByIdAsync ( postEfPolicy . Id ) ;
savedPolicys . Add ( savedPolicy ) ;
2021-09-27 22:54:28 +02:00
}
2022-08-29 20:53:16 +02:00
2021-09-27 22:54:28 +02:00
var sqlOrganization = await sqlOrganizationRepo . CreateAsync ( organization ) ;
2022-08-29 20:53:16 +02:00
2021-09-27 22:54:28 +02:00
policy . OrganizationId = sqlOrganization . Id ;
var sqlPolicy = await sqlPolicyRepo . CreateAsync ( policy ) ;
var savedSqlPolicy = await sqlPolicyRepo . GetByIdAsync ( sqlPolicy . Id ) ;
savedPolicys . Add ( savedSqlPolicy ) ;
2022-08-29 20:53:16 +02:00
2022-01-11 10:40:51 +01:00
var distinctItems = savedPolicys . Distinct ( equalityComparer ) ;
Assert . True ( ! distinctItems . Skip ( 1 ) . Any ( ) ) ;
2022-08-29 21:53:48 +02:00
}
2022-08-29 22:06:55 +02:00
2021-09-27 22:54:28 +02:00
[CiSkippedTheory]
[EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, false, OrganizationUserStatusType.Confirmed, false, true, true, false)] // Ordinary user
[EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, false, OrganizationUserStatusType.Invited, true, true, true, false)] // Invited user
2021-11-02 22:08:13 +01:00
[EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.Owner, false, OrganizationUserStatusType.Confirmed, false, true, true, false)] // Owner
[EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.Admin, false, OrganizationUserStatusType.Confirmed, false, true, true, false)] // Admin
[EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, true, OrganizationUserStatusType.Confirmed, false, true, true, false)] // canManagePolicies
[EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, false, OrganizationUserStatusType.Confirmed, false, true, true, true)] // Provider
[EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, false, OrganizationUserStatusType.Confirmed, false, false, true, false)] // Policy disabled
2021-09-27 22:54:28 +02:00
[EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, false, OrganizationUserStatusType.Confirmed, false, true, false, false)] // No policy of Type
2021-11-02 22:08:13 +01:00
[EfPolicyApplicableToUserInlineAutoData(OrganizationUserType.User, false, OrganizationUserStatusType.Invited, false, true, true, false)] // User not minStatus
2022-08-29 22:06:55 +02:00
2021-09-27 22:54:28 +02:00
public async void GetManyByTypeApplicableToUser_Works_DataMatches (
// Inline data
OrganizationUserType userType ,
bool canManagePolicies ,
OrganizationUserStatusType orgUserStatus ,
2021-11-02 22:08:13 +01:00
bool includeInvited ,
2021-09-27 22:54:28 +02:00
bool policyEnabled ,
bool policySameType ,
bool isProvider ,
2022-08-29 22:06:55 +02:00
2021-09-27 22:54:28 +02:00
// Auto data - models
2022-01-11 10:40:51 +01:00
Policy policy ,
User user ,
Organization organization ,
OrganizationUser orgUser ,
Provider provider ,
2021-09-27 22:54:28 +02:00
ProviderOrganization providerOrganization ,
2022-01-11 10:40:51 +01:00
ProviderUser providerUser ,
2021-09-27 22:54:28 +02:00
PolicyCompareIncludingOrganization equalityComparer ,
2022-08-29 22:06:55 +02:00
2021-09-27 22:54:28 +02:00
// Auto data - EF repos
List < EfRepo . PolicyRepository > suts ,
List < EfRepo . UserRepository > efUserRepository ,
List < EfRepo . OrganizationRepository > efOrganizationRepository ,
List < EfRepo . OrganizationUserRepository > efOrganizationUserRepository ,
List < EfRepo . ProviderRepository > efProviderRepository ,
List < EfRepo . ProviderOrganizationRepository > efProviderOrganizationRepository ,
List < EfRepo . ProviderUserRepository > efProviderUserRepository ,
2022-08-29 22:06:55 +02:00
2021-09-27 22:54:28 +02:00
// Auto data - SQL repos
SqlRepo . PolicyRepository sqlPolicyRepo ,
SqlRepo . UserRepository sqlUserRepo ,
SqlRepo . OrganizationRepository sqlOrganizationRepo ,
SqlRepo . ProviderRepository sqlProviderRepo ,
SqlRepo . OrganizationUserRepository sqlOrganizationUserRepo ,
SqlRepo . ProviderOrganizationRepository sqlProviderOrganizationRepo ,
SqlRepo . ProviderUserRepository sqlProviderUserRepo
2022-08-29 22:06:55 +02:00
)
{
2021-09-27 22:54:28 +02:00
// Combine EF and SQL repos into one list per type
var policyRepos = suts . ToList < IPolicyRepository > ( ) ;
policyRepos . Add ( sqlPolicyRepo ) ;
var userRepos = efUserRepository . ToList < IUserRepository > ( ) ;
userRepos . Add ( sqlUserRepo ) ;
var orgRepos = efOrganizationRepository . ToList < IOrganizationRepository > ( ) ;
orgRepos . Add ( sqlOrganizationRepo ) ;
var orgUserRepos = efOrganizationUserRepository . ToList < IOrganizationUserRepository > ( ) ;
orgUserRepos . Add ( sqlOrganizationUserRepo ) ;
var providerRepos = efProviderRepository . ToList < IProviderRepository > ( ) ;
providerRepos . Add ( sqlProviderRepo ) ;
var providerOrgRepos = efProviderOrganizationRepository . ToList < IProviderOrganizationRepository > ( ) ;
providerOrgRepos . Add ( sqlProviderOrganizationRepo ) ;
var providerUserRepos = efProviderUserRepository . ToList < IProviderUserRepository > ( ) ;
providerUserRepos . Add ( sqlProviderUserRepo ) ;
2022-08-29 22:06:55 +02:00
2021-09-27 22:54:28 +02:00
// Arrange data
var savedPolicyType = PolicyType . SingleOrg ;
var queriedPolicyType = policySameType ? savedPolicyType : PolicyType . DisableSend ;
2022-08-29 22:06:55 +02:00
2021-09-27 22:54:28 +02:00
orgUser . Type = userType ;
orgUser . Status = orgUserStatus ;
var permissionsData = new Permissions { ManagePolicies = canManagePolicies } ;
orgUser . Permissions = JsonSerializer . Serialize ( permissionsData , new JsonSerializerOptions
2022-08-29 22:06:55 +02:00
{
2021-09-27 22:54:28 +02:00
PropertyNamingPolicy = JsonNamingPolicy . CamelCase ,
2022-08-29 22:06:55 +02:00
} ) ;
2021-09-27 22:54:28 +02:00
policy . Enabled = policyEnabled ;
policy . Type = savedPolicyType ;
2022-08-29 22:06:55 +02:00
2022-01-11 10:40:51 +01:00
var results = new List < Policy > ( ) ;
2021-09-27 22:54:28 +02:00
foreach ( var policyRepo in policyRepos )
{
var i = policyRepos . IndexOf ( policyRepo ) ;
2022-08-29 22:06:55 +02:00
2021-09-27 22:54:28 +02:00
// Seed database
var savedUser = await userRepos [ i ] . CreateAsync ( user ) ;
var savedOrg = await orgRepos [ i ] . CreateAsync ( organization ) ;
2022-08-29 22:06:55 +02:00
2021-09-27 22:54:28 +02:00
// Invited orgUsers are not associated with an account yet, so they are identified by Email not UserId
if ( orgUserStatus = = OrganizationUserStatusType . Invited )
2022-08-29 22:06:55 +02:00
{
2021-09-27 22:54:28 +02:00
orgUser . Email = savedUser . Email ;
orgUser . UserId = null ;
}
else
{
orgUser . UserId = savedUser . Id ;
}
orgUser . OrganizationId = savedOrg . Id ;
await orgUserRepos [ i ] . CreateAsync ( orgUser ) ;
2022-01-11 10:40:51 +01:00
if ( isProvider )
2022-08-29 22:06:55 +02:00
{
2022-01-11 10:40:51 +01:00
var savedProvider = await providerRepos [ i ] . CreateAsync ( provider ) ;
2021-09-27 22:54:28 +02:00
providerOrganization . OrganizationId = savedOrg . Id ;
providerOrganization . ProviderId = savedProvider . Id ;
await providerOrgRepos [ i ] . CreateAsync ( providerOrganization ) ;
2022-08-29 22:06:55 +02:00
2021-09-27 22:54:28 +02:00
providerUser . UserId = savedUser . Id ;
providerUser . ProviderId = savedProvider . Id ;
await providerUserRepos [ i ] . CreateAsync ( providerUser ) ;
2022-08-29 22:06:55 +02:00
}
2021-09-27 22:54:28 +02:00
policy . OrganizationId = savedOrg . Id ;
await policyRepo . CreateAsync ( policy ) ;
if ( suts . Contains ( policyRepo ) )
{
( policyRepo as EfRepo . BaseEntityFrameworkRepository ) . ClearChangeTracking ( ) ;
}
var minStatus = includeInvited ? OrganizationUserStatusType . Invited : OrganizationUserStatusType . Accepted ;
2021-12-16 15:35:09 +01:00
2022-08-29 22:06:55 +02:00
// Act
2021-09-27 22:54:28 +02:00
var result = await policyRepo . GetManyByTypeApplicableToUserIdAsync ( savedUser . Id , queriedPolicyType , minStatus ) ;
results . Add ( result . FirstOrDefault ( ) ) ;
}
2022-08-29 22:06:55 +02:00
2021-09-27 22:54:28 +02:00
// Assert
var distinctItems = results . Distinct ( equalityComparer ) ;
2022-08-29 22:06:55 +02:00
2021-09-27 22:54:28 +02:00
Assert . True ( results . All ( r = > r = = null ) | |
! distinctItems . Skip ( 1 ) . Any ( ) ) ;
Postgres & MySql Support For Self-Hosted Installations (#1386)
* EF Database Support Init (#1221)
* scaffolding for ef support
* deleted old postgres repos
* added tables to oncreate
* updated all the things to .NET 5
* Addition to #1221: Migrated DockerFiles from dotnet/3.1 to 5.0 (#1223)
* Migrated DockerFiles from dotnet/3.1 to 5.0
* Migrated SSO/Dockerfile from dotnet 3.1 to 5.0
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
* EFDatabaseSupport: Updated links and description in README.md and SETUP.md (#1232)
* Updated requirements in README.md
* Updated link to documentation of app-secrets
* upgraded dotnet version to 5.0
* Ef database support implementation examples (#1265)
* mostly finished testing the user repo
* finished testing user repo
* finished org, user, ssoconfig, and ssouser ef implementations
* removed unused prop
* fixed a sql file
* fixed a spacing issue
* fixed a spacing issue
* removed extra database creation
* refactoring
* MsSql => SqlServer
* refactoring
* code review fixes
* build fix
* code review
* continued attempts to fix the the build
* skipped another test
* finished all create test
* initial pass at several repos
* continued building out repos
* initial pass at several repos
* initial pass at device repo
* initial pass at collection repo
* initial run of all Entity Framework implementations
* signup, signin, create/edit ciphers works
* sync working
* all web vault pages seem to load with 100% 200s
* bulkcopy, folders, and favorites
* group and collection management
* sso, groups, emergency access, send
* get basic creates matching on all repos
* got everything building again post merge
* removed some IDE config files
* cleanup
* no more notimplemented methods in the cipher repo
* no more not implementeds everywhere
* cleaned up schema/navigation properties and fixed tests
* removed a sql comment that was written in c# style
* fixed build issues from merge
* removed unsupported db providers
* formatting
* code review refactors
* naming cleanup for queries
* added provider methods
* cipher repo cleanup
* implemented several missing procedures from the EF implementation surround account revision dates, keys, and storage
* fixed the build
* added a null check
* consolidated some cipher repo methods
* formatting fix
* cleaned up indentation of queries
* removed .idea file
* generated postgres migrations
* added mysql migrations
* formatting
* Bug Fixes & Formatting
* Formatting
* fixed a bug with bulk import when using MySql
* code review fixes
* fixed the build
* implemented new methods
* formatting
* fixed the build
* cleaned up select statements in ef queries
* formatting
* formatting
* formatting
Co-authored-by: Daniel James Smith <djsmith85@users.noreply.github.com>
2021-07-08 18:35:48 +02:00
}
}