From 227092b57acc886469e16bcc4c0d3256e86d3d1e Mon Sep 17 00:00:00 2001 From: Dennis Fink Date: Tue, 17 Nov 2026 14:44:00 +0100 Subject: feat(receiver): add source domain access rules Add persistent source block and allow lists with authenticated management, single-row and bulk blocking actions, and optional fail-closed allowlist mode. Reject disallowed sources before enqueueing and recheck policy in verification workers, while sharing canonical hostname normalization across receiver, sender, and configuration paths. --- webmentions_ssg/views/endpoint.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'webmentions_ssg/views/endpoint.py') diff --git a/webmentions_ssg/views/endpoint.py b/webmentions_ssg/views/endpoint.py index 934ffad..6d84d92 100644 --- a/webmentions_ssg/views/endpoint.py +++ b/webmentions_ssg/views/endpoint.py @@ -18,6 +18,7 @@ from .. import forms from ..db_helpers import rows_affected from ..extensions import csrf, db, limiter from ..models import ReceivedWebmention, source_target_digest +from ..source_policy import source_rejection_reason from ..tasks.verification import verify_webmention from .blueprint import webmentions_bp @@ -152,6 +153,9 @@ def receive_webmention() -> ResponseReturnValue: source = cast(str, form.source.data) target = cast(str, form.target.data) + if reason := source_rejection_reason(source): + return {"error": reason}, HTTPStatus.FORBIDDEN + result = record_submission(source, target) if result is None: -- cgit v1.3.1