From 58a4a8ee06bcf23c3957af5c2ea035b6797c4395 Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Sun, 16 Aug 2026 20:39:41 +0200 Subject: refactor(core): remove user credential length limits Store usernames and password hashes as text instead of fixed-length strings so their maximum length is not constrained by the database schema. Require every user to have a password hash. --- webmentions_ssg/models.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'webmentions_ssg') diff --git a/webmentions_ssg/models.py b/webmentions_ssg/models.py index 02c42ef..b6679e8 100644 --- a/webmentions_ssg/models.py +++ b/webmentions_ssg/models.py @@ -3,7 +3,6 @@ from __future__ import annotations import uuid from datetime import datetime, timezone from enum import StrEnum -from typing import Optional from flask_login import UserMixin from sqlalchemy import ( @@ -33,8 +32,8 @@ class User(UserMixin, Base): __tablename__ = "users" id: Mapped[int] = mapped_column(primary_key=True) - username: Mapped[str] = mapped_column(String(64), index=True, unique=True) - password_hash: Mapped[Optional[str]] = mapped_column(String(256)) + username: Mapped[str] = mapped_column(Text(), index=True, unique=True) + password_hash: Mapped[str] = mapped_column(Text(), nullable=False) def __repr__(self) -> str: return f"" -- cgit v1.3.1