improvements/all-fixes #1
Loading…
Reference in a new issue
No description provided.
Delete branch "improvements/all-fixes"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The /actor/{username}/outbox endpoint called get_reviews(limit=50) which returns every review on the server, not just the ones authored by the requested actor. Any actor's outbox exposed all reviews. Added get_reviews_by_actor() to the db layer and used it in the outbox route so each actor's outbox only contains their own published reviews. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>New endpoints: - POST /api/follow — Follow a remote actor by URI or acct (user@domain). Resolves via WebFinger, fetches and caches the remote actor, stores the follow relationship locally (pending), and sends a signed Follow activity to the remote inbox. - DELETE /api/reviews/{id} — Delete a review. Only the author can delete their own reviews (403 otherwise). Federates a Delete activity to followers so remote servers also remove the review. - GET /api/reviews/{id} — Fetch a single review by ID (404 if missing). - GET /api/reviews — Added limit/offset query params for pagination. Total count returned via X-Total-Count response header (backward compatible — response body is still a bare array). Inbox handler: - Added _handle_delete for Delete activities — removes the referenced review locally, but only if the sender is the original author. New db functions: - get_review_by_id, delete_review, count_reviews - get_reviews_by_bounds now accepts offset parameter Tests: 8 new tests (67 total) covering single review fetch, delete (author, not-found, auth), pagination, and follow (invalid target, auth). Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>Split the two largest modules into focused packages: app/routes/activitypub.py (401 lines) → app/routes/activitypub/ package: - helpers.py — URI builders, require_local_actor, fetch_remote_actor - webfinger.py — /.well-known/webfinger endpoint - actor.py — /actor/{username} endpoint - inbox.py — /actor/{username}/inbox + activity handlers - collections.py — Shared inbox, Outbox, Followers, Following - __init__.py — Router aggregation + backward-compatible re-exports app/db.py (367 lines) → app/db/ package: - connection.py — get_db, SCHEMA, connection pragmas - actors.py — Actor CRUD, password hashing, list_local_actors - reviews.py — Review CRUD, bounds queries, pagination, count - follows.py — Follow/follower relationship operations - __init__.py — Re-exports all public functions for backward compat All existing imports (from app.db import ...) continue to work via the package __init__.py re-exports. The _fetch_remote_actor private function was renamed to fetch_remote_actor (public) since it's used across modules. Updated tests/conftest.py to import from app.db.connection for the _db global. Updated README project layout and added testing docs. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>