validation

package
v1.1.17 Latest Latest
Warning

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

Go to latest
Published: Feb 21, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

Package validation contains inbox-specific ActivityPub validation helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsAddressedTo

func IsAddressedTo(activity *activitypub.Activity, actor *activitypub.Actor) bool

IsAddressedTo returns true if the activity addresses the actor or inbox.

func ParseActivity

func ParseActivity(logger *zap.Logger, body []byte) (*activitypub.Activity, error)

ParseActivity parses and sanitizes an ActivityPub activity from the raw request body.

func ValidateActivity

func ValidateActivity(logger *zap.Logger, activity *activitypub.Activity, actor *activitypub.Actor) error

ValidateActivity validates required fields and addressing for the activity and target actor.

func ValidateActivityAddressing

func ValidateActivityAddressing(activity *activitypub.Activity) error

ValidateActivityAddressing validates all addressing fields in the activity.

func ValidateActivityTargeting

func ValidateActivityTargeting(logger *zap.Logger, activity *activitypub.Activity, actor *activitypub.Actor) error

ValidateActivityTargeting ensures the activity is addressed to the target actor.

func ValidateActorPublicKey

func ValidateActorPublicKey(actor *activitypub.Actor) error

ValidateActorPublicKey validates the public key field when present.

func ValidateActorUsername

func ValidateActorUsername(actorURL string) error

ValidateActorUsername validates the actor URL and username format.

func ValidateBasicActivity

func ValidateBasicActivity(activity *activitypub.Activity) error

ValidateBasicActivity validates the basic ActivityPub activity structure.

func ValidateBasicActor

func ValidateBasicActor(actor *activitypub.Actor) error

ValidateBasicActor validates the basic ActivityPub actor structure.

func ValidateComprehensiveAddressing

func ValidateComprehensiveAddressing(logger *zap.Logger, activity *activitypub.Activity) error

ValidateComprehensiveAddressing validates addressing using the ActivityPub validator.

func ValidateCreateActivityObject

func ValidateCreateActivityObject(activity *activitypub.Activity) error

ValidateCreateActivityObject validates the embedded object structure for Create activities.

func ValidateNoteObject

func ValidateNoteObject(objMap map[string]interface{}) error

ValidateNoteObject validates embedded Note objects when present.

func ValidateObjectAttachments

func ValidateObjectAttachments(objMap map[string]interface{}) error

ValidateObjectAttachments validates ActivityPub attachments on an embedded object.

func ValidateObjectTags

func ValidateObjectTags(objMap map[string]interface{}) error

ValidateObjectTags validates ActivityPub tags on an embedded object.

func ValidateRequestBody

func ValidateRequestBody(logger *zap.Logger, body []byte) error

ValidateRequestBody enforces request body presence and size limits.

Types

This section is empty.

Jump to

Keyboard shortcuts

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