federation

package
v0.10.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsASMediaType added in v0.10.0

func IsASMediaType(ct string) bool

IsASMediaType will return whether the given content-type string matches one of the 2 possible ActivityStreams incoming content types: - application/activity+json - application/ld+json;profile=https://w3.org/ns/activitystreams

Where for the above we are leniant with whitespace and quotes.

func NewClock

func NewClock() pub.Clock

NewClock returns a simple pub.Clock for use in federation interfaces.

Types

type Clock

type Clock struct{}

Clock implements the Clock interface of go-fed

func (*Clock) Now

func (c *Clock) Now() time.Time

Now just returns the time now

type Federator

type Federator interface {
	// FederatingActor returns the underlying pub.FederatingActor, which can be used to send activities, and serve actors at inboxes/outboxes.
	FederatingActor() pub.FederatingActor
	// FederatingDB returns the underlying FederatingDB interface.
	FederatingDB() federatingdb.DB
	// TransportController returns the underlying transport controller.
	TransportController() transport.Controller

	// AuthenticateFederatedRequest can be used to check the authenticity of incoming http-signed requests for federating resources.
	// The given username will be used to create a transport for making outgoing requests. See the implementation for more detailed comments.
	//
	// If the request is valid and passes authentication, the URL of the key owner ID will be returned, as well as true, and nil.
	//
	// If the request does not pass authentication, or there's a domain block, nil, false, nil will be returned.
	//
	// If something goes wrong during authentication, nil, false, and an error will be returned.
	AuthenticateFederatedRequest(ctx context.Context, username string) (*url.URL, gtserror.WithCode)

	pub.CommonBehavior
	pub.FederatingProtocol
	dereferencing.Dereferencer
}

Federator wraps various interfaces and functions to manage activitypub federation from gotosocial

func NewFederator

func NewFederator(state *state.State, federatingDB federatingdb.DB, transportController transport.Controller, typeConverter typeutils.TypeConverter, mediaManager *media.Manager) Federator

NewFederator returns a new federator

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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