A golang webfinger server implementation
25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.
Sheena Artrip d773028eb1
Initial commit of webfinger service
7 yıl önce
LICENSE Initial commit of webfinger service 7 yıl önce
README.md Initial commit of webfinger service 7 yıl önce
account.go Initial commit of webfinger service 7 yıl önce
account_test.go Initial commit of webfinger service 7 yıl önce
doc.go Initial commit of webfinger service 7 yıl önce
error.go Initial commit of webfinger service 7 yıl önce
error_test.go Initial commit of webfinger service 7 yıl önce
http.go Initial commit of webfinger service 7 yıl önce
http_test.go Initial commit of webfinger service 7 yıl önce
link.go Initial commit of webfinger service 7 yıl önce
middleware.go Initial commit of webfinger service 7 yıl önce
resolver.go Initial commit of webfinger service 7 yıl önce
resource.go Initial commit of webfinger service 7 yıl önce
service.go Initial commit of webfinger service 7 yıl önce

README.md

go-webfinger

go-webfinger is a golang webfinger server implementation.

Usage

webfinger.Service is implemented as a net/http handler, which means usage is simply registering the object with your http service.

Using the webfinger service as the main ServeHTTP:

myResolver = ...
wf := webfinger.Default(myResolver{})
wf.NotFoundHandler = // the rest of your app
http.ListenAndService(":8080", wf)

Using the webfinger service as a route on an existing HTTP router:

myResolver = ...
wf := webfinger.Default(myResolver{})
http.Handle(webfinger.WebFingerPath, http.HandlerFunc(wf.Webfinger))
http.ListenAndService(":8080", nil)

Defaults

The webfinger service is installed with a few defaults. Some of these defaults ensure we stick closely to the webfinger specification (tls-only, CORS, Content-Type) and other defaults are simply useful for development (no-cache)

The full list of defaults can be found in the godoc for webfinger.Service. They are exposed as public variables which can be overriden.

PreHandlers are the list of preflight HTTP handlers to run. You can add your own via wf.PreHandlers["my-custom-name"] = ..., however, execution order is not guaranteed.

TLS-Only

Handler which routes to the TLS version of the page. Disable via wf.NoTLSHandler = nil.

No-Cache

A PreFlight handler which sets no-cache headers on anything under /.well-known/webfinger. Disable or override via wf.PreHandlers[webfinger.NoCacheMiddleware]

Content Type as application/jrd+json

A PreFlight handler which sets the Content-Type to application/jrd+json. Disable or override via wf.PreHandlers[webfinger.ContentTypeMiddleware].

CORS

A PreFlight handler which adds the CORS headers. Disable or override via wf.PreHandlers[webfinger.CorsMiddleware].