diff options
| author | Dennis Fink | 2026-11-12 19:57:08 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-12 19:57:08 +0100 |
| commit | 4bd1d9e348918b2e55db47a1ac3489d035cf55e2 (patch) | |
| tree | f7ed41a374a8a4136792039a262dc62aa8cf8c59 /webmentions_ssg/forms/__init__.py | |
| parent | 7035e9f9467684cccae2b7ff3faaa62e6a9f91aa (diff) | |
| download | webmentions-ssg-4bd1d9e348918b2e55db47a1ac3489d035cf55e2.tar.gz webmentions-ssg-4bd1d9e348918b2e55db47a1ac3489d035cf55e2.zip | |
refactor(core): split modules by responsibility
Break up monolithic views, task helpers, networking, CLI, and
application extension setup so each module owns a focused concern.
Reorganize the test suite around the new boundaries while preserving
existing Webmention behavior and coverage.
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/forms/__init__.py | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/webmentions_ssg/forms/__init__.py b/webmentions_ssg/forms/__init__.py deleted file mode 100644 index 589cbd9..0000000 --- a/webmentions_ssg/forms/__init__.py +++ /dev/null @@ -1,78 +0,0 @@ -# SPDX-FileCopyrightText: 2026 Dennis Fink <me+coding@dennisfink.me> -# -# SPDX-License-Identifier: BSD-3-Clause - -"""Define forms for login, Webmention submission, and administration.""" - -import re - -from flask_wtf import FlaskForm -from wtforms import PasswordField, StringField, SubmitField -from wtforms.validators import URL, InputRequired, Regexp - -from .validators import ( - AllowedHostname, - HTTPXURL, - NotEqualTo, - PublicIPLiteral, - URLMaxBytes, -) - - -class LoginForm(FlaskForm): - """ - Form for authenticating a user. - """ - - username = StringField("Username", validators=[InputRequired()]) - password = PasswordField("Password", validators=[InputRequired()]) - submit = SubmitField("Sign In") - - -class EndpointForm(FlaskForm): - """ - Form for receiving a Webmention. - - The source must be a public HTTP or HTTPS URL distinct from the target. - The target must be an HTTP or HTTPS URL using an allowed hostname. - """ - - source = StringField( - "source", - validators=[ - InputRequired(), - URLMaxBytes(), - HTTPXURL(), - URL(), - Regexp( - "^https?://.*", - flags=re.IGNORECASE, - message="source must begin with http or https", - ), - NotEqualTo("target"), - PublicIPLiteral(), - ], - ) - target = StringField( - "target", - validators=[ - InputRequired(), - URLMaxBytes(), - HTTPXURL(), - URL(), - Regexp( - "^https?://.*", - flags=re.IGNORECASE, - message="target must begin with http or https", - ), - AllowedHostname(), - ], - ) - - -class AdminActionForm(FlaskForm): - """ - Form for confirming an administrative action. - """ - - submit = SubmitField("Confirm") |
