1
0
mirror of https://github.com/bitwarden/server synced 2025-12-24 04:03:25 +00:00

Delete all seeded data

Fixup single user recipe to inform of seeded entities
This commit is contained in:
Matt Gibson
2025-10-09 15:36:29 -07:00
parent d93cd50818
commit 431a708914
5 changed files with 72 additions and 18 deletions

View File

@@ -6,7 +6,7 @@ namespace Bit.Seeder.Recipes;
public class SingleUserRecipe(DatabaseContext db)
{
public Dictionary<string, string?> Seed(string email)
public RecipeResult Seed(string email)
{
var userSeeder = new UserSeeder(Guid.NewGuid());
var user = userSeeder.CreateUser(email);
@@ -14,16 +14,23 @@ public class SingleUserRecipe(DatabaseContext db)
db.Add(user);
db.SaveChanges();
return userSeeder.GetMangleMap(user, new UserData
return new RecipeResult
{
Email = email,
Id = Guid.Parse("00000000-0000-0000-0000-000000000001"),
Key = "seeded_key",
PublicKey = "seeded_public_key",
PrivateKey = "seeded_private_key",
ApiKey = "seeded_api_key",
Kdf = KdfType.PBKDF2_SHA256,
KdfIterations = 600_000,
});
Result = userSeeder.GetMangleMap(user, new UserData
{
Email = email,
Id = Guid.Parse("00000000-0000-0000-0000-000000000001"),
Key = "seeded_key",
PublicKey = "seeded_public_key",
PrivateKey = "seeded_private_key",
ApiKey = "seeded_api_key",
Kdf = KdfType.PBKDF2_SHA256,
KdfIterations = 600_000,
}),
TrackedEntities = new Dictionary<string, List<Guid>>
{
["User"] = [user.Id]
}
};
}
}