auth

package module
v0.0.0-...-94e2f18 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 24 Imported by: 4

README

About GoActivityPub: Authorization

MIT Licensed Build Status Test Coverage Go Report Card

This project is part of the GoActivityPub library which helps with creating ActivityPub applications using the Go programming language.

It is a wrapper package around making compatible libraries as HTTP-Sig and OAuth2 interact with GoActiivtyPub.

It provides functions to append Authorization headers to requests made with the client module, and also middlewares for verifying incoming requests against remote actors.

For more details you can have a look at the expanded documentation.

For discussions about the projects you can write to the discussions mailing list: ~mariusor/go-activitypub-discuss@lists.sr.ht

For patches and bug reports please use the dev mailing list: ~mariusor/go-activitypub-dev@lists.sr.ht

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AnonymousActor = vocab.Actor{
	ID: vocab.PublicNS,

	Type: vocab.ActorType,
	Name: vocab.DefaultNaturalLanguage("Anonymous"),
}

Functions

func Config

func Config(initFns ...InitFn) config

func HTTPSignature

func HTTPSignature(initFns ...InitFn) httpSigVerifier

HTTPSignature returns an HTTP-Signature validator for loading f

func LoadRemoteKey

func LoadRemoteKey(_ context.Context, c ActivityPubClient, iri vocab.IRI) (vocab.Actor, *vocab.PublicKey, error)

LoadRemoteKey fetches a remote Public Key and returns it's owner.

func OAuth2

func OAuth2(initFns ...InitFn) oauthVerifier

OAuth2

func Verifier

func Verifier(initFns ...InitFn) actorResolver

Types

type ActivityPubClient

type ActivityPubClient interface {
	Do(r *http.Request) (*http.Response, error)
	LoadIRI(id vocab.IRI) (vocab.Item, error)
}

type InitFn

type InitFn = func(*config)

func WithClient

func WithClient(cl ActivityPubClient) InitFn

func WithLogger

func WithLogger(l log.Logger) InitFn

func WithNonceChecker

func WithNonceChecker(nc httpsig.NonceChecker) InitFn

func WithStorage

func WithStorage(s oauthStore) InitFn

Jump to

Keyboard shortcuts

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