diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 22e5fad21e..165efd0c7f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Install cloc run: | @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Set up dotnet uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 @@ -49,7 +49,7 @@ jobs: NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages steps: - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Set up dotnet uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 @@ -135,13 +135,13 @@ jobs: node: true steps: - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Set up dotnet uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 - name: Set up Node - uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 + uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1 with: cache: "npm" cache-dependency-path: "**/package-lock.json" @@ -185,7 +185,7 @@ jobs: ls -atlh ../../../ - name: Upload project artifact - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: ${{ matrix.project_name }}.zip path: ${{ matrix.base_path }}/${{ matrix.project_name }}/${{ matrix.project_name }}.zip @@ -246,7 +246,7 @@ jobs: dotnet: true steps: - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Check Branch to Publish env: @@ -337,7 +337,7 @@ jobs: needs: build-docker steps: - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Set up dotnet uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 @@ -403,7 +403,7 @@ jobs: - name: Upload Docker stub US artifact if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc' - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: docker-stub-US.zip path: docker-stub-US.zip @@ -411,7 +411,7 @@ jobs: - name: Upload Docker stub EU artifact if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc' - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: docker-stub-EU.zip path: docker-stub-EU.zip @@ -419,7 +419,7 @@ jobs: - name: Upload Docker stub US checksum artifact if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc' - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: docker-stub-US-sha256.txt path: docker-stub-US-sha256.txt @@ -427,7 +427,7 @@ jobs: - name: Upload Docker stub EU checksum artifact if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc' - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: docker-stub-EU-sha256.txt path: docker-stub-EU-sha256.txt @@ -453,7 +453,7 @@ jobs: GLOBALSETTINGS__SQLSERVER__CONNECTIONSTRING: "placeholder" - name: Upload Swagger artifact - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: swagger.json path: swagger.json @@ -476,7 +476,7 @@ jobs: - win-x64 steps: - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Set up dotnet uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 @@ -500,7 +500,7 @@ jobs: - name: Upload project artifact Windows if: ${{ contains(matrix.target, 'win') == true }} - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: MsSqlMigratorUtility-${{ matrix.target }} path: util/MsSqlMigratorUtility/obj/build-output/publish/MsSqlMigratorUtility.exe @@ -508,7 +508,7 @@ jobs: - name: Upload project artifact if: ${{ contains(matrix.target, 'win') == false }} - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: MsSqlMigratorUtility-${{ matrix.target }} path: util/MsSqlMigratorUtility/obj/build-output/publish/MsSqlMigratorUtility @@ -522,7 +522,7 @@ jobs: - build-docker steps: - name: Login to Azure - CI Subscription - uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf # v1.4.3 + uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 with: creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} diff --git a/.github/workflows/cleanup-after-pr.yml b/.github/workflows/cleanup-after-pr.yml index 992343bfdf..d24144c0b7 100644 --- a/.github/workflows/cleanup-after-pr.yml +++ b/.github/workflows/cleanup-after-pr.yml @@ -11,7 +11,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 ########## ACR ########## - name: Login to Azure - QA Subscription diff --git a/.github/workflows/database.yml b/.github/workflows/database.yml index 41ca7d6093..523957ae58 100644 --- a/.github/workflows/database.yml +++ b/.github/workflows/database.yml @@ -25,7 +25,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Set up dotnet uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 @@ -44,7 +44,7 @@ jobs: shell: pwsh - name: Upload DACPAC - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: sql.dacpac path: Sql.dacpac @@ -70,7 +70,7 @@ jobs: shell: pwsh - name: Upload Report - uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3 with: name: report.xml path: | diff --git a/.github/workflows/infrastructure-tests.yml b/.github/workflows/infrastructure-tests.yml index 978e933a34..7669be7b75 100644 --- a/.github/workflows/infrastructure-tests.yml +++ b/.github/workflows/infrastructure-tests.yml @@ -38,7 +38,7 @@ jobs: runs-on: ubuntu-22.04 steps: - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Set up dotnet uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 diff --git a/.github/workflows/protect-files.yml b/.github/workflows/protect-files.yml index 22f8bc57c0..2c79c8a983 100644 --- a/.github/workflows/protect-files.yml +++ b/.github/workflows/protect-files.yml @@ -30,7 +30,7 @@ jobs: label: "DB-migrations-changed" steps: - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 with: fetch-depth: 2 diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d78009cdc4..3caa364895 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -37,7 +37,7 @@ jobs: fi - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Check Release Version id: version @@ -136,7 +136,7 @@ jobs: creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} - name: Deploy App - uses: azure/webapps-deploy@85270a1854658d167ab239bce43949edb336fa7c # v2.2.9 + uses: azure/webapps-deploy@4bca689e4c7129e55923ea9c45401b22dc6aa96f # v2.2.11 with: app-name: ${{ steps.retrieve-secrets.outputs.webapp-name }} publish-profile: ${{ steps.retrieve-secrets.outputs.publish-profile }} @@ -211,7 +211,7 @@ jobs: echo "Github Release Option: $RELEASE_OPTION" - name: Checkout repo - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Setup project name id: setup @@ -300,7 +300,7 @@ jobs: - name: Create release if: ${{ github.event.inputs.release_type != 'Dry Run' }} - uses: ncipollo/release-action@a2e71bdd4e7dab70ca26a852f29600c98b33153e # v1.12.0 + uses: ncipollo/release-action@6c75be85e571768fa31b40abf38de58ba0397db5 # v1.13.0 with: artifacts: "docker-stub-US.zip, docker-stub-US-sha256.txt, diff --git a/.github/workflows/version-bump.yml b/.github/workflows/version-bump.yml index 829298d714..1616404d53 100644 --- a/.github/workflows/version-bump.yml +++ b/.github/workflows/version-bump.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-20.04 steps: - name: Checkout Branch - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 + uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0 - name: Login to Azure - CI Subscription uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 @@ -29,7 +29,7 @@ jobs: secrets: "github-gpg-private-key, github-gpg-private-key-passphrase" - name: Import GPG key - uses: crazy-max/ghaction-import-gpg@72b6676b71ab476b77e676928516f6982eef7a41 # v5.3.0 + uses: crazy-max/ghaction-import-gpg@d6f3f49f3345e29369fe57596a3ca8f94c4d2ca7 # v5.4.0 with: gpg_private_key: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key }} passphrase: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key-passphrase }} diff --git a/Directory.Build.props b/Directory.Build.props index 3a60d958ca..952cacd42b 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -2,7 +2,7 @@ net6.0 - 2023.8.2 + 2023.9.0 Bit.$(MSBuildProjectName) true enable diff --git a/NuGet.Config b/NuGet.Config deleted file mode 100644 index ecaab16a1e..0000000000 --- a/NuGet.Config +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/bitwarden_license/src/Commercial.Core/SecretsManager/Queries/Projects/MaxProjectsQuery.cs b/bitwarden_license/src/Commercial.Core/SecretsManager/Queries/Projects/MaxProjectsQuery.cs index 7cbb37f18c..fc30c2c6e8 100644 --- a/bitwarden_license/src/Commercial.Core/SecretsManager/Queries/Projects/MaxProjectsQuery.cs +++ b/bitwarden_license/src/Commercial.Core/SecretsManager/Queries/Projects/MaxProjectsQuery.cs @@ -20,7 +20,7 @@ public class MaxProjectsQuery : IMaxProjectsQuery _projectRepository = projectRepository; } - public async Task<(short? max, bool? atMax)> GetByOrgIdAsync(Guid organizationId) + public async Task<(short? max, bool? overMax)> GetByOrgIdAsync(Guid organizationId, int projectsToAdd) { var org = await _organizationRepository.GetByIdAsync(organizationId); if (org == null) @@ -37,7 +37,7 @@ public class MaxProjectsQuery : IMaxProjectsQuery if (plan.Type == PlanType.Free) { var projects = await _projectRepository.GetProjectCountByOrganizationIdAsync(organizationId); - return projects >= plan.MaxProjects ? (plan.MaxProjects, true) : (plan.MaxProjects, false); + return projects + projectsToAdd > plan.MaxProjects ? (plan.MaxProjects, true) : (plan.MaxProjects, false); } return (null, null); diff --git a/bitwarden_license/src/Commercial.Core/packages.lock.json b/bitwarden_license/src/Commercial.Core/packages.lock.json index 00a5669486..49e4ef1244 100644 --- a/bitwarden_license/src/Commercial.Core/packages.lock.json +++ b/bitwarden_license/src/Commercial.Core/packages.lock.json @@ -141,10 +141,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2424,43 +2425,43 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } } } diff --git a/bitwarden_license/src/Commercial.Infrastructure.EntityFramework/packages.lock.json b/bitwarden_license/src/Commercial.Infrastructure.EntityFramework/packages.lock.json index f31e24c953..ca7a2c8632 100644 --- a/bitwarden_license/src/Commercial.Infrastructure.EntityFramework/packages.lock.json +++ b/bitwarden_license/src/Commercial.Infrastructure.EntityFramework/packages.lock.json @@ -159,10 +159,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2584,56 +2585,56 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } } } diff --git a/bitwarden_license/src/Scim/Utilities/ScimServiceCollectionExtensions.cs b/bitwarden_license/src/Scim/Utilities/ScimServiceCollectionExtensions.cs index fff70760d4..75b60a71fc 100644 --- a/bitwarden_license/src/Scim/Utilities/ScimServiceCollectionExtensions.cs +++ b/bitwarden_license/src/Scim/Utilities/ScimServiceCollectionExtensions.cs @@ -1,6 +1,4 @@ -using Bit.Core.OrganizationFeatures.OrganizationUsers; -using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; -using Bit.Scim.Groups; +using Bit.Scim.Groups; using Bit.Scim.Groups.Interfaces; using Bit.Scim.Users; using Bit.Scim.Users.Interfaces; @@ -23,7 +21,6 @@ public static class ScimServiceCollectionExtensions public static void AddScimUserCommands(this IServiceCollection services) { - services.AddScoped(); services.AddScoped(); services.AddScoped(); } diff --git a/bitwarden_license/src/Scim/packages.lock.json b/bitwarden_license/src/Scim/packages.lock.json index ad36bb6cd7..16a42f355d 100644 --- a/bitwarden_license/src/Scim/packages.lock.json +++ b/bitwarden_license/src/Scim/packages.lock.json @@ -158,10 +158,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2588,71 +2589,71 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/bitwarden_license/src/Sso/Utilities/DynamicAuthenticationSchemeProvider.cs b/bitwarden_license/src/Sso/Utilities/DynamicAuthenticationSchemeProvider.cs index aeef3f679b..1487697279 100644 --- a/bitwarden_license/src/Sso/Utilities/DynamicAuthenticationSchemeProvider.cs +++ b/bitwarden_license/src/Sso/Utilities/DynamicAuthenticationSchemeProvider.cs @@ -415,7 +415,7 @@ public class DynamicAuthenticationSchemeProvider : AuthenticationSchemeProvider }; options.IdentityProviders.Add(idp); - return new DynamicAuthenticationScheme(name, name, typeof(Saml2Handler), options, SsoType.Saml2); + return new DynamicAuthenticationScheme(name, name, typeof(Saml2BitHandler), options, SsoType.Saml2); } private NameIdFormat GetNameIdFormat(Saml2NameIdFormat format) diff --git a/bitwarden_license/src/Sso/Utilities/Saml2BitHandler.cs b/bitwarden_license/src/Sso/Utilities/Saml2BitHandler.cs new file mode 100644 index 0000000000..6e5a37fb96 --- /dev/null +++ b/bitwarden_license/src/Sso/Utilities/Saml2BitHandler.cs @@ -0,0 +1,205 @@ +using System.Text; +using Microsoft.AspNetCore.Authentication; +using Microsoft.AspNetCore.Authentication.Cookies; +using Microsoft.AspNetCore.DataProtection; +using Microsoft.Extensions.Options; +using Sustainsys.Saml2.AspNetCore2; +using Sustainsys.Saml2.WebSso; + +namespace Bit.Sso.Utilities; + +// Temporary handler for validating Saml2 requests +// Most of this is taken from Sustainsys.Saml2.AspNetCore2.Saml2Handler +// TODO: PM-3641 - Remove this handler once there is a proper solution +public class Saml2BitHandler : IAuthenticationRequestHandler +{ + private readonly Saml2Handler _saml2Handler; + private string _scheme; + + private readonly IOptionsMonitorCache _optionsCache; + private Saml2Options _options; + private HttpContext _context; + private readonly IDataProtector _dataProtector; + private readonly IOptionsFactory _optionsFactory; + private bool _emitSameSiteNone; + + public Saml2BitHandler( + IOptionsMonitorCache optionsCache, + IDataProtectionProvider dataProtectorProvider, + IOptionsFactory optionsFactory) + { + if (dataProtectorProvider == null) + { + throw new ArgumentNullException(nameof(dataProtectorProvider)); + } + + _optionsFactory = optionsFactory; + _optionsCache = optionsCache; + + _saml2Handler = new Saml2Handler(optionsCache, dataProtectorProvider, optionsFactory); + _dataProtector = dataProtectorProvider.CreateProtector(_saml2Handler.GetType().FullName); + } + + public Task InitializeAsync(AuthenticationScheme scheme, HttpContext context) + { + _context = context ?? throw new ArgumentNullException(nameof(context)); + _options = _optionsCache.GetOrAdd(scheme.Name, () => _optionsFactory.Create(scheme.Name)); + _emitSameSiteNone = _options.Notifications.EmitSameSiteNone(context.Request.GetUserAgent()); + _scheme = scheme.Name; + + return _saml2Handler.InitializeAsync(scheme, context); + } + + + public async Task HandleRequestAsync() + { + if (!_context.Request.Path.StartsWithSegments(_options.SPOptions.ModulePath, StringComparison.Ordinal)) + { + return false; + } + + var commandName = _context.Request.Path.Value.Substring( + _options.SPOptions.ModulePath.Length).TrimStart('/'); + + var commandResult = CommandFactory.GetCommand(commandName).Run( + _context.ToHttpRequestData(_options.CookieManager, _dataProtector.Unprotect), _options); + + // Scheme is the organization ID since we use dynamic handlers for authentication schemes. + // We need to compare this to the scheme returned in the RelayData to ensure this value hasn't been + // tampered with + if (commandResult.RelayData["scheme"] != _scheme) + { + return false; + } + + await commandResult.Apply( + _context, _dataProtector, _options.CookieManager, _options.SignInScheme, _options.SignOutScheme, _emitSameSiteNone); + + return true; + } + + public Task AuthenticateAsync() => _saml2Handler.AuthenticateAsync(); + + public Task ChallengeAsync(AuthenticationProperties properties) => _saml2Handler.ChallengeAsync(properties); + + public Task ForbidAsync(AuthenticationProperties properties) => _saml2Handler.ForbidAsync(properties); +} + + +static class HttpRequestExtensions +{ + public static HttpRequestData ToHttpRequestData( + this HttpContext httpContext, + ICookieManager cookieManager, + Func cookieDecryptor) + { + var request = httpContext.Request; + + var uri = new Uri( + request.Scheme + + "://" + + request.Host + + request.Path + + request.QueryString); + + var pathBase = httpContext.Request.PathBase.Value; + pathBase = string.IsNullOrEmpty(pathBase) ? "/" : pathBase; + IEnumerable>> formData = null; + if (httpContext.Request.Method == "POST" && httpContext.Request.HasFormContentType) + { + formData = request.Form.Select( + f => new KeyValuePair>(f.Key, f.Value)); + } + + return new HttpRequestData( + httpContext.Request.Method, + uri, + pathBase, + formData, + cookieName => cookieManager.GetRequestCookie(httpContext, cookieName), + cookieDecryptor, + httpContext.User); + } + + public static string GetUserAgent(this HttpRequest request) + { + return request.Headers["user-agent"].FirstOrDefault() ?? ""; + } +} + +static class CommandResultExtensions +{ + public static async Task Apply( + this CommandResult commandResult, + HttpContext httpContext, + IDataProtector dataProtector, + ICookieManager cookieManager, + string signInScheme, + string signOutScheme, + bool emitSameSiteNone) + { + httpContext.Response.StatusCode = (int)commandResult.HttpStatusCode; + + if (commandResult.Location != null) + { + httpContext.Response.Headers["Location"] = commandResult.Location.OriginalString; + } + + if (!string.IsNullOrEmpty(commandResult.SetCookieName)) + { + var cookieData = HttpRequestData.ConvertBinaryData( + dataProtector.Protect(commandResult.GetSerializedRequestState())); + + cookieManager.AppendResponseCookie( + httpContext, + commandResult.SetCookieName, + cookieData, + new CookieOptions() + { + HttpOnly = true, + Secure = commandResult.SetCookieSecureFlag, + // We are expecting a different site to POST back to us, + // so the ASP.Net Core default of Lax is not appropriate in this case + SameSite = emitSameSiteNone ? SameSiteMode.None : (SameSiteMode)(-1), + IsEssential = true + }); + } + + foreach (var h in commandResult.Headers) + { + httpContext.Response.Headers.Add(h.Key, h.Value); + } + + if (!string.IsNullOrEmpty(commandResult.ClearCookieName)) + { + cookieManager.DeleteCookie( + httpContext, + commandResult.ClearCookieName, + new CookieOptions + { + Secure = commandResult.SetCookieSecureFlag + }); + } + + if (!string.IsNullOrEmpty(commandResult.Content)) + { + var buffer = Encoding.UTF8.GetBytes(commandResult.Content); + httpContext.Response.ContentType = commandResult.ContentType; + await httpContext.Response.Body.WriteAsync(buffer, 0, buffer.Length); + } + + if (commandResult.Principal != null) + { + var authProps = new AuthenticationProperties(commandResult.RelayData) + { + RedirectUri = commandResult.Location.OriginalString + }; + await httpContext.SignInAsync(signInScheme, commandResult.Principal, authProps); + } + + if (commandResult.TerminateLocalSession) + { + await httpContext.SignOutAsync(signOutScheme ?? signInScheme); + } + } +} diff --git a/bitwarden_license/src/Sso/packages.lock.json b/bitwarden_license/src/Sso/packages.lock.json index b182c9a240..ecccbaab16 100644 --- a/bitwarden_license/src/Sso/packages.lock.json +++ b/bitwarden_license/src/Sso/packages.lock.json @@ -183,10 +183,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2748,71 +2749,71 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } 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 6706e01657..79ffb421e1 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 @@ -22,7 +22,7 @@ public class MaxProjectsQueryTests { sutProvider.GetDependency().GetByIdAsync(default).ReturnsNull(); - await Assert.ThrowsAsync(async () => await sutProvider.Sut.GetByOrgIdAsync(organizationId)); + await Assert.ThrowsAsync(async () => await sutProvider.Sut.GetByOrgIdAsync(organizationId, 1)); await sutProvider.GetDependency().DidNotReceiveWithAnyArgs() .GetProjectCountByOrganizationIdAsync(organizationId); @@ -43,7 +43,7 @@ public class MaxProjectsQueryTests sutProvider.GetDependency().GetByIdAsync(organization.Id).Returns(organization); await Assert.ThrowsAsync( - async () => await sutProvider.Sut.GetByOrgIdAsync(organization.Id)); + async () => await sutProvider.Sut.GetByOrgIdAsync(organization.Id, 1)); await sutProvider.GetDependency().DidNotReceiveWithAnyArgs() .GetProjectCountByOrganizationIdAsync(organization.Id); @@ -60,7 +60,7 @@ public class MaxProjectsQueryTests organization.PlanType = planType; sutProvider.GetDependency().GetByIdAsync(organization.Id).Returns(organization); - var (limit, overLimit) = await sutProvider.Sut.GetByOrgIdAsync(organization.Id); + var (limit, overLimit) = await sutProvider.Sut.GetByOrgIdAsync(organization.Id, 1); Assert.Null(limit); Assert.Null(overLimit); @@ -70,13 +70,31 @@ public class MaxProjectsQueryTests } [Theory] - [BitAutoData(PlanType.Free, 0, false)] - [BitAutoData(PlanType.Free, 1, false)] - [BitAutoData(PlanType.Free, 2, false)] - [BitAutoData(PlanType.Free, 3, true)] - [BitAutoData(PlanType.Free, 4, true)] - [BitAutoData(PlanType.Free, 40, true)] - public async Task GetByOrgIdAsync_SmFreePlan_Success(PlanType planType, int projects, bool shouldBeAtMax, + [BitAutoData(PlanType.Free, 0, 1, false)] + [BitAutoData(PlanType.Free, 1, 1, false)] + [BitAutoData(PlanType.Free, 2, 1, false)] + [BitAutoData(PlanType.Free, 3, 1, true)] + [BitAutoData(PlanType.Free, 4, 1, true)] + [BitAutoData(PlanType.Free, 40, 1, true)] + [BitAutoData(PlanType.Free, 0, 2, false)] + [BitAutoData(PlanType.Free, 1, 2, false)] + [BitAutoData(PlanType.Free, 2, 2, true)] + [BitAutoData(PlanType.Free, 3, 2, true)] + [BitAutoData(PlanType.Free, 4, 2, true)] + [BitAutoData(PlanType.Free, 40, 2, true)] + [BitAutoData(PlanType.Free, 0, 3, false)] + [BitAutoData(PlanType.Free, 1, 3, true)] + [BitAutoData(PlanType.Free, 2, 3, true)] + [BitAutoData(PlanType.Free, 3, 3, true)] + [BitAutoData(PlanType.Free, 4, 3, true)] + [BitAutoData(PlanType.Free, 40, 3, true)] + [BitAutoData(PlanType.Free, 0, 4, true)] + [BitAutoData(PlanType.Free, 1, 4, true)] + [BitAutoData(PlanType.Free, 2, 4, true)] + [BitAutoData(PlanType.Free, 3, 4, true)] + [BitAutoData(PlanType.Free, 4, 4, true)] + [BitAutoData(PlanType.Free, 40, 4, true)] + public async Task GetByOrgIdAsync_SmFreePlan__Success(PlanType planType, int projects, int projectsToAdd, bool expectedOverMax, SutProvider sutProvider, Organization organization) { organization.PlanType = planType; @@ -84,12 +102,12 @@ public class MaxProjectsQueryTests sutProvider.GetDependency().GetProjectCountByOrganizationIdAsync(organization.Id) .Returns(projects); - var (max, atMax) = await sutProvider.Sut.GetByOrgIdAsync(organization.Id); + var (max, overMax) = await sutProvider.Sut.GetByOrgIdAsync(organization.Id, projectsToAdd); Assert.NotNull(max); - Assert.NotNull(atMax); + Assert.NotNull(overMax); Assert.Equal(3, max.Value); - Assert.Equal(shouldBeAtMax, atMax); + Assert.Equal(expectedOverMax, overMax); await sutProvider.GetDependency().Received(1) .GetProjectCountByOrganizationIdAsync(organization.Id); diff --git a/bitwarden_license/test/Commercial.Core.Test/packages.lock.json b/bitwarden_license/test/Commercial.Core.Test/packages.lock.json index 09019299e5..25d8df6081 100644 --- a/bitwarden_license/test/Commercial.Core.Test/packages.lock.json +++ b/bitwarden_license/test/Commercial.Core.Test/packages.lock.json @@ -201,10 +201,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2666,7 +2667,7 @@ "commercial.core": { "type": "Project", "dependencies": { - "Core": "[2023.7.2, )" + "Core": "[2023.9.0, )" } }, "common": { @@ -2674,7 +2675,7 @@ "dependencies": { "AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )", - "Core": "[2023.7.2, )", + "Core": "[2023.9.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )", "NSubstitute": "[4.3.0, )", @@ -2693,7 +2694,7 @@ "Azure.Storage.Blobs": "[12.14.1, )", "Azure.Storage.Queues": "[12.12.0, )", "BitPay.Light": "[1.0.1907, )", - "Braintree": "[5.12.0, )", + "Braintree": "[5.19.0, )", "DnsClient": "[1.7.0, )", "Fido2.AspNet": "[3.0.1, )", "Handlebars.Net": "[2.1.2, )", @@ -2728,8 +2729,8 @@ "dependencies": { "AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )", - "Common": "[2023.7.2, )", - "Core": "[2023.7.2, )", + "Common": "[2023.9.0, )", + "Core": "[2023.9.0, )", "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/packages.lock.json b/bitwarden_license/test/Scim.IntegrationTest/packages.lock.json index cb1f3a3c85..e1d3b4b09e 100644 --- a/bitwarden_license/test/Scim.IntegrationTest/packages.lock.json +++ b/bitwarden_license/test/Scim.IntegrationTest/packages.lock.json @@ -239,10 +239,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2986,108 +2987,108 @@ "common": { "type": "Project", "dependencies": { - "AutoFixture.AutoNSubstitute": "4.17.0", - "AutoFixture.Xunit2": "4.17.0", - "Core": "2023.7.2", - "Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", - "Microsoft.NET.Test.Sdk": "17.1.0", - "NSubstitute": "4.3.0", - "xunit": "2.4.1" + "AutoFixture.AutoNSubstitute": "[4.17.0, )", + "AutoFixture.Xunit2": "[4.17.0, )", + "Core": "[2023.9.0, )", + "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", + "Microsoft.NET.Test.Sdk": "[17.1.0, )", + "NSubstitute": "[4.3.0, )", + "xunit": "[2.4.1, )" } }, "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "identity": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "SharedWeb": "2023.7.2", - "Swashbuckle.AspNetCore.SwaggerGen": "6.5.0" + "Core": "[2023.9.0, )", + "SharedWeb": "[2023.9.0, )", + "Swashbuckle.AspNetCore.SwaggerGen": "[6.5.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "integrationtestcommon": { "type": "Project", "dependencies": { - "Common": "2023.7.2", - "Identity": "2023.7.2", - "Microsoft.AspNetCore.Mvc.Testing": "6.0.5", - "Microsoft.EntityFrameworkCore.InMemory": "7.0.5", - "Microsoft.Extensions.Configuration": "6.0.1" + "Common": "[2023.9.0, )", + "Identity": "[2023.9.0, )", + "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.7.2", - "SharedWeb": "2023.7.2" + "Core": "[2023.9.0, )", + "SharedWeb": "[2023.9.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/bitwarden_license/test/Scim.Test/packages.lock.json b/bitwarden_license/test/Scim.Test/packages.lock.json index d1268a6933..36253d50a1 100644 --- a/bitwarden_license/test/Scim.Test/packages.lock.json +++ b/bitwarden_license/test/Scim.Test/packages.lock.json @@ -227,10 +227,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2831,90 +2832,90 @@ "common": { "type": "Project", "dependencies": { - "AutoFixture.AutoNSubstitute": "4.17.0", - "AutoFixture.Xunit2": "4.17.0", - "Core": "2023.7.2", - "Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", - "Microsoft.NET.Test.Sdk": "17.1.0", - "NSubstitute": "4.3.0", - "xunit": "2.4.1" + "AutoFixture.AutoNSubstitute": "[4.17.0, )", + "AutoFixture.Xunit2": "[4.17.0, )", + "Core": "[2023.9.0, )", + "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", + "Microsoft.NET.Test.Sdk": "[17.1.0, )", + "NSubstitute": "[4.3.0, )", + "xunit": "[2.4.1, )" } }, "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "scim": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "SharedWeb": "2023.7.2" + "Core": "[2023.9.0, )", + "SharedWeb": "[2023.9.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/dev/create_certificates_mac.sh b/dev/create_certificates_mac.sh index 108d82a5be..2c3ed53505 100755 --- a/dev/create_certificates_mac.sh +++ b/dev/create_certificates_mac.sh @@ -2,14 +2,14 @@ openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout identity_server_dev.key -out identity_server_dev.crt \ -subj "/CN=Bitwarden Identity Server Dev" -days 3650 -openssl pkcs12 -export -out identity_server_dev.pfx -inkey identity_server_dev.key -in identity_server_dev.crt \ +openssl pkcs12 -export -legacy -out identity_server_dev.pfx -inkey identity_server_dev.key -in identity_server_dev.crt \ -certfile identity_server_dev.crt security import ./identity_server_dev.pfx -k ~/Library/Keychains/Login.keychain openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout data_protection_dev.key -out data_protection_dev.crt \ -subj "/CN=Bitwarden Data Protection Dev" -days 3650 -openssl pkcs12 -export -out data_protection_dev.pfx -inkey data_protection_dev.key -in data_protection_dev.crt \ +openssl pkcs12 -export -legacy -out data_protection_dev.pfx -inkey data_protection_dev.key -in data_protection_dev.crt \ -certfile data_protection_dev.crt security import ./data_protection_dev.pfx -k ~/Library/Keychains/Login.keychain diff --git a/dev/docker-compose.yml b/dev/docker-compose.yml index 2e0e4113d7..4d27c0472a 100644 --- a/dev/docker-compose.yml +++ b/dev/docker-compose.yml @@ -68,7 +68,7 @@ services: - mysql idp: - image: kenchan0130/simplesamlphp:1.19.3 + image: kenchan0130/simplesamlphp:1.19.8 container_name: idp ports: - "8090:8080" diff --git a/dev/setup_secrets.ps1 b/dev/setup_secrets.ps1 index e9903bf4dc..5c807ee86b 100644 --- a/dev/setup_secrets.ps1 +++ b/dev/setup_secrets.ps1 @@ -1,7 +1,7 @@ #!/usr/bin/env pwsh # Helper script for applying the same user secrets to each project param ( - [bool]$clear, + [switch]$clear, [Parameter(ValueFromRemainingArguments = $true, Position=1)] $cmdArgs ) diff --git a/perf/MicroBenchmarks/packages.lock.json b/perf/MicroBenchmarks/packages.lock.json index 4ff0399864..c8d9a6e53f 100644 --- a/perf/MicroBenchmarks/packages.lock.json +++ b/perf/MicroBenchmarks/packages.lock.json @@ -166,10 +166,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2531,43 +2532,43 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } } } diff --git a/src/Admin/Views/Providers/Organizations.cshtml b/src/Admin/Views/Providers/Organizations.cshtml index a6cc20a1c8..06fc490bcc 100644 --- a/src/Admin/Views/Providers/Organizations.cshtml +++ b/src/Admin/Views/Providers/Organizations.cshtml @@ -44,7 +44,7 @@
@if (org.Status == OrganizationStatusType.Pending) { - + } diff --git a/src/Admin/Views/Providers/_ProviderScripts.cshtml b/src/Admin/Views/Providers/_ProviderScripts.cshtml index d74065d562..3ff2d9ae2c 100644 --- a/src/Admin/Views/Providers/_ProviderScripts.cshtml +++ b/src/Admin/Views/Providers/_ProviderScripts.cshtml @@ -1,14 +1,14 @@ \ No newline at end of file + diff --git a/src/Admin/packages.lock.json b/src/Admin/packages.lock.json index ba1b89dafa..b830fdad38 100644 --- a/src/Admin/packages.lock.json +++ b/src/Admin/packages.lock.json @@ -178,10 +178,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2791,114 +2792,114 @@ "commercial.core": { "type": "Project", "dependencies": { - "Core": "2023.7.2" + "Core": "[2023.9.0, )" } }, "commercial.infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } }, "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "migrator": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Microsoft.Extensions.Logging": "6.0.0", - "dbup-sqlserver": "5.0.8" + "Core": "[2023.9.0, )", + "Microsoft.Extensions.Logging": "[6.0.0, )", + "dbup-sqlserver": "[5.0.8, )" } }, "mysqlmigrations": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } }, "postgresmigrations": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } }, "sqlitemigrations": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/src/Api/Auth/Controllers/TwoFactorController.cs b/src/Api/Auth/Controllers/TwoFactorController.cs index 0c8822219a..884f2939ba 100644 --- a/src/Api/Auth/Controllers/TwoFactorController.cs +++ b/src/Api/Auth/Controllers/TwoFactorController.cs @@ -236,7 +236,7 @@ public class TwoFactorController : Controller [HttpPost("get-webauthn")] public async Task GetWebAuthn([FromBody] SecretVerificationRequestModel model) { - var user = await CheckAsync(model, true); + var user = await CheckAsync(model, false); var response = new TwoFactorWebAuthnResponseModel(user); return response; } @@ -245,7 +245,7 @@ public class TwoFactorController : Controller [ApiExplorerSettings(IgnoreApi = true)] // Disable Swagger due to CredentialCreateOptions not converting properly public async Task GetWebAuthnChallenge([FromBody] SecretVerificationRequestModel model) { - var user = await CheckAsync(model, true); + var user = await CheckAsync(model, false); var reg = await _userService.StartWebAuthnRegistrationAsync(user); return reg; } @@ -254,7 +254,7 @@ public class TwoFactorController : Controller [HttpPost("webauthn")] public async Task PutWebAuthn([FromBody] TwoFactorWebAuthnRequestModel model) { - var user = await CheckAsync(model, true); + var user = await CheckAsync(model, false); var success = await _userService.CompleteWebAuthRegistrationAsync( user, model.Id.Value, model.Name, model.DeviceResponse); @@ -271,7 +271,7 @@ public class TwoFactorController : Controller public async Task DeleteWebAuthn( [FromBody] TwoFactorWebAuthnDeleteRequestModel model) { - var user = await CheckAsync(model, true); + var user = await CheckAsync(model, false); await _userService.DeleteWebAuthnKeyAsync(user, model.Id.Value); var response = new TwoFactorWebAuthnResponseModel(user); return response; diff --git a/src/Api/Controllers/OrganizationUsersController.cs b/src/Api/Controllers/OrganizationUsersController.cs index 3dbaea3ff9..d1c4ebacd6 100644 --- a/src/Api/Controllers/OrganizationUsersController.cs +++ b/src/Api/Controllers/OrganizationUsersController.cs @@ -30,6 +30,7 @@ public class OrganizationUsersController : Controller private readonly ICurrentContext _currentContext; private readonly ICountNewSmSeatsRequiredQuery _countNewSmSeatsRequiredQuery; private readonly IUpdateSecretsManagerSubscriptionCommand _updateSecretsManagerSubscriptionCommand; + private readonly IUpdateOrganizationUserGroupsCommand _updateOrganizationUserGroupsCommand; public OrganizationUsersController( IOrganizationRepository organizationRepository, @@ -41,7 +42,8 @@ public class OrganizationUsersController : Controller IPolicyRepository policyRepository, ICurrentContext currentContext, ICountNewSmSeatsRequiredQuery countNewSmSeatsRequiredQuery, - IUpdateSecretsManagerSubscriptionCommand updateSecretsManagerSubscriptionCommand) + IUpdateSecretsManagerSubscriptionCommand updateSecretsManagerSubscriptionCommand, + IUpdateOrganizationUserGroupsCommand updateOrganizationUserGroupsCommand) { _organizationRepository = organizationRepository; _organizationUserRepository = organizationUserRepository; @@ -53,6 +55,7 @@ public class OrganizationUsersController : Controller _currentContext = currentContext; _countNewSmSeatsRequiredQuery = countNewSmSeatsRequiredQuery; _updateSecretsManagerSubscriptionCommand = updateSecretsManagerSubscriptionCommand; + _updateOrganizationUserGroupsCommand = updateOrganizationUserGroupsCommand; } [HttpGet("{id}")] @@ -308,7 +311,7 @@ public class OrganizationUsersController : Controller } var loggedInUserId = _userService.GetProperUserId(User); - await _organizationService.UpdateUserGroupsAsync(organizationUser, model.GroupIds.Select(g => new Guid(g)), loggedInUserId); + await _updateOrganizationUserGroupsCommand.UpdateUserGroupsAsync(organizationUser, model.GroupIds.Select(g => new Guid(g)), loggedInUserId); } [HttpPut("{userId}/reset-password-enrollment")] diff --git a/src/Api/Public/Controllers/MembersController.cs b/src/Api/Public/Controllers/MembersController.cs index 9d7ca86d3b..74dd4b83e1 100644 --- a/src/Api/Public/Controllers/MembersController.cs +++ b/src/Api/Public/Controllers/MembersController.cs @@ -3,6 +3,7 @@ using Bit.Api.Models.Public.Request; using Bit.Api.Models.Public.Response; using Bit.Core.Context; using Bit.Core.Models.Business; +using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; using Bit.Core.Repositories; using Bit.Core.Services; using Microsoft.AspNetCore.Authorization; @@ -19,19 +20,22 @@ public class MembersController : Controller private readonly IOrganizationService _organizationService; private readonly IUserService _userService; private readonly ICurrentContext _currentContext; + private readonly IUpdateOrganizationUserGroupsCommand _updateOrganizationUserGroupsCommand; public MembersController( IOrganizationUserRepository organizationUserRepository, IGroupRepository groupRepository, IOrganizationService organizationService, IUserService userService, - ICurrentContext currentContext) + ICurrentContext currentContext, + IUpdateOrganizationUserGroupsCommand updateOrganizationUserGroupsCommand) { _organizationUserRepository = organizationUserRepository; _groupRepository = groupRepository; _organizationService = organizationService; _userService = userService; _currentContext = currentContext; + _updateOrganizationUserGroupsCommand = updateOrganizationUserGroupsCommand; } /// @@ -183,7 +187,7 @@ public class MembersController : Controller { return new NotFoundResult(); } - await _organizationService.UpdateUserGroupsAsync(existingUser, model.GroupIds, null); + await _updateOrganizationUserGroupsCommand.UpdateUserGroupsAsync(existingUser, model.GroupIds, null); return new OkResult(); } diff --git a/src/Api/SecretsManager/Controllers/ProjectsController.cs b/src/Api/SecretsManager/Controllers/ProjectsController.cs index 4f3815ca78..e59918593a 100644 --- a/src/Api/SecretsManager/Controllers/ProjectsController.cs +++ b/src/Api/SecretsManager/Controllers/ProjectsController.cs @@ -79,8 +79,8 @@ public class ProjectsController : Controller throw new NotFoundException(); } - var (max, atMax) = await _maxProjectsQuery.GetByOrgIdAsync(organizationId); - if (atMax != null && atMax.Value) + var (max, overMax) = await _maxProjectsQuery.GetByOrgIdAsync(organizationId, 1); + if (overMax != null && overMax.Value) { throw new BadRequestException($"You have reached the maximum number of projects ({max}) for this plan."); } diff --git a/src/Api/SecretsManager/Controllers/SecretsManagerPortingController.cs b/src/Api/SecretsManager/Controllers/SecretsManagerPortingController.cs index ac2e3e5c2a..3d26c8f702 100644 --- a/src/Api/SecretsManager/Controllers/SecretsManagerPortingController.cs +++ b/src/Api/SecretsManager/Controllers/SecretsManagerPortingController.cs @@ -4,6 +4,7 @@ using Bit.Core.Context; using Bit.Core.Enums; using Bit.Core.Exceptions; using Bit.Core.SecretsManager.Commands.Porting.Interfaces; +using Bit.Core.SecretsManager.Queries.Projects.Interfaces; using Bit.Core.SecretsManager.Repositories; using Bit.Core.Services; using Bit.Core.Utilities; @@ -19,14 +20,18 @@ public class SecretsManagerPortingController : Controller private readonly ISecretRepository _secretRepository; private readonly IProjectRepository _projectRepository; private readonly IUserService _userService; + private readonly IMaxProjectsQuery _maxProjectsQuery; private readonly IImportCommand _importCommand; private readonly ICurrentContext _currentContext; - public SecretsManagerPortingController(ISecretRepository secretRepository, IProjectRepository projectRepository, IUserService userService, IImportCommand importCommand, ICurrentContext currentContext) + public SecretsManagerPortingController(ISecretRepository secretRepository, IProjectRepository projectRepository, + IUserService userService, IMaxProjectsQuery maxProjectsQuery, IImportCommand importCommand, + ICurrentContext currentContext) { _secretRepository = secretRepository; _projectRepository = projectRepository; _userService = userService; + _maxProjectsQuery = maxProjectsQuery; _importCommand = importCommand; _currentContext = currentContext; } @@ -69,6 +74,16 @@ public class SecretsManagerPortingController : Controller throw new BadRequestException("A secret can only be in one project at a time."); } + var projectsToAdd = importRequest.Projects?.Count(); + if (projectsToAdd is > 0) + { + var (max, overMax) = await _maxProjectsQuery.GetByOrgIdAsync(organizationId, projectsToAdd.Value); + if (overMax != null && overMax.Value) + { + throw new BadRequestException($"The maximum number of projects for this plan is ({max})."); + } + } + await _importCommand.ImportAsync(organizationId, importRequest.ToSMImport()); } } diff --git a/src/Api/packages.lock.json b/src/Api/packages.lock.json index 570ebdec3f..409ac010c2 100644 --- a/src/Api/packages.lock.json +++ b/src/Api/packages.lock.json @@ -281,10 +281,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2771,85 +2772,85 @@ "commercial.core": { "type": "Project", "dependencies": { - "Core": "2023.7.2" + "Core": "[2023.9.0, )" } }, "commercial.infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } }, "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/src/Billing/packages.lock.json b/src/Billing/packages.lock.json index ad36bb6cd7..16a42f355d 100644 --- a/src/Billing/packages.lock.json +++ b/src/Billing/packages.lock.json @@ -158,10 +158,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2588,71 +2589,71 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/src/Core/Auth/Identity/WebAuthnTokenProvider.cs b/src/Core/Auth/Identity/WebAuthnTokenProvider.cs index 8ada74b697..ef6535de74 100644 --- a/src/Core/Auth/Identity/WebAuthnTokenProvider.cs +++ b/src/Core/Auth/Identity/WebAuthnTokenProvider.cs @@ -28,10 +28,6 @@ public class WebAuthnTokenProvider : IUserTwoFactorTokenProvider public async Task CanGenerateTwoFactorTokenAsync(UserManager manager, User user) { var userService = _serviceProvider.GetRequiredService(); - if (!(await userService.CanAccessPremium(user))) - { - return false; - } var webAuthnProvider = user.GetTwoFactorProvider(TwoFactorProviderType.WebAuthn); if (!HasProperMetaData(webAuthnProvider)) @@ -45,10 +41,6 @@ public class WebAuthnTokenProvider : IUserTwoFactorTokenProvider public async Task GenerateAsync(string purpose, UserManager manager, User user) { var userService = _serviceProvider.GetRequiredService(); - if (!(await userService.CanAccessPremium(user))) - { - return null; - } var provider = user.GetTwoFactorProvider(TwoFactorProviderType.WebAuthn); var keys = LoadKeys(provider); @@ -81,7 +73,7 @@ public class WebAuthnTokenProvider : IUserTwoFactorTokenProvider public async Task ValidateAsync(string purpose, string token, UserManager manager, User user) { var userService = _serviceProvider.GetRequiredService(); - if (!(await userService.CanAccessPremium(user)) || string.IsNullOrWhiteSpace(token)) + if (string.IsNullOrWhiteSpace(token)) { return false; } diff --git a/src/Core/Auth/Models/Business/Tokenables/SsoEmail2faSessionTokenable.cs b/src/Core/Auth/Models/Business/Tokenables/SsoEmail2faSessionTokenable.cs index e8c8a33f56..ea8347653b 100644 --- a/src/Core/Auth/Models/Business/Tokenables/SsoEmail2faSessionTokenable.cs +++ b/src/Core/Auth/Models/Business/Tokenables/SsoEmail2faSessionTokenable.cs @@ -6,11 +6,12 @@ namespace Bit.Core.Auth.Models.Business.Tokenables; // This token just provides a verifiable authN mechanism for the API service // TwoFactorController.cs SendEmailLogin anonymous endpoint so it cannot be -// used maliciously. +// used maliciously. public class SsoEmail2faSessionTokenable : ExpiringTokenable { // Just over 2 min expiration (client expires session after 2 min) - private static readonly TimeSpan _tokenLifetime = TimeSpan.FromMinutes(2.05); + public static TimeSpan GetTokenLifetime() => TimeSpan.FromMinutes(2.05); + public const string ClearTextPrefix = "BwSsoEmail2FaSessionToken_"; public const string DataProtectorPurpose = "SsoEmail2faSessionTokenDataProtector"; @@ -24,7 +25,7 @@ public class SsoEmail2faSessionTokenable : ExpiringTokenable [JsonConstructor] public SsoEmail2faSessionTokenable() { - ExpirationDate = DateTime.UtcNow.Add(_tokenLifetime); + ExpirationDate = DateTime.UtcNow.Add(GetTokenLifetime()); } public SsoEmail2faSessionTokenable(User user) : this() @@ -44,7 +45,7 @@ public class SsoEmail2faSessionTokenable : ExpiringTokenable Email.Equals(user.Email, StringComparison.InvariantCultureIgnoreCase); } - // Validates deserialized + // Validates deserialized protected override bool TokenIsValid() => Identifier == TokenIdentifier && Id != default && !string.IsNullOrWhiteSpace(Email); } diff --git a/src/Core/Auth/Models/TwoFactorProvider.cs b/src/Core/Auth/Models/TwoFactorProvider.cs index 9cd7a98b07..498a70cb09 100644 --- a/src/Core/Auth/Models/TwoFactorProvider.cs +++ b/src/Core/Auth/Models/TwoFactorProvider.cs @@ -57,7 +57,6 @@ public class TwoFactorProvider case TwoFactorProviderType.Duo: case TwoFactorProviderType.YubiKey: case TwoFactorProviderType.U2f: // Keep to ensure old U2f keys are considered premium - case TwoFactorProviderType.WebAuthn: return true; default: return false; diff --git a/src/Core/Auth/Services/Implementations/AuthRequestService.cs b/src/Core/Auth/Services/Implementations/AuthRequestService.cs index b75a5c1303..e59177d9fd 100644 --- a/src/Core/Auth/Services/Implementations/AuthRequestService.cs +++ b/src/Core/Auth/Services/Implementations/AuthRequestService.cs @@ -82,34 +82,39 @@ public class AuthRequestService : IAuthRequestService /// public async Task CreateAuthRequestAsync(AuthRequestCreateRequestModel model) { - var user = await _userRepository.GetByEmailAsync(model.Email); - if (user == null) - { - throw new NotFoundException(); - } - if (!_currentContext.DeviceType.HasValue) { throw new BadRequestException("Device type not provided."); } - if (_globalSettings.PasswordlessAuth.KnownDevicesOnly) + var userNotFound = false; + var user = await _userRepository.GetByEmailAsync(model.Email); + if (user == null) + { + userNotFound = true; + } + else if (_globalSettings.PasswordlessAuth.KnownDevicesOnly) { var devices = await _deviceRepository.GetManyByUserIdAsync(user.Id); if (devices == null || !devices.Any(d => d.Identifier == model.DeviceIdentifier)) { - throw new BadRequestException( - "Login with device is only available on devices that have been previously logged in."); + userNotFound = true; } } + // Anonymous endpoints must not leak that a user exists or not + if (userNotFound) + { + throw new BadRequestException("User or known device not found."); + } + // AdminApproval requests require correlating the user and their organization if (model.Type == AuthRequestType.AdminApproval) { // TODO: When single org policy is turned on we should query for only a single organization from the current user // and create only an AuthRequest for that organization and return only that one - // This will send out the request to all organizations this user belongs to + // This will send out the request to all organizations this user belongs to var organizationUsers = await _organizationUserRepository.GetManyByUserAsync(_currentContext.UserId!.Value); if (organizationUsers.Count == 0) @@ -173,7 +178,7 @@ public class AuthRequestService : IAuthRequestService switch (authRequest.Type) { case AuthRequestType.AdminApproval: - // AdminApproval has a different expiration time, by default is 7 days compared to + // AdminApproval has a different expiration time, by default is 7 days compared to // non-AdminApproval ones having a default of 15 minutes. if (IsDateExpired(authRequest.CreationDate, _globalSettings.PasswordlessAuth.AdminRequestExpiration)) { @@ -213,7 +218,7 @@ public class AuthRequestService : IAuthRequestService await _authRequestRepository.ReplaceAsync(authRequest); - // We only want to send an approval notification if the request is approved (or null), + // We only want to send an approval notification if the request is approved (or null), // to not leak that it was denied to the originating client if it was originated by a malicious actor. if (authRequest.Approved ?? true) { diff --git a/src/Core/Constants.cs b/src/Core/Constants.cs index 8db721d17e..db7aa17757 100644 --- a/src/Core/Constants.cs +++ b/src/Core/Constants.cs @@ -36,7 +36,6 @@ public static class FeatureFlagKeys public const string DisplayEuEnvironment = "display-eu-environment"; public const string DisplayLowKdfIterationWarning = "display-kdf-iteration-warning"; public const string TrustedDeviceEncryption = "trusted-device-encryption"; - public const string SecretsManagerBilling = "sm-ga-billing"; public const string AutofillV2 = "autofill-v2"; public static List GetAllKeys() @@ -46,4 +45,13 @@ public static class FeatureFlagKeys .Select(x => (string)x.GetRawConstantValue()) .ToList(); } + + public static Dictionary GetLocalOverrideFlagValues() + { + // place overriding values when needed locally (offline), or return null + return new Dictionary() + { + { TrustedDeviceEncryption, "true" } + }; + } } diff --git a/src/Core/Context/CurrentContext.cs b/src/Core/Context/CurrentContext.cs index 4877a9a8f2..4751beb797 100644 --- a/src/Core/Context/CurrentContext.cs +++ b/src/Core/Context/CurrentContext.cs @@ -358,7 +358,9 @@ public class CurrentContext : ICurrentContext public async Task ViewAssignedCollections(Guid orgId) { - return await EditAssignedCollections(orgId) || await DeleteAssignedCollections(orgId); + return await CreateNewCollections(orgId) // Required to display the existing collections under which the new collection can be nested + || await EditAssignedCollections(orgId) + || await DeleteAssignedCollections(orgId); } public async Task ManageGroups(Guid orgId) diff --git a/src/Core/Core.csproj b/src/Core/Core.csproj index 95b5fe8eeb..dff657d7e8 100644 --- a/src/Core/Core.csproj +++ b/src/Core/Core.csproj @@ -51,7 +51,7 @@ - + diff --git a/src/Core/Models/Business/TaxInfo.cs b/src/Core/Models/Business/TaxInfo.cs index e763b72235..4424576ec9 100644 --- a/src/Core/Models/Business/TaxInfo.cs +++ b/src/Core/Models/Business/TaxInfo.cs @@ -35,14 +35,23 @@ public class TaxInfo return _taxIdType; } - switch (BillingAddressCountry) + switch (BillingAddressCountry.ToUpper()) { + case "AD": + _taxIdType = "ad_nrt"; + break; case "AE": _taxIdType = "ae_trn"; break; + case "AR": + _taxIdType = "ar_cuit"; + break; case "AU": _taxIdType = "au_abn"; break; + case "BO": + _taxIdType = "bo_tin"; + break; case "BR": _taxIdType = "br_cnpj"; break; @@ -55,9 +64,45 @@ public class TaxInfo } _taxIdType = "ca_bn"; break; + case "CH": + _taxIdType = "ch_vat"; + break; case "CL": _taxIdType = "cl_tin"; break; + case "CN": + _taxIdType = "cn_tin"; + break; + case "CO": + _taxIdType = "co_nit"; + break; + case "CR": + _taxIdType = "cr_tin"; + break; + case "DO": + _taxIdType = "do_rcn"; + break; + case "EC": + _taxIdType = "ec_ruc"; + break; + case "EG": + _taxIdType = "eg_tin"; + break; + case "GE": + _taxIdType = "ge_vat"; + break; + case "ID": + _taxIdType = "id_npwp"; + break; + case "IL": + _taxIdType = "il_vat"; + break; + case "IS": + _taxIdType = "is_vat"; + break; + case "KE": + _taxIdType = "ke_pin"; + break; case "AT": case "BE": case "BG": @@ -115,6 +160,15 @@ public class TaxInfo case "NZ": _taxIdType = "nz_gst"; break; + case "PE": + _taxIdType = "pe_ruc"; + break; + case "PH": + _taxIdType = "ph_tin"; + break; + case "RS": + _taxIdType = "rs_pib"; + break; case "RU": _taxIdType = "ru_inn"; break; @@ -124,15 +178,33 @@ public class TaxInfo case "SG": _taxIdType = "sg_gst"; break; + case "SV": + _taxIdType = "sv_nit"; + break; case "TH": _taxIdType = "th_vat"; break; + case "TR": + _taxIdType = "tr_tin"; + break; case "TW": _taxIdType = "tw_vat"; break; + case "UA": + _taxIdType = "ua_vat"; + break; case "US": _taxIdType = "us_ein"; break; + case "UY": + _taxIdType = "uy_ruc"; + break; + case "VE": + _taxIdType = "ve_rif"; + break; + case "VN": + _taxIdType = "vn_tin"; + break; case "ZA": _taxIdType = "za_vat"; break; diff --git a/src/Core/OrganizationFeatures/OrganizationServiceCollectionExtensions.cs b/src/Core/OrganizationFeatures/OrganizationServiceCollectionExtensions.cs index a534ed5bea..1756149236 100644 --- a/src/Core/OrganizationFeatures/OrganizationServiceCollectionExtensions.cs +++ b/src/Core/OrganizationFeatures/OrganizationServiceCollectionExtensions.cs @@ -45,6 +45,7 @@ public static class OrganizationServiceCollectionExtensions services.AddOrganizationLicenseCommandsQueries(); services.AddOrganizationDomainCommandsQueries(); services.AddOrganizationAuthCommands(); + services.AddOrganizationUserCommands(); services.AddOrganizationUserCommandsQueries(); services.AddBaseOrganizationSubscriptionCommandsQueries(); } @@ -81,6 +82,12 @@ public static class OrganizationServiceCollectionExtensions } } + private static void AddOrganizationUserCommands(this IServiceCollection services) + { + services.AddScoped(); + services.AddScoped(); + } + private static void AddOrganizationApiKeyCommandsQueries(this IServiceCollection services) { services.AddScoped(); diff --git a/src/Core/OrganizationFeatures/OrganizationUsers/Interfaces/IUpdateOrganizationUserGroupsCommand.cs b/src/Core/OrganizationFeatures/OrganizationUsers/Interfaces/IUpdateOrganizationUserGroupsCommand.cs new file mode 100644 index 0000000000..9dae932334 --- /dev/null +++ b/src/Core/OrganizationFeatures/OrganizationUsers/Interfaces/IUpdateOrganizationUserGroupsCommand.cs @@ -0,0 +1,8 @@ +using Bit.Core.Entities; + +namespace Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; + +public interface IUpdateOrganizationUserGroupsCommand +{ + Task UpdateUserGroupsAsync(OrganizationUser organizationUser, IEnumerable groupIds, Guid? loggedInUserId); +} diff --git a/src/Core/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommand.cs b/src/Core/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommand.cs new file mode 100644 index 0000000000..7bb5814d6e --- /dev/null +++ b/src/Core/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommand.cs @@ -0,0 +1,34 @@ +using Bit.Core.Entities; +using Bit.Core.Enums; +using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces; +using Bit.Core.Repositories; +using Bit.Core.Services; + +namespace Bit.Core.OrganizationFeatures.OrganizationUsers; + +public class UpdateOrganizationUserGroupsCommand : IUpdateOrganizationUserGroupsCommand +{ + private readonly IEventService _eventService; + private readonly IOrganizationService _organizationService; + private readonly IOrganizationUserRepository _organizationUserRepository; + + public UpdateOrganizationUserGroupsCommand( + IEventService eventService, + IOrganizationService organizationService, + IOrganizationUserRepository organizationUserRepository) + { + _eventService = eventService; + _organizationService = organizationService; + _organizationUserRepository = organizationUserRepository; + } + + public async Task UpdateUserGroupsAsync(OrganizationUser organizationUser, IEnumerable groupIds, Guid? loggedInUserId) + { + if (loggedInUserId.HasValue) + { + await _organizationService.ValidateOrganizationUserUpdatePermissions(organizationUser.OrganizationId, organizationUser.Type, null, organizationUser.GetPermissions()); + } + await _organizationUserRepository.UpdateGroupsAsync(organizationUser.Id, groupIds); + await _eventService.LogOrganizationUserEventAsync(organizationUser, EventType.OrganizationUser_UpdatedGroups); + } +} diff --git a/src/Core/SecretsManager/Queries/Projects/Interfaces/IMaxProjectsQuery.cs b/src/Core/SecretsManager/Queries/Projects/Interfaces/IMaxProjectsQuery.cs index e00f5ed674..6bb9a40c75 100644 --- a/src/Core/SecretsManager/Queries/Projects/Interfaces/IMaxProjectsQuery.cs +++ b/src/Core/SecretsManager/Queries/Projects/Interfaces/IMaxProjectsQuery.cs @@ -2,5 +2,5 @@ public interface IMaxProjectsQuery { - Task<(short? max, bool? atMax)> GetByOrgIdAsync(Guid organizationId); + Task<(short? max, bool? overMax)> GetByOrgIdAsync(Guid organizationId, int projectsToAdd); } diff --git a/src/Core/Services/IOrganizationService.cs b/src/Core/Services/IOrganizationService.cs index 832aa9de4c..3c48367d53 100644 --- a/src/Core/Services/IOrganizationService.cs +++ b/src/Core/Services/IOrganizationService.cs @@ -39,6 +39,12 @@ public interface IOrganizationService OrganizationUserType type, bool accessAll, string externalId, IEnumerable collections, IEnumerable groups); Task>> ResendInvitesAsync(Guid organizationId, Guid? invitingUserId, IEnumerable organizationUsersId); Task ResendInviteAsync(Guid organizationId, Guid? invitingUserId, Guid organizationUserId, bool initOrganization = false); + /// + /// Moves an OrganizationUser into the Accepted status and marks their email as verified. + /// This method is used where the user has clicked the invitation link sent by email. + /// + /// The token embedded in the email invitation link + /// The accepted OrganizationUser. Task AcceptUserAsync(Guid organizationUserId, User user, string token, IUserService userService); Task AcceptUserAsync(string orgIdentifier, User user, IUserService userService); Task AcceptUserAsync(Guid organizationId, User user, IUserService userService); @@ -54,7 +60,6 @@ public interface IOrganizationService Task DeleteUserAsync(Guid organizationId, Guid userId); Task>> DeleteUsersAsync(Guid organizationId, IEnumerable organizationUserIds, Guid? deletingUserId); - Task UpdateUserGroupsAsync(OrganizationUser organizationUser, IEnumerable groupIds, Guid? loggedInUserId); Task UpdateUserResetPasswordEnrollmentAsync(Guid organizationId, Guid userId, string resetPasswordKey, Guid? callingUserId); Task ImportAsync(Guid organizationId, Guid? importingUserId, IEnumerable groups, IEnumerable newUsers, IEnumerable removeUserExternalIds, @@ -82,4 +87,6 @@ public interface IOrganizationService void ValidatePasswordManagerPlan(Models.StaticStore.Plan plan, OrganizationUpgrade upgrade); void ValidateSecretsManagerPlan(Models.StaticStore.Plan plan, OrganizationUpgrade upgrade); + Task ValidateOrganizationUserUpdatePermissions(Guid organizationId, OrganizationUserType newType, + OrganizationUserType? oldType, Permissions permissions); } diff --git a/src/Core/Services/Implementations/LaunchDarklyFeatureService.cs b/src/Core/Services/Implementations/LaunchDarklyFeatureService.cs index adf2a6e96a..501db21d82 100644 --- a/src/Core/Services/Implementations/LaunchDarklyFeatureService.cs +++ b/src/Core/Services/Implementations/LaunchDarklyFeatureService.cs @@ -29,24 +29,12 @@ public class LaunchDarklyFeatureService : IFeatureService, IDisposable // support configuration directly from settings else if (globalSettings.LaunchDarkly?.FlagValues?.Any() is true) { - var source = TestData.DataSource(); - foreach (var kvp in globalSettings.LaunchDarkly.FlagValues) - { - if (bool.TryParse(kvp.Value, out bool boolValue)) - { - source.Update(source.Flag(kvp.Key).ValueForAll(LaunchDarkly.Sdk.LdValue.Of(boolValue))); - } - else if (int.TryParse(kvp.Value, out int intValue)) - { - source.Update(source.Flag(kvp.Key).ValueForAll(LaunchDarkly.Sdk.LdValue.Of(intValue))); - } - else - { - source.Update(source.Flag(kvp.Key).ValueForAll(LaunchDarkly.Sdk.LdValue.Of(kvp.Value))); - } - } - - ldConfig.DataSource(source); + ldConfig.DataSource(BuildDataSource(globalSettings.LaunchDarkly.FlagValues)); + } + // support local overrides + else if (FeatureFlagKeys.GetLocalOverrideFlagValues()?.Any() is true) + { + ldConfig.DataSource(BuildDataSource(FeatureFlagKeys.GetLocalOverrideFlagValues())); } else { @@ -187,4 +175,26 @@ public class LaunchDarklyFeatureService : IFeatureService, IDisposable return builder.Build(); } + + private TestData BuildDataSource(Dictionary values) + { + var source = TestData.DataSource(); + foreach (var kvp in values) + { + if (bool.TryParse(kvp.Value, out bool boolValue)) + { + source.Update(source.Flag(kvp.Key).ValueForAll(LaunchDarkly.Sdk.LdValue.Of(boolValue))); + } + else if (int.TryParse(kvp.Value, out int intValue)) + { + source.Update(source.Flag(kvp.Key).ValueForAll(LaunchDarkly.Sdk.LdValue.Of(intValue))); + } + else + { + source.Update(source.Flag(kvp.Key).ValueForAll(LaunchDarkly.Sdk.LdValue.Of(kvp.Value))); + } + } + + return source; + } } diff --git a/src/Core/Services/Implementations/OrganizationService.cs b/src/Core/Services/Implementations/OrganizationService.cs index 0699168031..2388faded2 100644 --- a/src/Core/Services/Implementations/OrganizationService.cs +++ b/src/Core/Services/Implementations/OrganizationService.cs @@ -1098,7 +1098,15 @@ public class OrganizationService : IOrganizationService throw new BadRequestException("User email does not match invite."); } - return await AcceptUserAsync(orgUser, user, userService); + var organizationUser = await AcceptUserAsync(orgUser, user, userService); + + if (user.EmailVerified == false) + { + user.EmailVerified = true; + await _userRepository.ReplaceAsync(user); + } + + return organizationUser; } public async Task AcceptUserAsync(string orgIdentifier, User user, IUserService userService) @@ -1587,17 +1595,6 @@ public class OrganizationService : IOrganizationService return hasOtherOwner; } - public async Task UpdateUserGroupsAsync(OrganizationUser organizationUser, IEnumerable groupIds, Guid? loggedInUserId) - { - if (loggedInUserId.HasValue) - { - await ValidateOrganizationUserUpdatePermissions(organizationUser.OrganizationId, organizationUser.Type, null, organizationUser.GetPermissions()); - } - await _organizationUserRepository.UpdateGroupsAsync(organizationUser.Id, groupIds); - await _eventService.LogOrganizationUserEventAsync(organizationUser, - EventType.OrganizationUser_UpdatedGroups); - } - public async Task UpdateUserResetPasswordEnrollmentAsync(Guid organizationId, Guid userId, string resetPasswordKey, Guid? callingUserId) { // Org User must be the same as the calling user and the organization ID associated with the user must match passed org ID @@ -2037,7 +2034,7 @@ public class OrganizationService : IOrganizationService } } - private async Task ValidateOrganizationUserUpdatePermissions(Guid organizationId, OrganizationUserType newType, OrganizationUserType? oldType, Permissions permissions) + public async Task ValidateOrganizationUserUpdatePermissions(Guid organizationId, OrganizationUserType newType, OrganizationUserType? oldType, Permissions permissions) { if (await _currentContext.OrganizationOwner(organizationId)) { diff --git a/src/Core/packages.lock.json b/src/Core/packages.lock.json index 57052b8e95..26d7ee5280 100644 --- a/src/Core/packages.lock.json +++ b/src/Core/packages.lock.json @@ -98,11 +98,12 @@ }, "Braintree": { "type": "Direct", - "requested": "[5.12.0, )", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "requested": "[5.19.0, )", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, diff --git a/src/Events/packages.lock.json b/src/Events/packages.lock.json index ad36bb6cd7..16a42f355d 100644 --- a/src/Events/packages.lock.json +++ b/src/Events/packages.lock.json @@ -158,10 +158,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2588,71 +2589,71 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/src/EventsProcessor/packages.lock.json b/src/EventsProcessor/packages.lock.json index ad36bb6cd7..16a42f355d 100644 --- a/src/EventsProcessor/packages.lock.json +++ b/src/EventsProcessor/packages.lock.json @@ -158,10 +158,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2588,71 +2589,71 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/src/Icons/packages.lock.json b/src/Icons/packages.lock.json index eaf9913dc4..0b2c51d0c0 100644 --- a/src/Icons/packages.lock.json +++ b/src/Icons/packages.lock.json @@ -167,10 +167,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2597,71 +2598,71 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/src/Identity/IdentityServer/BaseRequestValidator.cs b/src/Identity/IdentityServer/BaseRequestValidator.cs index e0cafbfa13..d52d3064a6 100644 --- a/src/Identity/IdentityServer/BaseRequestValidator.cs +++ b/src/Identity/IdentityServer/BaseRequestValidator.cs @@ -26,6 +26,7 @@ using Bit.Core.Utilities; using Bit.Identity.Utilities; using IdentityServer4.Validation; using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.Caching.Distributed; namespace Bit.Identity.IdentityServer; @@ -45,6 +46,8 @@ public abstract class BaseRequestValidator where T : class private readonly GlobalSettings _globalSettings; private readonly IUserRepository _userRepository; private readonly IDataProtectorTokenFactory _tokenDataFactory; + private readonly IDistributedCache _distributedCache; + private readonly DistributedCacheEntryOptions _cacheEntryOptions; protected ICurrentContext CurrentContext { get; } protected IPolicyService PolicyService { get; } @@ -69,7 +72,8 @@ public abstract class BaseRequestValidator where T : class IPolicyService policyService, IDataProtectorTokenFactory tokenDataFactory, IFeatureService featureService, - ISsoConfigRepository ssoConfigRepository) + ISsoConfigRepository ssoConfigRepository, + IDistributedCache distributedCache) { _userManager = userManager; _deviceRepository = deviceRepository; @@ -89,6 +93,14 @@ public abstract class BaseRequestValidator where T : class _tokenDataFactory = tokenDataFactory; FeatureService = featureService; SsoConfigRepository = ssoConfigRepository; + _distributedCache = distributedCache; + _cacheEntryOptions = new DistributedCacheEntryOptions + { + // This sets the time an item is cached to 15 minutes. This value is hard coded + // to 15 because to it covers all time-out windows for both Authenticators and + // Email TOTP. + AbsoluteExpirationRelativeToNow = new TimeSpan(0, 15, 0) + }; } protected async Task ValidateAsync(T context, ValidatedTokenRequest request, @@ -135,18 +147,26 @@ public abstract class BaseRequestValidator where T : class var verified = await VerifyTwoFactor(user, twoFactorOrganization, twoFactorProviderType, twoFactorToken); - if ((!verified || isBot) && twoFactorProviderType != TwoFactorProviderType.Remember) + var cacheKey = "TOTP_" + user.Email + "_" + twoFactorToken; + + var isOtpCached = Core.Utilities.DistributedCacheExtensions.TryGetValue(_distributedCache, cacheKey, out string _); + if (!verified || isBot || isOtpCached) { - await UpdateFailedAuthDetailsAsync(user, true, !validatorContext.KnownDevice); - await BuildErrorResultAsync("Two-step token is invalid. Try again.", true, context, user); + if (twoFactorProviderType != TwoFactorProviderType.Remember) + { + await UpdateFailedAuthDetailsAsync(user, true, !validatorContext.KnownDevice); + await BuildErrorResultAsync("Two-step token is invalid. Try again.", true, context, user); + } + else if (twoFactorProviderType == TwoFactorProviderType.Remember) + { + await BuildTwoFactorResultAsync(user, twoFactorOrganization, context); + } return; } - else if ((!verified || isBot) && twoFactorProviderType == TwoFactorProviderType.Remember) + // We only want to track TOTPs in the chache to enforce one time use. + if (twoFactorProviderType == TwoFactorProviderType.Authenticator || twoFactorProviderType == TwoFactorProviderType.Email) { - // Delay for brute force. - await Task.Delay(2000); - await BuildTwoFactorResultAsync(user, twoFactorOrganization, context); - return; + await Core.Utilities.DistributedCacheExtensions.SetAsync(_distributedCache, cacheKey, twoFactorToken, _cacheEntryOptions); } } else diff --git a/src/Identity/IdentityServer/CustomTokenRequestValidator.cs b/src/Identity/IdentityServer/CustomTokenRequestValidator.cs index e6e39bade1..a15a738372 100644 --- a/src/Identity/IdentityServer/CustomTokenRequestValidator.cs +++ b/src/Identity/IdentityServer/CustomTokenRequestValidator.cs @@ -14,6 +14,7 @@ using IdentityModel; using IdentityServer4.Extensions; using IdentityServer4.Validation; using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.Caching.Distributed; #nullable enable @@ -42,11 +43,13 @@ public class CustomTokenRequestValidator : BaseRequestValidator tokenDataFactory, - IFeatureService featureService) + IFeatureService featureService, + IDistributedCache distributedCache) : base(userManager, deviceRepository, deviceService, userService, eventService, organizationDuoWebTokenProvider, organizationRepository, organizationUserRepository, applicationCacheService, mailService, logger, currentContext, globalSettings, - userRepository, policyService, tokenDataFactory, featureService, ssoConfigRepository) + userRepository, policyService, tokenDataFactory, featureService, ssoConfigRepository, + distributedCache) { _userManager = userManager; } diff --git a/src/Identity/IdentityServer/ResourceOwnerPasswordValidator.cs b/src/Identity/IdentityServer/ResourceOwnerPasswordValidator.cs index df17a474a3..8b8b0be52d 100644 --- a/src/Identity/IdentityServer/ResourceOwnerPasswordValidator.cs +++ b/src/Identity/IdentityServer/ResourceOwnerPasswordValidator.cs @@ -13,6 +13,7 @@ using Bit.Core.Utilities; using IdentityServer4.Models; using IdentityServer4.Validation; using Microsoft.AspNetCore.Identity; +using Microsoft.Extensions.Caching.Distributed; namespace Bit.Identity.IdentityServer; @@ -44,11 +45,12 @@ public class ResourceOwnerPasswordValidator : BaseRequestValidator tokenDataFactory, IFeatureService featureService, - ISsoConfigRepository ssoConfigRepository) + ISsoConfigRepository ssoConfigRepository, + IDistributedCache distributedCache) : base(userManager, deviceRepository, deviceService, userService, eventService, organizationDuoWebTokenProvider, organizationRepository, organizationUserRepository, applicationCacheService, mailService, logger, currentContext, globalSettings, userRepository, policyService, - tokenDataFactory, featureService, ssoConfigRepository) + tokenDataFactory, featureService, ssoConfigRepository, distributedCache) { _userManager = userManager; _userService = userService; diff --git a/src/Identity/packages.lock.json b/src/Identity/packages.lock.json index dba26e1fd2..3577f2faef 100644 --- a/src/Identity/packages.lock.json +++ b/src/Identity/packages.lock.json @@ -167,10 +167,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2610,71 +2611,71 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/src/Infrastructure.Dapper/packages.lock.json b/src/Infrastructure.Dapper/packages.lock.json index d4a6831987..8700a708a7 100644 --- a/src/Infrastructure.Dapper/packages.lock.json +++ b/src/Infrastructure.Dapper/packages.lock.json @@ -147,10 +147,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2430,43 +2431,43 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } } } diff --git a/src/Infrastructure.EntityFramework/Repositories/OrganizationRepository.cs b/src/Infrastructure.EntityFramework/Repositories/OrganizationRepository.cs index 702f9bea53..b7ffb9978a 100644 --- a/src/Infrastructure.EntityFramework/Repositories/OrganizationRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/OrganizationRepository.cs @@ -144,27 +144,42 @@ public class OrganizationRepository : Repository c.UserId == null && c.OrganizationId == organization.Id)); + await dbContext.Ciphers.Where(c => c.UserId == null && c.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); await deleteCiphersTransaction.CommitAsync(); + var organizationDeleteTransaction = await dbContext.Database.BeginTransactionAsync(); - dbContext.SsoUsers.RemoveRange(dbContext.SsoUsers.Where(su => su.OrganizationId == organization.Id)); - dbContext.SsoConfigs.RemoveRange(dbContext.SsoConfigs.Where(sc => sc.OrganizationId == organization.Id)); - var collectionUsers = from cu in dbContext.CollectionUsers - join ou in dbContext.OrganizationUsers on cu.OrganizationUserId equals ou.Id - where ou.OrganizationId == organization.Id - select cu; - dbContext.CollectionUsers.RemoveRange(collectionUsers); - dbContext.OrganizationUsers.RemoveRange( - dbContext.OrganizationUsers.Where(ou => ou.OrganizationId == organization.Id)); - dbContext.ProviderOrganizations.RemoveRange( - dbContext.ProviderOrganizations.Where(po => po.OrganizationId == organization.Id)); + await dbContext.SsoUsers.Where(su => su.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); + await dbContext.SsoConfigs.Where(sc => sc.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); + await dbContext.CollectionUsers.Where(cu => cu.OrganizationUser.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); + await dbContext.UserProjectAccessPolicy.Where(ap => ap.OrganizationUser.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); + await dbContext.UserServiceAccountAccessPolicy.Where(ap => ap.OrganizationUser.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); + await dbContext.OrganizationUsers.Where(ou => ou.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); + await dbContext.ProviderOrganizations.Where(po => po.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); + + await dbContext.GroupServiceAccountAccessPolicy.Where(ap => ap.GrantedServiceAccount.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); + await dbContext.Project.Where(p => p.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); + await dbContext.Secret.Where(s => s.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); + await dbContext.ApiKeys.Where(ak => ak.ServiceAccount.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); + await dbContext.ServiceAccount.Where(sa => sa.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); // The below section are 3 SPROCS in SQL Server but are only called by here - dbContext.OrganizationApiKeys.RemoveRange( - dbContext.OrganizationApiKeys.Where(oa => oa.OrganizationId == organization.Id)); - dbContext.OrganizationConnections.RemoveRange( - dbContext.OrganizationConnections.Where(oc => oc.OrganizationId == organization.Id)); + await dbContext.OrganizationApiKeys.Where(oa => oa.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); + await dbContext.OrganizationConnections.Where(oc => oc.OrganizationId == organization.Id) + .ExecuteDeleteAsync(); var sponsoringOrgs = await dbContext.OrganizationSponsorships .Where(os => os.SponsoringOrganizationId == organization.Id) .ToListAsync(); diff --git a/src/Infrastructure.EntityFramework/Repositories/OrganizationUserRepository.cs b/src/Infrastructure.EntityFramework/Repositories/OrganizationUserRepository.cs index 8256696d96..b3adada814 100644 --- a/src/Infrastructure.EntityFramework/Repositories/OrganizationUserRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/OrganizationUserRepository.cs @@ -93,6 +93,11 @@ public class OrganizationUserRepository : Repository gu.OrganizationUserId == organizationUserId); dbContext.GroupUsers.RemoveRange(groupUsers); + dbContext.UserProjectAccessPolicy.RemoveRange( + dbContext.UserProjectAccessPolicy.Where(ap => ap.OrganizationUserId == organizationUserId)); + dbContext.UserServiceAccountAccessPolicy.RemoveRange( + dbContext.UserServiceAccountAccessPolicy.Where(ap => ap.OrganizationUserId == organizationUserId)); + var orgSponsorships = await dbContext.OrganizationSponsorships .Where(os => os.SponsoringOrganizationUserId == organizationUserId) .ToListAsync(); @@ -325,7 +330,7 @@ public class OrganizationUserRepository : Repository u.Id); var userIdEntities = dbContext.OrganizationUsers.Where(x => userIds.Contains(x.Id)); - // Query groups/collections separately to avoid cartesian explosion + // Query groups/collections separately to avoid cartesian explosion if (includeGroups) { groups = (await (from gu in dbContext.GroupUsers diff --git a/src/Infrastructure.EntityFramework/Repositories/UserRepository.cs b/src/Infrastructure.EntityFramework/Repositories/UserRepository.cs index ba422c789b..b29153e47c 100644 --- a/src/Infrastructure.EntityFramework/Repositories/UserRepository.cs +++ b/src/Infrastructure.EntityFramework/Repositories/UserRepository.cs @@ -167,6 +167,10 @@ public class UserRepository : Repository, IUserR where ou.UserId == user.Id select gu; dbContext.GroupUsers.RemoveRange(groupUsers); + dbContext.UserProjectAccessPolicy.RemoveRange( + dbContext.UserProjectAccessPolicy.Where(ap => ap.OrganizationUser.UserId == user.Id)); + dbContext.UserServiceAccountAccessPolicy.RemoveRange( + dbContext.UserServiceAccountAccessPolicy.Where(ap => ap.OrganizationUser.UserId == user.Id)); dbContext.OrganizationUsers.RemoveRange(dbContext.OrganizationUsers.Where(ou => ou.UserId == user.Id)); dbContext.ProviderUsers.RemoveRange(dbContext.ProviderUsers.Where(pu => pu.UserId == user.Id)); dbContext.SsoUsers.RemoveRange(dbContext.SsoUsers.Where(su => su.UserId == user.Id)); diff --git a/src/Infrastructure.EntityFramework/SecretsManager/Configurations/AccessPolicyEntityTypeConfiguration.cs b/src/Infrastructure.EntityFramework/SecretsManager/Configurations/AccessPolicyEntityTypeConfiguration.cs index dd7f01f5d5..9e8732a854 100644 --- a/src/Infrastructure.EntityFramework/SecretsManager/Configurations/AccessPolicyEntityTypeConfiguration.cs +++ b/src/Infrastructure.EntityFramework/SecretsManager/Configurations/AccessPolicyEntityTypeConfiguration.cs @@ -39,6 +39,12 @@ public class UserProjectAccessPolicyEntityTypeConfiguration : IEntityTypeConfigu builder .Property(e => e.GrantedProjectId) .HasColumnName(nameof(UserProjectAccessPolicy.GrantedProjectId)); + + builder + .HasOne(e => e.GrantedProject) + .WithMany(e => e.UserAccessPolicies) + .HasForeignKey(nameof(UserProjectAccessPolicy.GrantedProjectId)) + .OnDelete(DeleteBehavior.Cascade); } } @@ -67,6 +73,18 @@ public class GroupProjectAccessPolicyEntityTypeConfiguration : IEntityTypeConfig builder .Property(e => e.GrantedProjectId) .HasColumnName(nameof(GroupProjectAccessPolicy.GrantedProjectId)); + + builder + .HasOne(e => e.GrantedProject) + .WithMany(e => e.GroupAccessPolicies) + .HasForeignKey(nameof(GroupProjectAccessPolicy.GrantedProjectId)) + .OnDelete(DeleteBehavior.Cascade); + + builder + .HasOne(e => e.Group) + .WithMany() + .HasForeignKey(nameof(GroupProjectAccessPolicy.GroupId)) + .OnDelete(DeleteBehavior.Cascade); } } @@ -81,6 +99,12 @@ public class GroupServiceAccountAccessPolicyEntityTypeConfiguration : IEntityTyp builder .Property(e => e.GrantedServiceAccountId) .HasColumnName(nameof(GroupServiceAccountAccessPolicy.GrantedServiceAccountId)); + + builder + .HasOne(e => e.Group) + .WithMany() + .HasForeignKey(nameof(GroupProjectAccessPolicy.GroupId)) + .OnDelete(DeleteBehavior.Cascade); } } @@ -95,5 +119,11 @@ public class ServiceAccountProjectAccessPolicyEntityTypeConfiguration : IEntityT builder .Property(e => e.GrantedProjectId) .HasColumnName(nameof(ServiceAccountProjectAccessPolicy.GrantedProjectId)); + + builder + .HasOne(e => e.GrantedProject) + .WithMany(e => e.ServiceAccountAccessPolicies) + .HasForeignKey(nameof(ServiceAccountProjectAccessPolicy.GrantedProjectId)) + .OnDelete(DeleteBehavior.Cascade); } } diff --git a/src/Infrastructure.EntityFramework/packages.lock.json b/src/Infrastructure.EntityFramework/packages.lock.json index 5ba1a4723e..90a67e5d86 100644 --- a/src/Infrastructure.EntityFramework/packages.lock.json +++ b/src/Infrastructure.EntityFramework/packages.lock.json @@ -221,10 +221,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2590,43 +2591,43 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } } } diff --git a/src/Notifications/Notifications.csproj b/src/Notifications/Notifications.csproj index b9f2528011..30391c0af1 100644 --- a/src/Notifications/Notifications.csproj +++ b/src/Notifications/Notifications.csproj @@ -8,7 +8,7 @@ - + diff --git a/src/Notifications/packages.lock.json b/src/Notifications/packages.lock.json index bcbdffb856..3da9edc48e 100644 --- a/src/Notifications/packages.lock.json +++ b/src/Notifications/packages.lock.json @@ -14,9 +14,9 @@ }, "Microsoft.AspNetCore.SignalR.StackExchangeRedis": { "type": "Direct", - "requested": "[6.0.4, )", - "resolved": "6.0.4", - "contentHash": "E3Ihoz4xXHVyqx4ZidQAEbWbjD0bEOTsnDMuz7FoFyev0fLJCHWOiR6Y9E+8Qb/dmUDrfaLdZzKUSwtlHPGGgA==", + "requested": "[6.0.22, )", + "resolved": "6.0.22", + "contentHash": "qcwxQNBUIuiVCA8pJTPoxFXQOum0R3+Lh7bfHOQxgpcP3wNQoSRK8yqEEiv0E15vMLiboh88+Ujnu2Wzq66onQ==", "dependencies": { "MessagePack": "2.1.90", "Microsoft.Extensions.Options": "6.0.0", @@ -179,10 +179,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2638,71 +2639,71 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/src/SharedWeb/packages.lock.json b/src/SharedWeb/packages.lock.json index f2362deb13..08d941f5b0 100644 --- a/src/SharedWeb/packages.lock.json +++ b/src/SharedWeb/packages.lock.json @@ -158,10 +158,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2588,63 +2589,63 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } } } diff --git a/test/Api.IntegrationTest/packages.lock.json b/test/Api.IntegrationTest/packages.lock.json index e5303d8110..4dacbaa007 100644 --- a/test/Api.IntegrationTest/packages.lock.json +++ b/test/Api.IntegrationTest/packages.lock.json @@ -321,10 +321,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -3137,133 +3138,133 @@ "api": { "type": "Project", "dependencies": { - "AspNetCore.HealthChecks.AzureServiceBus": "6.1.0", - "AspNetCore.HealthChecks.AzureStorage": "6.1.2", - "AspNetCore.HealthChecks.Network": "6.0.4", - "AspNetCore.HealthChecks.Redis": "6.0.4", - "AspNetCore.HealthChecks.SendGrid": "6.0.2", - "AspNetCore.HealthChecks.SqlServer": "6.0.2", - "AspNetCore.HealthChecks.Uris": "6.0.3", - "Azure.Messaging.EventGrid": "4.10.0", - "Commercial.Core": "2023.7.2", - "Commercial.Infrastructure.EntityFramework": "2023.7.2", - "Core": "2023.7.2", - "SharedWeb": "2023.7.2", - "Swashbuckle.AspNetCore": "6.5.0" + "AspNetCore.HealthChecks.AzureServiceBus": "[6.1.0, )", + "AspNetCore.HealthChecks.AzureStorage": "[6.1.2, )", + "AspNetCore.HealthChecks.Network": "[6.0.4, )", + "AspNetCore.HealthChecks.Redis": "[6.0.4, )", + "AspNetCore.HealthChecks.SendGrid": "[6.0.2, )", + "AspNetCore.HealthChecks.SqlServer": "[6.0.2, )", + "AspNetCore.HealthChecks.Uris": "[6.0.3, )", + "Azure.Messaging.EventGrid": "[4.10.0, )", + "Commercial.Core": "[2023.9.0, )", + "Commercial.Infrastructure.EntityFramework": "[2023.9.0, )", + "Core": "[2023.9.0, )", + "SharedWeb": "[2023.9.0, )", + "Swashbuckle.AspNetCore": "[6.5.0, )" } }, "commercial.core": { "type": "Project", "dependencies": { - "Core": "2023.7.2" + "Core": "[2023.9.0, )" } }, "commercial.infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } }, "common": { "type": "Project", "dependencies": { - "AutoFixture.AutoNSubstitute": "4.17.0", - "AutoFixture.Xunit2": "4.17.0", - "Core": "2023.7.2", - "Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", - "Microsoft.NET.Test.Sdk": "17.1.0", - "NSubstitute": "4.3.0", - "xunit": "2.4.1" + "AutoFixture.AutoNSubstitute": "[4.17.0, )", + "AutoFixture.Xunit2": "[4.17.0, )", + "Core": "[2023.9.0, )", + "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", + "Microsoft.NET.Test.Sdk": "[17.1.0, )", + "NSubstitute": "[4.3.0, )", + "xunit": "[2.4.1, )" } }, "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "identity": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "SharedWeb": "2023.7.2", - "Swashbuckle.AspNetCore.SwaggerGen": "6.5.0" + "Core": "[2023.9.0, )", + "SharedWeb": "[2023.9.0, )", + "Swashbuckle.AspNetCore.SwaggerGen": "[6.5.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "integrationtestcommon": { "type": "Project", "dependencies": { - "Common": "2023.7.2", - "Identity": "2023.7.2", - "Microsoft.AspNetCore.Mvc.Testing": "6.0.5", - "Microsoft.EntityFrameworkCore.InMemory": "7.0.5", - "Microsoft.Extensions.Configuration": "6.0.1" + "Common": "[2023.9.0, )", + "Identity": "[2023.9.0, )", + "Microsoft.AspNetCore.Mvc.Testing": "[6.0.5, )", + "Microsoft.EntityFrameworkCore.InMemory": "[7.0.5, )", + "Microsoft.Extensions.Configuration": "[6.0.1, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/test/Api.Test/SecretsManager/Controllers/ProjectsControllerTests.cs b/test/Api.Test/SecretsManager/Controllers/ProjectsControllerTests.cs index 32239159a6..27aa7ea713 100644 --- a/test/Api.Test/SecretsManager/Controllers/ProjectsControllerTests.cs +++ b/test/Api.Test/SecretsManager/Controllers/ProjectsControllerTests.cs @@ -132,7 +132,7 @@ public class ProjectsControllerTests .AuthorizeAsync(Arg.Any(), data.ToProject(orgId), Arg.Any>()).ReturnsForAnyArgs(AuthorizationResult.Success()); sutProvider.GetDependency().GetProperUserId(default).ReturnsForAnyArgs(Guid.NewGuid()); - sutProvider.GetDependency().GetByOrgIdAsync(orgId).Returns(((short)3, true)); + sutProvider.GetDependency().GetByOrgIdAsync(orgId, 1).Returns(((short)3, true)); await Assert.ThrowsAsync(() => sutProvider.Sut.CreateAsync(orgId, data)); diff --git a/test/Api.Test/packages.lock.json b/test/Api.Test/packages.lock.json index 7f490ffb18..f778ea613b 100644 --- a/test/Api.Test/packages.lock.json +++ b/test/Api.Test/packages.lock.json @@ -331,10 +331,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -3014,25 +3015,25 @@ "AspNetCore.HealthChecks.SqlServer": "[6.0.2, )", "AspNetCore.HealthChecks.Uris": "[6.0.3, )", "Azure.Messaging.EventGrid": "[4.10.0, )", - "Commercial.Core": "[2023.7.2, )", - "Commercial.Infrastructure.EntityFramework": "[2023.7.2, )", - "Core": "[2023.7.2, )", - "SharedWeb": "[2023.7.2, )", + "Commercial.Core": "[2023.9.0, )", + "Commercial.Infrastructure.EntityFramework": "[2023.9.0, )", + "Core": "[2023.9.0, )", + "SharedWeb": "[2023.9.0, )", "Swashbuckle.AspNetCore": "[6.5.0, )" } }, "commercial.core": { "type": "Project", "dependencies": { - "Core": "[2023.7.2, )" + "Core": "[2023.9.0, )" } }, "commercial.infrastructure.entityframework": { "type": "Project", "dependencies": { "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", - "Core": "[2023.7.2, )", - "Infrastructure.EntityFramework": "[2023.7.2, )" + "Core": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } }, "common": { @@ -3040,7 +3041,7 @@ "dependencies": { "AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )", - "Core": "[2023.7.2, )", + "Core": "[2023.9.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )", "NSubstitute": "[4.3.0, )", @@ -3059,7 +3060,7 @@ "Azure.Storage.Blobs": "[12.14.1, )", "Azure.Storage.Queues": "[12.12.0, )", "BitPay.Light": "[1.0.1907, )", - "Braintree": "[5.12.0, )", + "Braintree": "[5.19.0, )", "DnsClient": "[1.7.0, )", "Fido2.AspNet": "[3.0.1, )", "Handlebars.Net": "[2.1.2, )", @@ -3094,8 +3095,8 @@ "dependencies": { "AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )", - "Common": "[2023.7.2, )", - "Core": "[2023.7.2, )", + "Common": "[2023.9.0, )", + "Core": "[2023.9.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )", "NSubstitute": "[4.3.0, )", @@ -3105,7 +3106,7 @@ "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "[2023.7.2, )", + "Core": "[2023.9.0, )", "Dapper": "[2.0.123, )" } }, @@ -3113,7 +3114,7 @@ "type": "Project", "dependencies": { "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", - "Core": "[2023.7.2, )", + "Core": "[2023.9.0, )", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", @@ -3125,9 +3126,9 @@ "sharedweb": { "type": "Project", "dependencies": { - "Core": "[2023.7.2, )", - "Infrastructure.Dapper": "[2023.7.2, )", - "Infrastructure.EntityFramework": "[2023.7.2, )" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/test/Billing.Test/packages.lock.json b/test/Billing.Test/packages.lock.json index d9ae0401b1..8284839385 100644 --- a/test/Billing.Test/packages.lock.json +++ b/test/Billing.Test/packages.lock.json @@ -228,10 +228,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2832,90 +2833,90 @@ "billing": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "SharedWeb": "2023.7.2" + "Core": "[2023.9.0, )", + "SharedWeb": "[2023.9.0, )" } }, "common": { "type": "Project", "dependencies": { - "AutoFixture.AutoNSubstitute": "4.17.0", - "AutoFixture.Xunit2": "4.17.0", - "Core": "2023.7.2", - "Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", - "Microsoft.NET.Test.Sdk": "17.1.0", - "NSubstitute": "4.3.0", - "xunit": "2.4.1" + "AutoFixture.AutoNSubstitute": "[4.17.0, )", + "AutoFixture.Xunit2": "[4.17.0, )", + "Core": "[2023.9.0, )", + "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", + "Microsoft.NET.Test.Sdk": "[17.1.0, )", + "NSubstitute": "[4.3.0, )", + "xunit": "[2.4.1, )" } }, "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/test/Common/packages.lock.json b/test/Common/packages.lock.json index 679c8a92cf..498b2f4613 100644 --- a/test/Common/packages.lock.json +++ b/test/Common/packages.lock.json @@ -216,10 +216,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2664,43 +2665,43 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } } } diff --git a/test/Core.Test/Auth/Models/Business/Tokenables/SsoEmail2faSessionTokenableTests.cs b/test/Core.Test/Auth/Models/Business/Tokenables/SsoEmail2faSessionTokenableTests.cs new file mode 100644 index 0000000000..8d989710fc --- /dev/null +++ b/test/Core.Test/Auth/Models/Business/Tokenables/SsoEmail2faSessionTokenableTests.cs @@ -0,0 +1,173 @@ +using AutoFixture.Xunit2; +using Bit.Core.Auth.Models.Business.Tokenables; +using Bit.Core.Entities; +using Bit.Core.Tokens; +using Xunit; +namespace Bit.Core.Test.Auth.Models.Business.Tokenables; + +// Note: these test names follow MethodName_StateUnderTest_ExpectedBehavior pattern. +public class SsoEmail2faSessionTokenableTests +{ + // Allow a small tolerance for possible execution delays or clock precision to avoid flaky tests. + private static readonly TimeSpan _timeTolerance = TimeSpan.FromMilliseconds(10); + + /// + /// Tests the default constructor behavior when passed a null user. + /// + [Fact] + public void Constructor_NullUser_PropertiesSetToDefault() + { + var token = new SsoEmail2faSessionTokenable(null); + + Assert.Equal(default, token.Id); + Assert.Equal(default, token.Email); + } + + /// + /// Tests that when a valid user is provided to the constructor, the resulting token properties match the user. + /// + [Theory, AutoData] + public void Constructor_ValidUser_PropertiesSetFromUser(User user) + { + var token = new SsoEmail2faSessionTokenable(user); + + Assert.Equal(user.Id, token.Id); + Assert.Equal(user.Email, token.Email); + } + + /// + /// Tests the default expiration behavior immediately after initialization. + /// + [Fact] + public void Constructor_AfterInitialization_ExpirationSetToExpectedDuration() + { + var token = new SsoEmail2faSessionTokenable(); + var expectedExpiration = DateTime.UtcNow + SsoEmail2faSessionTokenable.GetTokenLifetime(); + + Assert.True(expectedExpiration - token.ExpirationDate < _timeTolerance); + } + + /// + /// Tests that a custom expiration date is preserved after token initialization. + /// + [Fact] + public void Constructor_CustomExpirationDate_ExpirationMatchesProvidedValue() + { + var customExpiration = DateTime.UtcNow.AddHours(3); + var token = new SsoEmail2faSessionTokenable + { + ExpirationDate = customExpiration + }; + + Assert.True((customExpiration - token.ExpirationDate).Duration() < _timeTolerance); + } + + /// + /// Tests the validity of a token initialized with a null user. + /// + [Fact] + public void Valid_NullUser_ReturnsFalse() + { + var token = new SsoEmail2faSessionTokenable(null); + + Assert.False(token.Valid); + } + + /// + /// Tests the validity of a token with a non-matching identifier. + /// + [Theory, AutoData] + public void Valid_WrongIdentifier_ReturnsFalse(User user) + { + var token = new SsoEmail2faSessionTokenable(user) + { + Identifier = "not correct" + }; + + Assert.False(token.Valid); + } + + /// + /// Tests the token validity when user ID is null. + /// + [Theory, AutoData] + public void TokenIsValid_NullUserId_ReturnsFalse(User user) + { + user.Id = default; // Guid.Empty + var token = new SsoEmail2faSessionTokenable(user); + + Assert.False(token.TokenIsValid(user)); + } + + /// + /// Tests the token validity when user's email is null. + /// + [Theory, AutoData] + public void TokenIsValid_NullEmail_ReturnsFalse(User user) + { + user.Email = null; + var token = new SsoEmail2faSessionTokenable(user); + + Assert.False(token.TokenIsValid(user)); + } + + /// + /// Tests the token validity when user ID and email match the token properties. + /// + [Theory, AutoData] + public void TokenIsValid_MatchingUserIdAndEmail_ReturnsTrue(User user) + { + var token = new SsoEmail2faSessionTokenable(user); + + Assert.True(token.TokenIsValid(user)); + } + + /// + /// Ensures that the token is invalid when the provided user's ID doesn't match the token's ID. + /// + [Theory, AutoData] + public void TokenIsValid_WrongUserId_ReturnsFalse(User user) + { + // Given a token initialized with a user's details + var token = new SsoEmail2faSessionTokenable(user); + + // modify the user's ID + user.Id = Guid.NewGuid(); + + // Then the token should be considered invalid + Assert.False(token.TokenIsValid(user)); + } + + /// + /// Ensures that the token is invalid when the provided user's email doesn't match the token's email. + /// + [Theory, AutoData] + public void TokenIsValid_WrongEmail_ReturnsFalse(User user) + { + // Given a token initialized with a user's details + var token = new SsoEmail2faSessionTokenable(user); + + // modify the user's email + user.Email = "nonMatchingEmail@example.com"; + + // Then the token should be considered invalid + Assert.False(token.TokenIsValid(user)); + } + + /// + /// Tests the deserialization of a token to ensure that the expiration date is preserved. + /// + [Theory, AutoData] + public void FromToken_SerializedToken_PreservesExpirationDate(User user) + { + var expectedDateTime = DateTime.UtcNow.AddHours(-5); + var token = new SsoEmail2faSessionTokenable(user) + { + ExpirationDate = expectedDateTime + }; + + var result = Tokenable.FromToken(token.ToToken()); + + Assert.Equal(expectedDateTime, result.ExpirationDate, precision: _timeTolerance); + } +} diff --git a/test/Core.Test/Auth/Services/AuthRequestServiceTests.cs b/test/Core.Test/Auth/Services/AuthRequestServiceTests.cs index 3cac774052..cd7f85ae8b 100644 --- a/test/Core.Test/Auth/Services/AuthRequestServiceTests.cs +++ b/test/Core.Test/Auth/Services/AuthRequestServiceTests.cs @@ -142,15 +142,19 @@ public class AuthRequestServiceTests } [Theory, BitAutoData] - public async Task CreateAuthRequestAsync_NoUser_ThrowsNotFound( + public async Task CreateAuthRequestAsync_NoUser_ThrowsBadRequest( SutProvider sutProvider, AuthRequestCreateRequestModel createModel) { + sutProvider.GetDependency() + .DeviceType + .Returns(DeviceType.Android); + sutProvider.GetDependency() .GetByEmailAsync(createModel.Email) .Returns((User?)null); - await Assert.ThrowsAsync(() => sutProvider.Sut.CreateAuthRequestAsync(createModel)); + await Assert.ThrowsAsync(() => sutProvider.Sut.CreateAuthRequestAsync(createModel)); } [Theory, BitAutoData] @@ -253,7 +257,7 @@ public class AuthRequestServiceTests /// /// Story: If a user happens to exist to more than one organization, we will send the device approval request to - /// each of them. + /// each of them. /// [Theory, BitAutoData] public async Task CreateAuthRequestAsync_AdminApproval_CreatesForEachOrganization( @@ -627,8 +631,8 @@ public class AuthRequestServiceTests } /// - /// Story: An admin approves a request for one of their org users. For auditing purposes we need to - /// log an event that correlates the action for who the request was approved for. On approval we also need to + /// Story: An admin approves a request for one of their org users. For auditing purposes we need to + /// log an event that correlates the action for who the request was approved for. On approval we also need to /// push the notification to the user. /// [Theory, BitAutoData] diff --git a/test/Core.Test/AutoFixture/OrganizationFixtures.cs b/test/Core.Test/AutoFixture/OrganizationFixtures.cs index 0116296d33..4ef0e43fa7 100644 --- a/test/Core.Test/AutoFixture/OrganizationFixtures.cs +++ b/test/Core.Test/AutoFixture/OrganizationFixtures.cs @@ -10,6 +10,7 @@ using Bit.Core.Models.Data; using Bit.Core.Utilities; using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture.Attributes; +using Microsoft.AspNetCore.DataProtection; namespace Bit.Core.Test.AutoFixture.OrganizationFixtures; @@ -187,3 +188,31 @@ internal class SecretsManagerOrganizationCustomizeAttribute : BitCustomizeAttrib public override ICustomization GetCustomization() => new SecretsManagerOrganizationCustomization(); } + +internal class EphemeralDataProtectionCustomization : ICustomization +{ + public void Customize(IFixture fixture) + { + fixture.Customizations.Add(new EphemeralDataProtectionProviderBuilder()); + } + + private class EphemeralDataProtectionProviderBuilder : ISpecimenBuilder + { + public object Create(object request, ISpecimenContext context) + { + var type = request as Type; + if (type == null || type != typeof(IDataProtectionProvider)) + { + return new NoSpecimen(); + } + + return new EphemeralDataProtectionProvider(); + } + } +} + +internal class EphemeralDataProtectionAutoDataAttribute : CustomAutoDataAttribute +{ + public EphemeralDataProtectionAutoDataAttribute() : base(new SutProviderCustomization(), new EphemeralDataProtectionCustomization()) + { } +} diff --git a/test/Core.Test/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommandTests.cs b/test/Core.Test/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommandTests.cs new file mode 100644 index 0000000000..542220560c --- /dev/null +++ b/test/Core.Test/OrganizationFeatures/OrganizationUsers/UpdateOrganizationUserGroupsCommandTests.cs @@ -0,0 +1,50 @@ +using Bit.Core.Entities; +using Bit.Core.Enums; +using Bit.Core.OrganizationFeatures.OrganizationUsers; +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.Core.Test.OrganizationFeatures.OrganizationUsers; + +[SutProviderCustomize] +public class UpdateOrganizationUserGroupsCommandTests +{ + [Theory, BitAutoData] + public async Task UpdateUserGroups_Passes( + OrganizationUser organizationUser, + IEnumerable groupIds, + SutProvider sutProvider) + { + await sutProvider.Sut.UpdateUserGroupsAsync(organizationUser, groupIds, null); + + await sutProvider.GetDependency().DidNotReceiveWithAnyArgs() + .ValidateOrganizationUserUpdatePermissions(default, default, default, default); + await sutProvider.GetDependency().Received(1) + .UpdateGroupsAsync(organizationUser.Id, groupIds); + await sutProvider.GetDependency().Received(1) + .LogOrganizationUserEventAsync(organizationUser, EventType.OrganizationUser_UpdatedGroups); + } + + [Theory, BitAutoData] + public async Task UpdateUserGroups_WithSavingUserId_Passes( + OrganizationUser organizationUser, + IEnumerable groupIds, + Guid savingUserId, + SutProvider sutProvider) + { + organizationUser.Permissions = null; + + await sutProvider.Sut.UpdateUserGroupsAsync(organizationUser, groupIds, savingUserId); + + await sutProvider.GetDependency().Received(1) + .ValidateOrganizationUserUpdatePermissions(organizationUser.OrganizationId, organizationUser.Type, null, organizationUser.GetPermissions()); + await sutProvider.GetDependency().Received(1) + .UpdateGroupsAsync(organizationUser.Id, groupIds); + await sutProvider.GetDependency().Received(1) + .LogOrganizationUserEventAsync(organizationUser, EventType.OrganizationUser_UpdatedGroups); + } +} diff --git a/test/Core.Test/Services/LaunchDarklyFeatureServiceTests.cs b/test/Core.Test/Services/LaunchDarklyFeatureServiceTests.cs index 3644dc805b..37ced167be 100644 --- a/test/Core.Test/Services/LaunchDarklyFeatureServiceTests.cs +++ b/test/Core.Test/Services/LaunchDarklyFeatureServiceTests.cs @@ -20,14 +20,6 @@ public class LaunchDarklyFeatureServiceTests .Create(); } - [Fact] - public void Offline_WhenSelfHost() - { - var sutProvider = GetSutProvider(new Core.Settings.GlobalSettings() { SelfHosted = true }); - - Assert.False(sutProvider.Sut.IsOnline()); - } - [Theory, BitAutoData] public void DefaultFeatureValue_WhenSelfHost(string key) { diff --git a/test/Core.Test/Services/OrganizationServiceTests.cs b/test/Core.Test/Services/OrganizationServiceTests.cs index 54efee1187..a4974d39af 100644 --- a/test/Core.Test/Services/OrganizationServiceTests.cs +++ b/test/Core.Test/Services/OrganizationServiceTests.cs @@ -28,6 +28,7 @@ using Bit.Core.Tools.Services; using Bit.Core.Utilities; using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture.Attributes; +using Microsoft.AspNetCore.DataProtection; using NSubstitute; using NSubstitute.ExceptionExtensions; using Xunit; @@ -658,11 +659,10 @@ public class OrganizationServiceTests await sutProvider.GetDependency().Received(1).LogOrganizationUserEventsAsync(Arg.Any>()); } - [Theory, BitAutoData] + [Theory, BitAutoData, OrganizationInviteCustomize] public async Task InviteUser_WithSecretsManager_Passes(Organization organization, IEnumerable<(OrganizationUserInvite invite, string externalId)> invites, - [OrganizationUser(type: OrganizationUserType.Owner, status: OrganizationUserStatusType.Confirmed)] OrganizationUser savingUser, - SutProvider sutProvider) + OrganizationUser savingUser, SutProvider sutProvider) { organization.PlanType = PlanType.EnterpriseAnnually; InviteUserHelper_ArrangeValidPermissions(organization, savingUser, sutProvider); @@ -670,6 +670,10 @@ public class OrganizationServiceTests // Set up some invites to grant access to SM invites.First().invite.AccessSecretsManager = true; var invitedSmUsers = invites.First().invite.Emails.Count(); + foreach (var (invite, externalId) in invites.Skip(1)) + { + invite.AccessSecretsManager = false; + } // Assume we need to add seats for all invited SM users sutProvider.GetDependency() @@ -685,11 +689,10 @@ public class OrganizationServiceTests !update.MaxAutoscaleSmSeatsChanged)); } - [Theory, BitAutoData] + [Theory, BitAutoData, OrganizationInviteCustomize] public async Task InviteUser_WithSecretsManager_WhenErrorIsThrown_RevertsAutoscaling(Organization organization, IEnumerable<(OrganizationUserInvite invite, string externalId)> invites, - [OrganizationUser(type: OrganizationUserType.Owner, status: OrganizationUserStatusType.Confirmed)] OrganizationUser savingUser, - SutProvider sutProvider) + OrganizationUser savingUser, SutProvider sutProvider) { var initialSmSeats = organization.SmSeats; InviteUserHelper_ArrangeValidPermissions(organization, savingUser, sutProvider); @@ -697,6 +700,10 @@ public class OrganizationServiceTests // Set up some invites to grant access to SM invites.First().invite.AccessSecretsManager = true; var invitedSmUsers = invites.First().invite.Emails.Count(); + foreach (var (invite, externalId) in invites.Skip(1)) + { + invite.AccessSecretsManager = false; + } // Assume we need to add seats for all invited SM users sutProvider.GetDependency() @@ -741,13 +748,9 @@ public class OrganizationServiceTests private void InviteUserHelper_ArrangeValidPermissions(Organization organization, OrganizationUser savingUser, SutProvider sutProvider) { - savingUser.OrganizationId = organization.Id; - organization.UseCustomPermissions = true; sutProvider.GetDependency().GetByIdAsync(organization.Id).Returns(organization); sutProvider.GetDependency().OrganizationOwner(organization.Id).Returns(true); sutProvider.GetDependency().ManageUsers(organization.Id).Returns(true); - sutProvider.GetDependency().GetManyByOrganizationAsync(savingUser.OrganizationId, OrganizationUserType.Owner) - .Returns(new List { savingUser }); } [Theory, BitAutoData] @@ -1848,4 +1851,110 @@ public class OrganizationServiceTests sutProvider.Sut.ValidateSecretsManagerPlan(plan, signup); } + + [Theory] + [EphemeralDataProtectionAutoData] + public async Task AcceptUserAsync_Success([OrganizationUser(OrganizationUserStatusType.Invited)] OrganizationUser organizationUser, + User user, SutProvider sutProvider) + { + var token = SetupAcceptUserAsyncTest(sutProvider, user, organizationUser); + var userService = Substitute.For(); + + await sutProvider.Sut.AcceptUserAsync(organizationUser.Id, user, token, userService); + + await sutProvider.GetDependency().Received(1).ReplaceAsync( + Arg.Is(ou => ou.Id == organizationUser.Id && ou.Status == OrganizationUserStatusType.Accepted)); + await sutProvider.GetDependency().Received(1).ReplaceAsync( + Arg.Is(u => u.Id == user.Id && u.Email == user.Email && user.EmailVerified == true)); + } + + private string SetupAcceptUserAsyncTest(SutProvider sutProvider, User user, + OrganizationUser organizationUser) + { + user.Email = organizationUser.Email; + user.EmailVerified = false; + + var dataProtector = sutProvider.GetDependency() + .CreateProtector("OrganizationServiceDataProtector"); + // Token matching the format used in OrganizationService.InviteUserAsync + var token = dataProtector.Protect( + $"OrganizationUserInvite {organizationUser.Id} {organizationUser.Email} {CoreHelpers.ToEpocMilliseconds(DateTime.UtcNow)}"); + + sutProvider.GetDependency().OrganizationInviteExpirationHours.Returns(24); + + sutProvider.GetDependency().GetByIdAsync(organizationUser.Id) + .Returns(organizationUser); + + return token; + } + + [Theory] + [OrganizationInviteCustomize( + InviteeUserType = OrganizationUserType.Owner, + InvitorUserType = OrganizationUserType.Admin + ), BitAutoData] + public async Task ValidateOrganizationUserUpdatePermissions_WithAdminAddingOwner_Throws( + Guid organizationId, + OrganizationUserInvite organizationUserInvite, + SutProvider sutProvider) + { + var exception = await Assert.ThrowsAsync( + () => sutProvider.Sut.ValidateOrganizationUserUpdatePermissions(organizationId, organizationUserInvite.Type.Value, null, organizationUserInvite.Permissions)); + + Assert.Contains("only an owner can configure another owner's account.", exception.Message.ToLowerInvariant()); + } + + [Theory] + [OrganizationInviteCustomize( + InviteeUserType = OrganizationUserType.Admin, + InvitorUserType = OrganizationUserType.Owner + ), BitAutoData] + public async Task ValidateOrganizationUserUpdatePermissions_WithoutManageUsersPermission_Throws( + Guid organizationId, + OrganizationUserInvite organizationUserInvite, + SutProvider sutProvider) + { + var exception = await Assert.ThrowsAsync( + () => sutProvider.Sut.ValidateOrganizationUserUpdatePermissions(organizationId, organizationUserInvite.Type.Value, null, organizationUserInvite.Permissions)); + + Assert.Contains("your account does not have permission to manage users.", exception.Message.ToLowerInvariant()); + } + + [Theory] + [OrganizationInviteCustomize( + InviteeUserType = OrganizationUserType.Admin, + InvitorUserType = OrganizationUserType.Custom + ), BitAutoData] + public async Task ValidateOrganizationUserUpdatePermissions_WithCustomAddingAdmin_Throws( + Guid organizationId, + OrganizationUserInvite organizationUserInvite, + SutProvider sutProvider) + { + sutProvider.GetDependency().ManageUsers(organizationId).Returns(true); + + var exception = await Assert.ThrowsAsync( + () => sutProvider.Sut.ValidateOrganizationUserUpdatePermissions(organizationId, organizationUserInvite.Type.Value, null, organizationUserInvite.Permissions)); + + Assert.Contains("custom users can not manage admins or owners.", exception.Message.ToLowerInvariant()); + } + + [Theory] + [OrganizationInviteCustomize( + InviteeUserType = OrganizationUserType.Custom, + InvitorUserType = OrganizationUserType.Custom + ), BitAutoData] + public async Task ValidateOrganizationUserUpdatePermissions_WithCustomAddingUser_WithoutPermissions_Throws( + Guid organizationId, + OrganizationUserInvite organizationUserInvite, + SutProvider sutProvider) + { + var invitePermissions = new Permissions { AccessReports = true }; + sutProvider.GetDependency().ManageUsers(organizationId).Returns(true); + sutProvider.GetDependency().AccessReports(organizationId).Returns(false); + + var exception = await Assert.ThrowsAsync( + () => sutProvider.Sut.ValidateOrganizationUserUpdatePermissions(organizationId, organizationUserInvite.Type.Value, null, invitePermissions)); + + Assert.Contains("custom users can only grant the same custom permissions that they have.", exception.Message.ToLowerInvariant()); + } } diff --git a/test/Core.Test/packages.lock.json b/test/Core.Test/packages.lock.json index d319b95eda..c814703a91 100644 --- a/test/Core.Test/packages.lock.json +++ b/test/Core.Test/packages.lock.json @@ -222,10 +222,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2672,7 +2673,7 @@ "dependencies": { "AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )", - "Core": "[2023.7.2, )", + "Core": "[2023.9.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )", "NSubstitute": "[4.3.0, )", @@ -2691,7 +2692,7 @@ "Azure.Storage.Blobs": "[12.14.1, )", "Azure.Storage.Queues": "[12.12.0, )", "BitPay.Light": "[1.0.1907, )", - "Braintree": "[5.12.0, )", + "Braintree": "[5.19.0, )", "DnsClient": "[1.7.0, )", "Fido2.AspNet": "[3.0.1, )", "Handlebars.Net": "[2.1.2, )", diff --git a/test/Icons.Test/packages.lock.json b/test/Icons.Test/packages.lock.json index 4bdc813b6c..58a29e615a 100644 --- a/test/Icons.Test/packages.lock.json +++ b/test/Icons.Test/packages.lock.json @@ -235,10 +235,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2841,7 +2842,7 @@ "dependencies": { "AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )", - "Core": "[2023.7.2, )", + "Core": "[2023.9.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )", "NSubstitute": "[4.3.0, )", @@ -2851,79 +2852,79 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "icons": { "type": "Project", "dependencies": { - "AngleSharp": "1.0.4", - "Core": "2023.7.2", - "SharedWeb": "2023.7.2" + "AngleSharp": "[1.0.4, )", + "Core": "[2023.9.0, )", + "SharedWeb": "[2023.9.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/test/Identity.IntegrationTest/packages.lock.json b/test/Identity.IntegrationTest/packages.lock.json index 2c9545098c..49e914b2d0 100644 --- a/test/Identity.IntegrationTest/packages.lock.json +++ b/test/Identity.IntegrationTest/packages.lock.json @@ -239,10 +239,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2986,101 +2987,101 @@ "common": { "type": "Project", "dependencies": { - "AutoFixture.AutoNSubstitute": "4.17.0", - "AutoFixture.Xunit2": "4.17.0", - "Core": "2023.7.2", - "Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", - "Microsoft.NET.Test.Sdk": "17.1.0", - "NSubstitute": "4.3.0", - "xunit": "2.4.1" + "AutoFixture.AutoNSubstitute": "[4.17.0, )", + "AutoFixture.Xunit2": "[4.17.0, )", + "Core": "[2023.9.0, )", + "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", + "Microsoft.NET.Test.Sdk": "[17.1.0, )", + "NSubstitute": "[4.3.0, )", + "xunit": "[2.4.1, )" } }, "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "identity": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "SharedWeb": "2023.7.2", - "Swashbuckle.AspNetCore.SwaggerGen": "6.5.0" + "Core": "[2023.9.0, )", + "SharedWeb": "[2023.9.0, )", + "Swashbuckle.AspNetCore.SwaggerGen": "[6.5.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "integrationtestcommon": { "type": "Project", "dependencies": { - "Common": "2023.7.2", - "Identity": "2023.7.2", - "Microsoft.AspNetCore.Mvc.Testing": "6.0.5", - "Microsoft.EntityFrameworkCore.InMemory": "7.0.5", - "Microsoft.Extensions.Configuration": "6.0.1" + "Common": "[2023.9.0, )", + "Identity": "[2023.9.0, )", + "Microsoft.AspNetCore.Mvc.Testing": "[6.0.5, )", + "Microsoft.EntityFrameworkCore.InMemory": "[7.0.5, )", + "Microsoft.Extensions.Configuration": "[6.0.1, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/test/Identity.Test/packages.lock.json b/test/Identity.Test/packages.lock.json index 083fcf3c41..4d501fa090 100644 --- a/test/Identity.Test/packages.lock.json +++ b/test/Identity.Test/packages.lock.json @@ -228,10 +228,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2853,91 +2854,91 @@ "common": { "type": "Project", "dependencies": { - "AutoFixture.AutoNSubstitute": "4.17.0", - "AutoFixture.Xunit2": "4.17.0", - "Core": "2023.7.2", - "Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", - "Microsoft.NET.Test.Sdk": "17.1.0", - "NSubstitute": "4.3.0", - "xunit": "2.4.1" + "AutoFixture.AutoNSubstitute": "[4.17.0, )", + "AutoFixture.Xunit2": "[4.17.0, )", + "Core": "[2023.9.0, )", + "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", + "Microsoft.NET.Test.Sdk": "[17.1.0, )", + "NSubstitute": "[4.3.0, )", + "xunit": "[2.4.1, )" } }, "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "identity": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "SharedWeb": "2023.7.2", - "Swashbuckle.AspNetCore.SwaggerGen": "6.5.0" + "Core": "[2023.9.0, )", + "SharedWeb": "[2023.9.0, )", + "Swashbuckle.AspNetCore.SwaggerGen": "[6.5.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/test/Infrastructure.EFIntegration.Test/packages.lock.json b/test/Infrastructure.EFIntegration.Test/packages.lock.json index 377737a92f..ef30b1cb1a 100644 --- a/test/Infrastructure.EFIntegration.Test/packages.lock.json +++ b/test/Infrastructure.EFIntegration.Test/packages.lock.json @@ -229,10 +229,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2835,7 +2836,7 @@ "dependencies": { "AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )", - "Core": "[2023.7.2, )", + "Core": "[2023.9.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )", "NSubstitute": "[4.3.0, )", @@ -2854,7 +2855,7 @@ "Azure.Storage.Blobs": "[12.14.1, )", "Azure.Storage.Queues": "[12.12.0, )", "BitPay.Light": "[1.0.1907, )", - "Braintree": "[5.12.0, )", + "Braintree": "[5.19.0, )", "DnsClient": "[1.7.0, )", "Fido2.AspNet": "[3.0.1, )", "Handlebars.Net": "[2.1.2, )", @@ -2889,8 +2890,8 @@ "dependencies": { "AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )", - "Common": "[2023.7.2, )", - "Core": "[2023.7.2, )", + "Common": "[2023.9.0, )", + "Core": "[2023.9.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )", "NSubstitute": "[4.3.0, )", @@ -2900,7 +2901,7 @@ "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "[2023.7.2, )", + "Core": "[2023.9.0, )", "Dapper": "[2.0.123, )" } }, @@ -2908,7 +2909,7 @@ "type": "Project", "dependencies": { "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", - "Core": "[2023.7.2, )", + "Core": "[2023.9.0, )", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", diff --git a/test/Infrastructure.IntegrationTest/packages.lock.json b/test/Infrastructure.IntegrationTest/packages.lock.json index 0bde31c886..9c69a541c8 100644 --- a/test/Infrastructure.IntegrationTest/packages.lock.json +++ b/test/Infrastructure.IntegrationTest/packages.lock.json @@ -228,10 +228,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2703,63 +2704,63 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } } } diff --git a/test/IntegrationTestCommon/packages.lock.json b/test/IntegrationTestCommon/packages.lock.json index 2f20ff8c8a..6e1296d5c6 100644 --- a/test/IntegrationTestCommon/packages.lock.json +++ b/test/IntegrationTestCommon/packages.lock.json @@ -215,10 +215,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2972,91 +2973,91 @@ "common": { "type": "Project", "dependencies": { - "AutoFixture.AutoNSubstitute": "4.17.0", - "AutoFixture.Xunit2": "4.17.0", - "Core": "2023.7.2", - "Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", - "Microsoft.NET.Test.Sdk": "17.1.0", - "NSubstitute": "4.3.0", - "xunit": "2.4.1" + "AutoFixture.AutoNSubstitute": "[4.17.0, )", + "AutoFixture.Xunit2": "[4.17.0, )", + "Core": "[2023.9.0, )", + "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", + "Microsoft.NET.Test.Sdk": "[17.1.0, )", + "NSubstitute": "[4.3.0, )", + "xunit": "[2.4.1, )" } }, "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "identity": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "SharedWeb": "2023.7.2", - "Swashbuckle.AspNetCore.SwaggerGen": "6.5.0" + "Core": "[2023.9.0, )", + "SharedWeb": "[2023.9.0, )", + "Swashbuckle.AspNetCore.SwaggerGen": "[6.5.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/util/Migrator/DbScripts_data_migration/2023-08-03_00_PopulateResellerNames.sql b/util/Migrator/DbScripts/2023-08-03_00_PopulateResellerNames.sql similarity index 100% rename from util/Migrator/DbScripts_data_migration/2023-08-03_00_PopulateResellerNames.sql rename to util/Migrator/DbScripts/2023-08-03_00_PopulateResellerNames.sql diff --git a/util/Migrator/DbScripts/2023-08-10_00_ClientSecretHashDataMigration.sql b/util/Migrator/DbScripts/2023-08-10_00_ClientSecretHashDataMigration.sql index 66869d48b7..0462d64622 100644 --- a/util/Migrator/DbScripts/2023-08-10_00_ClientSecretHashDataMigration.sql +++ b/util/Migrator/DbScripts/2023-08-10_00_ClientSecretHashDataMigration.sql @@ -6,14 +6,6 @@ The final migration is in util/Migrator/DbScripts/2023-08-10_01_RemoveClientSecr IF COL_LENGTH('[dbo].[ApiKey]', 'ClientSecretHash') IS NOT NULL AND COL_LENGTH('[dbo].[ApiKey]', 'ClientSecret') IS NOT NULL BEGIN - -- Add index - IF NOT EXISTS(SELECT name FROM sys.indexes WHERE name = 'IX_ApiKey_ClientSecretHash') - BEGIN - CREATE NONCLUSTERED INDEX [IX_ApiKey_ClientSecretHash] - ON [dbo].[ApiKey]([ClientSecretHash] ASC) - WITH (ONLINE = ON) - END - -- Data Migration DECLARE @BatchSize INT = 10000 WHILE @BatchSize > 0 @@ -34,9 +26,5 @@ BEGIN COMMIT TRANSACTION Migrate_ClientSecretHash END - -- Drop index - DROP INDEX IF EXISTS [IX_ApiKey_ClientSecretHash] - ON [dbo].[ApiKey]; - END GO diff --git a/util/Migrator/DbScripts/2023-09-14_00_Remove_WebAuthn_For_Free_Users.sql b/util/Migrator/DbScripts/2023-09-14_00_Remove_WebAuthn_For_Free_Users.sql new file mode 100644 index 0000000000..2cd34479a3 --- /dev/null +++ b/util/Migrator/DbScripts/2023-09-14_00_Remove_WebAuthn_For_Free_Users.sql @@ -0,0 +1,68 @@ +-- Assumptions: +-- When a 2FA method is disabled, it is removed from the TwoFactorProviders array + +-- Problem statement: +-- We have users who currently do not have any available 2FA method, with the only one being +-- WebAuthn, which is effectively disabled by a server-side permission check for Premium status. +-- With WebAuthn being made free, we want to avoid these users suddenly being forced +-- to provide 2FA using a key that they haven't used in a long time, by deleting that key from their TwoFactorProviders. + +DECLARE @UsersWithoutPremium TABLE +( + Id UNIQUEIDENTIFIER, + TwoFactorProviders NVARCHAR(MAX) +); + +DECLARE @TwoFactorMethodsForUsersWithoutPremium TABLE +( + Id UNIQUEIDENTIFIER, + TwoFactorType NVARCHAR(50) +) + +DECLARE @UsersToAdjust TABLE +( + Id UNIQUEIDENTIFIER +); + +-- Insert users who don't have Premium +INSERT INTO @UsersWithoutPremium +SELECT u.Id, u.TwoFactorProviders +from [User] u +WHERE u.Premium = 0; + +-- Filter out those users who get Premium from their org +DELETE FROM @UsersWithoutPremium +WHERE Id IN + (SELECT UserId + FROM [OrganizationUser] ou + INNER JOIN [Organization] o on o.Id = ou.OrganizationId WHERE o.Enabled = 1 AND o.UsersGetPremium = 1) + +-- From users without Premium, get their enabled 2FA methods +INSERT INTO @TwoFactorMethodsForUsersWithoutPremium +SELECT u.Id, + tfp1.[key] as TwoFactorType +FROM @UsersWithoutPremium u +CROSS APPLY OPENJSON(u.TwoFactorProviders) tfp1 +CROSS APPLY OPENJSON(tfp1.[value]) WITH ( + [Enabled] BIT '$.Enabled' +) tfp2 +WHERE [Enabled] = 1 -- We only want enabled 2FA methods + +INSERT INTO @UsersToAdjust +SELECT t1.Id +FROM @TwoFactorMethodsForUsersWithoutPremium t1 +WHERE t1.TwoFactorType = '7' +AND NOT EXISTS + (SELECT * + FROM @TwoFactorMethodsForUsersWithoutPremium t2 + WHERE t2.Id = t1.Id AND t2.TwoFactorType <> '7' AND t2.TwoFactorType <> '4') + +SELECT * +FROM @UsersToAdjust + +DECLARE @revisionDate DATETIME2(7) = GETUTCDATE(); + +UPDATE [User] +SET TwoFactorProviders = NULL, RevisionDate = @revisionDate +FROM @UsersToAdjust ua +WHERE ua.Id = [User].Id \ No newline at end of file diff --git a/util/Migrator/packages.lock.json b/util/Migrator/packages.lock.json index 2b74b28fd3..b6286102d7 100644 --- a/util/Migrator/packages.lock.json +++ b/util/Migrator/packages.lock.json @@ -165,10 +165,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2628,43 +2629,43 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } } } diff --git a/util/MsSqlMigratorUtility/packages.lock.json b/util/MsSqlMigratorUtility/packages.lock.json index bbe3aebd9b..e39912d7d5 100644 --- a/util/MsSqlMigratorUtility/packages.lock.json +++ b/util/MsSqlMigratorUtility/packages.lock.json @@ -168,10 +168,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2657,51 +2658,51 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "migrator": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Microsoft.Extensions.Logging": "6.0.0", - "dbup-sqlserver": "5.0.8" + "Core": "[2023.9.0, )", + "Microsoft.Extensions.Logging": "[6.0.0, )", + "dbup-sqlserver": "[5.0.8, )" } } } diff --git a/util/MySqlMigrations/Migrations/20230824202452_ACCESSPOLICY_ADD_DELETE_CASCADE.Designer.cs b/util/MySqlMigrations/Migrations/20230824202452_ACCESSPOLICY_ADD_DELETE_CASCADE.Designer.cs new file mode 100644 index 0000000000..8fc9edb7c4 --- /dev/null +++ b/util/MySqlMigrations/Migrations/20230824202452_ACCESSPOLICY_ADD_DELETE_CASCADE.Designer.cs @@ -0,0 +1,2236 @@ +// +using System; +using Bit.Infrastructure.EntityFramework.Repositories; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Bit.MySqlMigrations.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20230824202452_ACCESSPOLICY_ADD_DELETE_CASCADE")] + partial class ACCESSPOLICY_ADD_DELETE_CASCADE + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 64); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.AuthRequest", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessCode") + .HasMaxLength(25) + .HasColumnType("varchar(25)"); + + b.Property("Approved") + .HasColumnType("tinyint(1)"); + + b.Property("AuthenticationDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Key") + .HasColumnType("longtext"); + + b.Property("MasterPasswordHash") + .HasColumnType("longtext"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("RequestDeviceIdentifier") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("RequestDeviceType") + .HasColumnType("tinyint unsigned"); + + b.Property("RequestIpAddress") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("ResponseDate") + .HasColumnType("datetime(6)"); + + b.Property("ResponseDeviceId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("ResponseDeviceId"); + + b.HasIndex("UserId"); + + b.ToTable("AuthRequest", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.EmergencyAccess", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("GranteeId") + .HasColumnType("char(36)"); + + b.Property("GrantorId") + .HasColumnType("char(36)"); + + b.Property("KeyEncrypted") + .HasColumnType("longtext"); + + b.Property("LastNotificationDate") + .HasColumnType("datetime(6)"); + + b.Property("RecoveryInitiatedDate") + .HasColumnType("datetime(6)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("WaitTimeDays") + .HasColumnType("int"); + + b.HasKey("Id"); + + b.HasIndex("GranteeId"); + + b.HasIndex("GrantorId"); + + b.ToTable("EmergencyAccess", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.Grant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ClientId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ConsumedDate") + .HasColumnType("datetime(6)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .HasColumnType("longtext"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.HasKey("Key"); + + b.ToTable("Grant", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.SsoConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .HasColumnType("longtext"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("SsoConfig", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.SsoUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExternalId") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("SsoUser", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Collection", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExternalId") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Collection", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionCipher", b => + { + b.Property("CollectionId") + .HasColumnType("char(36)"); + + b.Property("CipherId") + .HasColumnType("char(36)"); + + b.HasKey("CollectionId", "CipherId"); + + b.HasIndex("CipherId"); + + b.ToTable("CollectionCipher", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionGroup", b => + { + b.Property("CollectionId") + .HasColumnType("char(36)"); + + b.Property("GroupId") + .HasColumnType("char(36)"); + + b.Property("HidePasswords") + .HasColumnType("tinyint(1)"); + + b.Property("ReadOnly") + .HasColumnType("tinyint(1)"); + + b.HasKey("CollectionId", "GroupId"); + + b.HasIndex("GroupId"); + + b.ToTable("CollectionGroups"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionUser", b => + { + b.Property("CollectionId") + .HasColumnType("char(36)"); + + b.Property("OrganizationUserId") + .HasColumnType("char(36)"); + + b.Property("HidePasswords") + .HasColumnType("tinyint(1)"); + + b.Property("ReadOnly") + .HasColumnType("tinyint(1)"); + + b.HasKey("CollectionId", "OrganizationUserId"); + + b.HasIndex("OrganizationUserId"); + + b.ToTable("CollectionUsers"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Device", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("EncryptedPrivateKey") + .HasColumnType("longtext"); + + b.Property("EncryptedPublicKey") + .HasColumnType("longtext"); + + b.Property("EncryptedUserKey") + .HasColumnType("longtext"); + + b.Property("Identifier") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PushToken") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Device", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Event", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ActingUserId") + .HasColumnType("char(36)"); + + b.Property("CipherId") + .HasColumnType("char(36)"); + + b.Property("CollectionId") + .HasColumnType("char(36)"); + + b.Property("Date") + .HasColumnType("datetime(6)"); + + b.Property("DeviceType") + .HasColumnType("tinyint unsigned"); + + b.Property("DomainName") + .HasColumnType("longtext"); + + b.Property("GroupId") + .HasColumnType("char(36)"); + + b.Property("InstallationId") + .HasColumnType("char(36)"); + + b.Property("IpAddress") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("OrganizationUserId") + .HasColumnType("char(36)"); + + b.Property("PolicyId") + .HasColumnType("char(36)"); + + b.Property("ProviderId") + .HasColumnType("char(36)"); + + b.Property("ProviderOrganizationId") + .HasColumnType("char(36)"); + + b.Property("ProviderUserId") + .HasColumnType("char(36)"); + + b.Property("SecretId") + .HasColumnType("char(36)"); + + b.Property("ServiceAccountId") + .HasColumnType("char(36)"); + + b.Property("SystemUser") + .HasColumnType("tinyint unsigned"); + + b.Property("Type") + .HasColumnType("int"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.ToTable("Event", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Group", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessAll") + .HasColumnType("tinyint(1)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("ExternalId") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Name") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Group", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.GroupUser", b => + { + b.Property("GroupId") + .HasColumnType("char(36)"); + + b.Property("OrganizationUserId") + .HasColumnType("char(36)"); + + b.HasKey("GroupId", "OrganizationUserId"); + + b.HasIndex("OrganizationUserId"); + + b.ToTable("GroupUser", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Installation", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("Key") + .HasMaxLength(150) + .HasColumnType("varchar(150)"); + + b.HasKey("Id"); + + b.ToTable("Installation", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Organization", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BillingEmail") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("BusinessAddress1") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("BusinessAddress2") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("BusinessAddress3") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("BusinessCountry") + .HasMaxLength(2) + .HasColumnType("varchar(2)"); + + b.Property("BusinessName") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("BusinessTaxNumber") + .HasMaxLength(30) + .HasColumnType("varchar(30)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("Gateway") + .HasColumnType("tinyint unsigned"); + + b.Property("GatewayCustomerId") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("GatewaySubscriptionId") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Identifier") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("LicenseKey") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("MaxAutoscaleSeats") + .HasColumnType("int"); + + b.Property("MaxAutoscaleSmSeats") + .HasColumnType("int"); + + b.Property("MaxAutoscaleSmServiceAccounts") + .HasColumnType("int"); + + b.Property("MaxCollections") + .HasColumnType("smallint"); + + b.Property("MaxStorageGb") + .HasColumnType("smallint"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("OwnersNotifiedOfAutoscaling") + .HasColumnType("datetime(6)"); + + b.Property("Plan") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PlanType") + .HasColumnType("tinyint unsigned"); + + b.Property("PrivateKey") + .HasColumnType("longtext"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("ReferenceData") + .HasColumnType("longtext"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Seats") + .HasColumnType("int"); + + b.Property("SecretsManagerBeta") + .HasColumnType("tinyint(1)"); + + b.Property("SelfHost") + .HasColumnType("tinyint(1)"); + + b.Property("SmSeats") + .HasColumnType("int"); + + b.Property("SmServiceAccounts") + .HasColumnType("int"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("Storage") + .HasColumnType("bigint"); + + b.Property("TwoFactorProviders") + .HasColumnType("longtext"); + + b.Property("Use2fa") + .HasColumnType("tinyint(1)"); + + b.Property("UseApi") + .HasColumnType("tinyint(1)"); + + b.Property("UseCustomPermissions") + .HasColumnType("tinyint(1)"); + + b.Property("UseDirectory") + .HasColumnType("tinyint(1)"); + + b.Property("UseEvents") + .HasColumnType("tinyint(1)"); + + b.Property("UseGroups") + .HasColumnType("tinyint(1)"); + + b.Property("UseKeyConnector") + .HasColumnType("tinyint(1)"); + + b.Property("UsePasswordManager") + .HasColumnType("tinyint(1)"); + + b.Property("UsePolicies") + .HasColumnType("tinyint(1)"); + + b.Property("UseResetPassword") + .HasColumnType("tinyint(1)"); + + b.Property("UseScim") + .HasColumnType("tinyint(1)"); + + b.Property("UseSecretsManager") + .HasColumnType("tinyint(1)"); + + b.Property("UseSso") + .HasColumnType("tinyint(1)"); + + b.Property("UseTotp") + .HasColumnType("tinyint(1)"); + + b.Property("UsersGetPremium") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("Organization", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationApiKey", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ApiKey") + .HasMaxLength(30) + .HasColumnType("varchar(30)"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("OrganizationApiKey", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationConnection", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Config") + .HasColumnType("longtext"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("OrganizationConnection", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationDomain", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DomainName") + .HasMaxLength(255) + .HasColumnType("varchar(255)"); + + b.Property("JobRunCount") + .HasColumnType("int"); + + b.Property("LastCheckedDate") + .HasColumnType("datetime(6)"); + + b.Property("NextRunDate") + .HasColumnType("datetime(6)"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("Txt") + .HasColumnType("longtext"); + + b.Property("VerifiedDate") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("OrganizationDomain", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationSponsorship", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("FriendlyName") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("LastSyncDate") + .HasColumnType("datetime(6)"); + + b.Property("OfferedToEmail") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("PlanSponsorshipType") + .HasColumnType("tinyint unsigned"); + + b.Property("SponsoredOrganizationId") + .HasColumnType("char(36)"); + + b.Property("SponsoringOrganizationId") + .HasColumnType("char(36)"); + + b.Property("SponsoringOrganizationUserId") + .HasColumnType("char(36)"); + + b.Property("ToDelete") + .HasColumnType("tinyint(1)"); + + b.Property("ValidUntil") + .HasColumnType("datetime(6)"); + + b.HasKey("Id"); + + b.HasIndex("SponsoredOrganizationId"); + + b.HasIndex("SponsoringOrganizationId"); + + b.ToTable("OrganizationSponsorship", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessAll") + .HasColumnType("tinyint(1)"); + + b.Property("AccessSecretsManager") + .HasColumnType("tinyint(1)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("ExternalId") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("Key") + .HasColumnType("longtext"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("Permissions") + .HasColumnType("longtext"); + + b.Property("ResetPasswordKey") + .HasColumnType("longtext"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Status") + .HasColumnType("smallint"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("OrganizationUser", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Policy", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .HasColumnType("longtext"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Policy", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Provider", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("BillingEmail") + .HasColumnType("longtext"); + + b.Property("BillingPhone") + .HasColumnType("longtext"); + + b.Property("BusinessAddress1") + .HasColumnType("longtext"); + + b.Property("BusinessAddress2") + .HasColumnType("longtext"); + + b.Property("BusinessAddress3") + .HasColumnType("longtext"); + + b.Property("BusinessCountry") + .HasColumnType("longtext"); + + b.Property("BusinessName") + .HasColumnType("longtext"); + + b.Property("BusinessTaxNumber") + .HasColumnType("longtext"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Enabled") + .HasColumnType("tinyint(1)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UseEvents") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("Provider", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.ProviderOrganization", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Key") + .HasColumnType("longtext"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("ProviderId") + .HasColumnType("char(36)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Settings") + .HasColumnType("longtext"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("ProviderId"); + + b.ToTable("ProviderOrganization", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.ProviderUser", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Email") + .HasColumnType("longtext"); + + b.Property("Key") + .HasColumnType("longtext"); + + b.Property("Permissions") + .HasColumnType("longtext"); + + b.Property("ProviderId") + .HasColumnType("char(36)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Status") + .HasColumnType("tinyint unsigned"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("ProviderId"); + + b.HasIndex("UserId"); + + b.ToTable("ProviderUser", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Send", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccessCount") + .HasColumnType("int"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .HasColumnType("longtext"); + + b.Property("DeletionDate") + .HasColumnType("datetime(6)"); + + b.Property("Disabled") + .HasColumnType("tinyint(1)"); + + b.Property("ExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("HideEmail") + .HasColumnType("tinyint(1)"); + + b.Property("Key") + .HasColumnType("longtext"); + + b.Property("MaxAccessCount") + .HasColumnType("int"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("Password") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("Send", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.TaxRate", b => + { + b.Property("Id") + .HasMaxLength(40) + .HasColumnType("varchar(40)"); + + b.Property("Active") + .HasColumnType("tinyint(1)"); + + b.Property("Country") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("varchar(10)"); + + b.Property("Rate") + .HasColumnType("decimal(65,30)"); + + b.Property("State") + .HasMaxLength(2) + .HasColumnType("varchar(2)"); + + b.HasKey("Id"); + + b.ToTable("TaxRate", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Transaction", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Amount") + .HasColumnType("decimal(65,30)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Details") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("Gateway") + .HasColumnType("tinyint unsigned"); + + b.Property("GatewayId") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("PaymentMethodType") + .HasColumnType("tinyint unsigned"); + + b.Property("Refunded") + .HasColumnType("tinyint(1)"); + + b.Property("RefundedAmount") + .HasColumnType("decimal(65,30)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("Transaction", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.User", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("AccountRevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("ApiKey") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("varchar(30)"); + + b.Property("AvatarColor") + .HasMaxLength(7) + .HasColumnType("varchar(7)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Culture") + .HasMaxLength(10) + .HasColumnType("varchar(10)"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("varchar(256)"); + + b.Property("EmailVerified") + .HasColumnType("tinyint(1)"); + + b.Property("EquivalentDomains") + .HasColumnType("longtext"); + + b.Property("ExcludedGlobalEquivalentDomains") + .HasColumnType("longtext"); + + b.Property("FailedLoginCount") + .HasColumnType("int"); + + b.Property("ForcePasswordReset") + .HasColumnType("tinyint(1)"); + + b.Property("Gateway") + .HasColumnType("tinyint unsigned"); + + b.Property("GatewayCustomerId") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("GatewaySubscriptionId") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Kdf") + .HasColumnType("tinyint unsigned"); + + b.Property("KdfIterations") + .HasColumnType("int"); + + b.Property("KdfMemory") + .HasColumnType("int"); + + b.Property("KdfParallelism") + .HasColumnType("int"); + + b.Property("Key") + .HasColumnType("longtext"); + + b.Property("LastEmailChangeDate") + .HasColumnType("datetime(6)"); + + b.Property("LastFailedLoginDate") + .HasColumnType("datetime(6)"); + + b.Property("LastKdfChangeDate") + .HasColumnType("datetime(6)"); + + b.Property("LastKeyRotationDate") + .HasColumnType("datetime(6)"); + + b.Property("LastPasswordChangeDate") + .HasColumnType("datetime(6)"); + + b.Property("LicenseKey") + .HasMaxLength(100) + .HasColumnType("varchar(100)"); + + b.Property("MasterPassword") + .HasMaxLength(300) + .HasColumnType("varchar(300)"); + + b.Property("MasterPasswordHint") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("MaxStorageGb") + .HasColumnType("smallint"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Premium") + .HasColumnType("tinyint(1)"); + + b.Property("PremiumExpirationDate") + .HasColumnType("datetime(6)"); + + b.Property("PrivateKey") + .HasColumnType("longtext"); + + b.Property("PublicKey") + .HasColumnType("longtext"); + + b.Property("ReferenceData") + .HasColumnType("longtext"); + + b.Property("RenewalReminderDate") + .HasColumnType("datetime(6)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("varchar(50)"); + + b.Property("Storage") + .HasColumnType("bigint"); + + b.Property("TwoFactorProviders") + .HasColumnType("longtext"); + + b.Property("TwoFactorRecoveryCode") + .HasMaxLength(32) + .HasColumnType("varchar(32)"); + + b.Property("UsesKeyConnector") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id"); + + b.ToTable("User", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("longtext"); + + b.Property("Read") + .HasColumnType("tinyint(1)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Write") + .HasColumnType("tinyint(1)"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.ToTable("AccessPolicy", (string)null); + + b.HasDiscriminator("Discriminator").HasValue("AccessPolicy"); + + b.UseTphMappingStrategy(); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ApiKey", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("ClientSecretHash") + .HasMaxLength(128) + .HasColumnType("varchar(128)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("EncryptedPayload") + .HasMaxLength(4000) + .HasColumnType("varchar(4000)"); + + b.Property("ExpireAt") + .HasColumnType("datetime(6)"); + + b.Property("Key") + .HasColumnType("longtext"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("varchar(200)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Scope") + .HasMaxLength(4000) + .HasColumnType("varchar(4000)"); + + b.Property("ServiceAccountId") + .HasColumnType("char(36)"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.HasIndex("ServiceAccountId") + .HasAnnotation("SqlServer:Clustered", false); + + b.ToTable("ApiKey", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DeletedDate") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.HasIndex("DeletedDate") + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); + + b.ToTable("Project", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Secret", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("DeletedDate") + .HasColumnType("datetime(6)"); + + b.Property("Key") + .HasColumnType("longtext"); + + b.Property("Note") + .HasColumnType("longtext"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Value") + .HasColumnType("longtext"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.HasIndex("DeletedDate") + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); + + b.ToTable("Secret", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); + + b.ToTable("ServiceAccount", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("Attachments") + .HasColumnType("longtext"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Data") + .HasColumnType("longtext"); + + b.Property("DeletedDate") + .HasColumnType("datetime(6)"); + + b.Property("Favorites") + .HasColumnType("longtext"); + + b.Property("Folders") + .HasColumnType("longtext"); + + b.Property("OrganizationId") + .HasColumnType("char(36)"); + + b.Property("Reprompt") + .HasColumnType("tinyint unsigned"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("Type") + .HasColumnType("tinyint unsigned"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("Cipher", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Folder", b => + { + b.Property("Id") + .HasColumnType("char(36)"); + + b.Property("CreationDate") + .HasColumnType("datetime(6)"); + + b.Property("Name") + .HasColumnType("longtext"); + + b.Property("RevisionDate") + .HasColumnType("datetime(6)"); + + b.Property("UserId") + .HasColumnType("char(36)"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Folder", (string)null); + }); + + modelBuilder.Entity("ProjectSecret", b => + { + b.Property("ProjectsId") + .HasColumnType("char(36)"); + + b.Property("SecretsId") + .HasColumnType("char(36)"); + + b.HasKey("ProjectsId", "SecretsId"); + + b.HasIndex("SecretsId"); + + b.ToTable("ProjectSecret"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.GroupProjectAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedProjectId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("char(36)") + .HasColumnName("GrantedProjectId"); + + b.Property("GroupId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("char(36)") + .HasColumnName("GroupId"); + + b.HasIndex("GrantedProjectId"); + + b.HasIndex("GroupId"); + + b.HasDiscriminator().HasValue("group_project"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.GroupServiceAccountAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedServiceAccountId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("char(36)") + .HasColumnName("GrantedServiceAccountId"); + + b.Property("GroupId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("char(36)") + .HasColumnName("GroupId"); + + b.HasIndex("GrantedServiceAccountId"); + + b.HasIndex("GroupId"); + + b.HasDiscriminator().HasValue("group_service_account"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccountProjectAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedProjectId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("char(36)") + .HasColumnName("GrantedProjectId"); + + b.Property("ServiceAccountId") + .HasColumnType("char(36)") + .HasColumnName("ServiceAccountId"); + + b.HasIndex("GrantedProjectId"); + + b.HasIndex("ServiceAccountId"); + + b.HasDiscriminator().HasValue("service_account_project"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.UserProjectAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedProjectId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("char(36)") + .HasColumnName("GrantedProjectId"); + + b.Property("OrganizationUserId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("char(36)") + .HasColumnName("OrganizationUserId"); + + b.HasIndex("GrantedProjectId"); + + b.HasIndex("OrganizationUserId"); + + b.HasDiscriminator().HasValue("user_project"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.UserServiceAccountAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedServiceAccountId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("char(36)") + .HasColumnName("GrantedServiceAccountId"); + + b.Property("OrganizationUserId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("char(36)") + .HasColumnName("OrganizationUserId"); + + b.HasIndex("GrantedServiceAccountId"); + + b.HasIndex("OrganizationUserId"); + + b.HasDiscriminator().HasValue("user_service_account"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.AuthRequest", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Device", "ResponseDevice") + .WithMany() + .HasForeignKey("ResponseDeviceId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + + b.Navigation("ResponseDevice"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.EmergencyAccess", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "Grantee") + .WithMany() + .HasForeignKey("GranteeId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "Grantor") + .WithMany() + .HasForeignKey("GrantorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Grantee"); + + b.Navigation("Grantor"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.SsoConfig", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("SsoConfigs") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.SsoUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("SsoUsers") + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("SsoUsers") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Collection", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Collections") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionCipher", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", "Cipher") + .WithMany("CollectionCiphers") + .HasForeignKey("CipherId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Collection", "Collection") + .WithMany("CollectionCiphers") + .HasForeignKey("CollectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Cipher"); + + b.Navigation("Collection"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionGroup", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Collection", "Collection") + .WithMany("CollectionGroups") + .HasForeignKey("CollectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") + .WithMany() + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Collection"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Collection", "Collection") + .WithMany("CollectionUsers") + .HasForeignKey("CollectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") + .WithMany("CollectionUsers") + .HasForeignKey("OrganizationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Collection"); + + b.Navigation("OrganizationUser"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Device", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Group", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Groups") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.GroupUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") + .WithMany("GroupUsers") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") + .WithMany("GroupUsers") + .HasForeignKey("OrganizationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + + b.Navigation("OrganizationUser"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationApiKey", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("ApiKeys") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationConnection", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Connections") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationDomain", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Domains") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationSponsorship", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "SponsoredOrganization") + .WithMany() + .HasForeignKey("SponsoredOrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "SponsoringOrganization") + .WithMany() + .HasForeignKey("SponsoringOrganizationId"); + + b.Navigation("SponsoredOrganization"); + + b.Navigation("SponsoringOrganization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("OrganizationUsers") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("OrganizationUsers") + .HasForeignKey("UserId"); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Policy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Policies") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.ProviderOrganization", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Provider", "Provider") + .WithMany() + .HasForeignKey("ProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + + b.Navigation("Provider"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.ProviderUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Provider", "Provider") + .WithMany() + .HasForeignKey("ProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("Provider"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Send", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Transaction", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Transactions") + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("Transactions") + .HasForeignKey("UserId"); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ApiKey", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount") + .WithMany() + .HasForeignKey("ServiceAccountId"); + + b.Navigation("ServiceAccount"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Secret", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Ciphers") + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("Ciphers") + .HasForeignKey("UserId"); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Folder", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("Folders") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("ProjectSecret", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", null) + .WithMany() + .HasForeignKey("ProjectsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Secret", null) + .WithMany() + .HasForeignKey("SecretsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.GroupProjectAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") + .WithMany("GroupAccessPolicies") + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") + .WithMany() + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("GrantedProject"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.GroupServiceAccountAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "GrantedServiceAccount") + .WithMany("GroupAccessPolicies") + .HasForeignKey("GrantedServiceAccountId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") + .WithMany() + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("GrantedServiceAccount"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccountProjectAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") + .WithMany("ServiceAccountAccessPolicies") + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount") + .WithMany() + .HasForeignKey("ServiceAccountId"); + + b.Navigation("GrantedProject"); + + b.Navigation("ServiceAccount"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.UserProjectAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") + .WithMany("UserAccessPolicies") + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") + .WithMany() + .HasForeignKey("OrganizationUserId"); + + b.Navigation("GrantedProject"); + + b.Navigation("OrganizationUser"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.UserServiceAccountAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "GrantedServiceAccount") + .WithMany("UserAccessPolicies") + .HasForeignKey("GrantedServiceAccountId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") + .WithMany() + .HasForeignKey("OrganizationUserId"); + + b.Navigation("GrantedServiceAccount"); + + b.Navigation("OrganizationUser"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Collection", b => + { + b.Navigation("CollectionCiphers"); + + b.Navigation("CollectionGroups"); + + b.Navigation("CollectionUsers"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Group", b => + { + b.Navigation("GroupUsers"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Organization", b => + { + b.Navigation("ApiKeys"); + + b.Navigation("Ciphers"); + + b.Navigation("Collections"); + + b.Navigation("Connections"); + + b.Navigation("Domains"); + + b.Navigation("Groups"); + + b.Navigation("OrganizationUsers"); + + b.Navigation("Policies"); + + b.Navigation("SsoConfigs"); + + b.Navigation("SsoUsers"); + + b.Navigation("Transactions"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", b => + { + b.Navigation("CollectionUsers"); + + b.Navigation("GroupUsers"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.User", b => + { + b.Navigation("Ciphers"); + + b.Navigation("Folders"); + + b.Navigation("OrganizationUsers"); + + b.Navigation("SsoUsers"); + + b.Navigation("Transactions"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", b => + { + b.Navigation("GroupAccessPolicies"); + + b.Navigation("ServiceAccountAccessPolicies"); + + b.Navigation("UserAccessPolicies"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", b => + { + b.Navigation("GroupAccessPolicies"); + + b.Navigation("UserAccessPolicies"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", b => + { + b.Navigation("CollectionCiphers"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/util/MySqlMigrations/Migrations/20230824202452_ACCESSPOLICY_ADD_DELETE_CASCADE.cs b/util/MySqlMigrations/Migrations/20230824202452_ACCESSPOLICY_ADD_DELETE_CASCADE.cs new file mode 100644 index 0000000000..711cfe7359 --- /dev/null +++ b/util/MySqlMigrations/Migrations/20230824202452_ACCESSPOLICY_ADD_DELETE_CASCADE.cs @@ -0,0 +1,63 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Bit.MySqlMigrations.Migrations; + +/// +public partial class ACCESSPOLICY_ADD_DELETE_CASCADE : Migration +{ + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_AccessPolicy_Group_GroupId", + table: "AccessPolicy"); + + migrationBuilder.DropForeignKey( + name: "FK_AccessPolicy_Project_GrantedProjectId", + table: "AccessPolicy"); + + migrationBuilder.AddForeignKey( + name: "FK_AccessPolicy_Group_GroupId", + table: "AccessPolicy", + column: "GroupId", + principalTable: "Group", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_AccessPolicy_Project_GrantedProjectId", + table: "AccessPolicy", + column: "GrantedProjectId", + principalTable: "Project", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_AccessPolicy_Group_GroupId", + table: "AccessPolicy"); + + migrationBuilder.DropForeignKey( + name: "FK_AccessPolicy_Project_GrantedProjectId", + table: "AccessPolicy"); + + migrationBuilder.AddForeignKey( + name: "FK_AccessPolicy_Group_GroupId", + table: "AccessPolicy", + column: "GroupId", + principalTable: "Group", + principalColumn: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_AccessPolicy_Project_GrantedProjectId", + table: "AccessPolicy", + column: "GrantedProjectId", + principalTable: "Project", + principalColumn: "Id"); + } +} diff --git a/util/MySqlMigrations/Migrations/DatabaseContextModelSnapshot.cs b/util/MySqlMigrations/Migrations/DatabaseContextModelSnapshot.cs index 8ed8369dea..1bc45e72df 100644 --- a/util/MySqlMigrations/Migrations/DatabaseContextModelSnapshot.cs +++ b/util/MySqlMigrations/Migrations/DatabaseContextModelSnapshot.cs @@ -2072,11 +2072,13 @@ namespace Bit.MySqlMigrations.Migrations { b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") .WithMany("GroupAccessPolicies") - .HasForeignKey("GrantedProjectId"); + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") .WithMany() - .HasForeignKey("GroupId"); + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade); b.Navigation("GrantedProject"); @@ -2091,7 +2093,8 @@ namespace Bit.MySqlMigrations.Migrations b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") .WithMany() - .HasForeignKey("GroupId"); + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade); b.Navigation("GrantedServiceAccount"); @@ -2102,7 +2105,8 @@ namespace Bit.MySqlMigrations.Migrations { b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") .WithMany("ServiceAccountAccessPolicies") - .HasForeignKey("GrantedProjectId"); + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount") .WithMany() @@ -2117,7 +2121,8 @@ namespace Bit.MySqlMigrations.Migrations { b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") .WithMany("UserAccessPolicies") - .HasForeignKey("GrantedProjectId"); + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") .WithMany() diff --git a/util/MySqlMigrations/packages.lock.json b/util/MySqlMigrations/packages.lock.json index 09909b0f05..8a6ee7dbd0 100644 --- a/util/MySqlMigrations/packages.lock.json +++ b/util/MySqlMigrations/packages.lock.json @@ -170,10 +170,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2613,56 +2614,56 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } } } diff --git a/util/PostgresMigrations/Migrations/20230824202447_ACCESSPOLICY_ADD_DELETE_CASCADE.Designer.cs b/util/PostgresMigrations/Migrations/20230824202447_ACCESSPOLICY_ADD_DELETE_CASCADE.Designer.cs new file mode 100644 index 0000000000..504faedcbf --- /dev/null +++ b/util/PostgresMigrations/Migrations/20230824202447_ACCESSPOLICY_ADD_DELETE_CASCADE.Designer.cs @@ -0,0 +1,2247 @@ +// +using System; +using Bit.Infrastructure.EntityFramework.Repositories; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; +using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata; + +#nullable disable + +namespace Bit.PostgresMigrations.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20230824202447_ACCESSPOLICY_ADD_DELETE_CASCADE")] + partial class ACCESSPOLICY_ADD_DELETE_CASCADE + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder + .HasAnnotation("Npgsql:CollationDefinition:postgresIndetermanisticCollation", "en-u-ks-primary,en-u-ks-primary,icu,False") + .HasAnnotation("ProductVersion", "7.0.5") + .HasAnnotation("Relational:MaxIdentifierLength", 63); + + NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.AuthRequest", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccessCode") + .HasMaxLength(25) + .HasColumnType("character varying(25)"); + + b.Property("Approved") + .HasColumnType("boolean"); + + b.Property("AuthenticationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("MasterPasswordHash") + .HasColumnType("text"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("PublicKey") + .HasColumnType("text"); + + b.Property("RequestDeviceIdentifier") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("RequestDeviceType") + .HasColumnType("smallint"); + + b.Property("RequestIpAddress") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("ResponseDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ResponseDeviceId") + .HasColumnType("uuid"); + + b.Property("Type") + .HasColumnType("smallint"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("ResponseDeviceId"); + + b.HasIndex("UserId"); + + b.ToTable("AuthRequest", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.EmergencyAccess", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("GranteeId") + .HasColumnType("uuid"); + + b.Property("GrantorId") + .HasColumnType("uuid"); + + b.Property("KeyEncrypted") + .HasColumnType("text"); + + b.Property("LastNotificationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RecoveryInitiatedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Status") + .HasColumnType("smallint"); + + b.Property("Type") + .HasColumnType("smallint"); + + b.Property("WaitTimeDays") + .HasColumnType("integer"); + + b.HasKey("Id"); + + b.HasIndex("GranteeId"); + + b.HasIndex("GrantorId"); + + b.ToTable("EmergencyAccess", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.Grant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ClientId") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ConsumedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Data") + .HasColumnType("text"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.HasKey("Key"); + + b.ToTable("Grant", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.SsoConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Data") + .HasColumnType("text"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("SsoConfig", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.SsoUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("bigint"); + + NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id")); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExternalId") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .UseCollation("postgresIndetermanisticCollation"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("SsoUser", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Collection", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExternalId") + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Collection", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionCipher", b => + { + b.Property("CollectionId") + .HasColumnType("uuid"); + + b.Property("CipherId") + .HasColumnType("uuid"); + + b.HasKey("CollectionId", "CipherId"); + + b.HasIndex("CipherId"); + + b.ToTable("CollectionCipher", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionGroup", b => + { + b.Property("CollectionId") + .HasColumnType("uuid"); + + b.Property("GroupId") + .HasColumnType("uuid"); + + b.Property("HidePasswords") + .HasColumnType("boolean"); + + b.Property("ReadOnly") + .HasColumnType("boolean"); + + b.HasKey("CollectionId", "GroupId"); + + b.HasIndex("GroupId"); + + b.ToTable("CollectionGroups"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionUser", b => + { + b.Property("CollectionId") + .HasColumnType("uuid"); + + b.Property("OrganizationUserId") + .HasColumnType("uuid"); + + b.Property("HidePasswords") + .HasColumnType("boolean"); + + b.Property("ReadOnly") + .HasColumnType("boolean"); + + b.HasKey("CollectionId", "OrganizationUserId"); + + b.HasIndex("OrganizationUserId"); + + b.ToTable("CollectionUsers"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Device", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("EncryptedPrivateKey") + .HasColumnType("text"); + + b.Property("EncryptedPublicKey") + .HasColumnType("text"); + + b.Property("EncryptedUserKey") + .HasColumnType("text"); + + b.Property("Identifier") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PushToken") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Type") + .HasColumnType("smallint"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Device", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Event", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ActingUserId") + .HasColumnType("uuid"); + + b.Property("CipherId") + .HasColumnType("uuid"); + + b.Property("CollectionId") + .HasColumnType("uuid"); + + b.Property("Date") + .HasColumnType("timestamp with time zone"); + + b.Property("DeviceType") + .HasColumnType("smallint"); + + b.Property("DomainName") + .HasColumnType("text"); + + b.Property("GroupId") + .HasColumnType("uuid"); + + b.Property("InstallationId") + .HasColumnType("uuid"); + + b.Property("IpAddress") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("OrganizationUserId") + .HasColumnType("uuid"); + + b.Property("PolicyId") + .HasColumnType("uuid"); + + b.Property("ProviderId") + .HasColumnType("uuid"); + + b.Property("ProviderOrganizationId") + .HasColumnType("uuid"); + + b.Property("ProviderUserId") + .HasColumnType("uuid"); + + b.Property("SecretId") + .HasColumnType("uuid"); + + b.Property("ServiceAccountId") + .HasColumnType("uuid"); + + b.Property("SystemUser") + .HasColumnType("smallint"); + + b.Property("Type") + .HasColumnType("integer"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.ToTable("Event", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Group", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccessAll") + .HasColumnType("boolean"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ExternalId") + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("Name") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Group", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.GroupUser", b => + { + b.Property("GroupId") + .HasColumnType("uuid"); + + b.Property("OrganizationUserId") + .HasColumnType("uuid"); + + b.HasKey("GroupId", "OrganizationUserId"); + + b.HasIndex("OrganizationUserId"); + + b.ToTable("GroupUser", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Installation", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Key") + .HasMaxLength(150) + .HasColumnType("character varying(150)"); + + b.HasKey("Id"); + + b.ToTable("Installation", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Organization", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("BillingEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("BusinessAddress1") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("BusinessAddress2") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("BusinessAddress3") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("BusinessCountry") + .HasMaxLength(2) + .HasColumnType("character varying(2)"); + + b.Property("BusinessName") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("BusinessTaxNumber") + .HasMaxLength(30) + .HasColumnType("character varying(30)"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Gateway") + .HasColumnType("smallint"); + + b.Property("GatewayCustomerId") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("GatewaySubscriptionId") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Identifier") + .HasMaxLength(50) + .HasColumnType("character varying(50)") + .UseCollation("postgresIndetermanisticCollation"); + + b.Property("LicenseKey") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("MaxAutoscaleSeats") + .HasColumnType("integer"); + + b.Property("MaxAutoscaleSmSeats") + .HasColumnType("integer"); + + b.Property("MaxAutoscaleSmServiceAccounts") + .HasColumnType("integer"); + + b.Property("MaxCollections") + .HasColumnType("smallint"); + + b.Property("MaxStorageGb") + .HasColumnType("smallint"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("OwnersNotifiedOfAutoscaling") + .HasColumnType("timestamp with time zone"); + + b.Property("Plan") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PlanType") + .HasColumnType("smallint"); + + b.Property("PrivateKey") + .HasColumnType("text"); + + b.Property("PublicKey") + .HasColumnType("text"); + + b.Property("ReferenceData") + .HasColumnType("text"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Seats") + .HasColumnType("integer"); + + b.Property("SecretsManagerBeta") + .HasColumnType("boolean"); + + b.Property("SelfHost") + .HasColumnType("boolean"); + + b.Property("SmSeats") + .HasColumnType("integer"); + + b.Property("SmServiceAccounts") + .HasColumnType("integer"); + + b.Property("Status") + .HasColumnType("smallint"); + + b.Property("Storage") + .HasColumnType("bigint"); + + b.Property("TwoFactorProviders") + .HasColumnType("text"); + + b.Property("Use2fa") + .HasColumnType("boolean"); + + b.Property("UseApi") + .HasColumnType("boolean"); + + b.Property("UseCustomPermissions") + .HasColumnType("boolean"); + + b.Property("UseDirectory") + .HasColumnType("boolean"); + + b.Property("UseEvents") + .HasColumnType("boolean"); + + b.Property("UseGroups") + .HasColumnType("boolean"); + + b.Property("UseKeyConnector") + .HasColumnType("boolean"); + + b.Property("UsePasswordManager") + .HasColumnType("boolean"); + + b.Property("UsePolicies") + .HasColumnType("boolean"); + + b.Property("UseResetPassword") + .HasColumnType("boolean"); + + b.Property("UseScim") + .HasColumnType("boolean"); + + b.Property("UseSecretsManager") + .HasColumnType("boolean"); + + b.Property("UseSso") + .HasColumnType("boolean"); + + b.Property("UseTotp") + .HasColumnType("boolean"); + + b.Property("UsersGetPremium") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("Organization", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationApiKey", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ApiKey") + .HasMaxLength(30) + .HasColumnType("character varying(30)"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Type") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("OrganizationApiKey", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationConnection", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Config") + .HasColumnType("text"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("Type") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("OrganizationConnection", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationDomain", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("DomainName") + .HasMaxLength(255) + .HasColumnType("character varying(255)"); + + b.Property("JobRunCount") + .HasColumnType("integer"); + + b.Property("LastCheckedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("NextRunDate") + .HasColumnType("timestamp with time zone"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("Txt") + .HasColumnType("text"); + + b.Property("VerifiedDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("OrganizationDomain", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationSponsorship", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("FriendlyName") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("LastSyncDate") + .HasColumnType("timestamp with time zone"); + + b.Property("OfferedToEmail") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("PlanSponsorshipType") + .HasColumnType("smallint"); + + b.Property("SponsoredOrganizationId") + .HasColumnType("uuid"); + + b.Property("SponsoringOrganizationId") + .HasColumnType("uuid"); + + b.Property("SponsoringOrganizationUserId") + .HasColumnType("uuid"); + + b.Property("ToDelete") + .HasColumnType("boolean"); + + b.Property("ValidUntil") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id"); + + b.HasIndex("SponsoredOrganizationId"); + + b.HasIndex("SponsoringOrganizationId"); + + b.ToTable("OrganizationSponsorship", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccessAll") + .HasColumnType("boolean"); + + b.Property("AccessSecretsManager") + .HasColumnType("boolean"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("character varying(256)"); + + b.Property("ExternalId") + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("Permissions") + .HasColumnType("text"); + + b.Property("ResetPasswordKey") + .HasColumnType("text"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Status") + .HasColumnType("smallint"); + + b.Property("Type") + .HasColumnType("smallint"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("OrganizationUser", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Policy", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Data") + .HasColumnType("text"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Type") + .HasColumnType("smallint"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Policy", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Provider", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("BillingEmail") + .HasColumnType("text"); + + b.Property("BillingPhone") + .HasColumnType("text"); + + b.Property("BusinessAddress1") + .HasColumnType("text"); + + b.Property("BusinessAddress2") + .HasColumnType("text"); + + b.Property("BusinessAddress3") + .HasColumnType("text"); + + b.Property("BusinessCountry") + .HasColumnType("text"); + + b.Property("BusinessName") + .HasColumnType("text"); + + b.Property("BusinessTaxNumber") + .HasColumnType("text"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Enabled") + .HasColumnType("boolean"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Status") + .HasColumnType("smallint"); + + b.Property("Type") + .HasColumnType("smallint"); + + b.Property("UseEvents") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("Provider", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.ProviderOrganization", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("ProviderId") + .HasColumnType("uuid"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Settings") + .HasColumnType("text"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("ProviderId"); + + b.ToTable("ProviderOrganization", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.ProviderUser", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Email") + .HasColumnType("text"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("Permissions") + .HasColumnType("text"); + + b.Property("ProviderId") + .HasColumnType("uuid"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Status") + .HasColumnType("smallint"); + + b.Property("Type") + .HasColumnType("smallint"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("ProviderId"); + + b.HasIndex("UserId"); + + b.ToTable("ProviderUser", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Send", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccessCount") + .HasColumnType("integer"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Data") + .HasColumnType("text"); + + b.Property("DeletionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Disabled") + .HasColumnType("boolean"); + + b.Property("ExpirationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("HideEmail") + .HasColumnType("boolean"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("MaxAccessCount") + .HasColumnType("integer"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("Password") + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Type") + .HasColumnType("smallint"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("Send", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.TaxRate", b => + { + b.Property("Id") + .HasMaxLength(40) + .HasColumnType("character varying(40)"); + + b.Property("Active") + .HasColumnType("boolean"); + + b.Property("Country") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Rate") + .HasColumnType("numeric"); + + b.Property("State") + .HasMaxLength(2) + .HasColumnType("character varying(2)"); + + b.HasKey("Id"); + + b.ToTable("TaxRate", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Transaction", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Amount") + .HasColumnType("numeric"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Details") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("Gateway") + .HasColumnType("smallint"); + + b.Property("GatewayId") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("PaymentMethodType") + .HasColumnType("smallint"); + + b.Property("Refunded") + .HasColumnType("boolean"); + + b.Property("RefundedAmount") + .HasColumnType("numeric"); + + b.Property("Type") + .HasColumnType("smallint"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("Transaction", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.User", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("AccountRevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("ApiKey") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("character varying(30)"); + + b.Property("AvatarColor") + .HasMaxLength(7) + .HasColumnType("character varying(7)"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Culture") + .HasMaxLength(10) + .HasColumnType("character varying(10)"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("character varying(256)") + .UseCollation("postgresIndetermanisticCollation"); + + b.Property("EmailVerified") + .HasColumnType("boolean"); + + b.Property("EquivalentDomains") + .HasColumnType("text"); + + b.Property("ExcludedGlobalEquivalentDomains") + .HasColumnType("text"); + + b.Property("FailedLoginCount") + .HasColumnType("integer"); + + b.Property("ForcePasswordReset") + .HasColumnType("boolean"); + + b.Property("Gateway") + .HasColumnType("smallint"); + + b.Property("GatewayCustomerId") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("GatewaySubscriptionId") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Kdf") + .HasColumnType("smallint"); + + b.Property("KdfIterations") + .HasColumnType("integer"); + + b.Property("KdfMemory") + .HasColumnType("integer"); + + b.Property("KdfParallelism") + .HasColumnType("integer"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("LastEmailChangeDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LastFailedLoginDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LastKdfChangeDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LastKeyRotationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LastPasswordChangeDate") + .HasColumnType("timestamp with time zone"); + + b.Property("LicenseKey") + .HasMaxLength(100) + .HasColumnType("character varying(100)"); + + b.Property("MasterPassword") + .HasMaxLength(300) + .HasColumnType("character varying(300)"); + + b.Property("MasterPasswordHint") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("MaxStorageGb") + .HasColumnType("smallint"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Premium") + .HasColumnType("boolean"); + + b.Property("PremiumExpirationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("PrivateKey") + .HasColumnType("text"); + + b.Property("PublicKey") + .HasColumnType("text"); + + b.Property("ReferenceData") + .HasColumnType("text"); + + b.Property("RenewalReminderDate") + .HasColumnType("timestamp with time zone"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("character varying(50)"); + + b.Property("Storage") + .HasColumnType("bigint"); + + b.Property("TwoFactorProviders") + .HasColumnType("text"); + + b.Property("TwoFactorRecoveryCode") + .HasMaxLength(32) + .HasColumnType("character varying(32)"); + + b.Property("UsesKeyConnector") + .HasColumnType("boolean"); + + b.HasKey("Id"); + + b.ToTable("User", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("text"); + + b.Property("Read") + .HasColumnType("boolean"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Write") + .HasColumnType("boolean"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.ToTable("AccessPolicy", (string)null); + + b.HasDiscriminator("Discriminator").HasValue("AccessPolicy"); + + b.UseTphMappingStrategy(); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ApiKey", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("ClientSecretHash") + .HasMaxLength(128) + .HasColumnType("character varying(128)"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("EncryptedPayload") + .HasMaxLength(4000) + .HasColumnType("character varying(4000)"); + + b.Property("ExpireAt") + .HasColumnType("timestamp with time zone"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("character varying(200)"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Scope") + .HasMaxLength(4000) + .HasColumnType("character varying(4000)"); + + b.Property("ServiceAccountId") + .HasColumnType("uuid"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.HasIndex("ServiceAccountId") + .HasAnnotation("SqlServer:Clustered", false); + + b.ToTable("ApiKey", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.HasIndex("DeletedDate") + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); + + b.ToTable("Project", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Secret", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("DeletedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Key") + .HasColumnType("text"); + + b.Property("Note") + .HasColumnType("text"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Value") + .HasColumnType("text"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.HasIndex("DeletedDate") + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); + + b.ToTable("Secret", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); + + b.ToTable("ServiceAccount", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("Attachments") + .HasColumnType("text"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Data") + .HasColumnType("text"); + + b.Property("DeletedDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Favorites") + .HasColumnType("text"); + + b.Property("Folders") + .HasColumnType("text"); + + b.Property("OrganizationId") + .HasColumnType("uuid"); + + b.Property("Reprompt") + .HasColumnType("smallint"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Type") + .HasColumnType("smallint"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("Cipher", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Folder", b => + { + b.Property("Id") + .HasColumnType("uuid"); + + b.Property("CreationDate") + .HasColumnType("timestamp with time zone"); + + b.Property("Name") + .HasColumnType("text"); + + b.Property("RevisionDate") + .HasColumnType("timestamp with time zone"); + + b.Property("UserId") + .HasColumnType("uuid"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Folder", (string)null); + }); + + modelBuilder.Entity("ProjectSecret", b => + { + b.Property("ProjectsId") + .HasColumnType("uuid"); + + b.Property("SecretsId") + .HasColumnType("uuid"); + + b.HasKey("ProjectsId", "SecretsId"); + + b.HasIndex("SecretsId"); + + b.ToTable("ProjectSecret"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.GroupProjectAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedProjectId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("uuid") + .HasColumnName("GrantedProjectId"); + + b.Property("GroupId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("uuid") + .HasColumnName("GroupId"); + + b.HasIndex("GrantedProjectId"); + + b.HasIndex("GroupId"); + + b.HasDiscriminator().HasValue("group_project"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.GroupServiceAccountAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedServiceAccountId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("uuid") + .HasColumnName("GrantedServiceAccountId"); + + b.Property("GroupId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("uuid") + .HasColumnName("GroupId"); + + b.HasIndex("GrantedServiceAccountId"); + + b.HasIndex("GroupId"); + + b.HasDiscriminator().HasValue("group_service_account"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccountProjectAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedProjectId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("uuid") + .HasColumnName("GrantedProjectId"); + + b.Property("ServiceAccountId") + .HasColumnType("uuid") + .HasColumnName("ServiceAccountId"); + + b.HasIndex("GrantedProjectId"); + + b.HasIndex("ServiceAccountId"); + + b.HasDiscriminator().HasValue("service_account_project"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.UserProjectAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedProjectId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("uuid") + .HasColumnName("GrantedProjectId"); + + b.Property("OrganizationUserId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("uuid") + .HasColumnName("OrganizationUserId"); + + b.HasIndex("GrantedProjectId"); + + b.HasIndex("OrganizationUserId"); + + b.HasDiscriminator().HasValue("user_project"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.UserServiceAccountAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedServiceAccountId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("uuid") + .HasColumnName("GrantedServiceAccountId"); + + b.Property("OrganizationUserId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("uuid") + .HasColumnName("OrganizationUserId"); + + b.HasIndex("GrantedServiceAccountId"); + + b.HasIndex("OrganizationUserId"); + + b.HasDiscriminator().HasValue("user_service_account"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.AuthRequest", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Device", "ResponseDevice") + .WithMany() + .HasForeignKey("ResponseDeviceId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + + b.Navigation("ResponseDevice"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.EmergencyAccess", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "Grantee") + .WithMany() + .HasForeignKey("GranteeId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "Grantor") + .WithMany() + .HasForeignKey("GrantorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Grantee"); + + b.Navigation("Grantor"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.SsoConfig", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("SsoConfigs") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.SsoUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("SsoUsers") + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("SsoUsers") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Collection", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Collections") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionCipher", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", "Cipher") + .WithMany("CollectionCiphers") + .HasForeignKey("CipherId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Collection", "Collection") + .WithMany("CollectionCiphers") + .HasForeignKey("CollectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Cipher"); + + b.Navigation("Collection"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionGroup", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Collection", "Collection") + .WithMany("CollectionGroups") + .HasForeignKey("CollectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") + .WithMany() + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Collection"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Collection", "Collection") + .WithMany("CollectionUsers") + .HasForeignKey("CollectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") + .WithMany("CollectionUsers") + .HasForeignKey("OrganizationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Collection"); + + b.Navigation("OrganizationUser"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Device", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Group", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Groups") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.GroupUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") + .WithMany("GroupUsers") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") + .WithMany("GroupUsers") + .HasForeignKey("OrganizationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + + b.Navigation("OrganizationUser"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationApiKey", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("ApiKeys") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationConnection", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Connections") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationDomain", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Domains") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationSponsorship", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "SponsoredOrganization") + .WithMany() + .HasForeignKey("SponsoredOrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "SponsoringOrganization") + .WithMany() + .HasForeignKey("SponsoringOrganizationId"); + + b.Navigation("SponsoredOrganization"); + + b.Navigation("SponsoringOrganization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("OrganizationUsers") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("OrganizationUsers") + .HasForeignKey("UserId"); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Policy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Policies") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.ProviderOrganization", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Provider", "Provider") + .WithMany() + .HasForeignKey("ProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + + b.Navigation("Provider"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.ProviderUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Provider", "Provider") + .WithMany() + .HasForeignKey("ProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("Provider"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Send", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Transaction", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Transactions") + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("Transactions") + .HasForeignKey("UserId"); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ApiKey", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount") + .WithMany() + .HasForeignKey("ServiceAccountId"); + + b.Navigation("ServiceAccount"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Secret", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Ciphers") + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("Ciphers") + .HasForeignKey("UserId"); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Folder", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("Folders") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("ProjectSecret", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", null) + .WithMany() + .HasForeignKey("ProjectsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Secret", null) + .WithMany() + .HasForeignKey("SecretsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.GroupProjectAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") + .WithMany("GroupAccessPolicies") + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") + .WithMany() + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("GrantedProject"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.GroupServiceAccountAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "GrantedServiceAccount") + .WithMany("GroupAccessPolicies") + .HasForeignKey("GrantedServiceAccountId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") + .WithMany() + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("GrantedServiceAccount"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccountProjectAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") + .WithMany("ServiceAccountAccessPolicies") + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount") + .WithMany() + .HasForeignKey("ServiceAccountId"); + + b.Navigation("GrantedProject"); + + b.Navigation("ServiceAccount"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.UserProjectAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") + .WithMany("UserAccessPolicies") + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") + .WithMany() + .HasForeignKey("OrganizationUserId"); + + b.Navigation("GrantedProject"); + + b.Navigation("OrganizationUser"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.UserServiceAccountAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "GrantedServiceAccount") + .WithMany("UserAccessPolicies") + .HasForeignKey("GrantedServiceAccountId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") + .WithMany() + .HasForeignKey("OrganizationUserId"); + + b.Navigation("GrantedServiceAccount"); + + b.Navigation("OrganizationUser"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Collection", b => + { + b.Navigation("CollectionCiphers"); + + b.Navigation("CollectionGroups"); + + b.Navigation("CollectionUsers"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Group", b => + { + b.Navigation("GroupUsers"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Organization", b => + { + b.Navigation("ApiKeys"); + + b.Navigation("Ciphers"); + + b.Navigation("Collections"); + + b.Navigation("Connections"); + + b.Navigation("Domains"); + + b.Navigation("Groups"); + + b.Navigation("OrganizationUsers"); + + b.Navigation("Policies"); + + b.Navigation("SsoConfigs"); + + b.Navigation("SsoUsers"); + + b.Navigation("Transactions"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", b => + { + b.Navigation("CollectionUsers"); + + b.Navigation("GroupUsers"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.User", b => + { + b.Navigation("Ciphers"); + + b.Navigation("Folders"); + + b.Navigation("OrganizationUsers"); + + b.Navigation("SsoUsers"); + + b.Navigation("Transactions"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", b => + { + b.Navigation("GroupAccessPolicies"); + + b.Navigation("ServiceAccountAccessPolicies"); + + b.Navigation("UserAccessPolicies"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", b => + { + b.Navigation("GroupAccessPolicies"); + + b.Navigation("UserAccessPolicies"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", b => + { + b.Navigation("CollectionCiphers"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/util/PostgresMigrations/Migrations/20230824202447_ACCESSPOLICY_ADD_DELETE_CASCADE.cs b/util/PostgresMigrations/Migrations/20230824202447_ACCESSPOLICY_ADD_DELETE_CASCADE.cs new file mode 100644 index 0000000000..36e07cd38e --- /dev/null +++ b/util/PostgresMigrations/Migrations/20230824202447_ACCESSPOLICY_ADD_DELETE_CASCADE.cs @@ -0,0 +1,63 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Bit.PostgresMigrations.Migrations; + +/// +public partial class ACCESSPOLICY_ADD_DELETE_CASCADE : Migration +{ + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_AccessPolicy_Group_GroupId", + table: "AccessPolicy"); + + migrationBuilder.DropForeignKey( + name: "FK_AccessPolicy_Project_GrantedProjectId", + table: "AccessPolicy"); + + migrationBuilder.AddForeignKey( + name: "FK_AccessPolicy_Group_GroupId", + table: "AccessPolicy", + column: "GroupId", + principalTable: "Group", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_AccessPolicy_Project_GrantedProjectId", + table: "AccessPolicy", + column: "GrantedProjectId", + principalTable: "Project", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_AccessPolicy_Group_GroupId", + table: "AccessPolicy"); + + migrationBuilder.DropForeignKey( + name: "FK_AccessPolicy_Project_GrantedProjectId", + table: "AccessPolicy"); + + migrationBuilder.AddForeignKey( + name: "FK_AccessPolicy_Group_GroupId", + table: "AccessPolicy", + column: "GroupId", + principalTable: "Group", + principalColumn: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_AccessPolicy_Project_GrantedProjectId", + table: "AccessPolicy", + column: "GrantedProjectId", + principalTable: "Project", + principalColumn: "Id"); + } +} diff --git a/util/PostgresMigrations/Migrations/DatabaseContextModelSnapshot.cs b/util/PostgresMigrations/Migrations/DatabaseContextModelSnapshot.cs index 4caa416f22..0560e83664 100644 --- a/util/PostgresMigrations/Migrations/DatabaseContextModelSnapshot.cs +++ b/util/PostgresMigrations/Migrations/DatabaseContextModelSnapshot.cs @@ -2083,11 +2083,13 @@ namespace Bit.PostgresMigrations.Migrations { b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") .WithMany("GroupAccessPolicies") - .HasForeignKey("GrantedProjectId"); + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") .WithMany() - .HasForeignKey("GroupId"); + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade); b.Navigation("GrantedProject"); @@ -2102,7 +2104,8 @@ namespace Bit.PostgresMigrations.Migrations b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") .WithMany() - .HasForeignKey("GroupId"); + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade); b.Navigation("GrantedServiceAccount"); @@ -2113,7 +2116,8 @@ namespace Bit.PostgresMigrations.Migrations { b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") .WithMany("ServiceAccountAccessPolicies") - .HasForeignKey("GrantedProjectId"); + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount") .WithMany() @@ -2128,7 +2132,8 @@ namespace Bit.PostgresMigrations.Migrations { b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") .WithMany("UserAccessPolicies") - .HasForeignKey("GrantedProjectId"); + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") .WithMany() diff --git a/util/PostgresMigrations/packages.lock.json b/util/PostgresMigrations/packages.lock.json index 09909b0f05..8a6ee7dbd0 100644 --- a/util/PostgresMigrations/packages.lock.json +++ b/util/PostgresMigrations/packages.lock.json @@ -170,10 +170,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2613,56 +2614,56 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } } } diff --git a/util/Setup/packages.lock.json b/util/Setup/packages.lock.json index 8dafc505b3..75193a0ccf 100644 --- a/util/Setup/packages.lock.json +++ b/util/Setup/packages.lock.json @@ -169,10 +169,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2634,51 +2635,51 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "migrator": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Microsoft.Extensions.Logging": "6.0.0", - "dbup-sqlserver": "5.0.8" + "Core": "[2023.9.0, )", + "Microsoft.Extensions.Logging": "[6.0.0, )", + "dbup-sqlserver": "[5.0.8, )" } } } diff --git a/util/SqlServerEFScaffold/packages.lock.json b/util/SqlServerEFScaffold/packages.lock.json index a15ccb4657..b3c52196cc 100644 --- a/util/SqlServerEFScaffold/packages.lock.json +++ b/util/SqlServerEFScaffold/packages.lock.json @@ -273,10 +273,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2792,103 +2793,103 @@ "api": { "type": "Project", "dependencies": { - "AspNetCore.HealthChecks.AzureServiceBus": "6.1.0", - "AspNetCore.HealthChecks.AzureStorage": "6.1.2", - "AspNetCore.HealthChecks.Network": "6.0.4", - "AspNetCore.HealthChecks.Redis": "6.0.4", - "AspNetCore.HealthChecks.SendGrid": "6.0.2", - "AspNetCore.HealthChecks.SqlServer": "6.0.2", - "AspNetCore.HealthChecks.Uris": "6.0.3", - "Azure.Messaging.EventGrid": "4.10.0", - "Commercial.Core": "2023.7.2", - "Commercial.Infrastructure.EntityFramework": "2023.7.2", - "Core": "2023.7.2", - "SharedWeb": "2023.7.2", - "Swashbuckle.AspNetCore": "6.5.0" + "AspNetCore.HealthChecks.AzureServiceBus": "[6.1.0, )", + "AspNetCore.HealthChecks.AzureStorage": "[6.1.2, )", + "AspNetCore.HealthChecks.Network": "[6.0.4, )", + "AspNetCore.HealthChecks.Redis": "[6.0.4, )", + "AspNetCore.HealthChecks.SendGrid": "[6.0.2, )", + "AspNetCore.HealthChecks.SqlServer": "[6.0.2, )", + "AspNetCore.HealthChecks.Uris": "[6.0.3, )", + "Azure.Messaging.EventGrid": "[4.10.0, )", + "Commercial.Core": "[2023.9.0, )", + "Commercial.Infrastructure.EntityFramework": "[2023.9.0, )", + "Core": "[2023.9.0, )", + "SharedWeb": "[2023.9.0, )", + "Swashbuckle.AspNetCore": "[6.5.0, )" } }, "commercial.core": { "type": "Project", "dependencies": { - "Core": "2023.7.2" + "Core": "[2023.9.0, )" } }, "commercial.infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } }, "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.dapper": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Dapper": "2.0.123" + "Core": "[2023.9.0, )", + "Dapper": "[2.0.123, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } }, "sharedweb": { "type": "Project", "dependencies": { - "Core": "2023.7.2", - "Infrastructure.Dapper": "2023.7.2", - "Infrastructure.EntityFramework": "2023.7.2" + "Core": "[2023.9.0, )", + "Infrastructure.Dapper": "[2023.9.0, )", + "Infrastructure.EntityFramework": "[2023.9.0, )" } } } diff --git a/util/SqliteMigrations/Migrations/20230824202443_ACCESSPOLICY_ADD_DELETE_CASCADE.Designer.cs b/util/SqliteMigrations/Migrations/20230824202443_ACCESSPOLICY_ADD_DELETE_CASCADE.Designer.cs new file mode 100644 index 0000000000..b4fae3362b --- /dev/null +++ b/util/SqliteMigrations/Migrations/20230824202443_ACCESSPOLICY_ADD_DELETE_CASCADE.Designer.cs @@ -0,0 +1,2234 @@ +// +using System; +using Bit.Infrastructure.EntityFramework.Repositories; +using Microsoft.EntityFrameworkCore; +using Microsoft.EntityFrameworkCore.Infrastructure; +using Microsoft.EntityFrameworkCore.Migrations; +using Microsoft.EntityFrameworkCore.Storage.ValueConversion; + +#nullable disable + +namespace Bit.SqliteMigrations.Migrations +{ + [DbContext(typeof(DatabaseContext))] + [Migration("20230824202443_ACCESSPOLICY_ADD_DELETE_CASCADE")] + partial class ACCESSPOLICY_ADD_DELETE_CASCADE + { + /// + protected override void BuildTargetModel(ModelBuilder modelBuilder) + { +#pragma warning disable 612, 618 + modelBuilder.HasAnnotation("ProductVersion", "7.0.5"); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.AuthRequest", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("AccessCode") + .HasMaxLength(25) + .HasColumnType("TEXT"); + + b.Property("Approved") + .HasColumnType("INTEGER"); + + b.Property("AuthenticationDate") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Key") + .HasColumnType("TEXT"); + + b.Property("MasterPasswordHash") + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("PublicKey") + .HasColumnType("TEXT"); + + b.Property("RequestDeviceIdentifier") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("RequestDeviceType") + .HasColumnType("INTEGER"); + + b.Property("RequestIpAddress") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("ResponseDate") + .HasColumnType("TEXT"); + + b.Property("ResponseDeviceId") + .HasColumnType("TEXT"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("ResponseDeviceId"); + + b.HasIndex("UserId"); + + b.ToTable("AuthRequest", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.EmergencyAccess", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("GranteeId") + .HasColumnType("TEXT"); + + b.Property("GrantorId") + .HasColumnType("TEXT"); + + b.Property("KeyEncrypted") + .HasColumnType("TEXT"); + + b.Property("LastNotificationDate") + .HasColumnType("TEXT"); + + b.Property("RecoveryInitiatedDate") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.Property("WaitTimeDays") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("GranteeId"); + + b.HasIndex("GrantorId"); + + b.ToTable("EmergencyAccess", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.Grant", b => + { + b.Property("Key") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("ClientId") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("ConsumedDate") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Data") + .HasColumnType("TEXT"); + + b.Property("Description") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("ExpirationDate") + .HasColumnType("TEXT"); + + b.Property("SessionId") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("SubjectId") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("Type") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.HasKey("Key"); + + b.ToTable("Grant", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.SsoConfig", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Data") + .HasColumnType("TEXT"); + + b.Property("Enabled") + .HasColumnType("INTEGER"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("SsoConfig", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.SsoUser", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("INTEGER"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("ExternalId") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("SsoUser", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Collection", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("ExternalId") + .HasMaxLength(300) + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Collection", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionCipher", b => + { + b.Property("CollectionId") + .HasColumnType("TEXT"); + + b.Property("CipherId") + .HasColumnType("TEXT"); + + b.HasKey("CollectionId", "CipherId"); + + b.HasIndex("CipherId"); + + b.ToTable("CollectionCipher", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionGroup", b => + { + b.Property("CollectionId") + .HasColumnType("TEXT"); + + b.Property("GroupId") + .HasColumnType("TEXT"); + + b.Property("HidePasswords") + .HasColumnType("INTEGER"); + + b.Property("ReadOnly") + .HasColumnType("INTEGER"); + + b.HasKey("CollectionId", "GroupId"); + + b.HasIndex("GroupId"); + + b.ToTable("CollectionGroups"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionUser", b => + { + b.Property("CollectionId") + .HasColumnType("TEXT"); + + b.Property("OrganizationUserId") + .HasColumnType("TEXT"); + + b.Property("HidePasswords") + .HasColumnType("INTEGER"); + + b.Property("ReadOnly") + .HasColumnType("INTEGER"); + + b.HasKey("CollectionId", "OrganizationUserId"); + + b.HasIndex("OrganizationUserId"); + + b.ToTable("CollectionUsers"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Device", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("EncryptedPrivateKey") + .HasColumnType("TEXT"); + + b.Property("EncryptedPublicKey") + .HasColumnType("TEXT"); + + b.Property("EncryptedUserKey") + .HasColumnType("TEXT"); + + b.Property("Identifier") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PushToken") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Device", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Event", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("ActingUserId") + .HasColumnType("TEXT"); + + b.Property("CipherId") + .HasColumnType("TEXT"); + + b.Property("CollectionId") + .HasColumnType("TEXT"); + + b.Property("Date") + .HasColumnType("TEXT"); + + b.Property("DeviceType") + .HasColumnType("INTEGER"); + + b.Property("DomainName") + .HasColumnType("TEXT"); + + b.Property("GroupId") + .HasColumnType("TEXT"); + + b.Property("InstallationId") + .HasColumnType("TEXT"); + + b.Property("IpAddress") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("OrganizationUserId") + .HasColumnType("TEXT"); + + b.Property("PolicyId") + .HasColumnType("TEXT"); + + b.Property("ProviderId") + .HasColumnType("TEXT"); + + b.Property("ProviderOrganizationId") + .HasColumnType("TEXT"); + + b.Property("ProviderUserId") + .HasColumnType("TEXT"); + + b.Property("SecretId") + .HasColumnType("TEXT"); + + b.Property("ServiceAccountId") + .HasColumnType("TEXT"); + + b.Property("SystemUser") + .HasColumnType("INTEGER"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Event", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Group", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("AccessAll") + .HasColumnType("INTEGER"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("ExternalId") + .HasMaxLength(300) + .HasColumnType("TEXT"); + + b.Property("Name") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Group", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.GroupUser", b => + { + b.Property("GroupId") + .HasColumnType("TEXT"); + + b.Property("OrganizationUserId") + .HasColumnType("TEXT"); + + b.HasKey("GroupId", "OrganizationUserId"); + + b.HasIndex("OrganizationUserId"); + + b.ToTable("GroupUser", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Installation", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("Enabled") + .HasColumnType("INTEGER"); + + b.Property("Key") + .HasMaxLength(150) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("Installation", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Organization", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("BillingEmail") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("BusinessAddress1") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("BusinessAddress2") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("BusinessAddress3") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("BusinessCountry") + .HasMaxLength(2) + .HasColumnType("TEXT"); + + b.Property("BusinessName") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("BusinessTaxNumber") + .HasMaxLength(30) + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Enabled") + .HasColumnType("INTEGER"); + + b.Property("ExpirationDate") + .HasColumnType("TEXT"); + + b.Property("Gateway") + .HasColumnType("INTEGER"); + + b.Property("GatewayCustomerId") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("GatewaySubscriptionId") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("Identifier") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("LicenseKey") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("MaxAutoscaleSeats") + .HasColumnType("INTEGER"); + + b.Property("MaxAutoscaleSmSeats") + .HasColumnType("INTEGER"); + + b.Property("MaxAutoscaleSmServiceAccounts") + .HasColumnType("INTEGER"); + + b.Property("MaxCollections") + .HasColumnType("INTEGER"); + + b.Property("MaxStorageGb") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("OwnersNotifiedOfAutoscaling") + .HasColumnType("TEXT"); + + b.Property("Plan") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PlanType") + .HasColumnType("INTEGER"); + + b.Property("PrivateKey") + .HasColumnType("TEXT"); + + b.Property("PublicKey") + .HasColumnType("TEXT"); + + b.Property("ReferenceData") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Seats") + .HasColumnType("INTEGER"); + + b.Property("SecretsManagerBeta") + .HasColumnType("INTEGER"); + + b.Property("SelfHost") + .HasColumnType("INTEGER"); + + b.Property("SmSeats") + .HasColumnType("INTEGER"); + + b.Property("SmServiceAccounts") + .HasColumnType("INTEGER"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.Property("Storage") + .HasColumnType("INTEGER"); + + b.Property("TwoFactorProviders") + .HasColumnType("TEXT"); + + b.Property("Use2fa") + .HasColumnType("INTEGER"); + + b.Property("UseApi") + .HasColumnType("INTEGER"); + + b.Property("UseCustomPermissions") + .HasColumnType("INTEGER"); + + b.Property("UseDirectory") + .HasColumnType("INTEGER"); + + b.Property("UseEvents") + .HasColumnType("INTEGER"); + + b.Property("UseGroups") + .HasColumnType("INTEGER"); + + b.Property("UseKeyConnector") + .HasColumnType("INTEGER"); + + b.Property("UsePasswordManager") + .HasColumnType("INTEGER"); + + b.Property("UsePolicies") + .HasColumnType("INTEGER"); + + b.Property("UseResetPassword") + .HasColumnType("INTEGER"); + + b.Property("UseScim") + .HasColumnType("INTEGER"); + + b.Property("UseSecretsManager") + .HasColumnType("INTEGER"); + + b.Property("UseSso") + .HasColumnType("INTEGER"); + + b.Property("UseTotp") + .HasColumnType("INTEGER"); + + b.Property("UsersGetPremium") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Organization", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationApiKey", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("ApiKey") + .HasMaxLength(30) + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("OrganizationApiKey", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationConnection", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("Config") + .HasColumnType("TEXT"); + + b.Property("Enabled") + .HasColumnType("INTEGER"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("OrganizationConnection", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationDomain", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("DomainName") + .HasMaxLength(255) + .HasColumnType("TEXT"); + + b.Property("JobRunCount") + .HasColumnType("INTEGER"); + + b.Property("LastCheckedDate") + .HasColumnType("TEXT"); + + b.Property("NextRunDate") + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("Txt") + .HasColumnType("TEXT"); + + b.Property("VerifiedDate") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("OrganizationDomain", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationSponsorship", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("FriendlyName") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("LastSyncDate") + .HasColumnType("TEXT"); + + b.Property("OfferedToEmail") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("PlanSponsorshipType") + .HasColumnType("INTEGER"); + + b.Property("SponsoredOrganizationId") + .HasColumnType("TEXT"); + + b.Property("SponsoringOrganizationId") + .HasColumnType("TEXT"); + + b.Property("SponsoringOrganizationUserId") + .HasColumnType("TEXT"); + + b.Property("ToDelete") + .HasColumnType("INTEGER"); + + b.Property("ValidUntil") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("SponsoredOrganizationId"); + + b.HasIndex("SponsoringOrganizationId"); + + b.ToTable("OrganizationSponsorship", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("AccessAll") + .HasColumnType("INTEGER"); + + b.Property("AccessSecretsManager") + .HasColumnType("INTEGER"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Email") + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("ExternalId") + .HasMaxLength(300) + .HasColumnType("TEXT"); + + b.Property("Key") + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("Permissions") + .HasColumnType("TEXT"); + + b.Property("ResetPasswordKey") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("OrganizationUser", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Policy", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Data") + .HasColumnType("TEXT"); + + b.Property("Enabled") + .HasColumnType("INTEGER"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.ToTable("Policy", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Provider", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("BillingEmail") + .HasColumnType("TEXT"); + + b.Property("BillingPhone") + .HasColumnType("TEXT"); + + b.Property("BusinessAddress1") + .HasColumnType("TEXT"); + + b.Property("BusinessAddress2") + .HasColumnType("TEXT"); + + b.Property("BusinessAddress3") + .HasColumnType("TEXT"); + + b.Property("BusinessCountry") + .HasColumnType("TEXT"); + + b.Property("BusinessName") + .HasColumnType("TEXT"); + + b.Property("BusinessTaxNumber") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Enabled") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.Property("UseEvents") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("Provider", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.ProviderOrganization", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Key") + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("ProviderId") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Settings") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("ProviderId"); + + b.ToTable("ProviderOrganization", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.ProviderUser", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Email") + .HasColumnType("TEXT"); + + b.Property("Key") + .HasColumnType("TEXT"); + + b.Property("Permissions") + .HasColumnType("TEXT"); + + b.Property("ProviderId") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Status") + .HasColumnType("INTEGER"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("ProviderId"); + + b.HasIndex("UserId"); + + b.ToTable("ProviderUser", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Send", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("AccessCount") + .HasColumnType("INTEGER"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Data") + .HasColumnType("TEXT"); + + b.Property("DeletionDate") + .HasColumnType("TEXT"); + + b.Property("Disabled") + .HasColumnType("INTEGER"); + + b.Property("ExpirationDate") + .HasColumnType("TEXT"); + + b.Property("HideEmail") + .HasColumnType("INTEGER"); + + b.Property("Key") + .HasColumnType("TEXT"); + + b.Property("MaxAccessCount") + .HasColumnType("INTEGER"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("Password") + .HasMaxLength(300) + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("Send", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.TaxRate", b => + { + b.Property("Id") + .HasMaxLength(40) + .HasColumnType("TEXT"); + + b.Property("Active") + .HasColumnType("INTEGER"); + + b.Property("Country") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("PostalCode") + .HasMaxLength(10) + .HasColumnType("TEXT"); + + b.Property("Rate") + .HasColumnType("TEXT"); + + b.Property("State") + .HasMaxLength(2) + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.ToTable("TaxRate", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Transaction", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("Amount") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Details") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("Gateway") + .HasColumnType("INTEGER"); + + b.Property("GatewayId") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("PaymentMethodType") + .HasColumnType("INTEGER"); + + b.Property("Refunded") + .HasColumnType("INTEGER"); + + b.Property("RefundedAmount") + .HasColumnType("TEXT"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("Transaction", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.User", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("AccountRevisionDate") + .HasColumnType("TEXT"); + + b.Property("ApiKey") + .IsRequired() + .HasMaxLength(30) + .HasColumnType("TEXT"); + + b.Property("AvatarColor") + .HasMaxLength(7) + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Culture") + .HasMaxLength(10) + .HasColumnType("TEXT"); + + b.Property("Email") + .IsRequired() + .HasMaxLength(256) + .HasColumnType("TEXT"); + + b.Property("EmailVerified") + .HasColumnType("INTEGER"); + + b.Property("EquivalentDomains") + .HasColumnType("TEXT"); + + b.Property("ExcludedGlobalEquivalentDomains") + .HasColumnType("TEXT"); + + b.Property("FailedLoginCount") + .HasColumnType("INTEGER"); + + b.Property("ForcePasswordReset") + .HasColumnType("INTEGER"); + + b.Property("Gateway") + .HasColumnType("INTEGER"); + + b.Property("GatewayCustomerId") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("GatewaySubscriptionId") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("Kdf") + .HasColumnType("INTEGER"); + + b.Property("KdfIterations") + .HasColumnType("INTEGER"); + + b.Property("KdfMemory") + .HasColumnType("INTEGER"); + + b.Property("KdfParallelism") + .HasColumnType("INTEGER"); + + b.Property("Key") + .HasColumnType("TEXT"); + + b.Property("LastEmailChangeDate") + .HasColumnType("TEXT"); + + b.Property("LastFailedLoginDate") + .HasColumnType("TEXT"); + + b.Property("LastKdfChangeDate") + .HasColumnType("TEXT"); + + b.Property("LastKeyRotationDate") + .HasColumnType("TEXT"); + + b.Property("LastPasswordChangeDate") + .HasColumnType("TEXT"); + + b.Property("LicenseKey") + .HasMaxLength(100) + .HasColumnType("TEXT"); + + b.Property("MasterPassword") + .HasMaxLength(300) + .HasColumnType("TEXT"); + + b.Property("MasterPasswordHint") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("MaxStorageGb") + .HasColumnType("INTEGER"); + + b.Property("Name") + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("Premium") + .HasColumnType("INTEGER"); + + b.Property("PremiumExpirationDate") + .HasColumnType("TEXT"); + + b.Property("PrivateKey") + .HasColumnType("TEXT"); + + b.Property("PublicKey") + .HasColumnType("TEXT"); + + b.Property("ReferenceData") + .HasColumnType("TEXT"); + + b.Property("RenewalReminderDate") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("SecurityStamp") + .IsRequired() + .HasMaxLength(50) + .HasColumnType("TEXT"); + + b.Property("Storage") + .HasColumnType("INTEGER"); + + b.Property("TwoFactorProviders") + .HasColumnType("TEXT"); + + b.Property("TwoFactorRecoveryCode") + .HasMaxLength(32) + .HasColumnType("TEXT"); + + b.Property("UsesKeyConnector") + .HasColumnType("INTEGER"); + + b.HasKey("Id"); + + b.ToTable("User", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Discriminator") + .IsRequired() + .HasColumnType("TEXT"); + + b.Property("Read") + .HasColumnType("INTEGER"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Write") + .HasColumnType("INTEGER"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.ToTable("AccessPolicy", (string)null); + + b.HasDiscriminator("Discriminator").HasValue("AccessPolicy"); + + b.UseTphMappingStrategy(); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ApiKey", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("ClientSecretHash") + .HasMaxLength(128) + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("EncryptedPayload") + .HasMaxLength(4000) + .HasColumnType("TEXT"); + + b.Property("ExpireAt") + .HasColumnType("TEXT"); + + b.Property("Key") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasMaxLength(200) + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Scope") + .HasMaxLength(4000) + .HasColumnType("TEXT"); + + b.Property("ServiceAccountId") + .HasColumnType("TEXT"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.HasIndex("ServiceAccountId") + .HasAnnotation("SqlServer:Clustered", false); + + b.ToTable("ApiKey", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("DeletedDate") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.HasIndex("DeletedDate") + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); + + b.ToTable("Project", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Secret", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("DeletedDate") + .HasColumnType("TEXT"); + + b.Property("Key") + .HasColumnType("TEXT"); + + b.Property("Note") + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Value") + .HasColumnType("TEXT"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.HasIndex("DeletedDate") + .HasAnnotation("SqlServer:Clustered", false); + + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); + + b.ToTable("Secret", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.HasKey("Id") + .HasAnnotation("SqlServer:Clustered", true); + + b.HasIndex("OrganizationId") + .HasAnnotation("SqlServer:Clustered", false); + + b.ToTable("ServiceAccount", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("Attachments") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Data") + .HasColumnType("TEXT"); + + b.Property("DeletedDate") + .HasColumnType("TEXT"); + + b.Property("Favorites") + .HasColumnType("TEXT"); + + b.Property("Folders") + .HasColumnType("TEXT"); + + b.Property("OrganizationId") + .HasColumnType("TEXT"); + + b.Property("Reprompt") + .HasColumnType("INTEGER"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("Type") + .HasColumnType("INTEGER"); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("OrganizationId"); + + b.HasIndex("UserId"); + + b.ToTable("Cipher", (string)null); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Folder", b => + { + b.Property("Id") + .HasColumnType("TEXT"); + + b.Property("CreationDate") + .HasColumnType("TEXT"); + + b.Property("Name") + .HasColumnType("TEXT"); + + b.Property("RevisionDate") + .HasColumnType("TEXT"); + + b.Property("UserId") + .HasColumnType("TEXT"); + + b.HasKey("Id"); + + b.HasIndex("UserId"); + + b.ToTable("Folder", (string)null); + }); + + modelBuilder.Entity("ProjectSecret", b => + { + b.Property("ProjectsId") + .HasColumnType("TEXT"); + + b.Property("SecretsId") + .HasColumnType("TEXT"); + + b.HasKey("ProjectsId", "SecretsId"); + + b.HasIndex("SecretsId"); + + b.ToTable("ProjectSecret"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.GroupProjectAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedProjectId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("TEXT") + .HasColumnName("GrantedProjectId"); + + b.Property("GroupId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("TEXT") + .HasColumnName("GroupId"); + + b.HasIndex("GrantedProjectId"); + + b.HasIndex("GroupId"); + + b.HasDiscriminator().HasValue("group_project"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.GroupServiceAccountAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedServiceAccountId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("TEXT") + .HasColumnName("GrantedServiceAccountId"); + + b.Property("GroupId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("TEXT") + .HasColumnName("GroupId"); + + b.HasIndex("GrantedServiceAccountId"); + + b.HasIndex("GroupId"); + + b.HasDiscriminator().HasValue("group_service_account"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccountProjectAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedProjectId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("TEXT") + .HasColumnName("GrantedProjectId"); + + b.Property("ServiceAccountId") + .HasColumnType("TEXT") + .HasColumnName("ServiceAccountId"); + + b.HasIndex("GrantedProjectId"); + + b.HasIndex("ServiceAccountId"); + + b.HasDiscriminator().HasValue("service_account_project"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.UserProjectAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedProjectId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("TEXT") + .HasColumnName("GrantedProjectId"); + + b.Property("OrganizationUserId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("TEXT") + .HasColumnName("OrganizationUserId"); + + b.HasIndex("GrantedProjectId"); + + b.HasIndex("OrganizationUserId"); + + b.HasDiscriminator().HasValue("user_project"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.UserServiceAccountAccessPolicy", b => + { + b.HasBaseType("Bit.Infrastructure.EntityFramework.SecretsManager.Models.AccessPolicy"); + + b.Property("GrantedServiceAccountId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("TEXT") + .HasColumnName("GrantedServiceAccountId"); + + b.Property("OrganizationUserId") + .ValueGeneratedOnUpdateSometimes() + .HasColumnType("TEXT") + .HasColumnName("OrganizationUserId"); + + b.HasIndex("GrantedServiceAccountId"); + + b.HasIndex("OrganizationUserId"); + + b.HasDiscriminator().HasValue("user_service_account"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.AuthRequest", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Device", "ResponseDevice") + .WithMany() + .HasForeignKey("ResponseDeviceId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + + b.Navigation("ResponseDevice"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.EmergencyAccess", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "Grantee") + .WithMany() + .HasForeignKey("GranteeId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "Grantor") + .WithMany() + .HasForeignKey("GrantorId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Grantee"); + + b.Navigation("Grantor"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.SsoConfig", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("SsoConfigs") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Auth.Models.SsoUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("SsoUsers") + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("SsoUsers") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Collection", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Collections") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionCipher", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", "Cipher") + .WithMany("CollectionCiphers") + .HasForeignKey("CipherId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Collection", "Collection") + .WithMany("CollectionCiphers") + .HasForeignKey("CollectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Cipher"); + + b.Navigation("Collection"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionGroup", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Collection", "Collection") + .WithMany("CollectionGroups") + .HasForeignKey("CollectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") + .WithMany() + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Collection"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.CollectionUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Collection", "Collection") + .WithMany("CollectionUsers") + .HasForeignKey("CollectionId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") + .WithMany("CollectionUsers") + .HasForeignKey("OrganizationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Collection"); + + b.Navigation("OrganizationUser"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Device", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Group", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Groups") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.GroupUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") + .WithMany("GroupUsers") + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") + .WithMany("GroupUsers") + .HasForeignKey("OrganizationUserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Group"); + + b.Navigation("OrganizationUser"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationApiKey", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("ApiKeys") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationConnection", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Connections") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationDomain", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Domains") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationSponsorship", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "SponsoredOrganization") + .WithMany() + .HasForeignKey("SponsoredOrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "SponsoringOrganization") + .WithMany() + .HasForeignKey("SponsoringOrganizationId"); + + b.Navigation("SponsoredOrganization"); + + b.Navigation("SponsoringOrganization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("OrganizationUsers") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("OrganizationUsers") + .HasForeignKey("UserId"); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Policy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Policies") + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.ProviderOrganization", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Provider", "Provider") + .WithMany() + .HasForeignKey("ProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + + b.Navigation("Provider"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.ProviderUser", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Provider", "Provider") + .WithMany() + .HasForeignKey("ProviderId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("Provider"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Send", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany() + .HasForeignKey("UserId"); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Transaction", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Transactions") + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("Transactions") + .HasForeignKey("UserId"); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ApiKey", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount") + .WithMany() + .HasForeignKey("ServiceAccountId"); + + b.Navigation("ServiceAccount"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Secret", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany() + .HasForeignKey("OrganizationId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("Organization"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Organization", "Organization") + .WithMany("Ciphers") + .HasForeignKey("OrganizationId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("Ciphers") + .HasForeignKey("UserId"); + + b.Navigation("Organization"); + + b.Navigation("User"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Folder", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.Models.User", "User") + .WithMany("Folders") + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.Navigation("User"); + }); + + modelBuilder.Entity("ProjectSecret", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", null) + .WithMany() + .HasForeignKey("ProjectsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Secret", null) + .WithMany() + .HasForeignKey("SecretsId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired(); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.GroupProjectAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") + .WithMany("GroupAccessPolicies") + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") + .WithMany() + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("GrantedProject"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.GroupServiceAccountAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "GrantedServiceAccount") + .WithMany("GroupAccessPolicies") + .HasForeignKey("GrantedServiceAccountId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") + .WithMany() + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade); + + b.Navigation("GrantedServiceAccount"); + + b.Navigation("Group"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccountProjectAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") + .WithMany("ServiceAccountAccessPolicies") + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount") + .WithMany() + .HasForeignKey("ServiceAccountId"); + + b.Navigation("GrantedProject"); + + b.Navigation("ServiceAccount"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.UserProjectAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") + .WithMany("UserAccessPolicies") + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") + .WithMany() + .HasForeignKey("OrganizationUserId"); + + b.Navigation("GrantedProject"); + + b.Navigation("OrganizationUser"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.UserServiceAccountAccessPolicy", b => + { + b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "GrantedServiceAccount") + .WithMany("UserAccessPolicies") + .HasForeignKey("GrantedServiceAccountId"); + + b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") + .WithMany() + .HasForeignKey("OrganizationUserId"); + + b.Navigation("GrantedServiceAccount"); + + b.Navigation("OrganizationUser"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Collection", b => + { + b.Navigation("CollectionCiphers"); + + b.Navigation("CollectionGroups"); + + b.Navigation("CollectionUsers"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Group", b => + { + b.Navigation("GroupUsers"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.Organization", b => + { + b.Navigation("ApiKeys"); + + b.Navigation("Ciphers"); + + b.Navigation("Collections"); + + b.Navigation("Connections"); + + b.Navigation("Domains"); + + b.Navigation("Groups"); + + b.Navigation("OrganizationUsers"); + + b.Navigation("Policies"); + + b.Navigation("SsoConfigs"); + + b.Navigation("SsoUsers"); + + b.Navigation("Transactions"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", b => + { + b.Navigation("CollectionUsers"); + + b.Navigation("GroupUsers"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Models.User", b => + { + b.Navigation("Ciphers"); + + b.Navigation("Folders"); + + b.Navigation("OrganizationUsers"); + + b.Navigation("SsoUsers"); + + b.Navigation("Transactions"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", b => + { + b.Navigation("GroupAccessPolicies"); + + b.Navigation("ServiceAccountAccessPolicies"); + + b.Navigation("UserAccessPolicies"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", b => + { + b.Navigation("GroupAccessPolicies"); + + b.Navigation("UserAccessPolicies"); + }); + + modelBuilder.Entity("Bit.Infrastructure.EntityFramework.Vault.Models.Cipher", b => + { + b.Navigation("CollectionCiphers"); + }); +#pragma warning restore 612, 618 + } + } +} diff --git a/util/SqliteMigrations/Migrations/20230824202443_ACCESSPOLICY_ADD_DELETE_CASCADE.cs b/util/SqliteMigrations/Migrations/20230824202443_ACCESSPOLICY_ADD_DELETE_CASCADE.cs new file mode 100644 index 0000000000..9b30c7fe2d --- /dev/null +++ b/util/SqliteMigrations/Migrations/20230824202443_ACCESSPOLICY_ADD_DELETE_CASCADE.cs @@ -0,0 +1,63 @@ +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace Bit.SqliteMigrations.Migrations; + +/// +public partial class ACCESSPOLICY_ADD_DELETE_CASCADE : Migration +{ + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_AccessPolicy_Group_GroupId", + table: "AccessPolicy"); + + migrationBuilder.DropForeignKey( + name: "FK_AccessPolicy_Project_GrantedProjectId", + table: "AccessPolicy"); + + migrationBuilder.AddForeignKey( + name: "FK_AccessPolicy_Group_GroupId", + table: "AccessPolicy", + column: "GroupId", + principalTable: "Group", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + + migrationBuilder.AddForeignKey( + name: "FK_AccessPolicy_Project_GrantedProjectId", + table: "AccessPolicy", + column: "GrantedProjectId", + principalTable: "Project", + principalColumn: "Id", + onDelete: ReferentialAction.Cascade); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropForeignKey( + name: "FK_AccessPolicy_Group_GroupId", + table: "AccessPolicy"); + + migrationBuilder.DropForeignKey( + name: "FK_AccessPolicy_Project_GrantedProjectId", + table: "AccessPolicy"); + + migrationBuilder.AddForeignKey( + name: "FK_AccessPolicy_Group_GroupId", + table: "AccessPolicy", + column: "GroupId", + principalTable: "Group", + principalColumn: "Id"); + + migrationBuilder.AddForeignKey( + name: "FK_AccessPolicy_Project_GrantedProjectId", + table: "AccessPolicy", + column: "GrantedProjectId", + principalTable: "Project", + principalColumn: "Id"); + } +} diff --git a/util/SqliteMigrations/Migrations/DatabaseContextModelSnapshot.cs b/util/SqliteMigrations/Migrations/DatabaseContextModelSnapshot.cs index 36ad15b051..c90967c711 100644 --- a/util/SqliteMigrations/Migrations/DatabaseContextModelSnapshot.cs +++ b/util/SqliteMigrations/Migrations/DatabaseContextModelSnapshot.cs @@ -2070,11 +2070,13 @@ namespace Bit.SqliteMigrations.Migrations { b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") .WithMany("GroupAccessPolicies") - .HasForeignKey("GrantedProjectId"); + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") .WithMany() - .HasForeignKey("GroupId"); + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade); b.Navigation("GrantedProject"); @@ -2089,7 +2091,8 @@ namespace Bit.SqliteMigrations.Migrations b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") .WithMany() - .HasForeignKey("GroupId"); + .HasForeignKey("GroupId") + .OnDelete(DeleteBehavior.Cascade); b.Navigation("GrantedServiceAccount"); @@ -2100,7 +2103,8 @@ namespace Bit.SqliteMigrations.Migrations { b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") .WithMany("ServiceAccountAccessPolicies") - .HasForeignKey("GrantedProjectId"); + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount") .WithMany() @@ -2115,7 +2119,8 @@ namespace Bit.SqliteMigrations.Migrations { b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") .WithMany("UserAccessPolicies") - .HasForeignKey("GrantedProjectId"); + .HasForeignKey("GrantedProjectId") + .OnDelete(DeleteBehavior.Cascade); b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") .WithMany() diff --git a/util/SqliteMigrations/packages.lock.json b/util/SqliteMigrations/packages.lock.json index 09909b0f05..8a6ee7dbd0 100644 --- a/util/SqliteMigrations/packages.lock.json +++ b/util/SqliteMigrations/packages.lock.json @@ -170,10 +170,11 @@ }, "Braintree": { "type": "Transitive", - "resolved": "5.12.0", - "contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", + "resolved": "5.19.0", + "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==", "dependencies": { - "Newtonsoft.Json": "9.0.1", + "Microsoft.CSharp": "4.7.0", + "Newtonsoft.Json": "13.0.1", "System.Xml.XPath.XmlDocument": "4.3.0" } }, @@ -2613,56 +2614,56 @@ "core": { "type": "Project", "dependencies": { - "AWSSDK.SQS": "3.7.2.47", - "AWSSDK.SimpleEmail": "3.7.0.150", - "AspNetCoreRateLimit": "4.0.2", - "AspNetCoreRateLimit.Redis": "1.0.1", - "Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", - "Azure.Messaging.ServiceBus": "7.15.0", - "Azure.Storage.Blobs": "12.14.1", - "Azure.Storage.Queues": "12.12.0", - "BitPay.Light": "1.0.1907", - "Braintree": "5.12.0", - "DnsClient": "1.7.0", - "Fido2.AspNet": "3.0.1", - "Handlebars.Net": "2.1.2", - "IdentityServer4": "4.1.2", - "IdentityServer4.AccessTokenValidation": "3.0.1", - "LaunchDarkly.ServerSdk": "7.0.0", - "MailKit": "3.2.0", - "Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", - "Microsoft.Azure.Cosmos.Table": "1.0.8", - "Microsoft.Azure.NotificationHubs": "4.1.0", - "Microsoft.Data.SqlClient": "5.0.1", - "Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", - "Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", - "Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", - "Microsoft.Extensions.Identity.Stores": "6.0.4", - "Newtonsoft.Json": "13.0.1", - "Otp.NET": "1.2.2", - "Quartz": "3.4.0", - "SendGrid": "9.27.0", - "Sentry.Serilog": "3.16.0", - "Serilog.AspNetCore": "5.0.0", - "Serilog.Extensions.Logging": "3.1.0", - "Serilog.Extensions.Logging.File": "2.0.0", - "Serilog.Sinks.AzureCosmosDB": "2.0.0", - "Serilog.Sinks.SyslogMessages": "2.0.6", - "Stripe.net": "40.0.0", - "YubicoDotNetClient": "1.2.0" + "AWSSDK.SQS": "[3.7.2.47, )", + "AWSSDK.SimpleEmail": "[3.7.0.150, )", + "AspNetCoreRateLimit": "[4.0.2, )", + "AspNetCoreRateLimit.Redis": "[1.0.1, )", + "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )", + "Azure.Messaging.ServiceBus": "[7.15.0, )", + "Azure.Storage.Blobs": "[12.14.1, )", + "Azure.Storage.Queues": "[12.12.0, )", + "BitPay.Light": "[1.0.1907, )", + "Braintree": "[5.19.0, )", + "DnsClient": "[1.7.0, )", + "Fido2.AspNet": "[3.0.1, )", + "Handlebars.Net": "[2.1.2, )", + "IdentityServer4": "[4.1.2, )", + "IdentityServer4.AccessTokenValidation": "[3.0.1, )", + "LaunchDarkly.ServerSdk": "[7.0.0, )", + "MailKit": "[3.2.0, )", + "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )", + "Microsoft.Azure.Cosmos.Table": "[1.0.8, )", + "Microsoft.Azure.NotificationHubs": "[4.1.0, )", + "Microsoft.Data.SqlClient": "[5.0.1, )", + "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )", + "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )", + "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )", + "Microsoft.Extensions.Identity.Stores": "[6.0.4, )", + "Newtonsoft.Json": "[13.0.1, )", + "Otp.NET": "[1.2.2, )", + "Quartz": "[3.4.0, )", + "SendGrid": "[9.27.0, )", + "Sentry.Serilog": "[3.16.0, )", + "Serilog.AspNetCore": "[5.0.0, )", + "Serilog.Extensions.Logging": "[3.1.0, )", + "Serilog.Extensions.Logging.File": "[2.0.0, )", + "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )", + "Serilog.Sinks.SyslogMessages": "[2.0.6, )", + "Stripe.net": "[40.0.0, )", + "YubicoDotNetClient": "[1.2.0, )" } }, "infrastructure.entityframework": { "type": "Project", "dependencies": { - "AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", - "Core": "2023.7.2", - "Microsoft.EntityFrameworkCore.Relational": "7.0.5", - "Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", - "Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", - "Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", - "Pomelo.EntityFrameworkCore.MySql": "7.0.0", - "linq2db.EntityFrameworkCore": "7.5.0" + "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", + "Core": "[2023.9.0, )", + "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", + "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", + "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )", + "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )", + "linq2db.EntityFrameworkCore": "[7.5.0, )" } } }