1
0
mirror of https://github.com/bitwarden/server.git synced 2025-07-01 16:12:49 -05:00

Merge remote-tracking branch 'origin/master' into ac/ac-1638/disallow-secrets-manager-for-msp-managed-organizations

This commit is contained in:
Thomas Rittson
2023-09-25 14:29:59 +10:00
104 changed files with 9865 additions and 2034 deletions

View File

@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Install cloc - name: Install cloc
run: | run: |
@ -34,7 +34,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Set up dotnet - name: Set up dotnet
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
@ -49,7 +49,7 @@ jobs:
NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages NUGET_PACKAGES: ${{ github.workspace }}/.nuget/packages
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Set up dotnet - name: Set up dotnet
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
@ -135,13 +135,13 @@ jobs:
node: true node: true
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Set up dotnet - name: Set up dotnet
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
- name: Set up Node - name: Set up Node
uses: actions/setup-node@64ed1c7eab4cce3362f8c340dee64e5eaeef8f7c # v3.6.0 uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with: with:
cache: "npm" cache: "npm"
cache-dependency-path: "**/package-lock.json" cache-dependency-path: "**/package-lock.json"
@ -185,7 +185,7 @@ jobs:
ls -atlh ../../../ ls -atlh ../../../
- name: Upload project artifact - name: Upload project artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with: with:
name: ${{ matrix.project_name }}.zip name: ${{ matrix.project_name }}.zip
path: ${{ matrix.base_path }}/${{ matrix.project_name }}/${{ matrix.project_name }}.zip path: ${{ matrix.base_path }}/${{ matrix.project_name }}/${{ matrix.project_name }}.zip
@ -246,7 +246,7 @@ jobs:
dotnet: true dotnet: true
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Check Branch to Publish - name: Check Branch to Publish
env: env:
@ -337,7 +337,7 @@ jobs:
needs: build-docker needs: build-docker
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Set up dotnet - name: Set up dotnet
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
@ -403,7 +403,7 @@ jobs:
- name: Upload Docker stub US artifact - name: Upload Docker stub US artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc' 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: with:
name: docker-stub-US.zip name: docker-stub-US.zip
path: docker-stub-US.zip path: docker-stub-US.zip
@ -411,7 +411,7 @@ jobs:
- name: Upload Docker stub EU artifact - name: Upload Docker stub EU artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc' 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: with:
name: docker-stub-EU.zip name: docker-stub-EU.zip
path: docker-stub-EU.zip path: docker-stub-EU.zip
@ -419,7 +419,7 @@ jobs:
- name: Upload Docker stub US checksum artifact - name: Upload Docker stub US checksum artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc' 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: with:
name: docker-stub-US-sha256.txt name: docker-stub-US-sha256.txt
path: docker-stub-US-sha256.txt path: docker-stub-US-sha256.txt
@ -427,7 +427,7 @@ jobs:
- name: Upload Docker stub EU checksum artifact - name: Upload Docker stub EU checksum artifact
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/rc' || github.ref == 'refs/heads/hotfix-rc' 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: with:
name: docker-stub-EU-sha256.txt name: docker-stub-EU-sha256.txt
path: docker-stub-EU-sha256.txt path: docker-stub-EU-sha256.txt
@ -453,7 +453,7 @@ jobs:
GLOBALSETTINGS__SQLSERVER__CONNECTIONSTRING: "placeholder" GLOBALSETTINGS__SQLSERVER__CONNECTIONSTRING: "placeholder"
- name: Upload Swagger artifact - name: Upload Swagger artifact
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with: with:
name: swagger.json name: swagger.json
path: swagger.json path: swagger.json
@ -476,7 +476,7 @@ jobs:
- win-x64 - win-x64
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Set up dotnet - name: Set up dotnet
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
@ -500,7 +500,7 @@ jobs:
- name: Upload project artifact Windows - name: Upload project artifact Windows
if: ${{ contains(matrix.target, 'win') == true }} if: ${{ contains(matrix.target, 'win') == true }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with: with:
name: MsSqlMigratorUtility-${{ matrix.target }} name: MsSqlMigratorUtility-${{ matrix.target }}
path: util/MsSqlMigratorUtility/obj/build-output/publish/MsSqlMigratorUtility.exe path: util/MsSqlMigratorUtility/obj/build-output/publish/MsSqlMigratorUtility.exe
@ -508,7 +508,7 @@ jobs:
- name: Upload project artifact - name: Upload project artifact
if: ${{ contains(matrix.target, 'win') == false }} if: ${{ contains(matrix.target, 'win') == false }}
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with: with:
name: MsSqlMigratorUtility-${{ matrix.target }} name: MsSqlMigratorUtility-${{ matrix.target }}
path: util/MsSqlMigratorUtility/obj/build-output/publish/MsSqlMigratorUtility path: util/MsSqlMigratorUtility/obj/build-output/publish/MsSqlMigratorUtility
@ -522,7 +522,7 @@ jobs:
- build-docker - build-docker
steps: steps:
- name: Login to Azure - CI Subscription - name: Login to Azure - CI Subscription
uses: Azure/login@1f63701bf3e6892515f1b7ce2d2bf1708b46beaf # v1.4.3 uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
with: with:
creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }} creds: ${{ secrets.AZURE_KV_CI_SERVICE_PRINCIPAL }}

View File

@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
########## ACR ########## ########## ACR ##########
- name: Login to Azure - QA Subscription - name: Login to Azure - QA Subscription

View File

@ -25,7 +25,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Set up dotnet - name: Set up dotnet
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0
@ -44,7 +44,7 @@ jobs:
shell: pwsh shell: pwsh
- name: Upload DACPAC - name: Upload DACPAC
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with: with:
name: sql.dacpac name: sql.dacpac
path: Sql.dacpac path: Sql.dacpac
@ -70,7 +70,7 @@ jobs:
shell: pwsh shell: pwsh
- name: Upload Report - name: Upload Report
uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with: with:
name: report.xml name: report.xml
path: | path: |

View File

@ -38,7 +38,7 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Set up dotnet - name: Set up dotnet
uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0 uses: actions/setup-dotnet@3447fd6a9f9e57506b15f895c5b76d3b197dc7c2 # v3.2.0

View File

@ -30,7 +30,7 @@ jobs:
label: "DB-migrations-changed" label: "DB-migrations-changed"
steps: steps:
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
with: with:
fetch-depth: 2 fetch-depth: 2

View File

@ -37,7 +37,7 @@ jobs:
fi fi
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Check Release Version - name: Check Release Version
id: version id: version
@ -136,7 +136,7 @@ jobs:
creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }} creds: ${{ secrets.AZURE_PROD_KV_CREDENTIALS }}
- name: Deploy App - name: Deploy App
uses: azure/webapps-deploy@85270a1854658d167ab239bce43949edb336fa7c # v2.2.9 uses: azure/webapps-deploy@4bca689e4c7129e55923ea9c45401b22dc6aa96f # v2.2.11
with: with:
app-name: ${{ steps.retrieve-secrets.outputs.webapp-name }} app-name: ${{ steps.retrieve-secrets.outputs.webapp-name }}
publish-profile: ${{ steps.retrieve-secrets.outputs.publish-profile }} publish-profile: ${{ steps.retrieve-secrets.outputs.publish-profile }}
@ -211,7 +211,7 @@ jobs:
echo "Github Release Option: $RELEASE_OPTION" echo "Github Release Option: $RELEASE_OPTION"
- name: Checkout repo - name: Checkout repo
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Setup project name - name: Setup project name
id: setup id: setup
@ -300,7 +300,7 @@ jobs:
- name: Create release - name: Create release
if: ${{ github.event.inputs.release_type != 'Dry Run' }} 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: with:
artifacts: "docker-stub-US.zip, artifacts: "docker-stub-US.zip,
docker-stub-US-sha256.txt, docker-stub-US-sha256.txt,

View File

@ -14,7 +14,7 @@ jobs:
runs-on: ubuntu-20.04 runs-on: ubuntu-20.04
steps: steps:
- name: Checkout Branch - name: Checkout Branch
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3 uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Login to Azure - CI Subscription - name: Login to Azure - CI Subscription
uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7 uses: Azure/login@92a5484dfaf04ca78a94597f4f19fea633851fa2 # v1.4.7
@ -29,7 +29,7 @@ jobs:
secrets: "github-gpg-private-key, github-gpg-private-key-passphrase" secrets: "github-gpg-private-key, github-gpg-private-key-passphrase"
- name: Import GPG key - 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: with:
gpg_private_key: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key }} gpg_private_key: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key }}
passphrase: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key-passphrase }} passphrase: ${{ steps.retrieve-secrets.outputs.github-gpg-private-key-passphrase }}

View File

@ -2,7 +2,7 @@
<PropertyGroup> <PropertyGroup>
<TargetFramework>net6.0</TargetFramework> <TargetFramework>net6.0</TargetFramework>
<Version>2023.8.2</Version> <Version>2023.9.0</Version>
<RootNamespace>Bit.$(MSBuildProjectName)</RootNamespace> <RootNamespace>Bit.$(MSBuildProjectName)</RootNamespace>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- No configured package sources besides the default. -->
</configuration>

View File

@ -20,7 +20,7 @@ public class MaxProjectsQuery : IMaxProjectsQuery
_projectRepository = projectRepository; _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); var org = await _organizationRepository.GetByIdAsync(organizationId);
if (org == null) if (org == null)
@ -37,7 +37,7 @@ public class MaxProjectsQuery : IMaxProjectsQuery
if (plan.Type == PlanType.Free) if (plan.Type == PlanType.Free)
{ {
var projects = await _projectRepository.GetProjectCountByOrganizationIdAsync(organizationId); 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); return (null, null);

View File

@ -141,10 +141,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2424,43 +2425,43 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
} }
} }

View File

@ -159,10 +159,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2584,56 +2585,56 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
} }
} }

View File

@ -1,6 +1,4 @@
using Bit.Core.OrganizationFeatures.OrganizationUsers; using Bit.Scim.Groups;
using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces;
using Bit.Scim.Groups;
using Bit.Scim.Groups.Interfaces; using Bit.Scim.Groups.Interfaces;
using Bit.Scim.Users; using Bit.Scim.Users;
using Bit.Scim.Users.Interfaces; using Bit.Scim.Users.Interfaces;
@ -23,7 +21,6 @@ public static class ScimServiceCollectionExtensions
public static void AddScimUserCommands(this IServiceCollection services) public static void AddScimUserCommands(this IServiceCollection services)
{ {
services.AddScoped<IDeleteOrganizationUserCommand, DeleteOrganizationUserCommand>();
services.AddScoped<IPatchUserCommand, PatchUserCommand>(); services.AddScoped<IPatchUserCommand, PatchUserCommand>();
services.AddScoped<IPostUserCommand, PostUserCommand>(); services.AddScoped<IPostUserCommand, PostUserCommand>();
} }

View File

@ -158,10 +158,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2588,71 +2589,71 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -415,7 +415,7 @@ public class DynamicAuthenticationSchemeProvider : AuthenticationSchemeProvider
}; };
options.IdentityProviders.Add(idp); 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) private NameIdFormat GetNameIdFormat(Saml2NameIdFormat format)

View File

@ -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<Saml2Options> _optionsCache;
private Saml2Options _options;
private HttpContext _context;
private readonly IDataProtector _dataProtector;
private readonly IOptionsFactory<Saml2Options> _optionsFactory;
private bool _emitSameSiteNone;
public Saml2BitHandler(
IOptionsMonitorCache<Saml2Options> optionsCache,
IDataProtectionProvider dataProtectorProvider,
IOptionsFactory<Saml2Options> 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<bool> 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<AuthenticateResult> 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<byte[], byte[]> 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<KeyValuePair<string, IEnumerable<string>>> formData = null;
if (httpContext.Request.Method == "POST" && httpContext.Request.HasFormContentType)
{
formData = request.Form.Select(
f => new KeyValuePair<string, IEnumerable<string>>(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);
}
}
}

View File

@ -183,10 +183,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2748,71 +2749,71 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -22,7 +22,7 @@ public class MaxProjectsQueryTests
{ {
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(default).ReturnsNull(); sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(default).ReturnsNull();
await Assert.ThrowsAsync<NotFoundException>(async () => await sutProvider.Sut.GetByOrgIdAsync(organizationId)); await Assert.ThrowsAsync<NotFoundException>(async () => await sutProvider.Sut.GetByOrgIdAsync(organizationId, 1));
await sutProvider.GetDependency<IProjectRepository>().DidNotReceiveWithAnyArgs() await sutProvider.GetDependency<IProjectRepository>().DidNotReceiveWithAnyArgs()
.GetProjectCountByOrganizationIdAsync(organizationId); .GetProjectCountByOrganizationIdAsync(organizationId);
@ -43,7 +43,7 @@ public class MaxProjectsQueryTests
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organization.Id).Returns(organization); sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organization.Id).Returns(organization);
await Assert.ThrowsAsync<BadRequestException>( await Assert.ThrowsAsync<BadRequestException>(
async () => await sutProvider.Sut.GetByOrgIdAsync(organization.Id)); async () => await sutProvider.Sut.GetByOrgIdAsync(organization.Id, 1));
await sutProvider.GetDependency<IProjectRepository>().DidNotReceiveWithAnyArgs() await sutProvider.GetDependency<IProjectRepository>().DidNotReceiveWithAnyArgs()
.GetProjectCountByOrganizationIdAsync(organization.Id); .GetProjectCountByOrganizationIdAsync(organization.Id);
@ -60,7 +60,7 @@ public class MaxProjectsQueryTests
organization.PlanType = planType; organization.PlanType = planType;
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organization.Id).Returns(organization); sutProvider.GetDependency<IOrganizationRepository>().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(limit);
Assert.Null(overLimit); Assert.Null(overLimit);
@ -70,13 +70,31 @@ public class MaxProjectsQueryTests
} }
[Theory] [Theory]
[BitAutoData(PlanType.Free, 0, false)] [BitAutoData(PlanType.Free, 0, 1, false)]
[BitAutoData(PlanType.Free, 1, false)] [BitAutoData(PlanType.Free, 1, 1, false)]
[BitAutoData(PlanType.Free, 2, false)] [BitAutoData(PlanType.Free, 2, 1, false)]
[BitAutoData(PlanType.Free, 3, true)] [BitAutoData(PlanType.Free, 3, 1, true)]
[BitAutoData(PlanType.Free, 4, true)] [BitAutoData(PlanType.Free, 4, 1, true)]
[BitAutoData(PlanType.Free, 40, true)] [BitAutoData(PlanType.Free, 40, 1, true)]
public async Task GetByOrgIdAsync_SmFreePlan_Success(PlanType planType, int projects, bool shouldBeAtMax, [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<MaxProjectsQuery> sutProvider, Organization organization) SutProvider<MaxProjectsQuery> sutProvider, Organization organization)
{ {
organization.PlanType = planType; organization.PlanType = planType;
@ -84,12 +102,12 @@ public class MaxProjectsQueryTests
sutProvider.GetDependency<IProjectRepository>().GetProjectCountByOrganizationIdAsync(organization.Id) sutProvider.GetDependency<IProjectRepository>().GetProjectCountByOrganizationIdAsync(organization.Id)
.Returns(projects); .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(max);
Assert.NotNull(atMax); Assert.NotNull(overMax);
Assert.Equal(3, max.Value); Assert.Equal(3, max.Value);
Assert.Equal(shouldBeAtMax, atMax); Assert.Equal(expectedOverMax, overMax);
await sutProvider.GetDependency<IProjectRepository>().Received(1) await sutProvider.GetDependency<IProjectRepository>().Received(1)
.GetProjectCountByOrganizationIdAsync(organization.Id); .GetProjectCountByOrganizationIdAsync(organization.Id);

View File

@ -201,10 +201,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2666,7 +2667,7 @@
"commercial.core": { "commercial.core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "[2023.7.2, )" "Core": "[2023.9.0, )"
} }
}, },
"common": { "common": {
@ -2674,7 +2675,7 @@
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )",
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "[17.1.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "[4.3.0, )", "NSubstitute": "[4.3.0, )",
@ -2693,7 +2694,7 @@
"Azure.Storage.Blobs": "[12.14.1, )", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "[12.12.0, )", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "[1.0.1907, )", "BitPay.Light": "[1.0.1907, )",
"Braintree": "[5.12.0, )", "Braintree": "[5.19.0, )",
"DnsClient": "[1.7.0, )", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "[3.0.1, )", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "[2.1.2, )", "Handlebars.Net": "[2.1.2, )",
@ -2728,8 +2729,8 @@
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )",
"Common": "[2023.7.2, )", "Common": "[2023.9.0, )",
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "[17.1.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "[4.3.0, )", "NSubstitute": "[4.3.0, )",

View File

@ -239,10 +239,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2986,108 +2987,108 @@
"common": { "common": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "4.17.0", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "4.17.0", "AutoFixture.Xunit2": "[4.17.0, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "17.1.0", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "4.3.0", "NSubstitute": "[4.3.0, )",
"xunit": "2.4.1" "xunit": "[2.4.1, )"
} }
}, },
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"identity": { "identity": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"SharedWeb": "2023.7.2", "SharedWeb": "[2023.9.0, )",
"Swashbuckle.AspNetCore.SwaggerGen": "6.5.0" "Swashbuckle.AspNetCore.SwaggerGen": "[6.5.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"integrationtestcommon": { "integrationtestcommon": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Common": "2023.7.2", "Common": "[2023.9.0, )",
"Identity": "2023.7.2", "Identity": "[2023.9.0, )",
"Microsoft.AspNetCore.Mvc.Testing": "6.0.5", "Microsoft.AspNetCore.Mvc.Testing": "[6.0.5, )",
"Microsoft.EntityFrameworkCore.InMemory": "7.0.5", "Microsoft.EntityFrameworkCore.InMemory": "[7.0.5, )",
"Microsoft.Extensions.Configuration": "6.0.1" "Microsoft.Extensions.Configuration": "[6.0.1, )"
} }
}, },
"scim": { "scim": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"SharedWeb": "2023.7.2" "SharedWeb": "[2023.9.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -227,10 +227,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2831,90 +2832,90 @@
"common": { "common": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "4.17.0", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "4.17.0", "AutoFixture.Xunit2": "[4.17.0, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "17.1.0", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "4.3.0", "NSubstitute": "[4.3.0, )",
"xunit": "2.4.1" "xunit": "[2.4.1, )"
} }
}, },
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"scim": { "scim": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"SharedWeb": "2023.7.2" "SharedWeb": "[2023.9.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -2,14 +2,14 @@
openssl req -x509 -newkey rsa:4096 -sha256 -nodes -keyout identity_server_dev.key -out identity_server_dev.crt \ 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 -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 -certfile identity_server_dev.crt
security import ./identity_server_dev.pfx -k ~/Library/Keychains/Login.keychain 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 \ 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 -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 -certfile data_protection_dev.crt
security import ./data_protection_dev.pfx -k ~/Library/Keychains/Login.keychain security import ./data_protection_dev.pfx -k ~/Library/Keychains/Login.keychain

View File

@ -68,7 +68,7 @@ services:
- mysql - mysql
idp: idp:
image: kenchan0130/simplesamlphp:1.19.3 image: kenchan0130/simplesamlphp:1.19.8
container_name: idp container_name: idp
ports: ports:
- "8090:8080" - "8090:8080"

View File

@ -1,7 +1,7 @@
#!/usr/bin/env pwsh #!/usr/bin/env pwsh
# Helper script for applying the same user secrets to each project # Helper script for applying the same user secrets to each project
param ( param (
[bool]$clear, [switch]$clear,
[Parameter(ValueFromRemainingArguments = $true, Position=1)] [Parameter(ValueFromRemainingArguments = $true, Position=1)]
$cmdArgs $cmdArgs
) )

View File

@ -166,10 +166,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2531,43 +2532,43 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
} }
} }

View File

@ -44,7 +44,7 @@
<div class="float-right"> <div class="float-right">
@if (org.Status == OrganizationStatusType.Pending) @if (org.Status == OrganizationStatusType.Pending)
{ {
<a href="#" class="float-right" onclick="return resendOwnerInvite('@org.OrganizationId', '@org.OrganizationName');"> <a href="#" class="float-right" onclick="return resendOwnerInvite('@org.OrganizationId');">
<i class="fa fa-envelope-o fa-lg" title="Resend Setup Invite"></i> <i class="fa fa-envelope-o fa-lg" title="Resend Setup Invite"></i>
</a> </a>
} }

View File

@ -1,14 +1,14 @@
<script> <script>
function resendOwnerInvite(orgId, orgName) { function resendOwnerInvite(orgId) {
if (confirm('Resend invite to "' + orgName + '"?')) { if (confirm('Resend invite to organization?')) {
$.ajax({ $.ajax({
type: "POST", type: "POST",
url: '@Url.Action("ResendOwnerInvite", "Organizations")' + '?id=' + orgId, url: '@Url.Action("ResendOwnerInvite", "Organizations")' + '?id=' + orgId,
dataType: 'json', dataType: 'json',
contentType: false, contentType: false,
processData: false, processData: false,
success: function (response) { success: function (response) {
alert('Invitation has been resent!'); alert('Invitation has been resent!');
}, },
error: function (response) { error: function (response) {
alert("Error!"); alert("Error!");
@ -17,4 +17,4 @@
} }
return false; return false;
} }
</script> </script>

View File

@ -178,10 +178,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2791,114 +2792,114 @@
"commercial.core": { "commercial.core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2" "Core": "[2023.9.0, )"
} }
}, },
"commercial.infrastructure.entityframework": { "commercial.infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
}, },
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"migrator": { "migrator": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.Extensions.Logging": "6.0.0", "Microsoft.Extensions.Logging": "[6.0.0, )",
"dbup-sqlserver": "5.0.8" "dbup-sqlserver": "[5.0.8, )"
} }
}, },
"mysqlmigrations": { "mysqlmigrations": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
}, },
"postgresmigrations": { "postgresmigrations": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
}, },
"sqlitemigrations": { "sqlitemigrations": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -236,7 +236,7 @@ public class TwoFactorController : Controller
[HttpPost("get-webauthn")] [HttpPost("get-webauthn")]
public async Task<TwoFactorWebAuthnResponseModel> GetWebAuthn([FromBody] SecretVerificationRequestModel model) public async Task<TwoFactorWebAuthnResponseModel> GetWebAuthn([FromBody] SecretVerificationRequestModel model)
{ {
var user = await CheckAsync(model, true); var user = await CheckAsync(model, false);
var response = new TwoFactorWebAuthnResponseModel(user); var response = new TwoFactorWebAuthnResponseModel(user);
return response; return response;
} }
@ -245,7 +245,7 @@ public class TwoFactorController : Controller
[ApiExplorerSettings(IgnoreApi = true)] // Disable Swagger due to CredentialCreateOptions not converting properly [ApiExplorerSettings(IgnoreApi = true)] // Disable Swagger due to CredentialCreateOptions not converting properly
public async Task<CredentialCreateOptions> GetWebAuthnChallenge([FromBody] SecretVerificationRequestModel model) public async Task<CredentialCreateOptions> GetWebAuthnChallenge([FromBody] SecretVerificationRequestModel model)
{ {
var user = await CheckAsync(model, true); var user = await CheckAsync(model, false);
var reg = await _userService.StartWebAuthnRegistrationAsync(user); var reg = await _userService.StartWebAuthnRegistrationAsync(user);
return reg; return reg;
} }
@ -254,7 +254,7 @@ public class TwoFactorController : Controller
[HttpPost("webauthn")] [HttpPost("webauthn")]
public async Task<TwoFactorWebAuthnResponseModel> PutWebAuthn([FromBody] TwoFactorWebAuthnRequestModel model) public async Task<TwoFactorWebAuthnResponseModel> PutWebAuthn([FromBody] TwoFactorWebAuthnRequestModel model)
{ {
var user = await CheckAsync(model, true); var user = await CheckAsync(model, false);
var success = await _userService.CompleteWebAuthRegistrationAsync( var success = await _userService.CompleteWebAuthRegistrationAsync(
user, model.Id.Value, model.Name, model.DeviceResponse); user, model.Id.Value, model.Name, model.DeviceResponse);
@ -271,7 +271,7 @@ public class TwoFactorController : Controller
public async Task<TwoFactorWebAuthnResponseModel> DeleteWebAuthn( public async Task<TwoFactorWebAuthnResponseModel> DeleteWebAuthn(
[FromBody] TwoFactorWebAuthnDeleteRequestModel model) [FromBody] TwoFactorWebAuthnDeleteRequestModel model)
{ {
var user = await CheckAsync(model, true); var user = await CheckAsync(model, false);
await _userService.DeleteWebAuthnKeyAsync(user, model.Id.Value); await _userService.DeleteWebAuthnKeyAsync(user, model.Id.Value);
var response = new TwoFactorWebAuthnResponseModel(user); var response = new TwoFactorWebAuthnResponseModel(user);
return response; return response;

View File

@ -30,6 +30,7 @@ public class OrganizationUsersController : Controller
private readonly ICurrentContext _currentContext; private readonly ICurrentContext _currentContext;
private readonly ICountNewSmSeatsRequiredQuery _countNewSmSeatsRequiredQuery; private readonly ICountNewSmSeatsRequiredQuery _countNewSmSeatsRequiredQuery;
private readonly IUpdateSecretsManagerSubscriptionCommand _updateSecretsManagerSubscriptionCommand; private readonly IUpdateSecretsManagerSubscriptionCommand _updateSecretsManagerSubscriptionCommand;
private readonly IUpdateOrganizationUserGroupsCommand _updateOrganizationUserGroupsCommand;
public OrganizationUsersController( public OrganizationUsersController(
IOrganizationRepository organizationRepository, IOrganizationRepository organizationRepository,
@ -41,7 +42,8 @@ public class OrganizationUsersController : Controller
IPolicyRepository policyRepository, IPolicyRepository policyRepository,
ICurrentContext currentContext, ICurrentContext currentContext,
ICountNewSmSeatsRequiredQuery countNewSmSeatsRequiredQuery, ICountNewSmSeatsRequiredQuery countNewSmSeatsRequiredQuery,
IUpdateSecretsManagerSubscriptionCommand updateSecretsManagerSubscriptionCommand) IUpdateSecretsManagerSubscriptionCommand updateSecretsManagerSubscriptionCommand,
IUpdateOrganizationUserGroupsCommand updateOrganizationUserGroupsCommand)
{ {
_organizationRepository = organizationRepository; _organizationRepository = organizationRepository;
_organizationUserRepository = organizationUserRepository; _organizationUserRepository = organizationUserRepository;
@ -53,6 +55,7 @@ public class OrganizationUsersController : Controller
_currentContext = currentContext; _currentContext = currentContext;
_countNewSmSeatsRequiredQuery = countNewSmSeatsRequiredQuery; _countNewSmSeatsRequiredQuery = countNewSmSeatsRequiredQuery;
_updateSecretsManagerSubscriptionCommand = updateSecretsManagerSubscriptionCommand; _updateSecretsManagerSubscriptionCommand = updateSecretsManagerSubscriptionCommand;
_updateOrganizationUserGroupsCommand = updateOrganizationUserGroupsCommand;
} }
[HttpGet("{id}")] [HttpGet("{id}")]
@ -308,7 +311,7 @@ public class OrganizationUsersController : Controller
} }
var loggedInUserId = _userService.GetProperUserId(User); 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")] [HttpPut("{userId}/reset-password-enrollment")]

View File

@ -3,6 +3,7 @@ using Bit.Api.Models.Public.Request;
using Bit.Api.Models.Public.Response; using Bit.Api.Models.Public.Response;
using Bit.Core.Context; using Bit.Core.Context;
using Bit.Core.Models.Business; using Bit.Core.Models.Business;
using Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces;
using Bit.Core.Repositories; using Bit.Core.Repositories;
using Bit.Core.Services; using Bit.Core.Services;
using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Authorization;
@ -19,19 +20,22 @@ public class MembersController : Controller
private readonly IOrganizationService _organizationService; private readonly IOrganizationService _organizationService;
private readonly IUserService _userService; private readonly IUserService _userService;
private readonly ICurrentContext _currentContext; private readonly ICurrentContext _currentContext;
private readonly IUpdateOrganizationUserGroupsCommand _updateOrganizationUserGroupsCommand;
public MembersController( public MembersController(
IOrganizationUserRepository organizationUserRepository, IOrganizationUserRepository organizationUserRepository,
IGroupRepository groupRepository, IGroupRepository groupRepository,
IOrganizationService organizationService, IOrganizationService organizationService,
IUserService userService, IUserService userService,
ICurrentContext currentContext) ICurrentContext currentContext,
IUpdateOrganizationUserGroupsCommand updateOrganizationUserGroupsCommand)
{ {
_organizationUserRepository = organizationUserRepository; _organizationUserRepository = organizationUserRepository;
_groupRepository = groupRepository; _groupRepository = groupRepository;
_organizationService = organizationService; _organizationService = organizationService;
_userService = userService; _userService = userService;
_currentContext = currentContext; _currentContext = currentContext;
_updateOrganizationUserGroupsCommand = updateOrganizationUserGroupsCommand;
} }
/// <summary> /// <summary>
@ -183,7 +187,7 @@ public class MembersController : Controller
{ {
return new NotFoundResult(); return new NotFoundResult();
} }
await _organizationService.UpdateUserGroupsAsync(existingUser, model.GroupIds, null); await _updateOrganizationUserGroupsCommand.UpdateUserGroupsAsync(existingUser, model.GroupIds, null);
return new OkResult(); return new OkResult();
} }

View File

@ -79,8 +79,8 @@ public class ProjectsController : Controller
throw new NotFoundException(); throw new NotFoundException();
} }
var (max, atMax) = await _maxProjectsQuery.GetByOrgIdAsync(organizationId); var (max, overMax) = await _maxProjectsQuery.GetByOrgIdAsync(organizationId, 1);
if (atMax != null && atMax.Value) if (overMax != null && overMax.Value)
{ {
throw new BadRequestException($"You have reached the maximum number of projects ({max}) for this plan."); throw new BadRequestException($"You have reached the maximum number of projects ({max}) for this plan.");
} }

View File

@ -4,6 +4,7 @@ using Bit.Core.Context;
using Bit.Core.Enums; using Bit.Core.Enums;
using Bit.Core.Exceptions; using Bit.Core.Exceptions;
using Bit.Core.SecretsManager.Commands.Porting.Interfaces; using Bit.Core.SecretsManager.Commands.Porting.Interfaces;
using Bit.Core.SecretsManager.Queries.Projects.Interfaces;
using Bit.Core.SecretsManager.Repositories; using Bit.Core.SecretsManager.Repositories;
using Bit.Core.Services; using Bit.Core.Services;
using Bit.Core.Utilities; using Bit.Core.Utilities;
@ -19,14 +20,18 @@ public class SecretsManagerPortingController : Controller
private readonly ISecretRepository _secretRepository; private readonly ISecretRepository _secretRepository;
private readonly IProjectRepository _projectRepository; private readonly IProjectRepository _projectRepository;
private readonly IUserService _userService; private readonly IUserService _userService;
private readonly IMaxProjectsQuery _maxProjectsQuery;
private readonly IImportCommand _importCommand; private readonly IImportCommand _importCommand;
private readonly ICurrentContext _currentContext; 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; _secretRepository = secretRepository;
_projectRepository = projectRepository; _projectRepository = projectRepository;
_userService = userService; _userService = userService;
_maxProjectsQuery = maxProjectsQuery;
_importCommand = importCommand; _importCommand = importCommand;
_currentContext = currentContext; _currentContext = currentContext;
} }
@ -69,6 +74,16 @@ public class SecretsManagerPortingController : Controller
throw new BadRequestException("A secret can only be in one project at a time."); 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()); await _importCommand.ImportAsync(organizationId, importRequest.ToSMImport());
} }
} }

View File

@ -281,10 +281,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2771,85 +2772,85 @@
"commercial.core": { "commercial.core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2" "Core": "[2023.9.0, )"
} }
}, },
"commercial.infrastructure.entityframework": { "commercial.infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
}, },
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -158,10 +158,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2588,71 +2589,71 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -28,10 +28,6 @@ public class WebAuthnTokenProvider : IUserTwoFactorTokenProvider<User>
public async Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<User> manager, User user) public async Task<bool> CanGenerateTwoFactorTokenAsync(UserManager<User> manager, User user)
{ {
var userService = _serviceProvider.GetRequiredService<IUserService>(); var userService = _serviceProvider.GetRequiredService<IUserService>();
if (!(await userService.CanAccessPremium(user)))
{
return false;
}
var webAuthnProvider = user.GetTwoFactorProvider(TwoFactorProviderType.WebAuthn); var webAuthnProvider = user.GetTwoFactorProvider(TwoFactorProviderType.WebAuthn);
if (!HasProperMetaData(webAuthnProvider)) if (!HasProperMetaData(webAuthnProvider))
@ -45,10 +41,6 @@ public class WebAuthnTokenProvider : IUserTwoFactorTokenProvider<User>
public async Task<string> GenerateAsync(string purpose, UserManager<User> manager, User user) public async Task<string> GenerateAsync(string purpose, UserManager<User> manager, User user)
{ {
var userService = _serviceProvider.GetRequiredService<IUserService>(); var userService = _serviceProvider.GetRequiredService<IUserService>();
if (!(await userService.CanAccessPremium(user)))
{
return null;
}
var provider = user.GetTwoFactorProvider(TwoFactorProviderType.WebAuthn); var provider = user.GetTwoFactorProvider(TwoFactorProviderType.WebAuthn);
var keys = LoadKeys(provider); var keys = LoadKeys(provider);
@ -81,7 +73,7 @@ public class WebAuthnTokenProvider : IUserTwoFactorTokenProvider<User>
public async Task<bool> ValidateAsync(string purpose, string token, UserManager<User> manager, User user) public async Task<bool> ValidateAsync(string purpose, string token, UserManager<User> manager, User user)
{ {
var userService = _serviceProvider.GetRequiredService<IUserService>(); var userService = _serviceProvider.GetRequiredService<IUserService>();
if (!(await userService.CanAccessPremium(user)) || string.IsNullOrWhiteSpace(token)) if (string.IsNullOrWhiteSpace(token))
{ {
return false; return false;
} }

View File

@ -6,11 +6,12 @@ namespace Bit.Core.Auth.Models.Business.Tokenables;
// This token just provides a verifiable authN mechanism for the API service // This token just provides a verifiable authN mechanism for the API service
// TwoFactorController.cs SendEmailLogin anonymous endpoint so it cannot be // TwoFactorController.cs SendEmailLogin anonymous endpoint so it cannot be
// used maliciously. // used maliciously.
public class SsoEmail2faSessionTokenable : ExpiringTokenable public class SsoEmail2faSessionTokenable : ExpiringTokenable
{ {
// Just over 2 min expiration (client expires session after 2 min) // 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 ClearTextPrefix = "BwSsoEmail2FaSessionToken_";
public const string DataProtectorPurpose = "SsoEmail2faSessionTokenDataProtector"; public const string DataProtectorPurpose = "SsoEmail2faSessionTokenDataProtector";
@ -24,7 +25,7 @@ public class SsoEmail2faSessionTokenable : ExpiringTokenable
[JsonConstructor] [JsonConstructor]
public SsoEmail2faSessionTokenable() public SsoEmail2faSessionTokenable()
{ {
ExpirationDate = DateTime.UtcNow.Add(_tokenLifetime); ExpirationDate = DateTime.UtcNow.Add(GetTokenLifetime());
} }
public SsoEmail2faSessionTokenable(User user) : this() public SsoEmail2faSessionTokenable(User user) : this()
@ -44,7 +45,7 @@ public class SsoEmail2faSessionTokenable : ExpiringTokenable
Email.Equals(user.Email, StringComparison.InvariantCultureIgnoreCase); Email.Equals(user.Email, StringComparison.InvariantCultureIgnoreCase);
} }
// Validates deserialized // Validates deserialized
protected override bool TokenIsValid() => protected override bool TokenIsValid() =>
Identifier == TokenIdentifier && Id != default && !string.IsNullOrWhiteSpace(Email); Identifier == TokenIdentifier && Id != default && !string.IsNullOrWhiteSpace(Email);
} }

View File

@ -57,7 +57,6 @@ public class TwoFactorProvider
case TwoFactorProviderType.Duo: case TwoFactorProviderType.Duo:
case TwoFactorProviderType.YubiKey: case TwoFactorProviderType.YubiKey:
case TwoFactorProviderType.U2f: // Keep to ensure old U2f keys are considered premium case TwoFactorProviderType.U2f: // Keep to ensure old U2f keys are considered premium
case TwoFactorProviderType.WebAuthn:
return true; return true;
default: default:
return false; return false;

View File

@ -82,34 +82,39 @@ public class AuthRequestService : IAuthRequestService
/// </remarks> /// </remarks>
public async Task<AuthRequest> CreateAuthRequestAsync(AuthRequestCreateRequestModel model) public async Task<AuthRequest> CreateAuthRequestAsync(AuthRequestCreateRequestModel model)
{ {
var user = await _userRepository.GetByEmailAsync(model.Email);
if (user == null)
{
throw new NotFoundException();
}
if (!_currentContext.DeviceType.HasValue) if (!_currentContext.DeviceType.HasValue)
{ {
throw new BadRequestException("Device type not provided."); 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); var devices = await _deviceRepository.GetManyByUserIdAsync(user.Id);
if (devices == null || !devices.Any(d => d.Identifier == model.DeviceIdentifier)) if (devices == null || !devices.Any(d => d.Identifier == model.DeviceIdentifier))
{ {
throw new BadRequestException( userNotFound = true;
"Login with device is only available on devices that have been previously logged in.");
} }
} }
// 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 // AdminApproval requests require correlating the user and their organization
if (model.Type == AuthRequestType.AdminApproval) 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 // 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 // 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); var organizationUsers = await _organizationUserRepository.GetManyByUserAsync(_currentContext.UserId!.Value);
if (organizationUsers.Count == 0) if (organizationUsers.Count == 0)
@ -173,7 +178,7 @@ public class AuthRequestService : IAuthRequestService
switch (authRequest.Type) switch (authRequest.Type)
{ {
case AuthRequestType.AdminApproval: 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. // non-AdminApproval ones having a default of 15 minutes.
if (IsDateExpired(authRequest.CreationDate, _globalSettings.PasswordlessAuth.AdminRequestExpiration)) if (IsDateExpired(authRequest.CreationDate, _globalSettings.PasswordlessAuth.AdminRequestExpiration))
{ {
@ -213,7 +218,7 @@ public class AuthRequestService : IAuthRequestService
await _authRequestRepository.ReplaceAsync(authRequest); 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. // to not leak that it was denied to the originating client if it was originated by a malicious actor.
if (authRequest.Approved ?? true) if (authRequest.Approved ?? true)
{ {

View File

@ -36,7 +36,6 @@ public static class FeatureFlagKeys
public const string DisplayEuEnvironment = "display-eu-environment"; public const string DisplayEuEnvironment = "display-eu-environment";
public const string DisplayLowKdfIterationWarning = "display-kdf-iteration-warning"; public const string DisplayLowKdfIterationWarning = "display-kdf-iteration-warning";
public const string TrustedDeviceEncryption = "trusted-device-encryption"; public const string TrustedDeviceEncryption = "trusted-device-encryption";
public const string SecretsManagerBilling = "sm-ga-billing";
public const string AutofillV2 = "autofill-v2"; public const string AutofillV2 = "autofill-v2";
public static List<string> GetAllKeys() public static List<string> GetAllKeys()
@ -46,4 +45,13 @@ public static class FeatureFlagKeys
.Select(x => (string)x.GetRawConstantValue()) .Select(x => (string)x.GetRawConstantValue())
.ToList(); .ToList();
} }
public static Dictionary<string, string> GetLocalOverrideFlagValues()
{
// place overriding values when needed locally (offline), or return null
return new Dictionary<string, string>()
{
{ TrustedDeviceEncryption, "true" }
};
}
} }

View File

@ -358,7 +358,9 @@ public class CurrentContext : ICurrentContext
public async Task<bool> ViewAssignedCollections(Guid orgId) public async Task<bool> 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<bool> ManageGroups(Guid orgId) public async Task<bool> ManageGroups(Guid orgId)

View File

@ -51,7 +51,7 @@
<PackageReference Include="Serilog.Sinks.AzureCosmosDB" Version="2.0.0" /> <PackageReference Include="Serilog.Sinks.AzureCosmosDB" Version="2.0.0" />
<PackageReference Include="Serilog.Sinks.SyslogMessages" Version="2.0.6" /> <PackageReference Include="Serilog.Sinks.SyslogMessages" Version="2.0.6" />
<PackageReference Include="AspNetCoreRateLimit" Version="4.0.2" /> <PackageReference Include="AspNetCoreRateLimit" Version="4.0.2" />
<PackageReference Include="Braintree" Version="5.12.0" /> <PackageReference Include="Braintree" Version="5.19.0" />
<PackageReference Include="Stripe.net" Version="40.0.0" /> <PackageReference Include="Stripe.net" Version="40.0.0" />
<PackageReference Include="Otp.NET" Version="1.2.2" /> <PackageReference Include="Otp.NET" Version="1.2.2" />
<PackageReference Include="YubicoDotNetClient" Version="1.2.0" /> <PackageReference Include="YubicoDotNetClient" Version="1.2.0" />

View File

@ -35,14 +35,23 @@ public class TaxInfo
return _taxIdType; return _taxIdType;
} }
switch (BillingAddressCountry) switch (BillingAddressCountry.ToUpper())
{ {
case "AD":
_taxIdType = "ad_nrt";
break;
case "AE": case "AE":
_taxIdType = "ae_trn"; _taxIdType = "ae_trn";
break; break;
case "AR":
_taxIdType = "ar_cuit";
break;
case "AU": case "AU":
_taxIdType = "au_abn"; _taxIdType = "au_abn";
break; break;
case "BO":
_taxIdType = "bo_tin";
break;
case "BR": case "BR":
_taxIdType = "br_cnpj"; _taxIdType = "br_cnpj";
break; break;
@ -55,9 +64,45 @@ public class TaxInfo
} }
_taxIdType = "ca_bn"; _taxIdType = "ca_bn";
break; break;
case "CH":
_taxIdType = "ch_vat";
break;
case "CL": case "CL":
_taxIdType = "cl_tin"; _taxIdType = "cl_tin";
break; 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 "AT":
case "BE": case "BE":
case "BG": case "BG":
@ -115,6 +160,15 @@ public class TaxInfo
case "NZ": case "NZ":
_taxIdType = "nz_gst"; _taxIdType = "nz_gst";
break; break;
case "PE":
_taxIdType = "pe_ruc";
break;
case "PH":
_taxIdType = "ph_tin";
break;
case "RS":
_taxIdType = "rs_pib";
break;
case "RU": case "RU":
_taxIdType = "ru_inn"; _taxIdType = "ru_inn";
break; break;
@ -124,15 +178,33 @@ public class TaxInfo
case "SG": case "SG":
_taxIdType = "sg_gst"; _taxIdType = "sg_gst";
break; break;
case "SV":
_taxIdType = "sv_nit";
break;
case "TH": case "TH":
_taxIdType = "th_vat"; _taxIdType = "th_vat";
break; break;
case "TR":
_taxIdType = "tr_tin";
break;
case "TW": case "TW":
_taxIdType = "tw_vat"; _taxIdType = "tw_vat";
break; break;
case "UA":
_taxIdType = "ua_vat";
break;
case "US": case "US":
_taxIdType = "us_ein"; _taxIdType = "us_ein";
break; break;
case "UY":
_taxIdType = "uy_ruc";
break;
case "VE":
_taxIdType = "ve_rif";
break;
case "VN":
_taxIdType = "vn_tin";
break;
case "ZA": case "ZA":
_taxIdType = "za_vat"; _taxIdType = "za_vat";
break; break;

View File

@ -45,6 +45,7 @@ public static class OrganizationServiceCollectionExtensions
services.AddOrganizationLicenseCommandsQueries(); services.AddOrganizationLicenseCommandsQueries();
services.AddOrganizationDomainCommandsQueries(); services.AddOrganizationDomainCommandsQueries();
services.AddOrganizationAuthCommands(); services.AddOrganizationAuthCommands();
services.AddOrganizationUserCommands();
services.AddOrganizationUserCommandsQueries(); services.AddOrganizationUserCommandsQueries();
services.AddBaseOrganizationSubscriptionCommandsQueries(); services.AddBaseOrganizationSubscriptionCommandsQueries();
} }
@ -81,6 +82,12 @@ public static class OrganizationServiceCollectionExtensions
} }
} }
private static void AddOrganizationUserCommands(this IServiceCollection services)
{
services.AddScoped<IDeleteOrganizationUserCommand, DeleteOrganizationUserCommand>();
services.AddScoped<IUpdateOrganizationUserGroupsCommand, UpdateOrganizationUserGroupsCommand>();
}
private static void AddOrganizationApiKeyCommandsQueries(this IServiceCollection services) private static void AddOrganizationApiKeyCommandsQueries(this IServiceCollection services)
{ {
services.AddScoped<IGetOrganizationApiKeyQuery, GetOrganizationApiKeyQuery>(); services.AddScoped<IGetOrganizationApiKeyQuery, GetOrganizationApiKeyQuery>();

View File

@ -0,0 +1,8 @@
using Bit.Core.Entities;
namespace Bit.Core.OrganizationFeatures.OrganizationUsers.Interfaces;
public interface IUpdateOrganizationUserGroupsCommand
{
Task UpdateUserGroupsAsync(OrganizationUser organizationUser, IEnumerable<Guid> groupIds, Guid? loggedInUserId);
}

View File

@ -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<Guid> 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);
}
}

View File

@ -2,5 +2,5 @@
public interface IMaxProjectsQuery public interface IMaxProjectsQuery
{ {
Task<(short? max, bool? atMax)> GetByOrgIdAsync(Guid organizationId); Task<(short? max, bool? overMax)> GetByOrgIdAsync(Guid organizationId, int projectsToAdd);
} }

View File

@ -39,6 +39,12 @@ public interface IOrganizationService
OrganizationUserType type, bool accessAll, string externalId, IEnumerable<CollectionAccessSelection> collections, IEnumerable<Guid> groups); OrganizationUserType type, bool accessAll, string externalId, IEnumerable<CollectionAccessSelection> collections, IEnumerable<Guid> groups);
Task<IEnumerable<Tuple<OrganizationUser, string>>> ResendInvitesAsync(Guid organizationId, Guid? invitingUserId, IEnumerable<Guid> organizationUsersId); Task<IEnumerable<Tuple<OrganizationUser, string>>> ResendInvitesAsync(Guid organizationId, Guid? invitingUserId, IEnumerable<Guid> organizationUsersId);
Task ResendInviteAsync(Guid organizationId, Guid? invitingUserId, Guid organizationUserId, bool initOrganization = false); Task ResendInviteAsync(Guid organizationId, Guid? invitingUserId, Guid organizationUserId, bool initOrganization = false);
/// <summary>
/// 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.
/// </summary>
/// <param name="token">The token embedded in the email invitation link</param>
/// <returns>The accepted OrganizationUser.</returns>
Task<OrganizationUser> AcceptUserAsync(Guid organizationUserId, User user, string token, IUserService userService); Task<OrganizationUser> AcceptUserAsync(Guid organizationUserId, User user, string token, IUserService userService);
Task<OrganizationUser> AcceptUserAsync(string orgIdentifier, User user, IUserService userService); Task<OrganizationUser> AcceptUserAsync(string orgIdentifier, User user, IUserService userService);
Task<OrganizationUser> AcceptUserAsync(Guid organizationId, User user, IUserService userService); Task<OrganizationUser> AcceptUserAsync(Guid organizationId, User user, IUserService userService);
@ -54,7 +60,6 @@ public interface IOrganizationService
Task DeleteUserAsync(Guid organizationId, Guid userId); Task DeleteUserAsync(Guid organizationId, Guid userId);
Task<List<Tuple<OrganizationUser, string>>> DeleteUsersAsync(Guid organizationId, Task<List<Tuple<OrganizationUser, string>>> DeleteUsersAsync(Guid organizationId,
IEnumerable<Guid> organizationUserIds, Guid? deletingUserId); IEnumerable<Guid> organizationUserIds, Guid? deletingUserId);
Task UpdateUserGroupsAsync(OrganizationUser organizationUser, IEnumerable<Guid> groupIds, Guid? loggedInUserId);
Task UpdateUserResetPasswordEnrollmentAsync(Guid organizationId, Guid userId, string resetPasswordKey, Guid? callingUserId); Task UpdateUserResetPasswordEnrollmentAsync(Guid organizationId, Guid userId, string resetPasswordKey, Guid? callingUserId);
Task ImportAsync(Guid organizationId, Guid? importingUserId, IEnumerable<ImportedGroup> groups, Task ImportAsync(Guid organizationId, Guid? importingUserId, IEnumerable<ImportedGroup> groups,
IEnumerable<ImportedOrganizationUser> newUsers, IEnumerable<string> removeUserExternalIds, IEnumerable<ImportedOrganizationUser> newUsers, IEnumerable<string> removeUserExternalIds,
@ -82,4 +87,6 @@ public interface IOrganizationService
void ValidatePasswordManagerPlan(Models.StaticStore.Plan plan, OrganizationUpgrade upgrade); void ValidatePasswordManagerPlan(Models.StaticStore.Plan plan, OrganizationUpgrade upgrade);
void ValidateSecretsManagerPlan(Models.StaticStore.Plan plan, OrganizationUpgrade upgrade); void ValidateSecretsManagerPlan(Models.StaticStore.Plan plan, OrganizationUpgrade upgrade);
Task ValidateOrganizationUserUpdatePermissions(Guid organizationId, OrganizationUserType newType,
OrganizationUserType? oldType, Permissions permissions);
} }

View File

@ -29,24 +29,12 @@ public class LaunchDarklyFeatureService : IFeatureService, IDisposable
// support configuration directly from settings // support configuration directly from settings
else if (globalSettings.LaunchDarkly?.FlagValues?.Any() is true) else if (globalSettings.LaunchDarkly?.FlagValues?.Any() is true)
{ {
var source = TestData.DataSource(); ldConfig.DataSource(BuildDataSource(globalSettings.LaunchDarkly.FlagValues));
foreach (var kvp in globalSettings.LaunchDarkly.FlagValues) }
{ // support local overrides
if (bool.TryParse(kvp.Value, out bool boolValue)) else if (FeatureFlagKeys.GetLocalOverrideFlagValues()?.Any() is true)
{ {
source.Update(source.Flag(kvp.Key).ValueForAll(LaunchDarkly.Sdk.LdValue.Of(boolValue))); ldConfig.DataSource(BuildDataSource(FeatureFlagKeys.GetLocalOverrideFlagValues()));
}
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);
} }
else else
{ {
@ -187,4 +175,26 @@ public class LaunchDarklyFeatureService : IFeatureService, IDisposable
return builder.Build(); return builder.Build();
} }
private TestData BuildDataSource(Dictionary<string, string> 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;
}
} }

View File

@ -1098,7 +1098,15 @@ public class OrganizationService : IOrganizationService
throw new BadRequestException("User email does not match invite."); 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<OrganizationUser> AcceptUserAsync(string orgIdentifier, User user, IUserService userService) public async Task<OrganizationUser> AcceptUserAsync(string orgIdentifier, User user, IUserService userService)
@ -1587,17 +1595,6 @@ public class OrganizationService : IOrganizationService
return hasOtherOwner; return hasOtherOwner;
} }
public async Task UpdateUserGroupsAsync(OrganizationUser organizationUser, IEnumerable<Guid> 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) 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 // 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)) if (await _currentContext.OrganizationOwner(organizationId))
{ {

View File

@ -98,11 +98,12 @@
}, },
"Braintree": { "Braintree": {
"type": "Direct", "type": "Direct",
"requested": "[5.12.0, )", "requested": "[5.19.0, )",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },

View File

@ -158,10 +158,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2588,71 +2589,71 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -158,10 +158,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2588,71 +2589,71 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -167,10 +167,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2597,71 +2598,71 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -26,6 +26,7 @@ using Bit.Core.Utilities;
using Bit.Identity.Utilities; using Bit.Identity.Utilities;
using IdentityServer4.Validation; using IdentityServer4.Validation;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Caching.Distributed;
namespace Bit.Identity.IdentityServer; namespace Bit.Identity.IdentityServer;
@ -45,6 +46,8 @@ public abstract class BaseRequestValidator<T> where T : class
private readonly GlobalSettings _globalSettings; private readonly GlobalSettings _globalSettings;
private readonly IUserRepository _userRepository; private readonly IUserRepository _userRepository;
private readonly IDataProtectorTokenFactory<SsoEmail2faSessionTokenable> _tokenDataFactory; private readonly IDataProtectorTokenFactory<SsoEmail2faSessionTokenable> _tokenDataFactory;
private readonly IDistributedCache _distributedCache;
private readonly DistributedCacheEntryOptions _cacheEntryOptions;
protected ICurrentContext CurrentContext { get; } protected ICurrentContext CurrentContext { get; }
protected IPolicyService PolicyService { get; } protected IPolicyService PolicyService { get; }
@ -69,7 +72,8 @@ public abstract class BaseRequestValidator<T> where T : class
IPolicyService policyService, IPolicyService policyService,
IDataProtectorTokenFactory<SsoEmail2faSessionTokenable> tokenDataFactory, IDataProtectorTokenFactory<SsoEmail2faSessionTokenable> tokenDataFactory,
IFeatureService featureService, IFeatureService featureService,
ISsoConfigRepository ssoConfigRepository) ISsoConfigRepository ssoConfigRepository,
IDistributedCache distributedCache)
{ {
_userManager = userManager; _userManager = userManager;
_deviceRepository = deviceRepository; _deviceRepository = deviceRepository;
@ -89,6 +93,14 @@ public abstract class BaseRequestValidator<T> where T : class
_tokenDataFactory = tokenDataFactory; _tokenDataFactory = tokenDataFactory;
FeatureService = featureService; FeatureService = featureService;
SsoConfigRepository = ssoConfigRepository; 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, protected async Task ValidateAsync(T context, ValidatedTokenRequest request,
@ -135,18 +147,26 @@ public abstract class BaseRequestValidator<T> where T : class
var verified = await VerifyTwoFactor(user, twoFactorOrganization, var verified = await VerifyTwoFactor(user, twoFactorOrganization,
twoFactorProviderType, twoFactorToken); 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); if (twoFactorProviderType != TwoFactorProviderType.Remember)
await BuildErrorResultAsync("Two-step token is invalid. Try again.", true, context, user); {
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; 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 Core.Utilities.DistributedCacheExtensions.SetAsync(_distributedCache, cacheKey, twoFactorToken, _cacheEntryOptions);
await Task.Delay(2000);
await BuildTwoFactorResultAsync(user, twoFactorOrganization, context);
return;
} }
} }
else else

View File

@ -14,6 +14,7 @@ using IdentityModel;
using IdentityServer4.Extensions; using IdentityServer4.Extensions;
using IdentityServer4.Validation; using IdentityServer4.Validation;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Caching.Distributed;
#nullable enable #nullable enable
@ -42,11 +43,13 @@ public class CustomTokenRequestValidator : BaseRequestValidator<CustomTokenReque
IUserRepository userRepository, IUserRepository userRepository,
IPolicyService policyService, IPolicyService policyService,
IDataProtectorTokenFactory<SsoEmail2faSessionTokenable> tokenDataFactory, IDataProtectorTokenFactory<SsoEmail2faSessionTokenable> tokenDataFactory,
IFeatureService featureService) IFeatureService featureService,
IDistributedCache distributedCache)
: base(userManager, deviceRepository, deviceService, userService, eventService, : base(userManager, deviceRepository, deviceService, userService, eventService,
organizationDuoWebTokenProvider, organizationRepository, organizationUserRepository, organizationDuoWebTokenProvider, organizationRepository, organizationUserRepository,
applicationCacheService, mailService, logger, currentContext, globalSettings, applicationCacheService, mailService, logger, currentContext, globalSettings,
userRepository, policyService, tokenDataFactory, featureService, ssoConfigRepository) userRepository, policyService, tokenDataFactory, featureService, ssoConfigRepository,
distributedCache)
{ {
_userManager = userManager; _userManager = userManager;
} }

View File

@ -13,6 +13,7 @@ using Bit.Core.Utilities;
using IdentityServer4.Models; using IdentityServer4.Models;
using IdentityServer4.Validation; using IdentityServer4.Validation;
using Microsoft.AspNetCore.Identity; using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Caching.Distributed;
namespace Bit.Identity.IdentityServer; namespace Bit.Identity.IdentityServer;
@ -44,11 +45,12 @@ public class ResourceOwnerPasswordValidator : BaseRequestValidator<ResourceOwner
IPolicyService policyService, IPolicyService policyService,
IDataProtectorTokenFactory<SsoEmail2faSessionTokenable> tokenDataFactory, IDataProtectorTokenFactory<SsoEmail2faSessionTokenable> tokenDataFactory,
IFeatureService featureService, IFeatureService featureService,
ISsoConfigRepository ssoConfigRepository) ISsoConfigRepository ssoConfigRepository,
IDistributedCache distributedCache)
: base(userManager, deviceRepository, deviceService, userService, eventService, : base(userManager, deviceRepository, deviceService, userService, eventService,
organizationDuoWebTokenProvider, organizationRepository, organizationUserRepository, organizationDuoWebTokenProvider, organizationRepository, organizationUserRepository,
applicationCacheService, mailService, logger, currentContext, globalSettings, userRepository, policyService, applicationCacheService, mailService, logger, currentContext, globalSettings, userRepository, policyService,
tokenDataFactory, featureService, ssoConfigRepository) tokenDataFactory, featureService, ssoConfigRepository, distributedCache)
{ {
_userManager = userManager; _userManager = userManager;
_userService = userService; _userService = userService;

View File

@ -167,10 +167,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2610,71 +2611,71 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -147,10 +147,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2430,43 +2431,43 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
} }
} }

View File

@ -144,27 +144,42 @@ public class OrganizationRepository : Repository<Core.Entities.Organization, Org
var dbContext = GetDatabaseContext(scope); var dbContext = GetDatabaseContext(scope);
await dbContext.UserBumpAccountRevisionDateByOrganizationIdAsync(organization.Id); await dbContext.UserBumpAccountRevisionDateByOrganizationIdAsync(organization.Id);
var deleteCiphersTransaction = await dbContext.Database.BeginTransactionAsync(); var deleteCiphersTransaction = await dbContext.Database.BeginTransactionAsync();
dbContext.Ciphers.RemoveRange( await dbContext.Ciphers.Where(c => c.UserId == null && c.OrganizationId == organization.Id)
dbContext.Ciphers.Where(c => c.UserId == null && c.OrganizationId == organization.Id)); .ExecuteDeleteAsync();
await deleteCiphersTransaction.CommitAsync(); await deleteCiphersTransaction.CommitAsync();
var organizationDeleteTransaction = await dbContext.Database.BeginTransactionAsync(); var organizationDeleteTransaction = await dbContext.Database.BeginTransactionAsync();
dbContext.SsoUsers.RemoveRange(dbContext.SsoUsers.Where(su => su.OrganizationId == organization.Id)); await dbContext.SsoUsers.Where(su => su.OrganizationId == organization.Id)
dbContext.SsoConfigs.RemoveRange(dbContext.SsoConfigs.Where(sc => sc.OrganizationId == organization.Id)); .ExecuteDeleteAsync();
var collectionUsers = from cu in dbContext.CollectionUsers await dbContext.SsoConfigs.Where(sc => sc.OrganizationId == organization.Id)
join ou in dbContext.OrganizationUsers on cu.OrganizationUserId equals ou.Id .ExecuteDeleteAsync();
where ou.OrganizationId == organization.Id await dbContext.CollectionUsers.Where(cu => cu.OrganizationUser.OrganizationId == organization.Id)
select cu; .ExecuteDeleteAsync();
dbContext.CollectionUsers.RemoveRange(collectionUsers); await dbContext.UserProjectAccessPolicy.Where(ap => ap.OrganizationUser.OrganizationId == organization.Id)
dbContext.OrganizationUsers.RemoveRange( .ExecuteDeleteAsync();
dbContext.OrganizationUsers.Where(ou => ou.OrganizationId == organization.Id)); await dbContext.UserServiceAccountAccessPolicy.Where(ap => ap.OrganizationUser.OrganizationId == organization.Id)
dbContext.ProviderOrganizations.RemoveRange( .ExecuteDeleteAsync();
dbContext.ProviderOrganizations.Where(po => po.OrganizationId == organization.Id)); 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 // The below section are 3 SPROCS in SQL Server but are only called by here
dbContext.OrganizationApiKeys.RemoveRange( await dbContext.OrganizationApiKeys.Where(oa => oa.OrganizationId == organization.Id)
dbContext.OrganizationApiKeys.Where(oa => oa.OrganizationId == organization.Id)); .ExecuteDeleteAsync();
dbContext.OrganizationConnections.RemoveRange( await dbContext.OrganizationConnections.Where(oc => oc.OrganizationId == organization.Id)
dbContext.OrganizationConnections.Where(oc => oc.OrganizationId == organization.Id)); .ExecuteDeleteAsync();
var sponsoringOrgs = await dbContext.OrganizationSponsorships var sponsoringOrgs = await dbContext.OrganizationSponsorships
.Where(os => os.SponsoringOrganizationId == organization.Id) .Where(os => os.SponsoringOrganizationId == organization.Id)
.ToListAsync(); .ToListAsync();

View File

@ -93,6 +93,11 @@ public class OrganizationUserRepository : Repository<Core.Entities.OrganizationU
.Where(gu => gu.OrganizationUserId == organizationUserId); .Where(gu => gu.OrganizationUserId == organizationUserId);
dbContext.GroupUsers.RemoveRange(groupUsers); 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 var orgSponsorships = await dbContext.OrganizationSponsorships
.Where(os => os.SponsoringOrganizationUserId == organizationUserId) .Where(os => os.SponsoringOrganizationUserId == organizationUserId)
.ToListAsync(); .ToListAsync();
@ -325,7 +330,7 @@ public class OrganizationUserRepository : Repository<Core.Entities.OrganizationU
var userIds = users.Select(u => u.Id); var userIds = users.Select(u => u.Id);
var userIdEntities = dbContext.OrganizationUsers.Where(x => userIds.Contains(x.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) if (includeGroups)
{ {
groups = (await (from gu in dbContext.GroupUsers groups = (await (from gu in dbContext.GroupUsers

View File

@ -167,6 +167,10 @@ public class UserRepository : Repository<Core.Entities.User, User, Guid>, IUserR
where ou.UserId == user.Id where ou.UserId == user.Id
select gu; select gu;
dbContext.GroupUsers.RemoveRange(groupUsers); 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.OrganizationUsers.RemoveRange(dbContext.OrganizationUsers.Where(ou => ou.UserId == user.Id));
dbContext.ProviderUsers.RemoveRange(dbContext.ProviderUsers.Where(pu => pu.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)); dbContext.SsoUsers.RemoveRange(dbContext.SsoUsers.Where(su => su.UserId == user.Id));

View File

@ -39,6 +39,12 @@ public class UserProjectAccessPolicyEntityTypeConfiguration : IEntityTypeConfigu
builder builder
.Property(e => e.GrantedProjectId) .Property(e => e.GrantedProjectId)
.HasColumnName(nameof(UserProjectAccessPolicy.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 builder
.Property(e => e.GrantedProjectId) .Property(e => e.GrantedProjectId)
.HasColumnName(nameof(GroupProjectAccessPolicy.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 builder
.Property(e => e.GrantedServiceAccountId) .Property(e => e.GrantedServiceAccountId)
.HasColumnName(nameof(GroupServiceAccountAccessPolicy.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 builder
.Property(e => e.GrantedProjectId) .Property(e => e.GrantedProjectId)
.HasColumnName(nameof(ServiceAccountProjectAccessPolicy.GrantedProjectId)); .HasColumnName(nameof(ServiceAccountProjectAccessPolicy.GrantedProjectId));
builder
.HasOne(e => e.GrantedProject)
.WithMany(e => e.ServiceAccountAccessPolicies)
.HasForeignKey(nameof(ServiceAccountProjectAccessPolicy.GrantedProjectId))
.OnDelete(DeleteBehavior.Cascade);
} }
} }

View File

@ -221,10 +221,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2590,43 +2591,43 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
} }
} }

View File

@ -8,7 +8,7 @@
<PropertyGroup Condition=" '$(RunConfiguration)' == 'Notifications-SelfHost' " /> <PropertyGroup Condition=" '$(RunConfiguration)' == 'Notifications-SelfHost' " />
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="6.0.4" /> <PackageReference Include="Microsoft.AspNetCore.SignalR.Protocols.MessagePack" Version="6.0.4" />
<PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="6.0.4" /> <PackageReference Include="Microsoft.AspNetCore.SignalR.StackExchangeRedis" Version="6.0.22" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -14,9 +14,9 @@
}, },
"Microsoft.AspNetCore.SignalR.StackExchangeRedis": { "Microsoft.AspNetCore.SignalR.StackExchangeRedis": {
"type": "Direct", "type": "Direct",
"requested": "[6.0.4, )", "requested": "[6.0.22, )",
"resolved": "6.0.4", "resolved": "6.0.22",
"contentHash": "E3Ihoz4xXHVyqx4ZidQAEbWbjD0bEOTsnDMuz7FoFyev0fLJCHWOiR6Y9E+8Qb/dmUDrfaLdZzKUSwtlHPGGgA==", "contentHash": "qcwxQNBUIuiVCA8pJTPoxFXQOum0R3+Lh7bfHOQxgpcP3wNQoSRK8yqEEiv0E15vMLiboh88+Ujnu2Wzq66onQ==",
"dependencies": { "dependencies": {
"MessagePack": "2.1.90", "MessagePack": "2.1.90",
"Microsoft.Extensions.Options": "6.0.0", "Microsoft.Extensions.Options": "6.0.0",
@ -179,10 +179,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2638,71 +2639,71 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -158,10 +158,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2588,63 +2589,63 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
} }
} }

View File

@ -321,10 +321,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -3137,133 +3138,133 @@
"api": { "api": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AspNetCore.HealthChecks.AzureServiceBus": "6.1.0", "AspNetCore.HealthChecks.AzureServiceBus": "[6.1.0, )",
"AspNetCore.HealthChecks.AzureStorage": "6.1.2", "AspNetCore.HealthChecks.AzureStorage": "[6.1.2, )",
"AspNetCore.HealthChecks.Network": "6.0.4", "AspNetCore.HealthChecks.Network": "[6.0.4, )",
"AspNetCore.HealthChecks.Redis": "6.0.4", "AspNetCore.HealthChecks.Redis": "[6.0.4, )",
"AspNetCore.HealthChecks.SendGrid": "6.0.2", "AspNetCore.HealthChecks.SendGrid": "[6.0.2, )",
"AspNetCore.HealthChecks.SqlServer": "6.0.2", "AspNetCore.HealthChecks.SqlServer": "[6.0.2, )",
"AspNetCore.HealthChecks.Uris": "6.0.3", "AspNetCore.HealthChecks.Uris": "[6.0.3, )",
"Azure.Messaging.EventGrid": "4.10.0", "Azure.Messaging.EventGrid": "[4.10.0, )",
"Commercial.Core": "2023.7.2", "Commercial.Core": "[2023.9.0, )",
"Commercial.Infrastructure.EntityFramework": "2023.7.2", "Commercial.Infrastructure.EntityFramework": "[2023.9.0, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"SharedWeb": "2023.7.2", "SharedWeb": "[2023.9.0, )",
"Swashbuckle.AspNetCore": "6.5.0" "Swashbuckle.AspNetCore": "[6.5.0, )"
} }
}, },
"commercial.core": { "commercial.core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2" "Core": "[2023.9.0, )"
} }
}, },
"commercial.infrastructure.entityframework": { "commercial.infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
}, },
"common": { "common": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "4.17.0", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "4.17.0", "AutoFixture.Xunit2": "[4.17.0, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "17.1.0", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "4.3.0", "NSubstitute": "[4.3.0, )",
"xunit": "2.4.1" "xunit": "[2.4.1, )"
} }
}, },
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"identity": { "identity": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"SharedWeb": "2023.7.2", "SharedWeb": "[2023.9.0, )",
"Swashbuckle.AspNetCore.SwaggerGen": "6.5.0" "Swashbuckle.AspNetCore.SwaggerGen": "[6.5.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"integrationtestcommon": { "integrationtestcommon": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Common": "2023.7.2", "Common": "[2023.9.0, )",
"Identity": "2023.7.2", "Identity": "[2023.9.0, )",
"Microsoft.AspNetCore.Mvc.Testing": "6.0.5", "Microsoft.AspNetCore.Mvc.Testing": "[6.0.5, )",
"Microsoft.EntityFrameworkCore.InMemory": "7.0.5", "Microsoft.EntityFrameworkCore.InMemory": "[7.0.5, )",
"Microsoft.Extensions.Configuration": "6.0.1" "Microsoft.Extensions.Configuration": "[6.0.1, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -132,7 +132,7 @@ public class ProjectsControllerTests
.AuthorizeAsync(Arg.Any<ClaimsPrincipal>(), data.ToProject(orgId), .AuthorizeAsync(Arg.Any<ClaimsPrincipal>(), data.ToProject(orgId),
Arg.Any<IEnumerable<IAuthorizationRequirement>>()).ReturnsForAnyArgs(AuthorizationResult.Success()); Arg.Any<IEnumerable<IAuthorizationRequirement>>()).ReturnsForAnyArgs(AuthorizationResult.Success());
sutProvider.GetDependency<IUserService>().GetProperUserId(default).ReturnsForAnyArgs(Guid.NewGuid()); sutProvider.GetDependency<IUserService>().GetProperUserId(default).ReturnsForAnyArgs(Guid.NewGuid());
sutProvider.GetDependency<IMaxProjectsQuery>().GetByOrgIdAsync(orgId).Returns(((short)3, true)); sutProvider.GetDependency<IMaxProjectsQuery>().GetByOrgIdAsync(orgId, 1).Returns(((short)3, true));
await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.CreateAsync(orgId, data)); await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.CreateAsync(orgId, data));

View File

@ -331,10 +331,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -3014,25 +3015,25 @@
"AspNetCore.HealthChecks.SqlServer": "[6.0.2, )", "AspNetCore.HealthChecks.SqlServer": "[6.0.2, )",
"AspNetCore.HealthChecks.Uris": "[6.0.3, )", "AspNetCore.HealthChecks.Uris": "[6.0.3, )",
"Azure.Messaging.EventGrid": "[4.10.0, )", "Azure.Messaging.EventGrid": "[4.10.0, )",
"Commercial.Core": "[2023.7.2, )", "Commercial.Core": "[2023.9.0, )",
"Commercial.Infrastructure.EntityFramework": "[2023.7.2, )", "Commercial.Infrastructure.EntityFramework": "[2023.9.0, )",
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"SharedWeb": "[2023.7.2, )", "SharedWeb": "[2023.9.0, )",
"Swashbuckle.AspNetCore": "[6.5.0, )" "Swashbuckle.AspNetCore": "[6.5.0, )"
} }
}, },
"commercial.core": { "commercial.core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "[2023.7.2, )" "Core": "[2023.9.0, )"
} }
}, },
"commercial.infrastructure.entityframework": { "commercial.infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Infrastructure.EntityFramework": "[2023.7.2, )" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
}, },
"common": { "common": {
@ -3040,7 +3041,7 @@
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )",
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "[17.1.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "[4.3.0, )", "NSubstitute": "[4.3.0, )",
@ -3059,7 +3060,7 @@
"Azure.Storage.Blobs": "[12.14.1, )", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "[12.12.0, )", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "[1.0.1907, )", "BitPay.Light": "[1.0.1907, )",
"Braintree": "[5.12.0, )", "Braintree": "[5.19.0, )",
"DnsClient": "[1.7.0, )", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "[3.0.1, )", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "[2.1.2, )", "Handlebars.Net": "[2.1.2, )",
@ -3094,8 +3095,8 @@
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )",
"Common": "[2023.7.2, )", "Common": "[2023.9.0, )",
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "[17.1.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "[4.3.0, )", "NSubstitute": "[4.3.0, )",
@ -3105,7 +3106,7 @@
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Dapper": "[2.0.123, )" "Dapper": "[2.0.123, )"
} }
}, },
@ -3113,7 +3114,7 @@
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
@ -3125,9 +3126,9 @@
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "[2023.7.2, )", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "[2023.7.2, )" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -228,10 +228,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2832,90 +2833,90 @@
"billing": { "billing": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"SharedWeb": "2023.7.2" "SharedWeb": "[2023.9.0, )"
} }
}, },
"common": { "common": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "4.17.0", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "4.17.0", "AutoFixture.Xunit2": "[4.17.0, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "17.1.0", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "4.3.0", "NSubstitute": "[4.3.0, )",
"xunit": "2.4.1" "xunit": "[2.4.1, )"
} }
}, },
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -216,10 +216,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2664,43 +2665,43 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
} }
} }

View File

@ -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);
/// <summary>
/// Tests the default constructor behavior when passed a null user.
/// </summary>
[Fact]
public void Constructor_NullUser_PropertiesSetToDefault()
{
var token = new SsoEmail2faSessionTokenable(null);
Assert.Equal(default, token.Id);
Assert.Equal(default, token.Email);
}
/// <summary>
/// Tests that when a valid user is provided to the constructor, the resulting token properties match the user.
/// </summary>
[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);
}
/// <summary>
/// Tests the default expiration behavior immediately after initialization.
/// </summary>
[Fact]
public void Constructor_AfterInitialization_ExpirationSetToExpectedDuration()
{
var token = new SsoEmail2faSessionTokenable();
var expectedExpiration = DateTime.UtcNow + SsoEmail2faSessionTokenable.GetTokenLifetime();
Assert.True(expectedExpiration - token.ExpirationDate < _timeTolerance);
}
/// <summary>
/// Tests that a custom expiration date is preserved after token initialization.
/// </summary>
[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);
}
/// <summary>
/// Tests the validity of a token initialized with a null user.
/// </summary>
[Fact]
public void Valid_NullUser_ReturnsFalse()
{
var token = new SsoEmail2faSessionTokenable(null);
Assert.False(token.Valid);
}
/// <summary>
/// Tests the validity of a token with a non-matching identifier.
/// </summary>
[Theory, AutoData]
public void Valid_WrongIdentifier_ReturnsFalse(User user)
{
var token = new SsoEmail2faSessionTokenable(user)
{
Identifier = "not correct"
};
Assert.False(token.Valid);
}
/// <summary>
/// Tests the token validity when user ID is null.
/// </summary>
[Theory, AutoData]
public void TokenIsValid_NullUserId_ReturnsFalse(User user)
{
user.Id = default; // Guid.Empty
var token = new SsoEmail2faSessionTokenable(user);
Assert.False(token.TokenIsValid(user));
}
/// <summary>
/// Tests the token validity when user's email is null.
/// </summary>
[Theory, AutoData]
public void TokenIsValid_NullEmail_ReturnsFalse(User user)
{
user.Email = null;
var token = new SsoEmail2faSessionTokenable(user);
Assert.False(token.TokenIsValid(user));
}
/// <summary>
/// Tests the token validity when user ID and email match the token properties.
/// </summary>
[Theory, AutoData]
public void TokenIsValid_MatchingUserIdAndEmail_ReturnsTrue(User user)
{
var token = new SsoEmail2faSessionTokenable(user);
Assert.True(token.TokenIsValid(user));
}
/// <summary>
/// Ensures that the token is invalid when the provided user's ID doesn't match the token's ID.
/// </summary>
[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));
}
/// <summary>
/// Ensures that the token is invalid when the provided user's email doesn't match the token's email.
/// </summary>
[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));
}
/// <summary>
/// Tests the deserialization of a token to ensure that the expiration date is preserved.
/// </summary>
[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<SsoEmail2faSessionTokenable>(token.ToToken());
Assert.Equal(expectedDateTime, result.ExpirationDate, precision: _timeTolerance);
}
}

View File

@ -142,15 +142,19 @@ public class AuthRequestServiceTests
} }
[Theory, BitAutoData] [Theory, BitAutoData]
public async Task CreateAuthRequestAsync_NoUser_ThrowsNotFound( public async Task CreateAuthRequestAsync_NoUser_ThrowsBadRequest(
SutProvider<AuthRequestService> sutProvider, SutProvider<AuthRequestService> sutProvider,
AuthRequestCreateRequestModel createModel) AuthRequestCreateRequestModel createModel)
{ {
sutProvider.GetDependency<ICurrentContext>()
.DeviceType
.Returns(DeviceType.Android);
sutProvider.GetDependency<IUserRepository>() sutProvider.GetDependency<IUserRepository>()
.GetByEmailAsync(createModel.Email) .GetByEmailAsync(createModel.Email)
.Returns((User?)null); .Returns((User?)null);
await Assert.ThrowsAsync<NotFoundException>(() => sutProvider.Sut.CreateAuthRequestAsync(createModel)); await Assert.ThrowsAsync<BadRequestException>(() => sutProvider.Sut.CreateAuthRequestAsync(createModel));
} }
[Theory, BitAutoData] [Theory, BitAutoData]
@ -253,7 +257,7 @@ public class AuthRequestServiceTests
/// <summary> /// <summary>
/// Story: If a user happens to exist to more than one organization, we will send the device approval request to /// 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.
/// </summary> /// </summary>
[Theory, BitAutoData] [Theory, BitAutoData]
public async Task CreateAuthRequestAsync_AdminApproval_CreatesForEachOrganization( public async Task CreateAuthRequestAsync_AdminApproval_CreatesForEachOrganization(
@ -627,8 +631,8 @@ public class AuthRequestServiceTests
} }
/// <summary> /// <summary>
/// Story: An admin approves a request for one of their org users. For auditing purposes we 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 /// 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. /// push the notification to the user.
/// </summary> /// </summary>
[Theory, BitAutoData] [Theory, BitAutoData]

View File

@ -10,6 +10,7 @@ using Bit.Core.Models.Data;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture;
using Bit.Test.Common.AutoFixture.Attributes; using Bit.Test.Common.AutoFixture.Attributes;
using Microsoft.AspNetCore.DataProtection;
namespace Bit.Core.Test.AutoFixture.OrganizationFixtures; namespace Bit.Core.Test.AutoFixture.OrganizationFixtures;
@ -187,3 +188,31 @@ internal class SecretsManagerOrganizationCustomizeAttribute : BitCustomizeAttrib
public override ICustomization GetCustomization() => public override ICustomization GetCustomization() =>
new SecretsManagerOrganizationCustomization(); 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())
{ }
}

View File

@ -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<Guid> groupIds,
SutProvider<UpdateOrganizationUserGroupsCommand> sutProvider)
{
await sutProvider.Sut.UpdateUserGroupsAsync(organizationUser, groupIds, null);
await sutProvider.GetDependency<IOrganizationService>().DidNotReceiveWithAnyArgs()
.ValidateOrganizationUserUpdatePermissions(default, default, default, default);
await sutProvider.GetDependency<IOrganizationUserRepository>().Received(1)
.UpdateGroupsAsync(organizationUser.Id, groupIds);
await sutProvider.GetDependency<IEventService>().Received(1)
.LogOrganizationUserEventAsync(organizationUser, EventType.OrganizationUser_UpdatedGroups);
}
[Theory, BitAutoData]
public async Task UpdateUserGroups_WithSavingUserId_Passes(
OrganizationUser organizationUser,
IEnumerable<Guid> groupIds,
Guid savingUserId,
SutProvider<UpdateOrganizationUserGroupsCommand> sutProvider)
{
organizationUser.Permissions = null;
await sutProvider.Sut.UpdateUserGroupsAsync(organizationUser, groupIds, savingUserId);
await sutProvider.GetDependency<IOrganizationService>().Received(1)
.ValidateOrganizationUserUpdatePermissions(organizationUser.OrganizationId, organizationUser.Type, null, organizationUser.GetPermissions());
await sutProvider.GetDependency<IOrganizationUserRepository>().Received(1)
.UpdateGroupsAsync(organizationUser.Id, groupIds);
await sutProvider.GetDependency<IEventService>().Received(1)
.LogOrganizationUserEventAsync(organizationUser, EventType.OrganizationUser_UpdatedGroups);
}
}

View File

@ -20,14 +20,6 @@ public class LaunchDarklyFeatureServiceTests
.Create(); .Create();
} }
[Fact]
public void Offline_WhenSelfHost()
{
var sutProvider = GetSutProvider(new Core.Settings.GlobalSettings() { SelfHosted = true });
Assert.False(sutProvider.Sut.IsOnline());
}
[Theory, BitAutoData] [Theory, BitAutoData]
public void DefaultFeatureValue_WhenSelfHost(string key) public void DefaultFeatureValue_WhenSelfHost(string key)
{ {

View File

@ -28,6 +28,7 @@ using Bit.Core.Tools.Services;
using Bit.Core.Utilities; using Bit.Core.Utilities;
using Bit.Test.Common.AutoFixture; using Bit.Test.Common.AutoFixture;
using Bit.Test.Common.AutoFixture.Attributes; using Bit.Test.Common.AutoFixture.Attributes;
using Microsoft.AspNetCore.DataProtection;
using NSubstitute; using NSubstitute;
using NSubstitute.ExceptionExtensions; using NSubstitute.ExceptionExtensions;
using Xunit; using Xunit;
@ -658,11 +659,10 @@ public class OrganizationServiceTests
await sutProvider.GetDependency<IEventService>().Received(1).LogOrganizationUserEventsAsync(Arg.Any<IEnumerable<(OrganizationUser, EventType, EventSystemUser, DateTime?)>>()); await sutProvider.GetDependency<IEventService>().Received(1).LogOrganizationUserEventsAsync(Arg.Any<IEnumerable<(OrganizationUser, EventType, EventSystemUser, DateTime?)>>());
} }
[Theory, BitAutoData] [Theory, BitAutoData, OrganizationInviteCustomize]
public async Task InviteUser_WithSecretsManager_Passes(Organization organization, public async Task InviteUser_WithSecretsManager_Passes(Organization organization,
IEnumerable<(OrganizationUserInvite invite, string externalId)> invites, IEnumerable<(OrganizationUserInvite invite, string externalId)> invites,
[OrganizationUser(type: OrganizationUserType.Owner, status: OrganizationUserStatusType.Confirmed)] OrganizationUser savingUser, OrganizationUser savingUser, SutProvider<OrganizationService> sutProvider)
SutProvider<OrganizationService> sutProvider)
{ {
organization.PlanType = PlanType.EnterpriseAnnually; organization.PlanType = PlanType.EnterpriseAnnually;
InviteUserHelper_ArrangeValidPermissions(organization, savingUser, sutProvider); InviteUserHelper_ArrangeValidPermissions(organization, savingUser, sutProvider);
@ -670,6 +670,10 @@ public class OrganizationServiceTests
// Set up some invites to grant access to SM // Set up some invites to grant access to SM
invites.First().invite.AccessSecretsManager = true; invites.First().invite.AccessSecretsManager = true;
var invitedSmUsers = invites.First().invite.Emails.Count(); 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 // Assume we need to add seats for all invited SM users
sutProvider.GetDependency<ICountNewSmSeatsRequiredQuery>() sutProvider.GetDependency<ICountNewSmSeatsRequiredQuery>()
@ -685,11 +689,10 @@ public class OrganizationServiceTests
!update.MaxAutoscaleSmSeatsChanged)); !update.MaxAutoscaleSmSeatsChanged));
} }
[Theory, BitAutoData] [Theory, BitAutoData, OrganizationInviteCustomize]
public async Task InviteUser_WithSecretsManager_WhenErrorIsThrown_RevertsAutoscaling(Organization organization, public async Task InviteUser_WithSecretsManager_WhenErrorIsThrown_RevertsAutoscaling(Organization organization,
IEnumerable<(OrganizationUserInvite invite, string externalId)> invites, IEnumerable<(OrganizationUserInvite invite, string externalId)> invites,
[OrganizationUser(type: OrganizationUserType.Owner, status: OrganizationUserStatusType.Confirmed)] OrganizationUser savingUser, OrganizationUser savingUser, SutProvider<OrganizationService> sutProvider)
SutProvider<OrganizationService> sutProvider)
{ {
var initialSmSeats = organization.SmSeats; var initialSmSeats = organization.SmSeats;
InviteUserHelper_ArrangeValidPermissions(organization, savingUser, sutProvider); InviteUserHelper_ArrangeValidPermissions(organization, savingUser, sutProvider);
@ -697,6 +700,10 @@ public class OrganizationServiceTests
// Set up some invites to grant access to SM // Set up some invites to grant access to SM
invites.First().invite.AccessSecretsManager = true; invites.First().invite.AccessSecretsManager = true;
var invitedSmUsers = invites.First().invite.Emails.Count(); 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 // Assume we need to add seats for all invited SM users
sutProvider.GetDependency<ICountNewSmSeatsRequiredQuery>() sutProvider.GetDependency<ICountNewSmSeatsRequiredQuery>()
@ -741,13 +748,9 @@ public class OrganizationServiceTests
private void InviteUserHelper_ArrangeValidPermissions(Organization organization, OrganizationUser savingUser, private void InviteUserHelper_ArrangeValidPermissions(Organization organization, OrganizationUser savingUser,
SutProvider<OrganizationService> sutProvider) SutProvider<OrganizationService> sutProvider)
{ {
savingUser.OrganizationId = organization.Id;
organization.UseCustomPermissions = true;
sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organization.Id).Returns(organization); sutProvider.GetDependency<IOrganizationRepository>().GetByIdAsync(organization.Id).Returns(organization);
sutProvider.GetDependency<ICurrentContext>().OrganizationOwner(organization.Id).Returns(true); sutProvider.GetDependency<ICurrentContext>().OrganizationOwner(organization.Id).Returns(true);
sutProvider.GetDependency<ICurrentContext>().ManageUsers(organization.Id).Returns(true); sutProvider.GetDependency<ICurrentContext>().ManageUsers(organization.Id).Returns(true);
sutProvider.GetDependency<IOrganizationUserRepository>().GetManyByOrganizationAsync(savingUser.OrganizationId, OrganizationUserType.Owner)
.Returns(new List<OrganizationUser> { savingUser });
} }
[Theory, BitAutoData] [Theory, BitAutoData]
@ -1848,4 +1851,110 @@ public class OrganizationServiceTests
sutProvider.Sut.ValidateSecretsManagerPlan(plan, signup); sutProvider.Sut.ValidateSecretsManagerPlan(plan, signup);
} }
[Theory]
[EphemeralDataProtectionAutoData]
public async Task AcceptUserAsync_Success([OrganizationUser(OrganizationUserStatusType.Invited)] OrganizationUser organizationUser,
User user, SutProvider<OrganizationService> sutProvider)
{
var token = SetupAcceptUserAsyncTest(sutProvider, user, organizationUser);
var userService = Substitute.For<IUserService>();
await sutProvider.Sut.AcceptUserAsync(organizationUser.Id, user, token, userService);
await sutProvider.GetDependency<IOrganizationUserRepository>().Received(1).ReplaceAsync(
Arg.Is<OrganizationUser>(ou => ou.Id == organizationUser.Id && ou.Status == OrganizationUserStatusType.Accepted));
await sutProvider.GetDependency<IUserRepository>().Received(1).ReplaceAsync(
Arg.Is<User>(u => u.Id == user.Id && u.Email == user.Email && user.EmailVerified == true));
}
private string SetupAcceptUserAsyncTest(SutProvider<OrganizationService> sutProvider, User user,
OrganizationUser organizationUser)
{
user.Email = organizationUser.Email;
user.EmailVerified = false;
var dataProtector = sutProvider.GetDependency<IDataProtectionProvider>()
.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<IGlobalSettings>().OrganizationInviteExpirationHours.Returns(24);
sutProvider.GetDependency<IOrganizationUserRepository>().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<OrganizationService> sutProvider)
{
var exception = await Assert.ThrowsAsync<BadRequestException>(
() => 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<OrganizationService> sutProvider)
{
var exception = await Assert.ThrowsAsync<BadRequestException>(
() => 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<OrganizationService> sutProvider)
{
sutProvider.GetDependency<ICurrentContext>().ManageUsers(organizationId).Returns(true);
var exception = await Assert.ThrowsAsync<BadRequestException>(
() => 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<OrganizationService> sutProvider)
{
var invitePermissions = new Permissions { AccessReports = true };
sutProvider.GetDependency<ICurrentContext>().ManageUsers(organizationId).Returns(true);
sutProvider.GetDependency<ICurrentContext>().AccessReports(organizationId).Returns(false);
var exception = await Assert.ThrowsAsync<BadRequestException>(
() => 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());
}
} }

View File

@ -222,10 +222,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2672,7 +2673,7 @@
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )",
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "[17.1.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "[4.3.0, )", "NSubstitute": "[4.3.0, )",
@ -2691,7 +2692,7 @@
"Azure.Storage.Blobs": "[12.14.1, )", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "[12.12.0, )", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "[1.0.1907, )", "BitPay.Light": "[1.0.1907, )",
"Braintree": "[5.12.0, )", "Braintree": "[5.19.0, )",
"DnsClient": "[1.7.0, )", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "[3.0.1, )", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "[2.1.2, )", "Handlebars.Net": "[2.1.2, )",

View File

@ -235,10 +235,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2841,7 +2842,7 @@
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )",
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "[17.1.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "[4.3.0, )", "NSubstitute": "[4.3.0, )",
@ -2851,79 +2852,79 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"icons": { "icons": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AngleSharp": "1.0.4", "AngleSharp": "[1.0.4, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"SharedWeb": "2023.7.2" "SharedWeb": "[2023.9.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -239,10 +239,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2986,101 +2987,101 @@
"common": { "common": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "4.17.0", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "4.17.0", "AutoFixture.Xunit2": "[4.17.0, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "17.1.0", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "4.3.0", "NSubstitute": "[4.3.0, )",
"xunit": "2.4.1" "xunit": "[2.4.1, )"
} }
}, },
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"identity": { "identity": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"SharedWeb": "2023.7.2", "SharedWeb": "[2023.9.0, )",
"Swashbuckle.AspNetCore.SwaggerGen": "6.5.0" "Swashbuckle.AspNetCore.SwaggerGen": "[6.5.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"integrationtestcommon": { "integrationtestcommon": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Common": "2023.7.2", "Common": "[2023.9.0, )",
"Identity": "2023.7.2", "Identity": "[2023.9.0, )",
"Microsoft.AspNetCore.Mvc.Testing": "6.0.5", "Microsoft.AspNetCore.Mvc.Testing": "[6.0.5, )",
"Microsoft.EntityFrameworkCore.InMemory": "7.0.5", "Microsoft.EntityFrameworkCore.InMemory": "[7.0.5, )",
"Microsoft.Extensions.Configuration": "6.0.1" "Microsoft.Extensions.Configuration": "[6.0.1, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -228,10 +228,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2853,91 +2854,91 @@
"common": { "common": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "4.17.0", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "4.17.0", "AutoFixture.Xunit2": "[4.17.0, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "17.1.0", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "4.3.0", "NSubstitute": "[4.3.0, )",
"xunit": "2.4.1" "xunit": "[2.4.1, )"
} }
}, },
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"identity": { "identity": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"SharedWeb": "2023.7.2", "SharedWeb": "[2023.9.0, )",
"Swashbuckle.AspNetCore.SwaggerGen": "6.5.0" "Swashbuckle.AspNetCore.SwaggerGen": "[6.5.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -229,10 +229,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2835,7 +2836,7 @@
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )",
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "[17.1.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "[4.3.0, )", "NSubstitute": "[4.3.0, )",
@ -2854,7 +2855,7 @@
"Azure.Storage.Blobs": "[12.14.1, )", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "[12.12.0, )", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "[1.0.1907, )", "BitPay.Light": "[1.0.1907, )",
"Braintree": "[5.12.0, )", "Braintree": "[5.19.0, )",
"DnsClient": "[1.7.0, )", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "[3.0.1, )", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "[2.1.2, )", "Handlebars.Net": "[2.1.2, )",
@ -2889,8 +2890,8 @@
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "[4.17.0, )", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "[4.17.0, )", "AutoFixture.Xunit2": "[4.17.0, )",
"Common": "[2023.7.2, )", "Common": "[2023.9.0, )",
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "[17.1.0, )", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "[4.3.0, )", "NSubstitute": "[4.3.0, )",
@ -2900,7 +2901,7 @@
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Dapper": "[2.0.123, )" "Dapper": "[2.0.123, )"
} }
}, },
@ -2908,7 +2909,7 @@
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "[2023.7.2, )", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",

View File

@ -228,10 +228,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2703,63 +2704,63 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
} }
} }

View File

@ -215,10 +215,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2972,91 +2973,91 @@
"common": { "common": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoFixture.AutoNSubstitute": "4.17.0", "AutoFixture.AutoNSubstitute": "[4.17.0, )",
"AutoFixture.Xunit2": "4.17.0", "AutoFixture.Xunit2": "[4.17.0, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Kralizek.AutoFixture.Extensions.MockHttp": "1.2.0", "Kralizek.AutoFixture.Extensions.MockHttp": "[1.2.0, )",
"Microsoft.NET.Test.Sdk": "17.1.0", "Microsoft.NET.Test.Sdk": "[17.1.0, )",
"NSubstitute": "4.3.0", "NSubstitute": "[4.3.0, )",
"xunit": "2.4.1" "xunit": "[2.4.1, )"
} }
}, },
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"identity": { "identity": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"SharedWeb": "2023.7.2", "SharedWeb": "[2023.9.0, )",
"Swashbuckle.AspNetCore.SwaggerGen": "6.5.0" "Swashbuckle.AspNetCore.SwaggerGen": "[6.5.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

View File

@ -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 IF COL_LENGTH('[dbo].[ApiKey]', 'ClientSecretHash') IS NOT NULL AND COL_LENGTH('[dbo].[ApiKey]', 'ClientSecret') IS NOT NULL
BEGIN 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 -- Data Migration
DECLARE @BatchSize INT = 10000 DECLARE @BatchSize INT = 10000
WHILE @BatchSize > 0 WHILE @BatchSize > 0
@ -34,9 +26,5 @@ BEGIN
COMMIT TRANSACTION Migrate_ClientSecretHash COMMIT TRANSACTION Migrate_ClientSecretHash
END END
-- Drop index
DROP INDEX IF EXISTS [IX_ApiKey_ClientSecretHash]
ON [dbo].[ApiKey];
END END
GO GO

View File

@ -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

View File

@ -165,10 +165,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2628,43 +2629,43 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
} }
} }

View File

@ -168,10 +168,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2657,51 +2658,51 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"migrator": { "migrator": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.Extensions.Logging": "6.0.0", "Microsoft.Extensions.Logging": "[6.0.0, )",
"dbup-sqlserver": "5.0.8" "dbup-sqlserver": "[5.0.8, )"
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,63 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.MySqlMigrations.Migrations;
/// <inheritdoc />
public partial class ACCESSPOLICY_ADD_DELETE_CASCADE : Migration
{
/// <inheritdoc />
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);
}
/// <inheritdoc />
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");
}
}

View File

@ -2072,11 +2072,13 @@ namespace Bit.MySqlMigrations.Migrations
{ {
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject")
.WithMany("GroupAccessPolicies") .WithMany("GroupAccessPolicies")
.HasForeignKey("GrantedProjectId"); .HasForeignKey("GrantedProjectId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group")
.WithMany() .WithMany()
.HasForeignKey("GroupId"); .HasForeignKey("GroupId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("GrantedProject"); b.Navigation("GrantedProject");
@ -2091,7 +2093,8 @@ namespace Bit.MySqlMigrations.Migrations
b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group")
.WithMany() .WithMany()
.HasForeignKey("GroupId"); .HasForeignKey("GroupId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("GrantedServiceAccount"); b.Navigation("GrantedServiceAccount");
@ -2102,7 +2105,8 @@ namespace Bit.MySqlMigrations.Migrations
{ {
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject")
.WithMany("ServiceAccountAccessPolicies") .WithMany("ServiceAccountAccessPolicies")
.HasForeignKey("GrantedProjectId"); .HasForeignKey("GrantedProjectId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount") b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount")
.WithMany() .WithMany()
@ -2117,7 +2121,8 @@ namespace Bit.MySqlMigrations.Migrations
{ {
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject")
.WithMany("UserAccessPolicies") .WithMany("UserAccessPolicies")
.HasForeignKey("GrantedProjectId"); .HasForeignKey("GrantedProjectId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser")
.WithMany() .WithMany()

View File

@ -170,10 +170,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2613,56 +2614,56 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,63 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations;
/// <inheritdoc />
public partial class ACCESSPOLICY_ADD_DELETE_CASCADE : Migration
{
/// <inheritdoc />
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);
}
/// <inheritdoc />
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");
}
}

View File

@ -2083,11 +2083,13 @@ namespace Bit.PostgresMigrations.Migrations
{ {
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject")
.WithMany("GroupAccessPolicies") .WithMany("GroupAccessPolicies")
.HasForeignKey("GrantedProjectId"); .HasForeignKey("GrantedProjectId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group")
.WithMany() .WithMany()
.HasForeignKey("GroupId"); .HasForeignKey("GroupId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("GrantedProject"); b.Navigation("GrantedProject");
@ -2102,7 +2104,8 @@ namespace Bit.PostgresMigrations.Migrations
b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group") b.HasOne("Bit.Infrastructure.EntityFramework.Models.Group", "Group")
.WithMany() .WithMany()
.HasForeignKey("GroupId"); .HasForeignKey("GroupId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("GrantedServiceAccount"); b.Navigation("GrantedServiceAccount");
@ -2113,7 +2116,8 @@ namespace Bit.PostgresMigrations.Migrations
{ {
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject")
.WithMany("ServiceAccountAccessPolicies") .WithMany("ServiceAccountAccessPolicies")
.HasForeignKey("GrantedProjectId"); .HasForeignKey("GrantedProjectId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount") b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.ServiceAccount", "ServiceAccount")
.WithMany() .WithMany()
@ -2128,7 +2132,8 @@ namespace Bit.PostgresMigrations.Migrations
{ {
b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject") b.HasOne("Bit.Infrastructure.EntityFramework.SecretsManager.Models.Project", "GrantedProject")
.WithMany("UserAccessPolicies") .WithMany("UserAccessPolicies")
.HasForeignKey("GrantedProjectId"); .HasForeignKey("GrantedProjectId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser") b.HasOne("Bit.Infrastructure.EntityFramework.Models.OrganizationUser", "OrganizationUser")
.WithMany() .WithMany()

View File

@ -170,10 +170,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2613,56 +2614,56 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
} }
} }

View File

@ -169,10 +169,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2634,51 +2635,51 @@
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"migrator": { "migrator": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.Extensions.Logging": "6.0.0", "Microsoft.Extensions.Logging": "[6.0.0, )",
"dbup-sqlserver": "5.0.8" "dbup-sqlserver": "[5.0.8, )"
} }
} }
} }

View File

@ -273,10 +273,11 @@
}, },
"Braintree": { "Braintree": {
"type": "Transitive", "type": "Transitive",
"resolved": "5.12.0", "resolved": "5.19.0",
"contentHash": "bV2tsVIvBQeKwULT4qPZUWhxSr8mFwyAAcvLDvDpCU0cMYPHzGSahha+ghUdgGMb317BqL34/Od59n2s3MkhOQ==", "contentHash": "B60wIX54g78nMsy5cJkvSfqs1VasYDXWFZQW0cUQ4QeW8Y5jPyBSaoxHwKC806lXUDaKC8kr5Y7Q6EdsBkPANQ==",
"dependencies": { "dependencies": {
"Newtonsoft.Json": "9.0.1", "Microsoft.CSharp": "4.7.0",
"Newtonsoft.Json": "13.0.1",
"System.Xml.XPath.XmlDocument": "4.3.0" "System.Xml.XPath.XmlDocument": "4.3.0"
} }
}, },
@ -2792,103 +2793,103 @@
"api": { "api": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AspNetCore.HealthChecks.AzureServiceBus": "6.1.0", "AspNetCore.HealthChecks.AzureServiceBus": "[6.1.0, )",
"AspNetCore.HealthChecks.AzureStorage": "6.1.2", "AspNetCore.HealthChecks.AzureStorage": "[6.1.2, )",
"AspNetCore.HealthChecks.Network": "6.0.4", "AspNetCore.HealthChecks.Network": "[6.0.4, )",
"AspNetCore.HealthChecks.Redis": "6.0.4", "AspNetCore.HealthChecks.Redis": "[6.0.4, )",
"AspNetCore.HealthChecks.SendGrid": "6.0.2", "AspNetCore.HealthChecks.SendGrid": "[6.0.2, )",
"AspNetCore.HealthChecks.SqlServer": "6.0.2", "AspNetCore.HealthChecks.SqlServer": "[6.0.2, )",
"AspNetCore.HealthChecks.Uris": "6.0.3", "AspNetCore.HealthChecks.Uris": "[6.0.3, )",
"Azure.Messaging.EventGrid": "4.10.0", "Azure.Messaging.EventGrid": "[4.10.0, )",
"Commercial.Core": "2023.7.2", "Commercial.Core": "[2023.9.0, )",
"Commercial.Infrastructure.EntityFramework": "2023.7.2", "Commercial.Infrastructure.EntityFramework": "[2023.9.0, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"SharedWeb": "2023.7.2", "SharedWeb": "[2023.9.0, )",
"Swashbuckle.AspNetCore": "6.5.0" "Swashbuckle.AspNetCore": "[6.5.0, )"
} }
}, },
"commercial.core": { "commercial.core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2" "Core": "[2023.9.0, )"
} }
}, },
"commercial.infrastructure.entityframework": { "commercial.infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
}, },
"core": { "core": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AWSSDK.SQS": "3.7.2.47", "AWSSDK.SQS": "[3.7.2.47, )",
"AWSSDK.SimpleEmail": "3.7.0.150", "AWSSDK.SimpleEmail": "[3.7.0.150, )",
"AspNetCoreRateLimit": "4.0.2", "AspNetCoreRateLimit": "[4.0.2, )",
"AspNetCoreRateLimit.Redis": "1.0.1", "AspNetCoreRateLimit.Redis": "[1.0.1, )",
"Azure.Extensions.AspNetCore.DataProtection.Blobs": "1.3.2", "Azure.Extensions.AspNetCore.DataProtection.Blobs": "[1.3.2, )",
"Azure.Messaging.ServiceBus": "7.15.0", "Azure.Messaging.ServiceBus": "[7.15.0, )",
"Azure.Storage.Blobs": "12.14.1", "Azure.Storage.Blobs": "[12.14.1, )",
"Azure.Storage.Queues": "12.12.0", "Azure.Storage.Queues": "[12.12.0, )",
"BitPay.Light": "1.0.1907", "BitPay.Light": "[1.0.1907, )",
"Braintree": "5.12.0", "Braintree": "[5.19.0, )",
"DnsClient": "1.7.0", "DnsClient": "[1.7.0, )",
"Fido2.AspNet": "3.0.1", "Fido2.AspNet": "[3.0.1, )",
"Handlebars.Net": "2.1.2", "Handlebars.Net": "[2.1.2, )",
"IdentityServer4": "4.1.2", "IdentityServer4": "[4.1.2, )",
"IdentityServer4.AccessTokenValidation": "3.0.1", "IdentityServer4.AccessTokenValidation": "[3.0.1, )",
"LaunchDarkly.ServerSdk": "7.0.0", "LaunchDarkly.ServerSdk": "[7.0.0, )",
"MailKit": "3.2.0", "MailKit": "[3.2.0, )",
"Microsoft.AspNetCore.Authentication.JwtBearer": "6.0.4", "Microsoft.AspNetCore.Authentication.JwtBearer": "[6.0.4, )",
"Microsoft.Azure.Cosmos.Table": "1.0.8", "Microsoft.Azure.Cosmos.Table": "[1.0.8, )",
"Microsoft.Azure.NotificationHubs": "4.1.0", "Microsoft.Azure.NotificationHubs": "[4.1.0, )",
"Microsoft.Data.SqlClient": "5.0.1", "Microsoft.Data.SqlClient": "[5.0.1, )",
"Microsoft.Extensions.Caching.StackExchangeRedis": "6.0.6", "Microsoft.Extensions.Caching.StackExchangeRedis": "[6.0.6, )",
"Microsoft.Extensions.Configuration.EnvironmentVariables": "6.0.1", "Microsoft.Extensions.Configuration.EnvironmentVariables": "[6.0.1, )",
"Microsoft.Extensions.Configuration.UserSecrets": "6.0.1", "Microsoft.Extensions.Configuration.UserSecrets": "[6.0.1, )",
"Microsoft.Extensions.Identity.Stores": "6.0.4", "Microsoft.Extensions.Identity.Stores": "[6.0.4, )",
"Newtonsoft.Json": "13.0.1", "Newtonsoft.Json": "[13.0.1, )",
"Otp.NET": "1.2.2", "Otp.NET": "[1.2.2, )",
"Quartz": "3.4.0", "Quartz": "[3.4.0, )",
"SendGrid": "9.27.0", "SendGrid": "[9.27.0, )",
"Sentry.Serilog": "3.16.0", "Sentry.Serilog": "[3.16.0, )",
"Serilog.AspNetCore": "5.0.0", "Serilog.AspNetCore": "[5.0.0, )",
"Serilog.Extensions.Logging": "3.1.0", "Serilog.Extensions.Logging": "[3.1.0, )",
"Serilog.Extensions.Logging.File": "2.0.0", "Serilog.Extensions.Logging.File": "[2.0.0, )",
"Serilog.Sinks.AzureCosmosDB": "2.0.0", "Serilog.Sinks.AzureCosmosDB": "[2.0.0, )",
"Serilog.Sinks.SyslogMessages": "2.0.6", "Serilog.Sinks.SyslogMessages": "[2.0.6, )",
"Stripe.net": "40.0.0", "Stripe.net": "[40.0.0, )",
"YubicoDotNetClient": "1.2.0" "YubicoDotNetClient": "[1.2.0, )"
} }
}, },
"infrastructure.dapper": { "infrastructure.dapper": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Dapper": "2.0.123" "Dapper": "[2.0.123, )"
} }
}, },
"infrastructure.entityframework": { "infrastructure.entityframework": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"AutoMapper.Extensions.Microsoft.DependencyInjection": "12.0.1", "AutoMapper.Extensions.Microsoft.DependencyInjection": "[12.0.1, )",
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Microsoft.EntityFrameworkCore.Relational": "7.0.5", "Microsoft.EntityFrameworkCore.Relational": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.SqlServer": "7.0.5", "Microsoft.EntityFrameworkCore.SqlServer": "[7.0.5, )",
"Microsoft.EntityFrameworkCore.Sqlite": "7.0.5", "Microsoft.EntityFrameworkCore.Sqlite": "[7.0.5, )",
"Npgsql.EntityFrameworkCore.PostgreSQL": "7.0.4", "Npgsql.EntityFrameworkCore.PostgreSQL": "[7.0.4, )",
"Pomelo.EntityFrameworkCore.MySql": "7.0.0", "Pomelo.EntityFrameworkCore.MySql": "[7.0.0, )",
"linq2db.EntityFrameworkCore": "7.5.0" "linq2db.EntityFrameworkCore": "[7.5.0, )"
} }
}, },
"sharedweb": { "sharedweb": {
"type": "Project", "type": "Project",
"dependencies": { "dependencies": {
"Core": "2023.7.2", "Core": "[2023.9.0, )",
"Infrastructure.Dapper": "2023.7.2", "Infrastructure.Dapper": "[2023.9.0, )",
"Infrastructure.EntityFramework": "2023.7.2" "Infrastructure.EntityFramework": "[2023.9.0, )"
} }
} }
} }

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