aboutsummaryrefslogtreecommitdiff
path: root/tests (unfollow)
Commit message (Collapse)Author
9 daysfix(core): make network task failures explicitDennis Fink
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.
9 daysrefactor(core): simplify login password verificationDennis Fink
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.
9 daysfix(core): harden session and redirect validationDennis Fink
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.
9 daysfix(receiver): reopen raced submissions after cooldownDennis Fink
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.
9 daysrefactor(core): extract hostname resolution helperDennis Fink
Move DNS resolution and address parsing into a dedicated helper so public address validation resolves hostnames through a single, testable path.
10 daysfix(core): reject all Unicode control charactersDennis Fink
Use shared Unicode category validation so passwords reject C1 controls in addition to C0 and DEL, and reuse the same helper for URL validation.
10 daysrefactor(core): consolidate endpoint URL validationDennis Fink
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.
10 daysrefactor(core): inline endpoint source comparisonDennis Fink
Remove the generic cross-field equality validator and keep the source-versus-target check directly on `EndpointForm`, where the validation rule is actually used.
10 daysfix(core): decouple task imports from app initializationDennis Fink
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.
10 daysrefactor(sender): simplify HTML endpoint discoveryDennis Fink
Use a case-insensitive CSS selector to find Webmention links directly, removing manual relation parsing while preserving endpoint validation and document order.
10 daysrefactor(core): use lowercase extension namesDennis Fink
Rename shared Flask extension singletons to conventional lowercase names and update imports throughout the application and tests to remove redundant aliases.
10 daysfix(core): validate Redis Huey URL schemesDennis Fink
Parse Redis backend flavours explicitly so supported combinations preserve the correct redis or rediss scheme while malformed or unknown variants fail fast.
10 dayschore(core): enable stricter Ruff lint rulesDennis Fink
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.
10 dayschore(core): fix task typing issuesDennis Fink
Add explicit result assertions, broader parser annotations, and SQLAlchemy result casts so static type checking reflects the runtime guarantees of task code.
10 daysrefactor(core): split modules by responsibilityDennis Fink
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.
2026-10-31fix(core): harden local setup and Huey configurationDennis Fink
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.
2026-10-31fix(core): harden login rate limiting behind proxiesDennis Fink
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.
2026-10-31fix(sender): treat malformed requests as terminal failuresDennis Fink
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.
2026-10-31fix(sender): prevent source scanner path escapesDennis Fink
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.
2026-10-31fix(receiver): prevent endless verification recoveryDennis Fink
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.
2026-10-31fix(core): reject IPv6 transition addressesDennis Fink
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.
2026-10-31feat(receiver): add resource limits and retentionDennis Fink
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.
2026-10-31fix(core): harden session and credential securityDennis Fink
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.
2026-10-31build: add storage backend dependency groupsDennis Fink
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.
2026-10-30fix(core): replace Huey pickle serialization with JSONDennis Fink
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.
2026-10-30fix(core): prevent DNS rebinding in HTTP requestsDennis Fink
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.
2026-10-30fix(sender): validate missing source directoriesDennis Fink
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.
2026-10-30fix(receiver): recover stale Webmention verificationsDennis Fink
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.
2026-10-30fix(sender): make endpoint discovery more resilientDennis Fink
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.
2026-10-30fix(receiver): handle punctuation around plain-text URLsDennis Fink
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.
2026-10-30fix(sender): stabilize source content fingerprintsDennis Fink
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.
2026-10-30fix(sender): retry manual scans on lock contentionDennis Fink
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.
2026-10-30fix(sender): prevent concurrent duplicate sendsDennis Fink
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.
2026-10-30feat(sender): add persistent retry backoffDennis Fink
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.
2026-10-30fix(sender): ignore inconclusive empty scansDennis Fink
Treat scans with no successfully processed source pages as inconclusive so a temporary empty or partially rebuilt output directory cannot mark every source deleted or trigger removal Webmentions. Defer pending sends until at least one source is scanned successfully.
2026-10-30fix(sender): prevent duplicate canonical source URLsDennis Fink
Keep persisted sources, including deleted ones, as owners of their canonical URLs so newly scanned aliases cannot claim the same source identity. Skip duplicate canonical paths without blocking unrelated sources from being saved or queued for delivery.
2026-10-30fix(sender): isolate source parser failuresDennis Fink
Prevent malformed pages or unexpected third-party parser exceptions from aborting an entire source scan or causing previously known sources to be treated as deleted. Keep persistence failures visible so database errors still fail the scan.
2026-10-30test: align test suite with package structureDennis Fink
2026-10-30fix(core): harden application configurationDennis Fink
Fail production startup when required configuration is missing, normalize allowed hostnames before validation, and move shared request limits into the default configuration so production does not depend on testing-only values. Set secure session cookie defaults while preserving explicit overrides and document the new rate-limit and notification settings in the example config.
2026-10-30fix(core): harden authentication flowsDennis Fink
Reduce login abuse and username enumeration by rate limiting POST attempts and always performing password verification, even for unknown users. Require authenticated, CSRF-protected POST requests for logout so sessions cannot be terminated through cross-site or accidental GET requests.
2026-10-29feat(receiver): send Webmention notification digestsDennis Fink
Batch verified Webmention notifications into a scheduled digest so bursts of incoming mentions do not generate a separate email for every verification. Track which mentions have already been reported and leave them pending when SMTP delivery fails so a later digest can retry safely.
2026-10-29fix(receiver): rate limit Webmention submissionsDennis Fink
Protect the public endpoint from abusive request floods and repeated duplicate submissions that would otherwise trigger unnecessary verification work. Add per-client and global limits, require shared limiter storage in production, and only reverify existing Webmentions after a configurable cooldown.
2026-10-29fix(core): prevent unsafe login redirectsDennis Fink
Validate post-login redirect targets as local paths and reject backslashes, scheme-relative URLs, and malformed paths that browsers may interpret as external destinations. Add regression coverage for safe local redirects and open redirect variants.
2026-10-29fix(core): fail closed when login password is missingDennis Fink
Reject login attempts when the submitted password is absent instead of relying on form validation to prevent a missing value from bypassing authentication. Add regression coverage for both incorrect and missing passwords.
2026-10-29fix(sender): validate Webmention status URLsDennis Fink
Treat status URLs returned by remote endpoints as untrusted input so malformed or non-HTTP schemes cannot be persisted or exposed as clickable links. Preserve successful delivery when a Location header is invalid while rendering legacy unsafe status values as plain text in the admin interface.
2026-10-27fix(core): resolve static type checking issuesDennis Fink
2026-10-27feat(core): add database CLIDennis Fink
Make database initialization and upgrades explicit so new installations cannot silently modify an existing or unversioned schema. Keep Flask-Migrate commands available separately and package the migration environment with the application for reliable deployment.
2026-10-27feat(core): expand user management CLIDennis Fink
Add commands to list users, reset passwords, and delete accounts. Move mail and user commands into dedicated CLI modules.
2026-10-26feat(core): add SMTP test mail commandDennis Fink
Make outgoing mail configuration easier to validate during deployment without waiting for a Webmention notification to exercise the SMTP path. Allow operators to override the configured notification recipient and surface missing configuration or delivery failures directly through the CLI.
2026-10-25refactor(core): simplify configuration keysDennis Fink
Remove the WEBMENTIONS_SSG prefix from application-specific configuration settings and update validators, tasks, and tests to use the shorter names.