From 6d6d079a3a99d3d3a922a640b6925eb2adf044de Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Tue, 17 Nov 2026 17:09:59 +0100 Subject: refactor(core)!: split forms and models by feature Replace monolithic form and model modules with focused packages for receiver, moderation, source, user, and shared validation concerns. Rename source policy concepts to domain moderation, including routes, models, tables, configuration, templates, and tests. BREAKING CHANGE: form and model import paths, moderation routes, and `SOURCE_ALLOWLIST_ENABLED` have changed; use `ALLOWLIST_ENABLED` and the new feature-specific modules. --- webmentions_ssg/models/moderation.py | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 webmentions_ssg/models/moderation.py (limited to 'webmentions_ssg/models/moderation.py') diff --git a/webmentions_ssg/models/moderation.py b/webmentions_ssg/models/moderation.py new file mode 100644 index 0000000..4200c39 --- /dev/null +++ b/webmentions_ssg/models/moderation.py @@ -0,0 +1,28 @@ +# SPDX-FileCopyrightText: 2026 Dennis Fink +# +# SPDX-License-Identifier: BSD-3-Clause + +"""Domain allowlist and blocklist models.""" + +from sqlalchemy import Text +from sqlalchemy.orm import Mapped, mapped_column + +from ..extensions import Base + + +class BlockedDomain(Base): + """Source domain rejected before submission or verification.""" + + __tablename__ = "blocked_domains" + + id: Mapped[int] = mapped_column(primary_key=True) + domain: Mapped[str] = mapped_column(Text(), nullable=False, unique=True) + + +class AllowedDomain(Base): + """A domain accepted when allowlist mode is enabled.""" + + __tablename__ = "allowed_domains" + + id: Mapped[int] = mapped_column(primary_key=True) + domain: Mapped[str] = mapped_column(Text(), nullable=False, unique=True) -- cgit v1.3.1