feat(e2e): add WebAuthn test user to fixture seeding
This commit is contained in:
parent
ef8bf10555
commit
c96ebe1b64
1 changed files with 12 additions and 0 deletions
|
|
@ -62,6 +62,18 @@ async def seed() -> None:
|
||||||
result["cred_username"] = "creduser"
|
result["cred_username"] = "creduser"
|
||||||
result["cred_password"] = "credpassword123"
|
result["cred_password"] = "credpassword123"
|
||||||
|
|
||||||
|
# 5. Create a user with password for WebAuthn registration tests
|
||||||
|
# (login with password first, then register a passkey)
|
||||||
|
webauthn_user = User(userid="test-user-03", username="webauthnuser", groups=["users"])
|
||||||
|
await user_repo.create(webauthn_user)
|
||||||
|
webauthn_password_hash = password_service.hash("webauthnpass123")
|
||||||
|
await cred_repo.create_password(
|
||||||
|
PasswordCredential(user_id=webauthn_user.userid, password_hash=webauthn_password_hash)
|
||||||
|
)
|
||||||
|
result["webauthn_username"] = "webauthnuser"
|
||||||
|
result["webauthn_password"] = "webauthnpass123"
|
||||||
|
result["webauthn_userid"] = "test-user-03"
|
||||||
|
|
||||||
# 4. Create an expired/used magic link for negative test
|
# 4. Create an expired/used magic link for negative test
|
||||||
expired_link = await magic_link_service.create(username="expired")
|
expired_link = await magic_link_service.create(username="expired")
|
||||||
await magic_link_service.mark_used(expired_link.token)
|
await magic_link_service.mark_used(expired_link.token)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue