1
0
mirror of https://github.com/bitwarden/server synced 2026-01-06 02:23:51 +00:00

Refactor recipies into scenes

This commit is contained in:
Hinton
2025-10-17 11:47:19 -04:00
parent f6fe7a9316
commit fd41332e4c
8 changed files with 120 additions and 108 deletions

View File

@@ -1,35 +0,0 @@
using Bit.Core.Enums;
using Bit.Infrastructure.EntityFramework.Repositories;
using Bit.Seeder.Factories;
namespace Bit.Seeder.Recipes;
public class SingleUserRecipe(DatabaseContext db, UserSeeder userSeeder)
{
public RecipeResult Seed(string email, bool emailVerified = false, bool premium = false)
{
var user = userSeeder.CreateUser(email, emailVerified, premium);
db.Add(user);
db.SaveChanges();
return new RecipeResult
{
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]
}
};
}
}