Commit Graph

26 Commits

Author SHA1 Message Date
e11b0a6609 feat: add ApVisibility (Public/FollowersOnly/Private) to broadcast_create_note and broadcast_update_note 2026-05-29 01:15:26 +02:00
4ef1315671 feat: add discoverable field to ApUser — no longer hard-coded to true 2026-05-29 01:11:55 +02:00
7424d1dc54 fix: address 3 PARTIAL plan items
#15 @context security vocab: actor JSON now uses actor_ap_context()
     which includes W3C security vocab + Mastodon toot extensions
     (manuallyApprovesFollowers, discoverable, featured).
     Applied to actor_handler, actor_json(), broadcast_actor_update().
     Activity JSON keeps plain AS context (no security vocab needed).

#17 HTTP Digest (documented, no code change): production mode
     (debug=false) REQUIRES Digest header on inbound POSTs via
     require_digest() in the non-compat normalization config.
     Added doc comment to ApFederationConfig::new() to clarify.

#26 Integration tests: 3 new tokio tests in src/tests/integration.rs
     using in-memory trait stubs. Tests cover:
     - check_guards idempotency (duplicate activity rejected)
     - check_guards domain block (blocked domain skipped)
     - extract_and_dispatch_mentions (on_mention called for local actor)
2026-05-29 01:00:45 +02:00
db6a451788 fix: address remaining 3 NOT DONE plan items
#18 featured collection: add featured_url to ApUser/DbActor/Person;
     serialized as featured field in AP JSON when set by consumer.

#19 Tombstone in Delete: broadcast_delete_to_followers now sends
     {"type":"Tombstone","id":"..."} instead of bare URL string.

#21 Backfill pagination: run_backfill uses get_local_objects_page
     with cursor-based loop — avoids loading all posts into memory;
     delivers newest-to-oldest in BATCH_SIZE chunks.
2026-05-29 00:52:37 +02:00
aec768b5a0 refactor(service): split into delivery/broadcast/follow/backfill submodules; remove dead content_to_html 2026-05-29 00:28:48 +02:00
90a0d91b39 refactor(activities): split into per-activity files with check_guards DRY helper 2026-05-29 00:17:31 +02:00
7ccc18e85c feat: production hardening — security, scale, protocol, DX
Breaking changes to FederationRepository, ApObjectHandler, ApUser:

FederationRepository:
- add is_activity_processed / mark_activity_processed (inbox idempotency)
- add get_accepted_follower_inboxes (DB-side dedup/filtering, replaces in-memory load-all)

ApObjectHandler:
- add on_announce_of_remote (cross-server boosts, previously silently dropped)

ApUser:
- add manually_approves_followers: bool
- add actor_type: ApActorType (was hardcoded Person)

Security:
- block check before actor HTTP fetch in Follow (prevents SSRF on blocked actors)
- 4xx responses use generic "not found"/"bad request" (no internal leak)
- 1 MB DefaultBodyLimit on inbox routes
- zeroize private key after generation

Delivery:
- all broadcasts are now non-blocking (tokio::spawn fallback, or EventPublisher queue)
- EventPublisher redesigned with typed FederationEvent enum (DeliveryRequested/DeliveryFailed)
- new deliver_to_inbox() public method for queue consumers
- configurable delivery_max_attempts and delivery_initial_delay_secs via builder
- Follow saved as Pending BEFORE delivery (race condition fix)

Router:
- GET /users/{id} (actor), GET /users/{id}/followers, GET /users/{id}/following now mounted

Protocol:
- mention extraction from Create/Update tag arrays → on_mention() dispatched
- WebFinger: add aliases field (acct: URI + AP actor URL)
- outbox: add last link, use count_local_posts for totalItems
- idempotency guard added to every inbound activity receive()
- actor serializes display_name and configurable actor_type/manually_approves_followers

Bump: 0.1.10 → 0.2.0
2026-05-28 23:35:41 +02:00
b557bd9d46 docs: update README to v0.1.10 — add new methods, fix signatures, document Move handling 2026-05-28 02:50:05 +02:00
d80cfd0431 feat: add mark_follower_accepted/rejected to ActivityPubService v0.1.10 2026-05-28 02:44:05 +02:00
432f39cbb4 feat: add broadcast_move to ActivityPubService; bump to v0.1.9 v0.1.9 2026-05-28 01:41:13 +02:00
2c509cbf88 feat: implement MoveActivity::receive with record migration and re-follow 2026-05-28 01:37:50 +02:00
52614d406a feat(repository): add migrate_follower_actor to FederationRepository 2026-05-28 01:33:13 +02:00
1949fce620 fix: accept follow for migrated actor URLs via UUID lookup v0.1.8 2026-05-28 00:30:58 +02:00
699258f830 feat: add targeted tracing logs for actor lookup and verification v0.1.7 2026-05-27 22:55:39 +02:00
9412a9739a fix: allow www. apex equivalence in actor domain verification
Threads serves actors at threads.net but their id field uses www.threads.net.
Extract apex_domain() helper and fall back to apex comparison when the
strict verify_domains_match check fails.
v0.1.6
2026-05-27 22:49:30 +02:00
13111c10b9 chore: bump version to 0.1.5 v0.1.5 2026-05-27 22:37:55 +02:00
2e3b6d5cd4 fix: accept optional outbox/followers/following and any AP actor type
Person struct now deserializes gracefully when outbox, followers, or
following are absent (Threads omits them for some actors). Accepts
Service/Application/Organization/Group in addition to Person.
manually_approves_followers defaults to false when absent.
2026-05-27 22:37:49 +02:00
bc857b2c08 feat: signed actor lookup and display_name on DbActor
Add display_name field to DbActor, populated from AP Person.name in
from_json. Expose LookedUpActor type and lookup_actor_by_handle method
on ActivityPubService — uses the existing signed webfinger_https path
so strict instances (Threads, etc.) return full actor data.
v0.1.4
2026-05-27 22:21:58 +02:00
7901b29f7c fix(actors): populate profile fields in read_from_id v0.1.3 2026-05-24 00:32:00 +02:00
Gabriel
a604e1bd40 docs: add README 2026-05-17 23:16:13 +02:00
Gabriel
f5374ec861 feat: add followers/following collection json methods 2026-05-17 22:58:30 +02:00
Gabriel
cc30582a1c feat: add broadcast_create_note, broadcast_update_note, base_url() accessor 2026-05-17 22:56:57 +02:00
Gabriel
f8dc20c026 gitignore 2026-05-17 22:54:03 +02:00
Gabriel
630cffe33f feat: k-ap public API, no ap_ports 2026-05-17 22:31:23 +02:00
Gabriel
cb84043ba3 feat: copy generic AP source files from thoughts 2026-05-17 22:30:25 +02:00
Gabriel
bf6ae50fcd init: k-ap crate scaffold 2026-05-17 22:23:52 +02:00