diff options
| author | Dennis Fink | 2026-11-17 14:44:00 +0100 |
|---|---|---|
| committer | Dennis Fink | 2026-11-17 14:44:00 +0100 |
| commit | 227092b57acc886469e16bcc4c0d3256e86d3d1e (patch) | |
| tree | c1de8d5f8f3a37562e482f84e8017213c08a05d6 /webmentions_ssg/tasks/verification.py | |
| parent | f98b0e446b41325c494bd97900b7bbf730a7d67e (diff) | |
| download | webmentions-ssg-227092b57acc886469e16bcc4c0d3256e86d3d1e.tar.gz webmentions-ssg-227092b57acc886469e16bcc4c0d3256e86d3d1e.zip | |
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.
Diffstat (limited to '')
| -rw-r--r-- | webmentions_ssg/tasks/verification.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/webmentions_ssg/tasks/verification.py b/webmentions_ssg/tasks/verification.py index b0f4d0f..d55608c 100644 --- a/webmentions_ssg/tasks/verification.py +++ b/webmentions_ssg/tasks/verification.py @@ -25,10 +25,10 @@ from ..net import ( media_type_of, read_limited_body, ) +from ..source_policy import source_rejection_reason from ..version import APP_NAME, VERSION from .target_matching import html_mentions_target, text_mentions_target - RECOVERY_EXHAUSTED_REASON = "Verification recovery limit reached" @@ -200,6 +200,10 @@ def determine_verification_outcome( retried. :raises httpx.RequestError: If a transient HTTP request error should be retried. """ + # Recheck at worker time: a source may have been blocked since submission. + if reason := source_rejection_reason(claim.source): + return ReceivedWebmentionStatus.FAILED, reason + try: mentions_target = source_mentions_target(claim.source, claim.target) except SourceGoneError as exc: |
