Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weโ€™ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[AC-1722] Deprecate "Edit/Delete Assigned Collections" custom permissions #4604

Merged
merged 51 commits into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
acc8e58
Add SQL script to migrate custom users with specific permissions to Uโ€ฆ
r-tome Aug 7, 2024
631b3e8
Add MySQL migration to migrate custom users with specific permissionsโ€ฆ
r-tome Aug 7, 2024
85d8194
Add Postgres migration to migrate custom users with specific permissiโ€ฆ
r-tome Aug 8, 2024
e542df1
Add Sqlite migration to migrate custom users with specific permissionโ€ฆ
r-tome Aug 8, 2024
428bbf6
Update AutoFixture usage in tests to resolve creating ILogger mock inโ€ฆ
r-tome Aug 8, 2024
4a655e2
Update EF integration tests database contexts to use each respective โ€ฆ
r-tome Aug 8, 2024
6b6549d
Add RunMigration method to BaseEntityFrameworkRepository
r-tome Aug 8, 2024
7476f8b
Add FinalFlexibleCollectionsDataMigrationsTests
r-tome Aug 8, 2024
16bbe2c
Improve data migration efficiency by using OPENJSON instead of multipโ€ฆ
r-tome Aug 9, 2024
6622bac
Add batching to the sql data migrations
r-tome Aug 9, 2024
21bf13c
Update DbMigrator to run a specific script based on its name
r-tome Aug 9, 2024
31c35f7
Update DatabaseDataAttribute to be able to test a specific migration
r-tome Aug 9, 2024
a6bc8ed
Add reference to the migration projects to Infrastructure.Integrationโ€ฆ
r-tome Aug 9, 2024
118de3d
Add integration test to test the migration FinalFlexibleCollectionsDaโ€ฆ
r-tome Aug 9, 2024
a4529b3
Merge branch 'main' into ac/ac-1722/deprecate-custom-permissions-final
r-tome Aug 12, 2024
3bd0c30
Remove EFIntegration tests and remove RunMigration method from BaseEnโ€ฆ
r-tome Aug 12, 2024
0377f70
Add IMigrationTesterService and implementations for SQL and EF migratโ€ฆ
r-tome Aug 12, 2024
60d6c2f
Add FinalFlexibleCollectionsDataMigrationsTests and remove test from โ€ฆ
r-tome Aug 12, 2024
da608c7
Update sql data migration script based on performance feedback
r-tome Aug 12, 2024
9a13a42
Bump date on EF migration scripts
r-tome Aug 12, 2024
b797f97
Merge branch 'main' into ac/ac-1722/deprecate-custom-permissions-final
r-tome Aug 14, 2024
2321524
Merge branch 'main' into ac/ac-1722/deprecate-custom-permissions-final
r-tome Aug 20, 2024
f456cbe
Merge branch 'main' into ac/ac-1722/deprecate-custom-permissions-final
r-tome Aug 21, 2024
169205b
Add xmldoc comments to IMigrationTesterService and each implementation
r-tome Aug 21, 2024
482caae
Bump up the date on the EF migration scripts
r-tome Aug 21, 2024
e6d5f47
Bump up dates on EF migrations
r-tome Aug 21, 2024
5dfab78
Added tests to assert no unwanted changes are made to the permissionsโ€ฆ
r-tome Aug 21, 2024
19130ee
Revert changes made to DbMigrator and refactor SqlMigrationTesterServโ€ฆ
r-tome Aug 21, 2024
1c4f2c6
Add method description
r-tome Aug 21, 2024
b6e08d1
Fix test to assert no changes are made to custom user
r-tome Aug 21, 2024
f757bc7
Remove unnecessary COALESCE and SELECT CASE
r-tome Aug 21, 2024
7627276
Unident lines on SQL script
r-tome Aug 21, 2024
ce87a7c
Merge branch 'main' into ac/ac-1722/deprecate-custom-permissions-final
r-tome Aug 22, 2024
b747a86
Update DatabaseDataAttribute MigrationName property to be nullable
r-tome Aug 22, 2024
f317797
Fix null reference checks
r-tome Aug 22, 2024
8dfb946
Merge branch 'main' into ac/ac-1722/deprecate-custom-permissions-final
r-tome Aug 23, 2024
1d3eff2
Remove unnecessary COALESCE from Postgres script
r-tome Aug 23, 2024
7b6498b
Merge branch 'main' into ac/ac-1722/deprecate-custom-permissions-final
r-tome Aug 26, 2024
c8b02d7
Bump dates on migration scripts
r-tome Aug 26, 2024
40276a7
Bump up dates on EF migrations
r-tome Aug 26, 2024
7e666f4
Merge branch 'main' into ac/ac-1722/deprecate-custom-permissions-final
r-tome Aug 27, 2024
feaf2fa
Merge branch 'main' into ac/ac-1722/deprecate-custom-permissions-final
eliykat Aug 28, 2024
0f89e57
Add migration tests for handling null
eliykat Aug 28, 2024
0664584
Add test for non json values
eliykat Aug 28, 2024
01d3743
Merge branch 'main' into ac/ac-1722/deprecate-custom-permissions-final
r-tome Aug 28, 2024
cc426c2
Fix test
r-tome Aug 28, 2024
21b43bf
Remove migrations
r-tome Aug 28, 2024
39792ef
Recreate EF migrations
r-tome Aug 28, 2024
f2a8ccb
Update Postgres data migration script to check for valid JSON in Permโ€ฆ
r-tome Aug 28, 2024
2b5009a
Merge branch 'main' into ac/ac-1722/deprecate-custom-permissions-final
r-tome Sep 2, 2024
39bab60
Merge branch 'main' into ac/ac-1722/deprecate-custom-permissions-final
r-tome Sep 2, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public CustomAutoDataAttribute(params Type[] iCustomizationTypes) : this(iCustom

public CustomAutoDataAttribute(params ICustomization[] customizations) : base(() =>
{
var fixture = new Fixture();
var fixture = new Fixture().WithAutoNSubstitutions();
eliykat marked this conversation as resolved.
Show resolved Hide resolved
foreach (var customization in customizations)
{
fixture.Customize(customization);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
using Bit.Infrastructure.EntityFramework.Vault.Models;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
using NSubstitute;

namespace Bit.Infrastructure.EFIntegration.Test.AutoFixture;
Expand Down Expand Up @@ -91,6 +92,8 @@ public object Create(object request, ISpecimenContext context)
})
.CreateMapper()));

fixture.Customize<ILogger<T>>(x => x.FromFactory(() => Substitute.For<ILogger<T>>()));
eliykat marked this conversation as resolved.
Show resolved Hide resolved

var repo = fixture.Create<T>();
list.Add(repo);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,32 @@ static DatabaseOptionsFactory()
{
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
Options.Add(new DbContextOptionsBuilder<DatabaseContext>()
.UseNpgsql(globalSettings.PostgreSql.ConnectionString)
.UseNpgsql(globalSettings.PostgreSql.ConnectionString, npgsqlDbContextOptionsBuilder =>
{
npgsqlDbContextOptionsBuilder.MigrationsAssembly(nameof(PostgresMigrations));
})
.UseApplicationServiceProvider(services)
.Options);
}
if (!string.IsNullOrWhiteSpace(GlobalSettingsFactory.GlobalSettings.MySql?.ConnectionString))
{
var mySqlConnectionString = globalSettings.MySql.ConnectionString;
Options.Add(new DbContextOptionsBuilder<DatabaseContext>()
.UseMySql(mySqlConnectionString, ServerVersion.AutoDetect(mySqlConnectionString))
.UseMySql(mySqlConnectionString, ServerVersion.AutoDetect(mySqlConnectionString), mySqlDbContextOptionsBuilder =>
{
mySqlDbContextOptionsBuilder.MigrationsAssembly(nameof(MySqlMigrations));
})
.UseApplicationServiceProvider(services)
.Options);
}
if (!string.IsNullOrWhiteSpace(GlobalSettingsFactory.GlobalSettings.Sqlite?.ConnectionString))
{
var sqliteConnectionString = globalSettings.Sqlite.ConnectionString;
Options.Add(new DbContextOptionsBuilder<DatabaseContext>()
.UseSqlite(sqliteConnectionString, mySqlDbContextOptionsBuilder =>
{
mySqlDbContextOptionsBuilder.MigrationsAssembly(nameof(SqliteMigrations));
})
.UseApplicationServiceProvider(services)
.Options);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
<ItemGroup>
<ProjectReference Include="..\..\src\Infrastructure.Dapper\Infrastructure.Dapper.csproj" />
<ProjectReference Include="..\..\src\Infrastructure.EntityFramework\Infrastructure.EntityFramework.csproj" />
<ProjectReference Include="..\..\util\MySqlMigrations\MySqlMigrations.csproj" />
<ProjectReference Include="..\..\util\PostgresMigrations\PostgresMigrations.csproj" />
<ProjectReference Include="..\..\util\SqliteMigrations\SqliteMigrations.csproj" />
<ProjectReference Include="..\Common\Common.csproj" />
<ProjectReference Include="..\Core.Test\Core.Test.csproj" />
</ItemGroup>
Expand Down
Loading
Loading