created exploitable user test data

This commit is contained in:
2025-05-19 10:36:17 +02:00
parent 136c5d5a00
commit 8890884167
2 changed files with 12 additions and 1 deletions

View File

@@ -108,4 +108,3 @@ Here is also a list of tools from OWASP, which check your applications for vulne
- https://owasp.org/www-project-top-ten/
- https://top10proactive.owasp.org/
- https://www.youtube.com/watch?v=eVPAq1nvSm0
-

View File

@@ -33,6 +33,12 @@ const users: InsertUser[] = faker.helpers.multiple(() => ({
email: faker.internet.email()
}), {count: 10})
const exploitedUsers: InsertUser[] = faker.helpers.multiple(() => ({
name: faker.person.fullName(),
password: createHash('md5').update("P@ssword1").digest('hex'),
email: faker.internet.email()
}), { count: 5 })
const userRole: UserRoleInsert[] = [
{userId: 1, roleId: 1},
{userId: 2, roleId: 1},
@@ -44,6 +50,11 @@ const userRole: UserRoleInsert[] = [
{userId: 8, roleId: 3},
{userId: 9, roleId: 3},
{userId: 10, roleId: 3},
{userId: 11, roleId: 1},
{userId: 12, roleId: 2},
{userId: 13, roleId: 3},
{userId: 14, roleId: 3},
{userId: 15, roleId: 3},
]
async function seedDB(){
@@ -51,6 +62,7 @@ async function seedDB(){
await db.insert(rolesTable).values(roles)
await db.insert(rolesPermissionsTable).values(rolePermission)
await db.insert(usersTable).values(users)
await db.insert(usersTable).values(exploitedUsers)
await db.insert(usersRolesTable).values(userRole)
}