diff --git a/API_SQLuedo/StubbedContextLib/StubbedContext.cs b/API_SQLuedo/StubbedContextLib/StubbedContext.cs index aca9691..b015ebc 100644 --- a/API_SQLuedo/StubbedContextLib/StubbedContext.cs +++ b/API_SQLuedo/StubbedContextLib/StubbedContext.cs @@ -1,5 +1,6 @@ using System.Security.Cryptography; using DbContextLib; +using DevOne.Security.Cryptography.BCrypt; using Entities; using Microsoft.AspNetCore.Cryptography.KeyDerivation; using Microsoft.EntityFrameworkCore; @@ -20,12 +21,13 @@ public class StubbedContext : UserDbContext { Id = 1, Username = "johnny", - Password = Convert.ToBase64String(KeyDerivation.Pbkdf2( + /*Password = Convert.ToBase64String(KeyDerivation.Pbkdf2( password: "Motdepasse", salt: RandomNumberGenerator.GetBytes(128 / 8), prf: KeyDerivationPrf.HMACSHA256, iterationCount: 100000, - numBytesRequested: 256 / 8)), + numBytesRequested: 256 / 8)),*/ + Password = BCryptHelper.HashPassword("Motdepasse", BCryptHelper.GenerateSalt()), Email = "Johnny.RATTON@etu.uca.fr", IsAdmin = true }, @@ -33,12 +35,13 @@ public class StubbedContext : UserDbContext { Id = 2, Username = "maxime", - Password = Convert.ToBase64String(KeyDerivation.Pbkdf2( + /*Password = Convert.ToBase64String(KeyDerivation.Pbkdf2( password: "Motdepasse", salt: RandomNumberGenerator.GetBytes(128 / 8), prf: KeyDerivationPrf.HMACSHA256, iterationCount: 100000, - numBytesRequested: 256 / 8)), + numBytesRequested: 256 / 8)),*/ + Password = BCryptHelper.HashPassword("Motdepasse", BCryptHelper.GenerateSalt()), Email = "Maxime.SAPOUNTZIS@etu.uca.fr", IsAdmin = true }, @@ -46,12 +49,13 @@ public class StubbedContext : UserDbContext { Id = 3, Username = "clement", - Password = Convert.ToBase64String(KeyDerivation.Pbkdf2( + /*Password = Convert.ToBase64String(KeyDerivation.Pbkdf2( password: "Motdepasse", salt: RandomNumberGenerator.GetBytes(128 / 8), prf: KeyDerivationPrf.HMACSHA256, iterationCount: 100000, - numBytesRequested: 256 / 8)), + numBytesRequested: 256 / 8)),*/ + Password = BCryptHelper.HashPassword("Motdepasse", BCryptHelper.GenerateSalt()), Email = "Clement.CHIEU@etu.uca.fr", IsAdmin = true }, @@ -59,12 +63,13 @@ public class StubbedContext : UserDbContext { Id = 4, Username = "erwan", - Password = Convert.ToBase64String(KeyDerivation.Pbkdf2( + /*Password = Convert.ToBase64String(KeyDerivation.Pbkdf2( password: "Motdepasse", salt: RandomNumberGenerator.GetBytes(128 / 8), prf: KeyDerivationPrf.HMACSHA256, iterationCount: 100000, - numBytesRequested: 256 / 8)), + numBytesRequested: 256 / 8)),*/ + Password = BCryptHelper.HashPassword("Motdepasse", BCryptHelper.GenerateSalt()), Email = "Erwan.MENAGER@etu.uca.fr", IsAdmin = true }, @@ -72,12 +77,13 @@ public class StubbedContext : UserDbContext { Id = 5, Username = "victor", - Password = Convert.ToBase64String(KeyDerivation.Pbkdf2( + /*Password = Convert.ToBase64String(KeyDerivation.Pbkdf2( password: "Motdepasse", salt: RandomNumberGenerator.GetBytes(128 / 8), prf: KeyDerivationPrf.HMACSHA256, iterationCount: 100000, - numBytesRequested: 256 / 8)), + numBytesRequested: 256 / 8)),*/ + Password = BCryptHelper.HashPassword("Motdepasse", BCryptHelper.GenerateSalt()), Email = "Victor.GABORIT@etu.uca.fr", IsAdmin = true }); diff --git a/API_SQLuedo/StubbedContextLib/StubbedContextLib.csproj b/API_SQLuedo/StubbedContextLib/StubbedContextLib.csproj index c87b24a..8600f45 100644 --- a/API_SQLuedo/StubbedContextLib/StubbedContextLib.csproj +++ b/API_SQLuedo/StubbedContextLib/StubbedContextLib.csproj @@ -11,6 +11,7 @@ + all runtime; build; native; contentfiles; analyzers; buildtransitive