diff --git a/src/account_parsing.py b/src/account_parsing.py index 712890c..3621cc5 100644 --- a/src/account_parsing.py +++ b/src/account_parsing.py @@ -7,14 +7,14 @@ import pydantic class _Account(pydantic.BaseModel): name: str login: str - passwd: str + password: str @classmethod def from_tuple(cls: Type[Self], tuple_: tuple[str, str, str]) -> Self: return cls(name=tuple_[0], login=tuple_[1], passwd=tuple_[2]) def as_tuple(self: Self) -> tuple[str, str, str]: - return (self.name, self.login, self.passwd) + return (self.name, self.login, self.password) class _Accounts(pydantic.BaseModel): diff --git a/src/database/add.py b/src/database/add.py index 1875dea..27e0d64 100644 --- a/src/database/add.py +++ b/src/database/add.py @@ -19,7 +19,7 @@ def add_account( name=name, salt=salt, enc_login=enc_login, - enc_pass=enc_password, + enc_password=enc_password, ) try: with sqlmodel.Session(engine) as session: @@ -41,7 +41,7 @@ def add_master_pass( master_pass = models.MasterPass( user_id=user_id, salt=salt, - passwd=password_hash, + password_hash=password_hash, ) try: with sqlmodel.Session(engine) as session: diff --git a/src/database/get.py b/src/database/get.py index b664b13..3a85192 100644 --- a/src/database/get.py +++ b/src/database/get.py @@ -19,7 +19,7 @@ def get_master_pass( result = session.exec(statement).first() if result is None: return - return (result.salt, result.passwd) + return (result.salt, result.password_hash) def get_accounts(engine: Engine, user_id: int) -> list[str]: @@ -43,7 +43,7 @@ def get_all_accounts( with sqlmodel.Session(engine) as session: result = session.exec(statement) yield from ( - (account.name, account.salt, account.enc_login, account.enc_pass) + (account.name, account.salt, account.enc_login, account.enc_password) for account in result ) @@ -61,4 +61,4 @@ def get_account_info( result = session.exec(statement).first() if result is None: return - return (result.salt, result.enc_login, result.enc_pass) + return (result.salt, result.enc_login, result.enc_password) diff --git a/src/database/models.py b/src/database/models.py index 7f4ce70..7a1d4cd 100644 --- a/src/database/models.py +++ b/src/database/models.py @@ -10,7 +10,7 @@ class MasterPass(sqlmodel.SQLModel, table=True): salt: bytes = sqlmodel.Field( sa_column=sqlmodel.Column(sqlmodel.BINARY(64), nullable=False) ) - passwd: bytes = sqlmodel.Field( + password_hash: bytes = sqlmodel.Field( sa_column=sqlmodel.Column(sqlmodel.BINARY(128), nullable=False) ) @@ -27,6 +27,6 @@ class Account(sqlmodel.SQLModel, table=True): enc_login: bytes = sqlmodel.Field( sa_column=sqlmodel.Column(sqlmodel.VARBINARY(256), nullable=False) ) - enc_pass: bytes = sqlmodel.Field( + enc_password: bytes = sqlmodel.Field( sa_column=sqlmodel.Column(sqlmodel.VARBINARY(256), nullable=False) )