validator

package
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Jul 27, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

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 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