implement login tutorial

This commit is contained in:
2024-08-01 12:36:15 -05:00
parent 772c93c8a8
commit 610c4b31af
8 changed files with 744 additions and 401 deletions

View File

@@ -1,6 +1,5 @@
from uuid import UUID, uuid4
from pydantic import BaseModel
from src.customer import Customer
from src.models import NKodePolicy, KeypadSize
from src.user import User
@@ -25,7 +24,7 @@ class NKodeAPI(BaseModel):
return new_customer.customer_id
def generate_index_interface(self, customer_id: UUID) -> tuple[UUID, list[int]]:
def generate_signup_interface(self, customer_id: UUID) -> tuple[UUID, list[int]]:
assert (customer_id in self.customers.keys())
customer = self.customers[customer_id]
login_interface = UserInterface.new(customer.attributes.keypad_size)
@@ -80,7 +79,7 @@ class NKodeAPI(BaseModel):
del self.signup_sessions[session_id]
return True
def get_login_index_interface(self, username: str, customer_id: UUID) -> list[int]:
def get_login_interface(self, username: str, customer_id: UUID) -> list[int]:
"""
TODO: how do we prevent a targeted denial-of-service attack?
"""