blob: 4200c3940a96655496cb229bb62afa96ebfd08e4 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me>
#
# 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)
|