webfinger

package module
v0.0.0-...-76f4443 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2026 License: MIT Imports: 16 Imported by: 0

README

Webfinger handlers on top of Go-ActivityPub storage

This project is a standalone server for providing WellKnown support for GoActivityPub servers that don't expose that functionality themselves.

It was created as a "sidecar" service that would work alongside FedBOX.

Please see the official documentation for how to configure and use it.

As a library you can use it like this:

	// .well-known
    cfg := NodeInfoConfig()
    ni := nodeinfo.NewService(cfg, NodeInfoResolverNew(a.front.storage))
	h := webfinger.handler{}

    // Web-Finger
    r.Route("/.well-known", func(r chi.Router) {
        r.Get("/webfinger", h.HandleWebFinger)
        r.Get("/host-meta", h.HandleHostMeta)
        r.Get("/nodeinfo", ni.NodeInfoDiscover)
    })
    r.Get("/nodeinfo", ni.NodeInfo)

Documentation

Overview

Package webfinger

Index

Constants

View Source
const NodeInfoDiscoverPath = "/.well-known/nodeinfo"
View Source
const NodeInfoPath = "/nodeinfo"
View Source
const WellKnownHostPath = "/.well-known/host-meta"
View Source
const WellKnownOAuthAuthorizationServerPath = "/.well-known/oauth-authorization-server"
View Source
const WellKnownWebFingerPath = "/.well-known/webfinger"

Variables

View Source
var Version = "HEAD"

Functions

func FilterID

func FilterID(id string) filters.Check

func FilterName

func FilterName(name string) filters.Check

func FilterURL

func FilterURL(u string) filters.Check

func IconOf

func IconOf(it vocab.Item) string

func LoadActor

func LoadActor(dbs []Storage, checkFns ...filters.Check) (vocab.Item, error)

func LoadIRI

func LoadIRI(dbs []Storage, what vocab.IRI, checkFns ...filters.Check) (vocab.Item, error)

func New

func New(l lw.Logger, db ...Storage) handler

func NodeInfoConfig

func NodeInfoConfig(app vocab.Actor, ni WebInfo) nodeinfo.Config

Types

type NodeInfoResolver

type NodeInfoResolver struct {
	// contains filtered or unexported fields
}

func NodeInfoResolverNew

func NodeInfoResolverNew(r storage.ReadStore, app vocab.Actor) NodeInfoResolver

func (NodeInfoResolver) IsOpenRegistration

func (n NodeInfoResolver) IsOpenRegistration() (bool, error)

func (NodeInfoResolver) Usage

func (n NodeInfoResolver) Usage() (nodeinfo.Usage, error)

type OAuthAuthorizationMetadata

type OAuthAuthorizationMetadata struct {
	Issuer                                     string                   `json:"issuer"`
	AuthorizationEndpoint                      string                   `json:"authorization_endpoint"`
	TokenEndpoint                              string                   `json:"token_endpoint"`
	TokenEndpointAuthMethodsSupported          []string                 `json:"token_endpoint_auth_methods_supported,omitempty"`
	TokenEndpointAuthSigningAlgValuesSupported []string                 `json:"token_endpoint_auth_signing_alg_values_supported,omitempty"`
	RegistrationEndpoint                       string                   `json:"registration_endpoint"`
	GrantTypesSupported                        []osin.AccessRequestType `json:"grant_types_supported,omitempty"`
	ScopesSupported                            []string                 `json:"scopes_supported,omitempty"`
	ResponseTypesSupported                     []string                 `json:"response_types_supported,omitempty"`
	ClientIDMetadataDocumentSupported          bool                     `json:"client_id_metadata_document_supported"`
	ServiceDocumentation                       string                   `json:"service_documentation,omitempty"`
	CodeChallengeMethodsSupported              []string                 `json:"code_challenge_methods_supported,omitempty"`
}

OAuthAuthorizationMetadata is the metadata returned by RFC8414 well known oauth-authorization-server end-point

https://datatracker.ietf.org/doc/html/rfc8414#section-3.2

Additionally we have added the "client_id_metadata_document_supported" field from the OAuth2 Client ID Metadata Document to let OAuth2 clients know that the mechanism is indeed supported.

https://datatracker.ietf.org/doc/html/draft-ietf-oauth-client-id-metadata-document-00#name-authorization-server-metada

type Storage

type Storage struct {
	Store
	Root vocab.Actor
}

type Store

type Store interface {
	Open() error
	Close()
	storage.ReadStore
}

type WebInfo

type WebInfo struct {
	Title       string   `json:"title"`
	Email       string   `json:"email"`
	Summary     string   `json:"summary"`
	Description string   `json:"description"`
	Thumbnail   string   `json:"thumbnail,omitempty"`
	Languages   []string `json:"languages"`
	URI         string   `json:"uri"`
	Urls        []string `json:"urls,omitempty"`
	Version     string   `json:"version"`
}

Directories

Path Synopsis
cmd
point command
internal

Jump to

Keyboard shortcuts

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