Documentation
¶
Index ¶
- Variables
- func Config(initFns ...InitFn) config
- func HTTPSigMsgFromRequest(req *http.Request) *httpsig.Message
- func HTTPSignature(initFns ...InitFn) httpSigVerifier
- func LoadRemoteKey(_ context.Context, c ActivityPubClient, iri vocab.IRI) (vocab.Actor, *vocab.PublicKey, error)
- func OAuth2(initFns ...InitFn) oauthVerifier
- func Verifier(initFns ...InitFn) actorResolver
- type AccessStore
- type ActivityPubClient
- type InitFn
- type ReadStore
Constants ¶
This section is empty.
Variables ¶
var AnonymousActor = vocab.Actor{ ID: vocab.PublicNS, Type: vocab.ActorType, Name: vocab.DefaultLangValue("Anonymous"), }
Functions ¶
func HTTPSignature ¶
func HTTPSignature(initFns ...InitFn) httpSigVerifier
HTTPSignature returns an HTTP-Signature validator for loading f
Types ¶
type AccessStore ¶
type AccessStore interface {
ReadStore
LoadAccess(string) (*osin.AccessData, error)
}
AccessStore is an ActivityPub storage implementation that can be used to retrieve actors and their generated OAuth2 access tokens. This functionality is used only by the client to server authorization mechanism.
type ActivityPubClient ¶
type ActivityPubClient interface {
Do(*http.Request) (*http.Response, error)
CtxLoadIRI(context.Context, vocab.IRI) (vocab.Item, error)
}
ActivityPubClient is an ActivityPub client that can retrieve remote items based on their IRI. It gets used when trying to dereference remote Actors based on their key IDs, in the process of validating the HTTP-Signatures based authorization headers for server to server, or secure fetch requests.
type InitFn ¶
type InitFn = func(*config)
func WithClient ¶
func WithClient(cl ActivityPubClient) InitFn
func WithLogger ¶
func WithNonceChecker ¶
func WithNonceChecker(nc httpsig.NonceGetter) InitFn
func WithOAuth2Storage ¶
func WithOAuth2Storage(s AccessStore) InitFn
WithOAuth2Storage sets the storage for verifying OAuth Access tokens against the local actor storage.
func WithStorage ¶
WithStorage sets the storage for verifying actors in local storage.
type ReadStore ¶
type ReadStore interface {
// Load returns an Item or an ItemCollection from an IRI
Load(vocab.IRI, ...filters.Check) (vocab.Item, error)
}
ReadStore is an ActivityPub storage implementation that can return a valid Item object based on its IRI. This functionality is used by both client to server and server to server authorization mechanisms.