validator

package
v0.11.25 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeletedObject

type DeletedObject struct{}

DeletedObject validates "delete" activities by trying to retrieve the original object.

func NewDeletedObject

func NewDeletedObject() DeletedObject

NewDeletedObject returns a fully initialized DeletedObject validator.

func (DeletedObject) Validate

func (v DeletedObject) Validate(request *http.Request, document *streams.Document) Result

Validate implements the Validator interface, which performs the actual validation.

type HTTPLookup

type HTTPLookup struct{}

HTTPLookup is a Validator that tries to retrieve the original document from the source server

func NewHTTPLookup

func NewHTTPLookup() HTTPLookup

func (HTTPLookup) Validate

func (v HTTPLookup) Validate(request *http.Request, document *streams.Document) Result

type HTTPSig

type HTTPSig struct{}

HTTPSig is a Validator that checks incoming HTTP requests using the HTTP signatures algorithm. https://docs.joinmastodon.org/spec/security/

func NewHTTPSig

func NewHTTPSig() HTTPSig

func (HTTPSig) Validate

func (validator HTTPSig) Validate(request *http.Request, document *streams.Document) Result

Validate uses the hannibal/sigs library to verify that the HTTP request is signed with a valid key.

type IdentityProof

type IdentityProof struct{}

IdentityProof implements FEP-c390 Identity Proofs https://codeberg.org/fediverse/fep/src/branch/main/fep/c390/fep-c390.md

func (IdentityProof) Validate

func (v IdentityProof) Validate(request *http.Request, document streams.Document) Result

type Result

type Result string

Result indicates the outcome of a validation attempt

const ResultError Result = "ERROR"

ResultError indicates that the current Validator encountered an error while attempting to validate the HTTP request

const ResultInvalid Result = "INVALID"

ResultInvalid indicates that the current Validator can say with certainty that the HTTP request is invalid

const ResultUnknown Result = "UNKNOWN"

ResultUnknown indicates that the current Validator cannot say that the HTTP request is valid or invalid

const ResultValid Result = "VALID"

ResultValid indicates that the current Validator has successfully validated the HTTP request

Jump to

Keyboard shortcuts

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