Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( KeyIDScheme = "https" KeyIDHostname = "zvelo.com" )
KeyGetter validates the scheme and hostname of the KeyID before fetching. Only those that match these values will be considered valid.
Functions ¶
func KeyGetter ¶
KeyGetter returns an httpsig.KeyGetter that will properly fetch zvelo public keys, if cache is non nil, it will be used to cache keys.
func Middleware ¶ added in v1.5.0
Middleware returns an http.Handler that can be used with an http.Server to receive and process zveloAPI callbacks. If getter is not nil, it will be used to validate HTTP Signatures on the incoming request.
Types ¶
type Handler ¶
type Handler interface {
Handle(http.ResponseWriter, *http.Request, *msg.QueryResult)
}
A Handler responds to a zveloAPI callback
type HandlerFunc ¶
type HandlerFunc func(http.ResponseWriter, *http.Request, *msg.QueryResult)
The HandlerFunc type is an adapter to allow the use of ordinary functions as zveloAPI handlers. If f is a function with the appropriate signature, HandlerFunc(f) is a Handler that calls f.
func (HandlerFunc) Handle ¶
func (f HandlerFunc) Handle(w http.ResponseWriter, r *http.Request, in *msg.QueryResult)
Handle calls f(w, r, in)
type KeyCache ¶ added in v1.5.0
KeyCache is a simple interface for caching JSON Web Keys
func FileKeyCache ¶ added in v1.5.0
FileKeyCache returns a KeyCache that stores keys on disk
func MemKeyCache ¶ added in v1.5.0
func MemKeyCache() KeyCache
MemKeyCache returns a KeyCache that stores keys in memory