Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
418dbb3
SDK integration in db seeder
Hinton Jul 1, 2025
072f9f2
Add hash password
Hinton Jul 28, 2025
75f11f6
Generate valid keys using rust
Hinton Jul 31, 2025
3132e09
Wire up crypto logic for sharing org key
Hinton Jul 31, 2025
3ad3081
Speed up KDF
Hinton Jul 31, 2025
9900a74
Use pre-generated RSA key
Hinton Aug 1, 2025
fa46919
Initial PoC of seeder API
Hinton Oct 7, 2025
d0d6bfb
Extract logic into service
Hinton Oct 7, 2025
2b340b7
Reformat
Hinton Oct 7, 2025
79f5d8f
Add support for destroying seeded data
Hinton Oct 7, 2025
92f2555
Refactor to track entities rather than manually writing destroy
Hinton Oct 7, 2025
185fbd0
Merge branch 'main' of github.com:bitwarden/server into arch/seeder-sdk
Hinton Oct 9, 2025
12ad758
Add dedicated functions instead of updating existing
Hinton Oct 9, 2025
4192b08
Configure csproj to build rust
Hinton Oct 9, 2025
f4342e2
Add SingleUserRecipe for seeding a single known user
MGibson1 Oct 9, 2025
d93cd50
Fix launch settings
MGibson1 Oct 9, 2025
5784d74
Add workaround for generated code
Hinton Oct 9, 2025
9a9c991
Undo changes to program.cs
Hinton Oct 9, 2025
fdd7cd0
Change the paths to wildcard to avoid errors on other platforms
Hinton Oct 9, 2025
431a708
Delete all seeded data
MGibson1 Oct 9, 2025
44aef68
Merge branch 'arch/seeder-sdk' of github.com:bitwarden/server into arโ€ฆ
Hinton Oct 9, 2025
3d863c0
Fixup device table user FK cascade
MGibson1 Oct 9, 2025
9c4c88f
Wire up SDK
Hinton Oct 10, 2025
13d666a
Fixup user mangling
MGibson1 Oct 10, 2025
ec82894
Prefer Repositories for Delete of entities
MGibson1 Oct 10, 2025
a7340c9
Add delete batch for playwright worker cleanup
MGibson1 Oct 10, 2025
fac2804
Force ef
Hinton Oct 10, 2025
99fb70a
use named parameters
MGibson1 Oct 10, 2025
45ba8f8
Add support for setting email verified and premium in seed
Hinton Oct 10, 2025
1137857
Add recipe for getting emergency access invites
Hinton Oct 11, 2025
6be734b
Get rid of some newlines
Hinton Oct 13, 2025
638a6be
Update SDK
Hinton Oct 13, 2025
7135fb1
Merge branch 'main' of github.com:bitwarden/server into arch/seeder-sdk
Hinton Oct 13, 2025
39cdb65
Add cargo as enabled manager in renovate
Hinton Oct 16, 2025
bb226ff
Delete Sdk2
Hinton Oct 16, 2025
91badfb
Remove Sdk2
Hinton Oct 16, 2025
685ee37
Add cargo to renovate
Hinton Oct 16, 2025
58c620e
Merge branch 'arch/seeder-sdk' of github.com:bitwarden/server into arโ€ฆ
Hinton Oct 16, 2025
b9dcac4
Initial cleanup
Hinton Oct 16, 2025
f6fe7a9
Change to primary constructor
Hinton Oct 16, 2025
fd41332
Refactor recipies into scenes
Hinton Oct 17, 2025
1daf9ad
Add queries, rename seed to scene
Hinton Oct 18, 2025
9231ae3
Split Scene and Query
Hinton Oct 20, 2025
16ee5cf
Merge branch 'main' of github.com:bitwarden/server into arch/seeder-api
Hinton Oct 21, 2025
878b78b
Stricter scene and query types
MGibson1 Oct 29, 2025
2d50d05
Rename service file to service name
MGibson1 Oct 30, 2025
3f22adc
Split scene service and query service
MGibson1 Oct 30, 2025
e96e70c
Create PlayData table and services
MGibson1 Nov 5, 2025
0b22af5
Merge remote-tracking branch 'origin/main' into arch/seeder-api
MGibson1 Nov 5, 2025
f211673
Use a header to track seeded data. This has benefits client side in sโ€ฆ
MGibson1 Nov 11, 2025
5b67c9f
Fix format
Hinton Nov 13, 2025
840307f
Document queries and scenes
Hinton Nov 13, 2025
dff45c1
Add documentation
Hinton Nov 13, 2025
d9b5ab2
Fix tests
Hinton Nov 14, 2025
fcdbfcb
Move delete many complexity to service
Hinton Nov 14, 2025
076397d
Revert "Fixup device table user FK cascade"
Hinton Nov 14, 2025
d9134d2
Fix lint
Hinton Nov 14, 2025
14044ff
Inject playId services in tests and don't fail if it's not found
MGibson1 Nov 17, 2025
1ebfac1
fixup seededData vs playData migrations
MGibson1 Nov 17, 2025
d6eaafb
recreate ef migrations
MGibson1 Nov 18, 2025
439bf37
use DI to determine whether to track play Ids
MGibson1 Nov 18, 2025
ccc89e7
differentially inject playId middleware
MGibson1 Nov 18, 2025
54e4c7e
fixup playIdService dependencies
MGibson1 Nov 18, 2025
ac036ef
Provide playIdService to seeder
MGibson1 Nov 18, 2025
620830b
fixup routing and sdk links
MGibson1 Nov 18, 2025
58afdd5
Use test sqlite database
MGibson1 Nov 18, 2025
833e181
Address pr feedback
MGibson1 Nov 18, 2025
811a234
Remove force ef setting
MGibson1 Nov 19, 2025
1e7e3db
Prefer startup pattern to program pattern
MGibson1 Nov 20, 2025
2e3b015
Fix mocking in PlayIdServiceTests
Hinton Nov 21, 2025
424e2b4
Merge branch 'main' into arch/seeder-api
Hinton Nov 27, 2025
688f156
Fix breaking change
Hinton Nov 27, 2025
6a26d7a
Add SutProviderCustomize
Hinton Nov 27, 2025
a187f2b
Specify working dir for build tasks
MGibson1 Dec 2, 2025
533153f
include specific rust toolchain, matching bitwarden sdk
MGibson1 Dec 2, 2025
80d8331
Include http context in tests
MGibson1 Dec 2, 2025
b314c0d
Fixup singleton tests
MGibson1 Dec 2, 2025
ee848ca
Log content
Hinton Dec 3, 2025
487f8b3
log output
Hinton Dec 3, 2025
e1b242d
Log correct value
Hinton Dec 3, 2025
ecfe6ec
Fix SDK requiring two builds
Hinton Dec 4, 2025
7039eb5
Revert printing
Hinton Dec 4, 2025
46f1478
Merge branch 'main' of github.com:bitwarden/server into arch/seeder-api
Hinton Dec 16, 2025
1f6300c
Remove changes to build workflow
Hinton Dec 16, 2025
24a1967
Resolve some comments
Hinton Dec 16, 2025
222cead
Document repositories
Hinton Dec 16, 2025
43cf416
Some more docs
Hinton Dec 16, 2025
f22e3fe
Add README.
Hinton Dec 18, 2025
742f77d
Resolve some comments
Hinton Dec 18, 2025
afce475
Add async suffix to remaining methods
Hinton Dec 18, 2025
ba879fd
Resolve review feedback
Hinton Dec 19, 2025
d9ddd34
Format
Hinton Dec 19, 2025
44b107d
Refactor to CQRS
Hinton Dec 19, 2025
e92d13d
Merge branch 'main' of github.com:bitwarden/server into arch/seeder-api
Hinton Jan 8, 2026
02e32f8
Move services into their own files
Hinton Jan 8, 2026
871e55b
fmt
Hinton Jan 8, 2026
8ab09a4
Extract TestTracking
Hinton Jan 8, 2026
2669253
Extract playid tracking from database repositories
Hinton Jan 8, 2026
814612c
Rename PlayData -> PlayItem
MGibson1 Jan 8, 2026
0f4f36d
Merge remote-tracking branch 'origin/main' into arch/seeder-api
MGibson1 Jan 8, 2026
2b0f7df
Remove EF migration so that it can be added to the end of the migratiโ€ฆ
MGibson1 Jan 8, 2026
4c76762
Re-add ef migrations to end of stack
MGibson1 Jan 8, 2026
6b38f61
Move mssql migration to bottom of the stack
MGibson1 Jan 8, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,28 @@
"preLaunchTask": "buildFullServer",
"stopAll": true
},
{
"name": "Full Server with Seeder API",
"configurations": [
"run-Admin",
"run-API",
"run-Events",
"run-EventsProcessor",
"run-Identity",
"run-Sso",
"run-Icons",
"run-Billing",
"run-Notifications",
"run-SeederAPI"
],
"presentation": {
"hidden": false,
"group": "AA_compounds",
"order": 6
},
"preLaunchTask": "buildFullServerWithSeederApi",
"stopAll": true
},
{
"name": "Self Host: Bit",
"configurations": [
Expand Down Expand Up @@ -204,6 +226,17 @@
},
"preLaunchTask": "buildSso",
},
{
"name": "Seeder API",
"configurations": [
"run-SeederAPI"
],
"presentation": {
"hidden": false,
"group": "cloud",
},
"preLaunchTask": "buildSeederAPI",
},
{
"name": "Admin Self Host",
"configurations": [
Expand Down Expand Up @@ -270,6 +303,17 @@
},
"preLaunchTask": "buildSso",
},
{
"name": "Seeder API Self Host",
"configurations": [
"run-SeederAPI-SelfHost"
],
"presentation": {
"hidden": false,
"group": "self-host",
},
"preLaunchTask": "buildSeederAPI",
}
],
"configurations": [
// Configurations represent run-only scenarios so that they can be used in multiple compounds
Expand Down Expand Up @@ -311,6 +355,25 @@
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": "run-SeederAPI",
"presentation": {
"hidden": true,
},
"requireExactSource": true,
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/util/SeederApi/bin/Debug/net8.0/SeederApi.dll",
"args": [],
"cwd": "${workspaceFolder}/util/SeederApi",
"stopAtEntry": false,
"env": {
"ASPNETCORE_ENVIRONMENT": "Development",
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": "run-Billing",
"presentation": {
Expand Down Expand Up @@ -488,6 +551,27 @@
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": "run-SeederAPI-SelfHost",
"presentation": {
"hidden": true,
},
"requireExactSource": true,
"type": "coreclr",
"request": "launch",
"program": "${workspaceFolder}/util/SeederApi/bin/Debug/net8.0/SeederApi.dll",
"args": [],
"cwd": "${workspaceFolder}/util/SeederApi",
"stopAtEntry": false,
"env": {
"ASPNETCORE_ENVIRONMENT": "Development",
"ASPNETCORE_URLS": "http://localhost:5048",
"developSelfHosted": "true",
},
"sourceFileMap": {
"/Views": "${workspaceFolder}/Views"
}
},
{
"name": "run-Admin-SelfHost",
"presentation": {
Expand Down
69 changes: 69 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,21 @@
"label": "buildFullServer",
"hide": true,
"dependsOrder": "sequence",
"dependsOn": [
"buildAdmin",
"buildAPI",
"buildEventsProcessor",
"buildIdentity",
"buildSso",
"buildIcons",
"buildBilling",
"buildNotifications"
],
},
{
"label": "buildFullServerWithSeederApi",
"hide": true,
"dependsOrder": "sequence",
"dependsOn": [
"buildAdmin",
"buildAPI",
Expand All @@ -52,6 +67,7 @@
"buildIcons",
"buildBilling",
"buildNotifications",
"buildSeederAPI"
],
},
{
Expand Down Expand Up @@ -89,6 +105,9 @@
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": "$msCompile"
},
{
Expand All @@ -102,6 +121,9 @@
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": "$msCompile"
},
{
Expand All @@ -115,6 +137,9 @@
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": "$msCompile"
},
{
Expand All @@ -128,6 +153,9 @@
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": "$msCompile"
},
{
Expand All @@ -141,6 +169,9 @@
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": "$msCompile"
},
{
Expand All @@ -154,6 +185,9 @@
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": "$msCompile"
},
{
Expand All @@ -167,6 +201,9 @@
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": "$msCompile"
},
{
Expand All @@ -180,6 +217,29 @@
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
"isDefault": true
}
},
{
"label": "buildSeederAPI",
"hide": true,
"command": "dotnet",
"type": "process",
"args": [
"build",
"${workspaceFolder}/util/SeederApi/SeederApi.csproj",
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
Expand All @@ -197,6 +257,9 @@
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
Expand All @@ -214,6 +277,9 @@
"/property:GenerateFullPaths=true",
"/consoleloggerparameters:NoSummary"
],
"options": {
"cwd": "${workspaceFolder}"
},
"problemMatcher": "$msCompile",
"group": {
"kind": "build",
Expand All @@ -224,6 +290,9 @@
"label": "test",
"type": "shell",
"command": "dotnet test",
"options": {
"cwd": "${workspaceFolder}"
},
"group": {
"kind": "test",
"isDefault": true
Expand Down
14 changes: 14 additions & 0 deletions bitwarden-server.sln
Original file line number Diff line number Diff line change
Expand Up @@ -134,8 +134,12 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DbSeederUtility", "util\DbSeederUtility\DbSeederUtility.csproj", "{17A89266-260A-4A03-81AE-C0468C6EE06E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RustSdk", "util\RustSdk\RustSdk.csproj", "{D1513D90-E4F5-44A9-9121-5E46E3E4A3F7}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharedWeb.Test", "test\SharedWeb.Test\SharedWeb.Test.csproj", "{AD59537D-5259-4B7A-948F-0CF58E80B359}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeederApi", "util\SeederApi\SeederApi.csproj", "{9F08DFBB-482B-4C9D-A5F4-6BDA6EC2E68F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SeederApi.IntegrationTest", "test\SeederApi.IntegrationTest\SeederApi.IntegrationTest.csproj", "{A2E067EF-609C-4D13-895A-E054C61D48BB}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SSO.Test", "bitwarden_license\test\SSO.Test\SSO.Test.csproj", "{7D98784C-C253-43FB-9873-25B65C6250D6}"
EndProject
Global
Expand Down Expand Up @@ -350,6 +354,14 @@ Global
{AD59537D-5259-4B7A-948F-0CF58E80B359}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AD59537D-5259-4B7A-948F-0CF58E80B359}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AD59537D-5259-4B7A-948F-0CF58E80B359}.Release|Any CPU.Build.0 = Release|Any CPU
{9F08DFBB-482B-4C9D-A5F4-6BDA6EC2E68F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{9F08DFBB-482B-4C9D-A5F4-6BDA6EC2E68F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9F08DFBB-482B-4C9D-A5F4-6BDA6EC2E68F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9F08DFBB-482B-4C9D-A5F4-6BDA6EC2E68F}.Release|Any CPU.Build.0 = Release|Any CPU
{A2E067EF-609C-4D13-895A-E054C61D48BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A2E067EF-609C-4D13-895A-E054C61D48BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A2E067EF-609C-4D13-895A-E054C61D48BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A2E067EF-609C-4D13-895A-E054C61D48BB}.Release|Any CPU.Build.0 = Release|Any CPU
{7D98784C-C253-43FB-9873-25B65C6250D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7D98784C-C253-43FB-9873-25B65C6250D6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7D98784C-C253-43FB-9873-25B65C6250D6}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -410,6 +422,8 @@ Global
{17A89266-260A-4A03-81AE-C0468C6EE06E} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84E}
{D1513D90-E4F5-44A9-9121-5E46E3E4A3F7} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84E}
{AD59537D-5259-4B7A-948F-0CF58E80B359} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84F}
{9F08DFBB-482B-4C9D-A5F4-6BDA6EC2E68F} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84E}
{A2E067EF-609C-4D13-895A-E054C61D48BB} = {DD5BD056-4AAE-43EF-BBD2-0B569B8DA84F}
{7D98784C-C253-43FB-9873-25B65C6250D6} = {287CFF34-BBDB-4BC4-AF88-1E19A5A4679B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
Expand Down
1 change: 1 addition & 0 deletions bitwarden_license/src/Scim/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ public void ConfigureServices(IServiceCollection services)

// Repositories
services.AddDatabaseRepositories(globalSettings);
services.AddTestPlayIdTracking(globalSettings);

// Context
services.AddScoped<ICurrentContext, CurrentContext>();
Expand Down
1 change: 1 addition & 0 deletions bitwarden_license/src/Sso/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ public void ConfigureServices(IServiceCollection services)

// Repositories
services.AddDatabaseRepositories(globalSettings);
services.AddTestPlayIdTracking(globalSettings);

// Context
services.AddScoped<ICurrentContext, CurrentContext>();
Expand Down
23 changes: 12 additions & 11 deletions dev/setup_secrets.ps1
100644 โ†’ 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Helper script for applying the same user secrets to each project
param (
[switch]$clear,
[Parameter(ValueFromRemainingArguments = $true, Position=1)]
[Parameter(ValueFromRemainingArguments = $true, Position = 1)]
$cmdArgs
)

Expand All @@ -16,17 +16,18 @@ if ($clear -eq $true) {
}

$projects = @{
Admin = "../src/Admin"
Api = "../src/Api"
Billing = "../src/Billing"
Events = "../src/Events"
EventsProcessor = "../src/EventsProcessor"
Icons = "../src/Icons"
Identity = "../src/Identity"
Notifications = "../src/Notifications"
Sso = "../bitwarden_license/src/Sso"
Scim = "../bitwarden_license/src/Scim"
Admin = "../src/Admin"
Api = "../src/Api"
Billing = "../src/Billing"
Events = "../src/Events"
EventsProcessor = "../src/EventsProcessor"
Icons = "../src/Icons"
Identity = "../src/Identity"
Notifications = "../src/Notifications"
Sso = "../bitwarden_license/src/Sso"
Scim = "../bitwarden_license/src/Scim"
IntegrationTests = "../test/Infrastructure.IntegrationTest"
SeederApi = "../util/SeederApi"
}

foreach ($key in $projects.keys) {
Expand Down
1 change: 1 addition & 0 deletions src/Admin/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public void ConfigureServices(IServiceCollection services)
default:
break;
}
services.AddTestPlayIdTracking(globalSettings);

// Context
services.AddScoped<ICurrentContext, CurrentContext>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public EmergencyAccess ToEmergencyAccess(EmergencyAccess existingEmergencyAccess
existingEmergencyAccess.KeyEncrypted = KeyEncrypted;
}
existingEmergencyAccess.Type = Type;
existingEmergencyAccess.WaitTimeDays = WaitTimeDays;
existingEmergencyAccess.WaitTimeDays = (short)WaitTimeDays;
return existingEmergencyAccess;
}
}
Expand Down
1 change: 1 addition & 0 deletions src/Api/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ public void ConfigureServices(IServiceCollection services)

// Repositories
services.AddDatabaseRepositories(globalSettings);
services.AddTestPlayIdTracking(globalSettings);

// Context
services.AddScoped<ICurrentContext, CurrentContext>();
Expand Down
Loading
Loading