|
|
|
@ -0,0 +1,50 @@
|
|
|
|
|
using System.Security.Cryptography;
|
|
|
|
|
using DbContextLib;
|
|
|
|
|
using Entities.SQLuedoDB;
|
|
|
|
|
using Microsoft.AspNetCore.Cryptography.KeyDerivation;
|
|
|
|
|
using Microsoft.EntityFrameworkCore;
|
|
|
|
|
|
|
|
|
|
namespace StubbedContextLib;
|
|
|
|
|
|
|
|
|
|
public class StubbedContext : UserDbContext
|
|
|
|
|
{
|
|
|
|
|
public StubbedContext(DbContextOptions<UserDbContext> options) : base(options)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void OnModelCreating(ModelBuilder modelBuilder)
|
|
|
|
|
{
|
|
|
|
|
base.OnModelCreating(modelBuilder);
|
|
|
|
|
modelBuilder.Entity<UserEntity>().HasData(
|
|
|
|
|
new UserEntity(1, "johnny", Convert.ToBase64String(KeyDerivation.Pbkdf2(
|
|
|
|
|
password: "motdepasse",
|
|
|
|
|
salt: RandomNumberGenerator.GetBytes(128 / 8),
|
|
|
|
|
prf: KeyDerivationPrf.HMACSHA256,
|
|
|
|
|
iterationCount: 100000,
|
|
|
|
|
numBytesRequested: 256 / 8)), "Johnny.RATTON@etu.uca.fr", true),
|
|
|
|
|
new UserEntity(2, "maxime", Convert.ToBase64String(KeyDerivation.Pbkdf2(
|
|
|
|
|
password: "motdepasse",
|
|
|
|
|
salt: RandomNumberGenerator.GetBytes(128 / 8),
|
|
|
|
|
prf: KeyDerivationPrf.HMACSHA256,
|
|
|
|
|
iterationCount: 100000,
|
|
|
|
|
numBytesRequested: 256 / 8)), "Maxime.SAPOUNTZIS@etu.uca.fr", true),
|
|
|
|
|
new UserEntity(3, "clement", Convert.ToBase64String(KeyDerivation.Pbkdf2(
|
|
|
|
|
password: "motdepasse",
|
|
|
|
|
salt: RandomNumberGenerator.GetBytes(128 / 8),
|
|
|
|
|
prf: KeyDerivationPrf.HMACSHA256,
|
|
|
|
|
iterationCount: 100000,
|
|
|
|
|
numBytesRequested: 256 / 8)), "Clement.CHIEU@etu.uca.fr", true),
|
|
|
|
|
new UserEntity(4, "erwan", Convert.ToBase64String(KeyDerivation.Pbkdf2(
|
|
|
|
|
password: "motdepasse",
|
|
|
|
|
salt: RandomNumberGenerator.GetBytes(128 / 8),
|
|
|
|
|
prf: KeyDerivationPrf.HMACSHA256,
|
|
|
|
|
iterationCount: 100000,
|
|
|
|
|
numBytesRequested: 256 / 8)), "Erwan.MENAGER@etu.uca.fr", true),
|
|
|
|
|
new UserEntity(5, "victor", Convert.ToBase64String(KeyDerivation.Pbkdf2(
|
|
|
|
|
password: "motdepasse",
|
|
|
|
|
salt: RandomNumberGenerator.GetBytes(128 / 8),
|
|
|
|
|
prf: KeyDerivationPrf.HMACSHA256,
|
|
|
|
|
iterationCount: 100000,
|
|
|
|
|
numBytesRequested: 256 / 8)), "Victor.GABORIT@etu.uca.fr", true));
|
|
|
|
|
}
|
|
|
|
|
}
|