aboutsummaryrefslogtreecommitdiff
path: root/tests (follow)
Commit message (Collapse)AuthorAge
* feat(receiver): add received Webmention filtersDennis Fink6 days
| | | | | | | | Add status, URL search, and updated-date filters to the received Webmention list with strict query validation and inclusive UTC date ranges. Preserve active filters across pagination, delete, and reverify actions.
* fix(core): restrict migrate CLI to developmentDennis Fink6 days
| | | | | | | | | Hide Flask-Migrate's unrestricted command group unless `WEBMENTIONS_SSG_DEV` is enabled, while keeping the guarded database management commands available. Base migration CLI exposure on the development environment flag rather than the selected configuration class.
* build: make development dependency groups opt inDennis Fink6 days
| | | | | Stop installing dev and test dependency groups during a plain `uv sync` so production environments only receive runtime requirements by default.
* style(core): reorder module declarationsDennis Fink6 days
| | | | | | | | | Group globals and data classes near module imports, keep primary classes and functions together, and move implementation helpers after their public callers. Reorder Alembic setup so configuration happens after the required helpers are defined, without changing runtime behavior.
* refactor(core)!: clarify Webmention domain terminologyDennis Fink7 days
| | | | | | | | | | | | Rename ambiguous models, statuses, task modules, fields, and helpers so names reflect source documents, verification, endpoint discovery, and delivery state. Migrate persisted status values and database identifiers without losing existing Webmention data. BREAKING CHANGE: persisted status values and database schema names have changed, and several public Python names have been renamed.
* refactor(core)!: standardize application terminologyDennis Fink7 days
| | | | | | | | | | | | | Rename configuration keys, task helpers, forms, network utilities, and view endpoints to make their responsibilities and domains more explicit. Align source-management routes and templates with the new terminology and rename the target-matching module and related task abstractions consistently. BREAKING CHANGE: configuration keys have been renamed and sent-source routes move from `/sent` to `/sources`, with corresponding blueprint endpoint changes.
* refactor(core): use HTTPStatus consistentlyDennis Fink8 days
| | | | | | Replace numeric HTTP response and assertion codes in views and tests with `HTTPStatus` members so status handling is more descriptive and consistent.
* docs(core): standardize reST docstringsDennis Fink8 days
| | | | | | | | | Expand function and method documentation with consistent reST parameter, return, and exception fields while clarifying behavior where additional context is useful. Normalize test and migration docstrings to the same documentation conventions.
* refactor(core): split task workflows into focused helpersDennis Fink9 days
| | | | | | | | | Decompose receiver verification, source scanning, and Webmention delivery into explicit claim, check, reconciliation, and outcome-recording stages. Extract Huey backend parsing helpers and add focused tests for the new task boundaries while preserving existing processing semantics.
* refactor(core): remove postponed model annotationsDennis Fink9 days
| | | | | | | | | Drop `from __future__ import annotations` now that UUID names no longer shadow the module namespace, and add coverage that mapped UUID and relationship annotations resolve correctly at runtime. Apply minor Python 3.14 syntax and formatting cleanup across tests and networking.
* refactor(receiver): map received status to enumDennis Fink9 days
| | | | | | | | | Store `ReceivedWebmention.status` as a non-native SQLAlchemy enum so model values round-trip as `ReceivedStatus` while remaining portable across database backends. Add a migration that preserves existing text statuses and coverage for upgrades and enum persistence.
* fix(core): reject invalid admin action formsDennis Fink9 days
| | | | | | Centralize administrative form validation so all protected actions return HTTP 400 on invalid submissions instead of allowing the rescan action to fail silently.
* refactor(core): consolidate repeated helper logicDennis Fink9 days
| | | | | | | | | Centralize SQL row counts, hostname parsing, and content-type normalization so tasks, forms, and scanners share consistent implementations. Simplify periodic task registration and admin lookups with table-driven setup and Flask-SQLAlchemy's built-in 404 helper.
* refactor(core): clarify Webmention mutation APIsDennis Fink9 days
| | | | | | | | Make in-place reset and reopen helpers return `None` so callers no longer perform pointless self-reassignment. Split explicit resend behavior into its own method instead of hiding it behind a boolean flag on `reopen`.
* refactor(core): centralize pending revision logicDennis Fink9 days
| | | | | | | | Make `SentWebmention.pending` a hybrid property so the same definition works in Python and SQL expressions. Reuse it across sender and scanner guards to remove duplicated revision checks.
* fix(core): clarify Huey file path semanticsDennis Fink9 days
| | | | | | | | Document and test SQLAlchemy-style slash handling for file and SQLite Huey URLs, including distinct relative and absolute path forms. Update validation errors to show the supported three- and four-slash conventions.
* fix(core): make network task failures explicitDennis Fink9 days
| | | | | | | | | | Introduce a dedicated response-size error so callers only translate expected limit violations instead of masking unrelated `ValueError` exceptions. Ensure failed sockets are always closed, remove dead discovery error handling, and log unexpected sender failures with tracebacks before recording them.
* refactor(core): simplify login password verificationDennis Fink9 days
| | | | | | | | | Replace the module-level dummy user with a lazily cached password hash so unknown usernames still perform a password check without hashing during every import. Use one linear verification path for existing, missing, and empty passwords.
* fix(core): harden session and redirect validationDennis Fink9 days
| | | | | | | | Reject non-string session identifiers explicitly and simplify fingerprint parsing so malformed authentication state fails closed. Tighten local redirect checks against control-character and backslash host tricks without relying on an unnecessary scheme check.
* fix(receiver): reopen raced submissions after cooldownDennis Fink9 days
| | | | | | | | | Recover a concurrently inserted Webmention through the same cooldown path as an existing submission so stale failures can be queued for verification. Extract digest lookup, insertion, and reopening helpers while preserving explicit SHA-256 collision handling.
* refactor(core): extract hostname resolution helperDennis Fink9 days
| | | | | | Move DNS resolution and address parsing into a dedicated helper so public address validation resolves hostnames through a single, testable path.
* fix(core): reject all Unicode control charactersDennis Fink9 days
| | | | | Use shared Unicode category validation so passwords reject C1 controls in addition to C0 and DEL, and reuse the same helper for URL validation.
* refactor(core): consolidate endpoint URL validationDennis Fink9 days
| | | | | | | | | Replace overlapping WTForms URL and regex checks with a single `HTTPURL` validator that enforces parseable HTTP(S) URLs without rewriting whitespace. Add coverage for malformed hosts and ports plus case-insensitive schemes.
* refactor(core): inline endpoint source comparisonDennis Fink9 days
| | | | | | Remove the generic cross-field equality validator and keep the source-versus-target check directly on `EndpointForm`, where the validation rule is actually used.
* fix(core): decouple task imports from app initializationDennis Fink10 days
| | | | | | | | | | Keep stable lazy task handles that register against the active Huey backend so modules can be imported before app creation and survive backend reinitialization. Separate package metadata and the shared blueprint from application startup to remove import-order dependencies and keep build-time version lookup lightweight.
* refactor(sender): simplify HTML endpoint discoveryDennis Fink10 days
| | | | | | Use a case-insensitive CSS selector to find Webmention links directly, removing manual relation parsing while preserving endpoint validation and document order.
* refactor(core): use lowercase extension namesDennis Fink10 days
| | | | | | Rename shared Flask extension singletons to conventional lowercase names and update imports throughout the application and tests to remove redundant aliases.
* fix(core): validate Redis Huey URL schemesDennis Fink10 days
| | | | | | Parse Redis backend flavours explicitly so supported combinations preserve the correct redis or rediss scheme while malformed or unknown variants fail fast.
* chore(core): enable stricter Ruff lint rulesDennis Fink10 days
| | | | | | | | Expand Ruff checks for bugbear, complexity, pathlib, return statements, simplifications, upgrades, and docstring style. Apply the resulting behavior-neutral cleanup across application and test code.
* chore(core): fix task typing issuesDennis Fink10 days
| | | | | | Add explicit result assertions, broader parser annotations, and SQLAlchemy result casts so static type checking reflects the runtime guarantees of task code.
* refactor(core): split modules by responsibilityDennis Fink10 days
| | | | | | | | 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.
* fix(core): harden local setup and Huey configurationDennis Fink2026-10-31
| | | | | | | | | Create local development and test directories automatically so fresh checkouts can start without pre-existing logging or instance paths. Reject in-memory and blackhole Huey backends in production because they cannot reliably deliver queued work across separate web and worker processes.
* fix(core): harden login rate limiting behind proxiesDennis Fink2026-10-31
| | | | | | | | | | Trust forwarded client addresses only for an explicitly configured number of reverse-proxy hops so per-IP limits cannot be bypassed or collapsed in proxied deployments. Add a separate hashed per-username login limit across IPs to reduce distributed credential-guessing attempts without storing raw usernames in limiter keys.
* fix(sender): treat malformed requests as terminal failuresDennis Fink2026-10-31
| | | | | | | | | Reject invalid stored targets and local URL or protocol errors as permanent failures so unrecoverable requests do not consume the sender retry budget. Preserve the recorded attempt state while preventing duplicate retries for the same source revision.
* fix(sender): prevent source scanner path escapesDennis Fink2026-10-31
| | | | | | | | | Reject symlinked source files whose resolved targets leave the configured source directory so scans cannot read unintended files from the host filesystem. Normalize and validate ignored hostname patterns at startup and again at scan time to keep scanner filtering predictable.
* fix(receiver): prevent endless verification recoveryDennis Fink2026-10-31
| | | | | | | | Cap stale verification requeues so repeatedly lost or crashing tasks eventually become terminal failures instead of cycling indefinitely. Reject URLs that httpx cannot safely fetch before enqueueing, and persist unexpected verification errors as terminal failures.
* fix(core): reject IPv6 transition addressesDennis Fink2026-10-31
| | | | | | | | | | Harden public-address validation against NAT64, IPv4-compatible, 6to4, and IPv4-mapped IPv6 forms that can encapsulate private or metadata destinations. Apply the same check to literal form validation and DNS-resolved addresses so SSRF protections do not rely on Python's `is_global` behavior alone.
* feat(receiver): add resource limits and retentionDennis Fink2026-10-31
| | | | | | | | Bound incoming request and URL sizes so untrusted Webmention submissions cannot consume unbounded application or database resources. Purge old failed and deleted received Webmentions on a schedule, and use portable SHA-256 URL fingerprints to preserve uniqueness for long URLs.
* fix(core): harden session and credential securityDennis Fink2026-10-31
| | | | | | | | | | Require persistent non-placeholder signing keys outside local development and bind login sessions to the current password hash so password changes revoke existing cookies. Enforce a minimal password policy for user administration while preserving long Unicode passphrases without arbitrary composition limits.
* build: add storage backend dependency groupsDennis Fink2026-10-31
| | | | | | | | | Provide matching published extras and uv groups for Redis, Valkey, Memcached, MongoDB, and PostgreSQL so deployments can install the clients required by their selected rate-limit or Huey backend. Keep shared backend groups aligned where Redis dependencies are used by both Flask-Limiter and Huey.
* fix(core): replace Huey pickle serialization with JSONDennis Fink2026-10-30
| | | | | | | | | Prevent broker-controlled task and result payloads from deserializing arbitrary Python objects by using a restricted JSON serializer with an explicit type allowlist. Fail closed on serializer overrides and document broker isolation and migration requirements for existing pickle-backed deployments.
* fix(core): prevent DNS rebinding in HTTP requestsDennis Fink2026-10-30
| | | | | | | | | | Pin outbound connections to validated public IP addresses so DNS changes cannot redirect receiver or sender requests onto private or link-local networks. Apply the same protection across redirects, add an overall request deadline, and keep DNS resolution out of synchronous endpoint form validation.
* fix(sender): validate missing source directoriesDennis Fink2026-10-30
| | | | | | Resolve configured source paths without requiring them to exist first so missing directories produce the scanner's explicit directory validation error instead of leaking a lower-level path resolution exception.
* fix(receiver): recover stale Webmention verificationsDennis Fink2026-10-30
| | | | | | | | | Add a periodic recovery sweep for Webmentions left in received or verifying states after worker crashes, lost queue entries, or interrupted processing. Use atomic lease-style updates so stale workers cannot overwrite newer results, and index verification state for efficient recovery scans.
* fix(sender): make endpoint discovery more resilientDennis Fink2026-10-30
| | | | | | | | Fall back to GET when HEAD fails so targets that reject or mishandle HEAD can still advertise a Webmention endpoint. Ignore malformed or unsupported endpoint candidates and continue searching for the first valid HTTP endpoint.
* fix(receiver): handle punctuation around plain-text URLsDennis Fink2026-10-30
| | | | | | | | | Ignore surrounding prose punctuation when matching target IRIs in text/plain sources so valid Webmentions are not rejected when URLs appear in normal sentences. Preserve balanced URL parentheses and reject longer URLs that only share the target as a prefix.
* fix(sender): stabilize source content fingerprintsDennis Fink2026-10-30
| | | | | | | | | Hash normalized reader-facing content and outgoing targets instead of raw h-entry markup so generated attributes and relative timestamps do not trigger spurious source revisions or repeat Webmentions. Preserve meaningful changes such as image updates and reaction target changes while ignoring target ordering and other markup noise.
* fix(sender): retry manual scans on lock contentionDennis Fink2026-10-30
| | | | | | | | Ensure requested rescans are not silently dropped when a periodic scan already holds the scanner lock. Defer the manual task and retry it after the active scan finishes while still propagating unrelated scan failures.
* fix(sender): prevent concurrent duplicate sendsDennis Fink2026-10-30
| | | | | | | | | Serialize delivery attempts per Webmention so duplicate queued tasks cannot send the same revision concurrently or consume additional retry attempts. Scope locks by Webmention UUID so unrelated deliveries can still run in parallel.
* feat(sender): add persistent retry backoffDennis Fink2026-10-30
| | | | | | | | | | Persist retry state per source revision so temporary delivery failures survive worker restarts and duplicate queued tasks cannot bypass the retry schedule. Use capped exponential backoff, stop after a configurable attempt limit, and reset the retry budget when a source changes or an admin resends manually.