Documentation
¶
Index ¶
- Constants
- func ActorAlias(actor *Actor) string
- func BaseContext() []string
- func DecodeContent(encoded string) ([]byte, error)
- func DeliverActivity(ctx context.Context, inboxURL string, activityJSON []byte, identity *Identity) error
- func DomainFromActorURL(actorURL string) string
- func EncodeContent(data []byte) string
- func EndpointFromActorURL(actorURL string) string
- func ExtractKeyID(req *http.Request) (string, error)
- func NowRFC3339() string
- func ResolveFollowTarget(ctx context.Context, input string) (string, error)
- func SendAccept(ctx context.Context, identity *Identity, followerActorURL string, ...) error
- func SendFollow(ctx context.Context, identity *Identity, targetActorURL string, ...) (string, error)
- func SendReject(ctx context.Context, identity *Identity, followerActorURL string, ...) error
- func SendUndo(ctx context.Context, identity *Identity, peerActorURL string, ...) error
- func SetAllowInsecureHTTP(v bool)
- func SignRequest(req *http.Request, keyID string, privKey crypto.PrivateKey, body []byte) error
- func StopDefaultWebFingerClient()
- func VerifyRequest(req *http.Request, pubKeyPEM string, body []byte, sigCache *SignatureCache) error
- type APPublisher
- func (p *APPublisher) ActorCache() *ActorCache
- func (p *APPublisher) Publish(ctx context.Context, activityType string, object any) error
- func (p *APPublisher) PublishBlobRef(ctx context.Context, digest string, size int64) error
- func (p *APPublisher) PublishManifest(ctx context.Context, repo, tag, digest, mediaType string, size int64, ...) error
- func (p *APPublisher) PublishManifestDelete(ctx context.Context, repo, digest string) error
- func (p *APPublisher) PublishTag(ctx context.Context, repo, tag, digest string) error
- func (p *APPublisher) PublishTagDelete(ctx context.Context, repo, tag string) error
- func (p *APPublisher) SetNotifyFunc(fn func())
- func (p *APPublisher) Stop()
- func (p *APPublisher) WithdrawRepo(ctx context.Context, repo string, tags []string, manifestDigests []string) error
- type APResolver
- type ActivityEnqueuer
- type Actor
- type ActorCache
- type ActorHandler
- type ActorInvalidator
- type ActorPublicKey
- type AdapterRegistry
- type BlobReplicator
- type DeliveryQueue
- type DeliveryRepository
- type EnqueueFunc
- type FedError
- type FedErrorKind
- type FederationAdapter
- type FollowersHandler
- type FollowersRepository
- type FollowingHandler
- type FollowingRepository
- type Identity
- type InboxConfig
- type InboxDispatcher
- type InboxHandler
- func (h *InboxHandler) BlockedActors() []string
- func (h *InboxHandler) BlockedDomains() []string
- func (h *InboxHandler) PauseActor(actorURL string)
- func (h *InboxHandler) PauseDomain(domain string)
- func (h *InboxHandler) ResumeActor(actorURL string)
- func (h *InboxHandler) ResumeDomain(domain string)
- func (h *InboxHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (h *InboxHandler) SetActorCache(c ActorInvalidator)
- func (h *InboxHandler) SetAdapters(r *AdapterRegistry)
- func (h *InboxHandler) SetBlobReplicator(r BlobReplicator)
- func (h *InboxHandler) SetEnqueueFunc(fn EnqueueFunc)
- func (h *InboxHandler) SetNamespaceForActor(actorURL, namespace string)
- func (h *InboxHandler) SetNotifier(n Notifier)
- func (h *InboxHandler) SetWorker(w ActivityEnqueuer)
- func (h *InboxHandler) Stop()
- type InboxRepository
- type InboxTask
- type InboxWorker
- type NodeInfo
- type NodeInfoHandler
- type NodeInfoSoftware
- type NodeInfoUsage
- type NodeInfoUsers
- type NodeInfoWellKnown
- type NodeInfoWellKnownLink
- type Notifier
- type OCIBlob
- type OCIManifest
- type OCITag
- type OutboxHandler
- type OutboxRepository
- type PackagePublisher
- type PublisherRepository
- type RawActivity
- type ResolverRepository
- type SignatureCache
- type WebFingerClient
- type WebFingerHandler
- type WebFingerLink
- type WebFingerResponse
Constants ¶
const ( ActivityFollow = "Follow" ActivityAccept = "Accept" ActivityReject = "Reject" ActivityUndo = "Undo" ActivityCreate = "Create" ActivityUpdate = "Update" ActivityAnnounce = "Announce" ActivityDelete = "Delete" AutoAcceptNone = "none" AutoAcceptAll = "all" AutoAcceptMutual = "mutual" )
const ( ContextActivityStreams = "https://www.w3.org/ns/activitystreams" ContextSecurity = "https://w3id.org/security/v1" ContextOCI = "https://opencontainers.org/ns/distribution" KeyContext = "@context" KeyType = "type" KeyObject = "object" KeyActor = "actor" KeyID = "id" TypeOCIManifest = "OCIManifest" TypeOCITag = "OCITag" TypeOCIBlob = "OCIBlob" TypeApplication = "Application" TypePerson = "Person" TypeOrderedCollection = "OrderedCollection" TypeOrderedCollectionPage = "OrderedCollectionPage" KeyOCIRepository = "ociRepository" KeyOCIDigest = "ociDigest" KeyOCITag = "ociTag" KeyOCIMediaType = "ociMediaType" KeyOCISize = "ociSize" KeyOCIContent = "ociContent" KeyOCIEndpoint = "ociEndpoint" MediaTypeActivityJSON = "application/activity+json" PEMTypePublicKey = "PUBLIC KEY" WebFingerRelSelf = "self" )
const PublicCollection = "https://www.w3.org/ns/activitystreams#Public"
PublicCollection is the special ActivityStreams address for public content.
Variables ¶
This section is empty.
Functions ¶
func ActorAlias ¶ added in v0.0.17
ActorAlias returns the account domain for display. Uses OCINamespace (account domain) when available for split-domain setups, otherwise falls back to the actor URL hostname.
func BaseContext ¶ added in v0.0.27
func BaseContext() []string
BaseContext is the standard AS2 + Security pair used by adapters that don't extend the vocabulary with backend-specific terms.
func DecodeContent ¶
DecodeContent decodes base64 manifest content from AP transport.
func DeliverActivity ¶
func DomainFromActorURL ¶ added in v0.0.17
DomainFromActorURL extracts the hostname from an actor URL.
func EncodeContent ¶
EncodeContent base64-encodes manifest bytes for AP transport.
func EndpointFromActorURL ¶
EndpointFromActorURL extracts the scheme+host base URL from an actor URL. It returns the original string unchanged when parsing fails.
func NowRFC3339 ¶ added in v0.0.27
func NowRFC3339() string
func ResolveFollowTarget ¶
ResolveFollowTarget resolves a domain, handle, or actor URL to an actor URL.
func SendAccept ¶
func SendAccept(ctx context.Context, identity *Identity, followerActorURL string, enqueue EnqueueFunc) error
SendAccept builds and delivers an Accept(Follow) activity to the follower's inbox. The caller is responsible for any DB state transitions (e.g. AcceptFollowRequest) before calling this function.
func SendFollow ¶ added in v0.0.7
func SendFollow(ctx context.Context, identity *Identity, targetActorURL string, enqueue EnqueueFunc) (string, error)
SendFollow builds and delivers a Follow activity to the target actor's inbox. Returns the actor's canonical ID. The caller is responsible for recording the outgoing follow and peer in the database.
func SendReject ¶
func SendReject(ctx context.Context, identity *Identity, followerActorURL string, enqueue EnqueueFunc) error
SendReject builds and delivers a Reject(Follow) activity to the follower's inbox. The caller is responsible for any DB state transitions (e.g. RejectFollowRequest) before calling this function.
func SendUndo ¶
func SendUndo(ctx context.Context, identity *Identity, peerActorURL string, enqueue EnqueueFunc) error
SendUndo builds and delivers an Undo(Follow) activity to the peer. Best-effort: returns an error but the caller should still proceed with the local cleanup.
func SetAllowInsecureHTTP ¶
func SetAllowInsecureHTTP(v bool)
SetAllowInsecureHTTP enables or disables insecure HTTP federation URLs.
func SignRequest ¶
func StopDefaultWebFingerClient ¶ added in v0.0.9
func StopDefaultWebFingerClient()
func VerifyRequest ¶
Types ¶
type APPublisher ¶
type APPublisher struct {
// contains filtered or unexported fields
}
func NewAPPublisher ¶
func NewAPPublisher(identity *Identity, db PublisherRepository, endpoint string, excludedRepos []string, logger *slog.Logger) *APPublisher
func (*APPublisher) ActorCache ¶
func (p *APPublisher) ActorCache() *ActorCache
func (*APPublisher) Publish ¶ added in v0.0.27
Publish is used by non-OCI backends (npm/cargo/pypi) which carry no tag context.
func (*APPublisher) PublishBlobRef ¶
func (*APPublisher) PublishManifest ¶
func (*APPublisher) PublishManifestDelete ¶ added in v0.0.29
func (p *APPublisher) PublishManifestDelete(ctx context.Context, repo, digest string) error
func (*APPublisher) PublishTag ¶
func (p *APPublisher) PublishTag(ctx context.Context, repo, tag, digest string) error
func (*APPublisher) PublishTagDelete ¶ added in v0.0.29
func (p *APPublisher) PublishTagDelete(ctx context.Context, repo, tag string) error
func (*APPublisher) SetNotifyFunc ¶
func (p *APPublisher) SetNotifyFunc(fn func())
func (*APPublisher) Stop ¶
func (p *APPublisher) Stop()
Stop releases background resources (actor cache eviction).
func (*APPublisher) WithdrawRepo ¶ added in v0.0.37
type APResolver ¶
type APResolver struct {
// contains filtered or unexported fields
}
func NewAPResolver ¶
func NewAPResolver(db ResolverRepository, logger *slog.Logger) *APResolver
func (*APResolver) FindBlobPeers ¶
type ActivityEnqueuer ¶ added in v0.0.5
ActivityEnqueuer pushes validated activities for async processing.
type Actor ¶
type Actor struct {
Context []any `json:"@context"`
Type string `json:"type"`
ID string `json:"id"`
Name string `json:"name"`
PreferredUsername string `json:"preferredUsername"`
Inbox string `json:"inbox"`
Outbox string `json:"outbox"`
Followers string `json:"followers"`
Following string `json:"following"`
PublicKey ActorPublicKey `json:"publicKey"`
Endpoints map[string]string `json:"endpoints,omitempty"`
URL string `json:"url,omitempty"`
OCINamespace string `json:"ociNamespace,omitempty"`
}
func FetchActor ¶
FetchActor fetches and parses a remote actor profile, signing the GET request for compatibility with servers that require authenticated fetches (e.g. Mastodon secure mode).
func FetchActorSigned ¶
FetchActorSigned fetches a remote actor, optionally signing the request.
func ParseActor ¶
type ActorCache ¶
type ActorCache struct {
// contains filtered or unexported fields
}
ActorCache provides a TTL-based cache for remote actor profiles.
func NewActorCache ¶
func NewActorCache(identity *Identity) *ActorCache
func (*ActorCache) Get ¶
Get returns a cached actor or fetches it (with a signed request) if missing/expired.
func (*ActorCache) Invalidate ¶
func (c *ActorCache) Invalidate(actorURL string)
func (*ActorCache) Stop ¶
func (c *ActorCache) Stop()
type ActorHandler ¶
type ActorHandler struct {
// contains filtered or unexported fields
}
func NewActorHandler ¶
func NewActorHandler(identity *Identity, nodeName, endpoint string) *ActorHandler
func (*ActorHandler) ServeHTTP ¶
func (h *ActorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type ActorInvalidator ¶
type ActorInvalidator interface {
Invalidate(actorURL string)
}
type ActorPublicKey ¶
type AdapterRegistry ¶ added in v0.0.27
type AdapterRegistry struct {
// contains filtered or unexported fields
}
func NewAdapterRegistry ¶ added in v0.0.27
func NewAdapterRegistry() *AdapterRegistry
func (*AdapterRegistry) Lookup ¶ added in v0.0.27
func (r *AdapterRegistry) Lookup(apType string) FederationAdapter
func (*AdapterRegistry) Register ¶ added in v0.0.27
func (r *AdapterRegistry) Register(a FederationAdapter) error
type BlobReplicator ¶
type DeliveryQueue ¶
type DeliveryQueue struct {
// contains filtered or unexported fields
}
func NewDeliveryQueue ¶
func NewDeliveryQueue(db DeliveryRepository, identity *Identity, logger *slog.Logger) *DeliveryQueue
func (*DeliveryQueue) Notify ¶
func (q *DeliveryQueue) Notify()
func (*DeliveryQueue) PreWarmCircuit ¶ added in v0.0.9
func (q *DeliveryQueue) PreWarmCircuit(ctx context.Context)
PreWarmCircuit loads unhealthy peer domains from the DB and opens the circuit breaker for each one. Call this once before Start to ensure a restart during an outage doesn't immediately retry all dead peers.
func (*DeliveryQueue) Start ¶
func (q *DeliveryQueue) Start(ctx context.Context)
func (*DeliveryQueue) Stop ¶
func (q *DeliveryQueue) Stop()
Stop signals the worker to stop and waits for it to finish.
type DeliveryRepository ¶ added in v0.0.9
type DeliveryRepository interface {
PendingDeliveries(ctx context.Context, limit int) ([]database.Delivery, error)
MarkDeliveryFailed(ctx context.Context, id int64, attempts, maxAttempts int, lastError string) error
MarkDelivered(ctx context.Context, id int64) error
CleanupDeliveries(ctx context.Context, olderThan time.Duration) (int64, error)
SetPeerHealthByDomain(ctx context.Context, domain string, healthy bool) error
UnhealthyPeerDomains(ctx context.Context) ([]string, error)
}
type EnqueueFunc ¶
type FedError ¶ added in v0.0.9
type FedError struct {
Kind FedErrorKind
Message string
Err error
}
FedError is a typed federation error that carries an HTTP status code and an appropriate log level. Inspired by GoToSocial's WithCode error.
func AsFedError ¶ added in v0.0.9
AsFedError extracts a *FedError from err if present.
type FedErrorKind ¶ added in v0.0.9
type FedErrorKind int
FedErrorKind classifies federation errors so callers can choose the right HTTP response code and log level without string-matching error messages.
const ( ErrMalformed FedErrorKind = iota // 400 — bad ActivityPub payload ErrForbidden // 403 — blocked actor or domain ErrNotRelevant // 200 — activity doesn't apply (log at debug) ErrPeerUnreachable // 502 — remote resource fetch failed )
type FederationAdapter ¶ added in v0.0.27
type FollowersHandler ¶
type FollowersHandler struct {
// contains filtered or unexported fields
}
func NewFollowersHandler ¶
func NewFollowersHandler(identity *Identity, db FollowersRepository) *FollowersHandler
func (*FollowersHandler) ServeHTTP ¶
func (h *FollowersHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FollowersRepository ¶ added in v0.0.9
type FollowingHandler ¶
type FollowingHandler struct {
// contains filtered or unexported fields
}
FollowingHandler returns who this instance is following (outgoing follows).
func NewFollowingHandler ¶
func NewFollowingHandler(identity *Identity, db FollowingRepository) *FollowingHandler
func (*FollowingHandler) ServeHTTP ¶
func (h *FollowingHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type FollowingRepository ¶ added in v0.0.9
type FollowingRepository interface {
ListOutgoingFollows(ctx context.Context, status string) ([]database.Actor, error)
CountOutgoingFollows(ctx context.Context, status string) (int, error)
ListOutgoingFollowsBatch(ctx context.Context, status string, afterID int64, limit int) ([]database.Actor, error)
}
FollowingRepository is the persistence port for the following handler.
type Identity ¶
type Identity struct {
ActorURL string
Domain string
AccountDomain string
PrivateKey *ecdsa.PrivateKey
Logger *slog.Logger
}
func LoadOrCreateIdentity ¶
func (*Identity) PublicKeyPEM ¶
type InboxConfig ¶
type InboxDispatcher ¶ added in v0.0.9
type InboxDispatcher interface {
// contains filtered or unexported methods
}
InboxDispatcher processes incoming ActivityPub tasks.
type InboxHandler ¶
type InboxHandler struct {
// contains filtered or unexported fields
}
func NewInboxHandler ¶
func NewInboxHandler(identity *Identity, db InboxRepository, cfg InboxConfig, logger *slog.Logger) *InboxHandler
func (*InboxHandler) BlockedActors ¶ added in v0.0.40
func (h *InboxHandler) BlockedActors() []string
BlockedActors returns the currently blocked actor URLs, sorted.
func (*InboxHandler) BlockedDomains ¶ added in v0.0.40
func (h *InboxHandler) BlockedDomains() []string
BlockedDomains returns the currently blocked domains, sorted.
func (*InboxHandler) PauseActor ¶ added in v0.0.40
func (h *InboxHandler) PauseActor(actorURL string)
PauseActor blocks all inbound activities from a single actor URL.
func (*InboxHandler) PauseDomain ¶ added in v0.0.40
func (h *InboxHandler) PauseDomain(domain string)
PauseDomain blocks all inbound activities from domain and its subdomains without a restart. Resume with ResumeDomain.
func (*InboxHandler) ResumeActor ¶ added in v0.0.40
func (h *InboxHandler) ResumeActor(actorURL string)
ResumeActor lifts a PauseActor block.
func (*InboxHandler) ResumeDomain ¶ added in v0.0.40
func (h *InboxHandler) ResumeDomain(domain string)
ResumeDomain lifts a PauseDomain block. It has no effect on domains blocked via static config once that config is reloaded.
func (*InboxHandler) ServeHTTP ¶
func (h *InboxHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
func (*InboxHandler) SetActorCache ¶
func (h *InboxHandler) SetActorCache(c ActorInvalidator)
func (*InboxHandler) SetAdapters ¶ added in v0.0.27
func (h *InboxHandler) SetAdapters(r *AdapterRegistry)
func (*InboxHandler) SetBlobReplicator ¶
func (h *InboxHandler) SetBlobReplicator(r BlobReplicator)
func (*InboxHandler) SetEnqueueFunc ¶
func (h *InboxHandler) SetEnqueueFunc(fn EnqueueFunc)
func (*InboxHandler) SetNamespaceForActor ¶ added in v0.0.5
func (h *InboxHandler) SetNamespaceForActor(actorURL, namespace string)
SetNamespaceForActor pre-populates the namespace cache for a given actor, bypassing the actor fetch. Intended for testing.
func (*InboxHandler) SetNotifier ¶ added in v0.0.8
func (h *InboxHandler) SetNotifier(n Notifier)
func (*InboxHandler) SetWorker ¶ added in v0.0.5
func (h *InboxHandler) SetWorker(w ActivityEnqueuer)
func (*InboxHandler) Stop ¶
func (h *InboxHandler) Stop()
type InboxRepository ¶ added in v0.0.9
type InboxRepository interface {
InsertActivityIfNew(ctx context.Context, activityID, activityType, actorURL string, activityJSON []byte) (bool, error)
AddFollowRequest(ctx context.Context, actorURL, publicKeyPEM, endpoint string, alias *string) error
AcceptFollowRequest(ctx context.Context, actorURL string) error
RejectFollowRequest(ctx context.Context, actorURL string) error
GetFollowRequest(ctx context.Context, actorURL string) (*database.FollowRequest, error)
GetFollow(ctx context.Context, actorURL string) (*database.Actor, error)
RemoveFollow(ctx context.Context, actorURL string) error
GetOutgoingFollow(ctx context.Context, actorURL string) (*database.Actor, error)
AcceptOutgoingFollow(ctx context.Context, actorURL string) error
RejectOutgoingFollow(ctx context.Context, actorURL string) error
GetRepository(ctx context.Context, name string) (*database.Repository, error)
GetOrCreateRepository(ctx context.Context, name, ownerDID string) (*database.Repository, error)
IsRepositoryOwner(ctx context.Context, repoID int64, did string) (bool, error)
PutManifest(ctx context.Context, m *database.Manifest) error
GetManifestByDigest(ctx context.Context, repoID int64, digest string) (*database.Manifest, error)
PutManifestLayers(ctx context.Context, manifestID int64, refs []database.BlobRef) error
DeleteManifest(ctx context.Context, repoID int64, digest string) error
RecordDeletedManifest(ctx context.Context, digest, repoName, sourceActor string) error
PutTag(ctx context.Context, repoID int64, name, manifestDigest string) error
DeleteTag(ctx context.Context, repoID int64, name string) error
FindPeersWithBlob(ctx context.Context, digest string) ([]database.PeerBlob, error)
GetBlob(ctx context.Context, digest string) (*database.Blob, error)
PutBlob(ctx context.Context, digest string, sizeBytes int64, mediaType *string, storedLocally bool) error
PutPeerBlob(ctx context.Context, peerActor, blobDigest, peerEndpoint string) error
}
type InboxTask ¶ added in v0.0.5
type InboxTask struct {
Activity RawActivity
PubKeyPEM string
RawBody []byte
}
InboxTask is a validated activity ready for processing.
type InboxWorker ¶ added in v0.0.5
type InboxWorker struct {
// contains filtered or unexported fields
}
InboxWorker processes validated ActivityPub activities asynchronously.
func NewInboxWorker ¶ added in v0.0.5
func NewInboxWorker(handler InboxDispatcher, logger *slog.Logger) *InboxWorker
func (*InboxWorker) Enqueue ¶ added in v0.0.5
func (w *InboxWorker) Enqueue(task InboxTask) bool
Enqueue pushes a task for async processing. Returns false if the queue is full.
func (*InboxWorker) Start ¶ added in v0.0.5
func (w *InboxWorker) Start(ctx context.Context)
func (*InboxWorker) Stop ¶ added in v0.0.5
func (w *InboxWorker) Stop()
type NodeInfo ¶
type NodeInfo struct {
Version string `json:"version"`
Software NodeInfoSoftware `json:"software"`
Protocols []string `json:"protocols"`
Usage NodeInfoUsage `json:"usage"`
OpenRegistrations bool `json:"openRegistrations"`
Metadata map[string]any `json:"metadata"`
}
type NodeInfoHandler ¶
type NodeInfoHandler struct {
// contains filtered or unexported fields
}
func NewNodeInfoHandler ¶
func NewNodeInfoHandler(domain, version string) *NodeInfoHandler
func (*NodeInfoHandler) ServeNodeInfo ¶
func (h *NodeInfoHandler) ServeNodeInfo(w http.ResponseWriter, r *http.Request)
func (*NodeInfoHandler) ServeWellKnown ¶
func (h *NodeInfoHandler) ServeWellKnown(w http.ResponseWriter, r *http.Request)
type NodeInfoSoftware ¶
type NodeInfoUsage ¶
type NodeInfoUsage struct {
Users NodeInfoUsers `json:"users"`
LocalPosts int `json:"localPosts"`
}
type NodeInfoUsers ¶
type NodeInfoWellKnown ¶
type NodeInfoWellKnown struct {
Links []NodeInfoWellKnownLink `json:"links"`
}
type NodeInfoWellKnownLink ¶
type OCIManifest ¶
type OCIManifest struct {
Context []string `json:"@context"`
Type string `json:"type"`
ID string `json:"id"`
AttributedTo string `json:"attributedTo"`
Published string `json:"published"`
Repository string `json:"ociRepository"`
Digest string `json:"ociDigest"`
MediaType string `json:"ociMediaType"`
Size int64 `json:"ociSize"`
Content string `json:"ociContent,omitempty"`
SubjectDigest string `json:"ociSubjectDigest,omitempty"`
Tag string `json:"ociTag,omitempty"`
}
type OutboxHandler ¶
type OutboxHandler struct {
// contains filtered or unexported fields
}
func NewOutboxHandler ¶
func NewOutboxHandler(identity *Identity, db OutboxRepository) *OutboxHandler
func (*OutboxHandler) ServeHTTP ¶
func (h *OutboxHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type OutboxRepository ¶ added in v0.0.9
type PackagePublisher ¶ added in v0.0.27
type PublisherRepository ¶ added in v0.0.9
type PublisherRepository interface {
PutActivity(ctx context.Context, activityID, activityType, actorURL string, activityJSON []byte) error
ListFollowsBatch(ctx context.Context, afterID int64, limit int) ([]database.Actor, error)
EnqueueDeliveryInserted(ctx context.Context, activityID, inboxURL string, activityJSON []byte) (bool, error)
}
type RawActivity ¶
type ResolverRepository ¶ added in v0.0.9
type SignatureCache ¶
type SignatureCache struct {
// contains filtered or unexported fields
}
func NewSignatureCache ¶
func NewSignatureCache() *SignatureCache
func (*SignatureCache) Stop ¶
func (sc *SignatureCache) Stop()
type WebFingerClient ¶ added in v0.0.9
type WebFingerClient struct {
// contains filtered or unexported fields
}
WebFingerClient handles WebFinger lookups with caching and deduplication. Call Stop() when done to release the background goroutine.
func NewWebFingerClient ¶ added in v0.0.9
func NewWebFingerClient() *WebFingerClient
func (*WebFingerClient) Lookup ¶ added in v0.0.9
Lookup resolves a resource via WebFinger and returns the AP actor URL. Results are cached for webfingerCacheTTL to avoid repeated lookups.
func (*WebFingerClient) Stop ¶ added in v0.0.9
func (c *WebFingerClient) Stop()
type WebFingerHandler ¶
type WebFingerHandler struct {
// contains filtered or unexported fields
}
func NewWebFingerHandler ¶
func NewWebFingerHandler(identity *Identity) *WebFingerHandler
func (*WebFingerHandler) ServeHTTP ¶
func (h *WebFingerHandler) ServeHTTP(w http.ResponseWriter, r *http.Request)
type WebFingerLink ¶
type WebFingerResponse ¶
type WebFingerResponse struct {
Subject string `json:"subject"`
Aliases []string `json:"aliases,omitempty"`
Links []WebFingerLink `json:"links"`
}