webfinger

package module
v0.0.0-...-5e9c121 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: MIT Imports: 13 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 WellKnownHostPath = "/.well-known/host-meta"
View Source
const WellKnownOAuthAuthorizationServerPath = "/.well-known/oauth-authorization-server"
View Source
const WellKnownWebFingerPath = "/.well-known/webfinger"

Variables

This section is empty.

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

Types

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()
	processing.ReadStore
}

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