fix(typing): resolve mypy errors in api.routes.controller.dependencies.authentication

This commit is contained in:
Mark Paronyan committed 2026-09-29 21:48:33 +03:00
1 parent dfea615248
commit a3cb73da3d
3 files changed
+12 -6

No files matched your search

+7 -2
View File
@@ -14,7 +14,10 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
import uuid
from sqlalchemy import Column, String, Boolean, DateTime, ForeignKey, func
from sqlalchemy.orm import Mapped, mapped_column
from .base import BaseTable, GUID
@@ -22,8 +25,10 @@ from .base import BaseTable, GUID
class ApiKey(BaseTable):
__tablename__ = "api_keys"
api_key_id = Column(GUID, primary_key=True)
user_id = Column(GUID, ForeignKey("users.user_id", ondelete="CASCADE"), nullable=False, index=True)
api_key_id: Mapped[uuid.UUID] = mapped_column(GUID, primary_key=True)
user_id: Mapped[uuid.UUID] = mapped_column(
GUID, ForeignKey("users.user_id", ondelete="CASCADE"), nullable=False, index=True
)
name = Column(String(128), nullable=False)
key_hash = Column(String(128), nullable=False)
key_prefix = Column(String(8), nullable=False)