diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e129ffb1e887..20bd4f3195e7 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -34,10 +34,15 @@ bitwarden_license/src/test/Scim.ScimTest @bitwarden/team-admin-console-dev # Billing Team **/*billing* @bitwarden/team-billing-dev -**/*subscription* @bitwarden/team-billing-dev -**/*stripe* @bitwarden/team-billing-dev -**/*paypal* @bitwarden/team-billing-dev -**/*braintree* @bitwarden/team-billing-dev **/*bitpay* @bitwarden/team-billing-dev +**/*braintree* @bitwarden/team-billing-dev **/*freshdesk* @bitwarden/team-billing-dev -**/*freshsales* @bitwarden/team-billing-dev \ No newline at end of file +**/*freshsales* @bitwarden/team-billing-dev +**/*paypal* @bitwarden/team-billing-dev +**/*stripe* @bitwarden/team-billing-dev +**/*subscription* @bitwarden/team-billing-dev +**/Billing @bitwarden/team-billing-dev + +# Multiple Owners +**/packages.lock.json +Directory.Build.props diff --git a/Directory.Build.props b/Directory.Build.props index 6820a03e3758..c915ffaaeac8 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ net6.0 - 2023.9.1 + 2023.10.1 Bit.$(MSBuildProjectName) true enable diff --git a/bitwarden_license/src/Commercial.Core/Providers/CreateProviderCommand.cs b/bitwarden_license/src/Commercial.Core/AdminConsole/Providers/CreateProviderCommand.cs similarity index 87% rename from bitwarden_license/src/Commercial.Core/Providers/CreateProviderCommand.cs rename to bitwarden_license/src/Commercial.Core/AdminConsole/Providers/CreateProviderCommand.cs index 36b6fe85c86e..738723a81989 100644 --- a/bitwarden_license/src/Commercial.Core/Providers/CreateProviderCommand.cs +++ b/bitwarden_license/src/Commercial.Core/AdminConsole/Providers/CreateProviderCommand.cs @@ -1,11 +1,12 @@ -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Providers.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Exceptions; -using Bit.Core.Providers.Interfaces; using Bit.Core.Repositories; -using Bit.Core.Services; -namespace Bit.Commercial.Core.Providers; +namespace Bit.Commercial.Core.AdminConsole.Providers; public class CreateProviderCommand : ICreateProviderCommand { diff --git a/bitwarden_license/src/Commercial.Core/Services/ProviderService.cs b/bitwarden_license/src/Commercial.Core/AdminConsole/Services/ProviderService.cs similarity index 98% rename from bitwarden_license/src/Commercial.Core/Services/ProviderService.cs rename to bitwarden_license/src/Commercial.Core/AdminConsole/Services/ProviderService.cs index d186eb6d4153..a03e92c3f012 100644 --- a/bitwarden_license/src/Commercial.Core/Services/ProviderService.cs +++ b/bitwarden_license/src/Commercial.Core/AdminConsole/Services/ProviderService.cs @@ -1,11 +1,13 @@ -using Bit.Core.Context; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Business.Provider; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; +using Bit.Core.Context; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Models.Business; -using Bit.Core.Models.Business.Provider; using Bit.Core.Models.Data; using Bit.Core.Repositories; using Bit.Core.Services; @@ -13,7 +15,7 @@ using Bit.Core.Utilities; using Microsoft.AspNetCore.DataProtection; -namespace Bit.Commercial.Core.Services; +namespace Bit.Commercial.Core.AdminConsole.Services; public class ProviderService : IProviderService { diff --git a/bitwarden_license/src/Commercial.Core/Utilities/ServiceCollectionExtensions.cs b/bitwarden_license/src/Commercial.Core/Utilities/ServiceCollectionExtensions.cs index b9d21915bf59..09788406de4d 100644 --- a/bitwarden_license/src/Commercial.Core/Utilities/ServiceCollectionExtensions.cs +++ b/bitwarden_license/src/Commercial.Core/Utilities/ServiceCollectionExtensions.cs @@ -1,7 +1,7 @@ -using Bit.Commercial.Core.Providers; -using Bit.Commercial.Core.Services; -using Bit.Core.Providers.Interfaces; -using Bit.Core.Services; +using Bit.Commercial.Core.AdminConsole.Providers; +using Bit.Commercial.Core.AdminConsole.Services; +using Bit.Core.AdminConsole.Providers.Interfaces; +using Bit.Core.AdminConsole.Services; using Microsoft.Extensions.DependencyInjection; namespace Bit.Commercial.Core.Utilities; diff --git a/bitwarden_license/src/Commercial.Infrastructure.EntityFramework/packages.lock.json b/bitwarden_license/src/Commercial.Infrastructure.EntityFramework/packages.lock.json index ca7a2c863276..c230392f018e 100644 --- a/bitwarden_license/src/Commercial.Infrastructure.EntityFramework/packages.lock.json +++ b/bitwarden_license/src/Commercial.Infrastructure.EntityFramework/packages.lock.json @@ -2628,7 +2628,7 @@ "type": "Project", "dependencies": { "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", - "Core": "[2023.9.0, )", + "Core": "[2023.10.1, )", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", diff --git a/bitwarden_license/src/Scim/Controllers/v2/UsersController.cs b/bitwarden_license/src/Scim/Controllers/v2/UsersController.cs index 22b8a22c8543..e760813054cd 100644 --- a/bitwarden_license/src/Scim/Controllers/v2/UsersController.cs +++ b/bitwarden_license/src/Scim/Controllers/v2/UsersController.cs @@ -1,6 +1,6 @@ -using Bit.Core.Enums; +using Bit.Core.AdminConsole.OrganizationFeatures.OrganizationUsers.Interfaces; +using Bit.Core.Enums; using Bit.Core.Exceptions; -using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Scim.Models; diff --git a/bitwarden_license/src/Scim/packages.lock.json b/bitwarden_license/src/Scim/packages.lock.json index 16a42f355d3f..722ede68b886 100644 --- a/bitwarden_license/src/Scim/packages.lock.json +++ b/bitwarden_license/src/Scim/packages.lock.json @@ -2631,7 +2631,7 @@ "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "[2023.9.0, )", + "Core": "[2023.10.1, )", "Dapper": "[2.0.123, )" } }, @@ -2639,7 +2639,7 @@ "type": "Project", "dependencies": { "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", - "Core": "[2023.9.0, )", + "Core": "[2023.10.1, )", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", @@ -2651,9 +2651,9 @@ "sharedweb": { "type": "Project", "dependencies": { - "Core": "[2023.9.0, )", - "Infrastructure.Dapper": "[2023.9.0, )", - "Infrastructure.EntityFramework": "[2023.9.0, )" + "Core": "[2023.10.1, )", + "Infrastructure.Dapper": "[2023.10.1, )", + "Infrastructure.EntityFramework": "[2023.10.1, )" } } } diff --git a/bitwarden_license/src/Sso/packages.lock.json b/bitwarden_license/src/Sso/packages.lock.json index ecccbaab16d0..59724fbae9be 100644 --- a/bitwarden_license/src/Sso/packages.lock.json +++ b/bitwarden_license/src/Sso/packages.lock.json @@ -2791,7 +2791,7 @@ "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "[2023.9.0, )", + "Core": "[2023.10.1, )", "Dapper": "[2.0.123, )" } }, @@ -2799,7 +2799,7 @@ "type": "Project", "dependencies": { "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", - "Core": "[2023.9.0, )", + "Core": "[2023.10.1, )", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", @@ -2811,9 +2811,9 @@ "sharedweb": { "type": "Project", "dependencies": { - "Core": "[2023.9.0, )", - "Infrastructure.Dapper": "[2023.9.0, )", - "Infrastructure.EntityFramework": "[2023.9.0, )" + "Core": "[2023.10.1, )", + "Infrastructure.Dapper": "[2023.10.1, )", + "Infrastructure.EntityFramework": "[2023.10.1, )" } } } diff --git a/bitwarden_license/test/Commercial.Core.Test/AutoFixture/ProviderUserFixtures.cs b/bitwarden_license/test/Commercial.Core.Test/AdminConsole/AutoFixture/ProviderUserFixtures.cs similarity index 83% rename from bitwarden_license/test/Commercial.Core.Test/AutoFixture/ProviderUserFixtures.cs rename to bitwarden_license/test/Commercial.Core.Test/AdminConsole/AutoFixture/ProviderUserFixtures.cs index 48f70c335066..fc47e80c8742 100644 --- a/bitwarden_license/test/Commercial.Core.Test/AutoFixture/ProviderUserFixtures.cs +++ b/bitwarden_license/test/Commercial.Core.Test/AdminConsole/AutoFixture/ProviderUserFixtures.cs @@ -1,9 +1,9 @@ using System.Reflection; using AutoFixture; using AutoFixture.Xunit2; -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Enums.Provider; -namespace Bit.Commercial.Core.Test.AutoFixture; +namespace Bit.Commercial.Core.Test.AdminConsole.AutoFixture; internal class ProviderUser : ICustomization { @@ -18,7 +18,7 @@ public ProviderUser(ProviderUserStatusType status, ProviderUserType type) public void Customize(IFixture fixture) { - fixture.Customize(composer => composer + fixture.Customize(composer => composer .With(o => o.Type, Type) .With(o => o.Status, Status)); } diff --git a/bitwarden_license/test/Commercial.Core.Test/ProviderFeatures/CreateProviderCommandTests.cs b/bitwarden_license/test/Commercial.Core.Test/AdminConsole/ProviderFeatures/CreateProviderCommandTests.cs similarity index 86% rename from bitwarden_license/test/Commercial.Core.Test/ProviderFeatures/CreateProviderCommandTests.cs rename to bitwarden_license/test/Commercial.Core.Test/AdminConsole/ProviderFeatures/CreateProviderCommandTests.cs index 721ed24d9c2a..399ed6ea1e1b 100644 --- a/bitwarden_license/test/Commercial.Core.Test/ProviderFeatures/CreateProviderCommandTests.cs +++ b/bitwarden_license/test/Commercial.Core.Test/AdminConsole/ProviderFeatures/CreateProviderCommandTests.cs @@ -1,16 +1,17 @@ -using Bit.Commercial.Core.Providers; +using Bit.Commercial.Core.AdminConsole.Providers; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Repositories; -using Bit.Core.Services; using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture.Attributes; using NSubstitute; using Xunit; -namespace Bit.Commercial.Core.Test.ProviderFeatures; +namespace Bit.Commercial.Core.Test.AdminConsole.ProviderFeatures; [SutProviderCustomize] public class CreateProviderCommandTests diff --git a/bitwarden_license/test/Commercial.Core.Test/Services/ProviderServiceTests.cs b/bitwarden_license/test/Commercial.Core.Test/AdminConsole/Services/ProviderServiceTests.cs similarity index 98% rename from bitwarden_license/test/Commercial.Core.Test/Services/ProviderServiceTests.cs rename to bitwarden_license/test/Commercial.Core.Test/AdminConsole/Services/ProviderServiceTests.cs index 2a6e68bfb422..01538003c6ee 100644 --- a/bitwarden_license/test/Commercial.Core.Test/Services/ProviderServiceTests.cs +++ b/bitwarden_license/test/Commercial.Core.Test/AdminConsole/Services/ProviderServiceTests.cs @@ -1,13 +1,14 @@ -using Bit.Commercial.Core.Services; -using Bit.Commercial.Core.Test.AutoFixture; +using Bit.Commercial.Core.AdminConsole.Services; +using Bit.Commercial.Core.Test.AdminConsole.AutoFixture; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Business.Provider; +using Bit.Core.AdminConsole.Repositories; using Bit.Core.Context; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Exceptions; using Bit.Core.Models.Business; -using Bit.Core.Models.Business.Provider; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Utilities; @@ -17,10 +18,10 @@ using NSubstitute; using NSubstitute.ReturnsExtensions; using Xunit; -using Provider = Bit.Core.Entities.Provider.Provider; -using ProviderUser = Bit.Core.Entities.Provider.ProviderUser; +using Provider = Bit.Core.AdminConsole.Entities.Provider.Provider; +using ProviderUser = Bit.Core.AdminConsole.Entities.Provider.ProviderUser; -namespace Bit.Commercial.Core.Test.Services; +namespace Bit.Commercial.Core.Test.AdminConsole.Services; [SutProviderCustomize] public class ProviderServiceTests diff --git a/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/Projects/MaxProjectsQueryTests.cs b/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/Projects/MaxProjectsQueryTests.cs index 79ffb421e1b3..58c944e8ebc0 100644 --- a/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/Projects/MaxProjectsQueryTests.cs +++ b/bitwarden_license/test/Commercial.Core.Test/SecretsManager/Queries/Projects/MaxProjectsQueryTests.cs @@ -30,29 +30,36 @@ await sutProvider.GetDependency().DidNotReceiveWithAnyArgs() [Theory] [BitAutoData(PlanType.FamiliesAnnually2019)] - [BitAutoData(PlanType.TeamsMonthly2019)] - [BitAutoData(PlanType.TeamsAnnually2019)] - [BitAutoData(PlanType.EnterpriseMonthly2019)] - [BitAutoData(PlanType.EnterpriseAnnually2019)] [BitAutoData(PlanType.Custom)] [BitAutoData(PlanType.FamiliesAnnually)] public async Task GetByOrgIdAsync_SmPlanIsNull_ThrowsBadRequest(PlanType planType, SutProvider sutProvider, Organization organization) { organization.PlanType = planType; - sutProvider.GetDependency().GetByIdAsync(organization.Id).Returns(organization); + sutProvider.GetDependency() + .GetByIdAsync(organization.Id) + .Returns(organization); await Assert.ThrowsAsync( async () => await sutProvider.Sut.GetByOrgIdAsync(organization.Id, 1)); - await sutProvider.GetDependency().DidNotReceiveWithAnyArgs() + await sutProvider.GetDependency() + .DidNotReceiveWithAnyArgs() .GetProjectCountByOrganizationIdAsync(organization.Id); } [Theory] + [BitAutoData(PlanType.TeamsMonthly2019)] + [BitAutoData(PlanType.TeamsMonthly2020)] [BitAutoData(PlanType.TeamsMonthly)] + [BitAutoData(PlanType.TeamsAnnually2019)] + [BitAutoData(PlanType.TeamsAnnually2020)] [BitAutoData(PlanType.TeamsAnnually)] + [BitAutoData(PlanType.EnterpriseMonthly2019)] + [BitAutoData(PlanType.EnterpriseMonthly2020)] [BitAutoData(PlanType.EnterpriseMonthly)] + [BitAutoData(PlanType.EnterpriseAnnually2019)] + [BitAutoData(PlanType.EnterpriseAnnually2020)] [BitAutoData(PlanType.EnterpriseAnnually)] public async Task GetByOrgIdAsync_SmNoneFreePlans_ReturnsNull(PlanType planType, SutProvider sutProvider, Organization organization) diff --git a/bitwarden_license/test/Commercial.Core.Test/packages.lock.json b/bitwarden_license/test/Commercial.Core.Test/packages.lock.json index 25d8df608173..205a8205c77a 100644 --- a/bitwarden_license/test/Commercial.Core.Test/packages.lock.json +++ b/bitwarden_license/test/Commercial.Core.Test/packages.lock.json @@ -2667,7 +2667,7 @@ "commercial.core": { "type": "Project", "dependencies": { - "Core": "[2023.9.0, )" + "Core": "[2023.10.1, )" } }, "common": { @@ -2675,7 +2675,7 @@ "dependencies": { "AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )", - "Core": "[2023.9.0, )", + "Core": "[2023.10.1, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )", "NSubstitute": "[4.3.0, )", @@ -2729,8 +2729,8 @@ "dependencies": { "AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )", - "Common": "[2023.9.0, )", - "Core": "[2023.9.0, )", + "Common": "[2023.10.1, )", + "Core": "[2023.10.1, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )", "NSubstitute": "[4.3.0, )", diff --git a/bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/GroupsControllerTests.cs b/bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/GroupsControllerTests.cs index 898e12b42203..6742c6e0ad4a 100644 --- a/bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/GroupsControllerTests.cs +++ b/bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/GroupsControllerTests.cs @@ -17,7 +17,6 @@ public class GroupsControllerTests : IClassFixture, IAsy public GroupsControllerTests(ScimApplicationFactory factory) { _factory = factory; - _factory.DatabaseName = "test_database_groups"; } public Task InitializeAsync() diff --git a/bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/UsersControllerTests.cs b/bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/UsersControllerTests.cs index 5a025a2c8c0b..c0e4f3eb7329 100644 --- a/bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/UsersControllerTests.cs +++ b/bitwarden_license/test/Scim.IntegrationTest/Controllers/v2/UsersControllerTests.cs @@ -17,7 +17,6 @@ public class UsersControllerTests : IClassFixture, IAsyn public UsersControllerTests(ScimApplicationFactory factory) { _factory = factory; - _factory.DatabaseName = "test_database_users"; } public Task InitializeAsync() diff --git a/bitwarden_license/test/Scim.IntegrationTest/packages.lock.json b/bitwarden_license/test/Scim.IntegrationTest/packages.lock.json index e1d3b4b09e30..3c292e2a4a59 100644 --- a/bitwarden_license/test/Scim.IntegrationTest/packages.lock.json +++ b/bitwarden_license/test/Scim.IntegrationTest/packages.lock.json @@ -655,14 +655,6 @@ "resolved": "7.0.5", "contentHash": "yMLM/aK1MikVqpjxd7PJ1Pjgztd3VAd26ZHxyjxG3RPeM9cHjvS5tCg9kAAayR6eHmBg0ffZsHdT28WfA5tTlA==" }, - "Microsoft.EntityFrameworkCore.InMemory": { - "type": "Transitive", - "resolved": "7.0.5", - "contentHash": "y3S/A/0uJX7KOhppC3xqyta6Z0PRz0qPLngH5GFu4GZ7/+Sw2u/amf7MavvR5GfZjGabGcohMpsRSahMmpF9gA==", - "dependencies": { - "Microsoft.EntityFrameworkCore": "7.0.5" - } - }, "Microsoft.EntityFrameworkCore.Relational": { "type": "Transitive", "resolved": "7.0.5", @@ -2989,7 +2981,7 @@ "dependencies": { "AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )", - "Core": "[2023.9.0, )", + "Core": "[2023.10.1, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )", "NSubstitute": "[4.3.0, )", @@ -3041,15 +3033,15 @@ "identity": { "type": "Project", "dependencies": { - "Core": "[2023.9.0, )", - "SharedWeb": "[2023.9.0, )", + "Core": "[2023.10.1, )", + "SharedWeb": "[2023.10.1, )", "Swashbuckle.AspNetCore.SwaggerGen": "[6.5.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "[2023.9.0, )", + "Core": "[2023.10.1, )", "Dapper": "[2.0.123, )" } }, @@ -3057,7 +3049,7 @@ "type": "Project", "dependencies": { "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", - "Core": "[2023.9.0, )", + "Core": "[2023.10.1, )", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", @@ -3069,26 +3061,25 @@ "integrationtestcommon": { "type": "Project", "dependencies": { - "Common": "[2023.9.0, )", - "Identity": "[2023.9.0, )", + "Common": "[2023.10.1, )", + "Identity": "[2023.10.1, )", "Microsoft.AspNetCore.Mvc.Testing": "[6.0.5, )", - "Microsoft.EntityFrameworkCore.InMemory": "[7.0.5, )", "Microsoft.Extensions.Configuration": "[6.0.1, )" } }, "scim": { "type": "Project", "dependencies": { - "Core": "[2023.9.0, )", - "SharedWeb": "[2023.9.0, )" + "Core": "[2023.10.1, )", + "SharedWeb": "[2023.10.1, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "[2023.9.0, )", - "Infrastructure.Dapper": "[2023.9.0, )", - "Infrastructure.EntityFramework": "[2023.9.0, )" + "Core": "[2023.10.1, )", + "Infrastructure.Dapper": "[2023.10.1, )", + "Infrastructure.EntityFramework": "[2023.10.1, )" } } } diff --git a/bitwarden_license/test/Scim.Test/packages.lock.json b/bitwarden_license/test/Scim.Test/packages.lock.json index 36253d50a120..f57a9109f18d 100644 --- a/bitwarden_license/test/Scim.Test/packages.lock.json +++ b/bitwarden_license/test/Scim.Test/packages.lock.json @@ -2834,7 +2834,7 @@ "dependencies": { "AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )", - "Core": "[2023.9.0, )", + "Core": "[2023.10.1, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )", "NSubstitute": "[4.3.0, )", @@ -2886,7 +2886,7 @@ "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "[2023.9.0, )", + "Core": "[2023.10.1, )", "Dapper": "[2.0.123, )" } }, @@ -2894,7 +2894,7 @@ "type": "Project", "dependencies": { "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", - "Core": "[2023.9.0, )", + "Core": "[2023.10.1, )", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", @@ -2906,16 +2906,16 @@ "scim": { "type": "Project", "dependencies": { - "Core": "[2023.9.0, )", - "SharedWeb": "[2023.9.0, )" + "Core": "[2023.10.1, )", + "SharedWeb": "[2023.10.1, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "[2023.9.0, )", - "Infrastructure.Dapper": "[2023.9.0, )", - "Infrastructure.EntityFramework": "[2023.9.0, )" + "Core": "[2023.10.1, )", + "Infrastructure.Dapper": "[2023.10.1, )", + "Infrastructure.EntityFramework": "[2023.10.1, )" } } } diff --git a/src/Admin/Controllers/OrganizationsController.cs b/src/Admin/Controllers/OrganizationsController.cs index b3a232c2c8ba..f671df558d80 100644 --- a/src/Admin/Controllers/OrganizationsController.cs +++ b/src/Admin/Controllers/OrganizationsController.cs @@ -215,7 +215,10 @@ public async Task Edit(Guid id, OrganizationEditModel model) try { - await _stripeSyncService.UpdateCustomerEmailAddress(organization.GatewayCustomerId, organization.BillingEmail); + if (!string.IsNullOrWhiteSpace(organization.GatewayCustomerId) && !string.IsNullOrWhiteSpace(organization.BillingEmail)) + { + await _stripeSyncService.UpdateCustomerEmailAddress(organization.GatewayCustomerId, organization.BillingEmail); + } } catch (StripeException stripeException) { diff --git a/src/Admin/Controllers/ProvidersController.cs b/src/Admin/Controllers/ProvidersController.cs index 3dbf1ca53bb3..8fa02e9b329f 100644 --- a/src/Admin/Controllers/ProvidersController.cs +++ b/src/Admin/Controllers/ProvidersController.cs @@ -1,9 +1,11 @@ using Bit.Admin.Enums; using Bit.Admin.Models; using Bit.Admin.Utilities; -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; -using Bit.Core.Providers.Interfaces; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Providers.Interfaces; +using Bit.Core.AdminConsole.Repositories; +using Bit.Core.AdminConsole.Services; using Bit.Core.Repositories; using Bit.Core.Services; using Bit.Core.Settings; diff --git a/src/Admin/Models/CreateProviderModel.cs b/src/Admin/Models/CreateProviderModel.cs index 9dcd218fa625..8eddd014cd5c 100644 --- a/src/Admin/Models/CreateProviderModel.cs +++ b/src/Admin/Models/CreateProviderModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; using Bit.SharedWeb.Utilities; namespace Bit.Admin.Models; diff --git a/src/Admin/Models/OrganizationEditModel.cs b/src/Admin/Models/OrganizationEditModel.cs index f8bfa453da1e..234d8bb1574c 100644 --- a/src/Admin/Models/OrganizationEditModel.cs +++ b/src/Admin/Models/OrganizationEditModel.cs @@ -1,9 +1,9 @@ using System.ComponentModel.DataAnnotations; using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Enums; -using Bit.Core.Enums.Provider; using Bit.Core.Models.Business; using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Settings; diff --git a/src/Admin/Models/OrganizationViewModel.cs b/src/Admin/Models/OrganizationViewModel.cs index 541f7a2fc1fb..0bad3650fd73 100644 --- a/src/Admin/Models/OrganizationViewModel.cs +++ b/src/Admin/Models/OrganizationViewModel.cs @@ -1,6 +1,6 @@ using Bit.Core.AdminConsole.Entities; +using Bit.Core.AdminConsole.Entities.Provider; using Bit.Core.Entities; -using Bit.Core.Entities.Provider; using Bit.Core.Enums; using Bit.Core.Models.Data.Organizations.OrganizationUsers; using Bit.Core.Vault.Entities; diff --git a/src/Admin/Models/ProviderEditModel.cs b/src/Admin/Models/ProviderEditModel.cs index 38fdb742a85a..b5219d8ed989 100644 --- a/src/Admin/Models/ProviderEditModel.cs +++ b/src/Admin/Models/ProviderEditModel.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -using Bit.Core.Entities.Provider; -using Bit.Core.Models.Data; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; namespace Bit.Admin.Models; diff --git a/src/Admin/Models/ProviderViewModel.cs b/src/Admin/Models/ProviderViewModel.cs index 766101e884b9..38e7eac4a2c2 100644 --- a/src/Admin/Models/ProviderViewModel.cs +++ b/src/Admin/Models/ProviderViewModel.cs @@ -1,6 +1,6 @@ -using Bit.Core.Entities.Provider; -using Bit.Core.Enums.Provider; -using Bit.Core.Models.Data; +using Bit.Core.AdminConsole.Entities.Provider; +using Bit.Core.AdminConsole.Enums.Provider; +using Bit.Core.AdminConsole.Models.Data.Provider; namespace Bit.Admin.Models; diff --git a/src/Admin/Models/ProvidersModel.cs b/src/Admin/Models/ProvidersModel.cs index dccf4a4d7610..5fb8e8dfab16 100644 --- a/src/Admin/Models/ProvidersModel.cs +++ b/src/Admin/Models/ProvidersModel.cs @@ -1,4 +1,4 @@ -using Bit.Core.Entities.Provider; +using Bit.Core.AdminConsole.Entities.Provider; namespace Bit.Admin.Models; diff --git a/src/Admin/Utilities/WebHostEnvironmentExtensions.cs b/src/Admin/Utilities/WebHostEnvironmentExtensions.cs new file mode 100644 index 000000000000..9602d4c76dc0 --- /dev/null +++ b/src/Admin/Utilities/WebHostEnvironmentExtensions.cs @@ -0,0 +1,24 @@ +namespace Bit.Admin.Utilities; + +public static class WebHostEnvironmentExtensions +{ + public static string GetStripeUrl(this IWebHostEnvironment hostingEnvironment) + { + if (hostingEnvironment.IsDevelopment() || hostingEnvironment.IsEnvironment("QA")) + { + return "https://dashboard.stripe.com/test"; + } + + return "https://dashboard.stripe.com"; + } + + public static string GetBraintreeMerchantUrl(this IWebHostEnvironment hostingEnvironment) + { + if (hostingEnvironment.IsDevelopment() || hostingEnvironment.IsEnvironment("QA")) + { + return "https://www.sandbox.braintreegateway.com/merchants"; + } + + return "https://www.braintreegateway.com/merchants"; + } +} diff --git a/src/Admin/Views/Organizations/_ProviderInformation.cshtml b/src/Admin/Views/Organizations/_ProviderInformation.cshtml index 217f9951b0c3..4bd2118ea0a3 100644 --- a/src/Admin/Views/Organizations/_ProviderInformation.cshtml +++ b/src/Admin/Views/Organizations/_ProviderInformation.cshtml @@ -1,5 +1,5 @@ @using Bit.SharedWeb.Utilities -@model Bit.Core.Entities.Provider.Provider +@model Bit.Core.AdminConsole.Entities.Provider.Provider
Provider Name
@Model.Name
diff --git a/src/Admin/Views/Providers/Admins.cshtml b/src/Admin/Views/Providers/Admins.cshtml index 533cb3034ea2..4d110aca5bcc 100644 --- a/src/Admin/Views/Providers/Admins.cshtml +++ b/src/Admin/Views/Providers/Admins.cshtml @@ -1,4 +1,5 @@ @using Bit.Admin.Enums; +@using Bit.Core.AdminConsole.Enums.Provider @inject Bit.Admin.Services.IAccessControlService AccessControlService @model ProviderViewModel diff --git a/src/Admin/Views/Providers/Create.cshtml b/src/Admin/Views/Providers/Create.cshtml index 107e93150b41..2e69da3ad7b3 100644 --- a/src/Admin/Views/Providers/Create.cshtml +++ b/src/Admin/Views/Providers/Create.cshtml @@ -1,4 +1,5 @@ @using Bit.SharedWeb.Utilities +@using Bit.Core.AdminConsole.Enums.Provider @model CreateProviderModel @{ ViewData["Title"] = "Create Provider"; diff --git a/src/Admin/Views/Providers/Organizations.cshtml b/src/Admin/Views/Providers/Organizations.cshtml index 06fc490bcc0d..b9c751480d44 100644 --- a/src/Admin/Views/Providers/Organizations.cshtml +++ b/src/Admin/Views/Providers/Organizations.cshtml @@ -1,3 +1,4 @@ +@using Bit.Core.AdminConsole.Enums.Provider @model ProviderViewModel @await Html.PartialAsync("_ProviderScripts") diff --git a/src/Admin/Views/Providers/_ViewInformation.cshtml b/src/Admin/Views/Providers/_ViewInformation.cshtml index ff4a2e8106ac..b01502e6d668 100644 --- a/src/Admin/Views/Providers/_ViewInformation.cshtml +++ b/src/Admin/Views/Providers/_ViewInformation.cshtml @@ -1,4 +1,5 @@ @using Bit.SharedWeb.Utilities +@using Bit.Core.AdminConsole.Enums.Provider @model ProviderViewModel
Id
diff --git a/src/Admin/Views/Shared/_OrganizationForm.cshtml b/src/Admin/Views/Shared/_OrganizationForm.cshtml index 697d3ef9435a..9e1b488b173c 100644 --- a/src/Admin/Views/Shared/_OrganizationForm.cshtml +++ b/src/Admin/Views/Shared/_OrganizationForm.cshtml @@ -1,5 +1,6 @@ @using Bit.SharedWeb.Utilities @using Bit.Admin.Enums; +@using Bit.Core.AdminConsole.Enums.Provider @inject Bit.Admin.Services.IAccessControlService AccessControlService; @model OrganizationEditModel @@ -258,7 +259,7 @@
- +
diff --git a/src/Admin/Views/Shared/_OrganizationFormScripts.cshtml b/src/Admin/Views/Shared/_OrganizationFormScripts.cshtml index 88dc8a78c1f7..5871977fea7c 100644 --- a/src/Admin/Views/Shared/_OrganizationFormScripts.cshtml +++ b/src/Admin/Views/Shared/_OrganizationFormScripts.cshtml @@ -1,3 +1,5 @@ +@inject IWebHostEnvironment HostingEnvironment +@using Bit.Admin.Utilities @model OrganizationEditModel