inbox

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2026 License: MIT Imports: 38 Imported by: 0

Documentation

Overview

Package inbox is the inbound side of the ActivityPub federation subsystem: parses verified inbound activities, dispatches them to per-type handlers (Follow, Like, Announce, Undo, Create, Update), and records accepted activities. Construct via New(Deps) and call Start(ctx) to spin up the request worker pool.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Deps

type Deps struct {
	Persistence      *persistence.Service
	Workerpool       *workerpool.Service
	Webhooks         *webhooks.Service
	Chat             *chat.Service
	Followers        followersrepository.FollowersRepository
	ConfigRepository configrepository.ConfigRepository
	Builder          *apmodels.Builder
	Resolver         *apresolvers.Resolver
	Events           *dispatcher.Dispatcher
}

Deps is the explicit dependency contract for inbox.

type Job

type Job struct {
	// contains filtered or unexported fields
}

Job bundles a single inbound HTTP request for a worker.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service owns the inbound inbox worker pool and routes verified activities to their per-type handlers. It composes the persistence service (to record accepted activities) and the followers repository (to track follow/unfollow state).

func New

func New(deps Deps) *Service

New constructs an idle inbox Service. Call Start to launch the worker pool.

func (*Service) AddToQueue

func (s *Service) AddToQueue(req apmodels.InboxRequest)

AddToQueue queues an inbound request for the worker pool.

func (*Service) Start

func (s *Service) Start()

Start launches the inbox worker pool. Safe to call once.

func (*Service) Verify

func (s *Service) Verify(request *http.Request, body []byte) (*url.URL, error)

Verify validates the HTTP signature of an inbound request against the signing actor's public key and checks it against blocked domains/actors. On success it returns the verified key owner's actor IRI (used by the caller to bind the activity's actor to its signer); on failure it returns a nil IRI and an error. nolint: cyclop

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址