refactor; remove the term interface
This commit is contained in:
12
src/user.py
12
src/user.py
@@ -2,7 +2,7 @@ from dataclasses import dataclass, field
|
||||
from src.models import EncipheredNKode
|
||||
from src.customer_attributes import CustomerAttributes
|
||||
from src.user_cipher_keys import UserCipherKeys
|
||||
from src.user_interface import UserInterface
|
||||
from src.user_keypad import UserKeypad
|
||||
from src.utils import xor_lists
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ class User:
|
||||
username: str
|
||||
enciphered_passcode: EncipheredNKode
|
||||
user_keys: UserCipherKeys
|
||||
user_interface: UserInterface
|
||||
user_keypad: UserKeypad
|
||||
renew: bool = field(default=False)
|
||||
|
||||
def renew_keys(self, sets_xor: list[int], attrs_xor: list[int]):
|
||||
@@ -19,11 +19,11 @@ class User:
|
||||
self.user_keys.set_key = xor_lists(self.user_keys.set_key, sets_xor)
|
||||
self.user_keys.alpha_key = xor_lists(self.user_keys.alpha_key, attrs_xor)
|
||||
|
||||
def refresh_passcode(self, passcode_attr_idx: list[int], customer_interface: CustomerAttributes):
|
||||
def refresh_passcode(self, passcode_attr_idx: list[int], customer_attributes: CustomerAttributes):
|
||||
self.user_keys = UserCipherKeys.create(
|
||||
customer_interface.keypad_size,
|
||||
customer_interface.set_vals,
|
||||
customer_attributes.keypad_size,
|
||||
customer_attributes.set_vals,
|
||||
self.user_keys.max_nkode_len
|
||||
)
|
||||
self.enciphered_passcode = self.user_keys.encipher_nkode(passcode_attr_idx, customer_interface)
|
||||
self.enciphered_passcode = self.user_keys.encipher_nkode(passcode_attr_idx, customer_attributes)
|
||||
self.renew = False
|
||||
|
||||
Reference in New Issue
Block a user