package main import ( "net/http" ) // An Authenticator takes an HTTP request and returns true iff it is allowed to // use our service. type Authenticator func(req *http.Request) bool func TokenAuthenticator() Authenticator { return func(req *http.Request) bool { return req.Header.Get("authorization") == "magic" } }