Add ActivityPub remote following #105

Closed
opened 2026-06-05 07:58:53 -05:00 by erik · 3 comments
Owner

Goal

Allow the template site actor to follow and unfollow remote Fediverse actors through Slugkit management flows while using Fedify for ActivityPub protocol handling where practical.

Requirements

  • Resolve a remote actor from a handle such as @alice@example.com or an actor URL.
  • Use WebFinger for handle resolution.
  • Fetch and validate remote actor documents with safe remote-fetch rules.
  • Use Fedify vocabulary/parsing helpers where practical for remote actor and inbound activity handling.
  • Create or reuse local contact/account records for followed actors when appropriate.
  • Store following records with pending, accepted, rejected, failed, cancelled, and unfollowed states.
  • Deliver Follow activities to remote actor inboxes through Fedify Context.sendActivity via the Slugkit sendActivityPubActivity helper.
  • Handle incoming Accept and Reject activities for follows initiated by the site through the Fedify inbox foundation.
  • Deliver Undo Follow for unfollow/cancel flows through Fedify Context.sendActivity via the Slugkit sendActivityPubActivity helper.
  • Expose behavior through the existing generic following management API contract where applicable.

Acceptance criteria

  • A valid handle can be resolved to a remote ActivityPub actor.
  • Following a remote actor stores a pending following record and queues Fedify delivery of Follow through the delivery helper.
  • Incoming Accept handled through Fedify updates the following record to accepted.
  • Incoming Reject handled through Fedify updates the following record to rejected.
  • Unfollow/cancel queues Fedify delivery of Undo Follow and updates local state.
  • Unsafe remote URLs are rejected.
  • Generic /api/v1/following routes return the expected following state.
  • No duplicate hand-rolled ActivityPub inbox routes are added outside the Fedify route setup.
  • Relevant tests and checks pass.

Dependencies

  • task-e025ad45
  • task-0d5b2e28
  • task-2775b988
## Goal Allow the template site actor to follow and unfollow remote Fediverse actors through Slugkit management flows while using Fedify for ActivityPub protocol handling where practical. ## Requirements - Resolve a remote actor from a handle such as `@alice@example.com` or an actor URL. - Use WebFinger for handle resolution. - Fetch and validate remote actor documents with safe remote-fetch rules. - Use Fedify vocabulary/parsing helpers where practical for remote actor and inbound activity handling. - Create or reuse local contact/account records for followed actors when appropriate. - Store following records with pending, accepted, rejected, failed, cancelled, and unfollowed states. - Deliver `Follow` activities to remote actor inboxes through Fedify `Context.sendActivity` via the Slugkit `sendActivityPubActivity` helper. - Handle incoming `Accept` and `Reject` activities for follows initiated by the site through the Fedify inbox foundation. - Deliver `Undo Follow` for unfollow/cancel flows through Fedify `Context.sendActivity` via the Slugkit `sendActivityPubActivity` helper. - Expose behavior through the existing generic following management API contract where applicable. ## Acceptance criteria - [ ] A valid handle can be resolved to a remote ActivityPub actor. - [ ] Following a remote actor stores a pending following record and queues Fedify delivery of `Follow` through the delivery helper. - [ ] Incoming `Accept` handled through Fedify updates the following record to accepted. - [ ] Incoming `Reject` handled through Fedify updates the following record to rejected. - [ ] Unfollow/cancel queues Fedify delivery of `Undo Follow` and updates local state. - [ ] Unsafe remote URLs are rejected. - [ ] Generic `/api/v1/following` routes return the expected following state. - [ ] No duplicate hand-rolled ActivityPub inbox routes are added outside the Fedify route setup. - [ ] Relevant tests and checks pass. ## Dependencies - task-e025ad45 - task-0d5b2e28 - task-2775b988
Author
Owner

Synced from todu comment by @todu on 2026-06-06T12:46:22.983Z

Plan approved

Implementation will use Fedify-first remote following:

  • real WebFinger/actor URL resolution with safe remote-fetch rules
  • Fedify sendActivityPubActivity / Context.sendActivity for Follow and Undo Follow delivery
  • Fedify inbox handlers for Accept/Reject state transitions
  • preserve generic following API shapes
  • add focused tests and full verification before PR
_Synced from todu comment by @todu on 2026-06-06T12:46:22.983Z_ ### Plan approved Implementation will use Fedify-first remote following: - real WebFinger/actor URL resolution with safe remote-fetch rules - Fedify `sendActivityPubActivity` / `Context.sendActivity` for Follow and Undo Follow delivery - Fedify inbox handlers for Accept/Reject state transitions - preserve generic following API shapes - add focused tests and full verification before PR
Author
Owner

Synced from todu comment by @todu on 2026-06-06T13:02:13.729Z

Review update

  • PR: #121 open, CI green (Forgejo task #162).
  • Result: approved.
  • Criteria: 9/9 met, 0 blocking issues, 0 warnings.
  • Follow-up: stop at human merge approval gate.
_Synced from todu comment by @todu on 2026-06-06T13:02:13.729Z_ ### Review update - PR: #121 open, CI green (Forgejo task #162). - Result: approved. - Criteria: 9/9 met, 0 blocking issues, 0 warnings. - Follow-up: stop at human merge approval gate.
erik 2026-06-06 08:10:09 -05:00
Author
Owner

Synced from todu comment by @todu on 2026-06-06T13:08:30.966Z

Completed

Close gate passed. All acceptance criteria are met.

Evidence summary:

  • Remote handles resolve through WebFinger and fetched actor documents are parsed with Fedify vocab helpers.
  • Remote actor, inbox, WebFinger, avatar, and fetch URLs are validated with HTTPS/non-local safe remote rules.
  • Following a remote actor creates a pending following record, creates/reuses contact/account data, and delivers Follow through the Fedify sendActivityPubActivity helper.
  • Fedify inbox listeners handle signed Accept and Reject responses and update following state.
  • Unfollow/cancel delivers Undo Follow through the Fedify delivery helper and records cancelled/unfollowed state.
  • Generic /api/v1/following behavior and OpenAPI status enums were updated and tested.
  • No duplicate raw ActivityPub inbox routes were added; handling remains in Fedify route setup.
  • make check, ./scripts/pre-pr.sh, and Forgejo CI task #162 passed; PR #121 was approved and merged.
_Synced from todu comment by @todu on 2026-06-06T13:08:30.966Z_ ### Completed Close gate passed. All acceptance criteria are met. Evidence summary: - Remote handles resolve through WebFinger and fetched actor documents are parsed with Fedify vocab helpers. - Remote actor, inbox, WebFinger, avatar, and fetch URLs are validated with HTTPS/non-local safe remote rules. - Following a remote actor creates a pending following record, creates/reuses contact/account data, and delivers `Follow` through the Fedify `sendActivityPubActivity` helper. - Fedify inbox listeners handle signed `Accept` and `Reject` responses and update following state. - Unfollow/cancel delivers `Undo Follow` through the Fedify delivery helper and records `cancelled`/`unfollowed` state. - Generic `/api/v1/following` behavior and OpenAPI status enums were updated and tested. - No duplicate raw ActivityPub inbox routes were added; handling remains in Fedify route setup. - `make check`, `./scripts/pre-pr.sh`, and Forgejo CI task #162 passed; PR #121 was approved and merged.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
erik/slugkit#105
No description provided.