Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Auth ¶
type Auth struct {
// contains filtered or unexported fields
}
Auth provides authentication via OAuth.
func New ¶
func New(clientID, clientSecret, jwtSecret string, jwtTTL time.Duration, hostname string, mux *http.ServeMux) *Auth
New instantiates an Auth object and registers it against provided http.ServeMux.
func (*Auth) RequireUser ¶
func (a *Auth) RequireUser(next http.Handler) http.HandlerFunc
RequireUser is a middleware function that ensures that the user is authenticated. Use User to get the username.
Click to show internal directories.
Click to hide internal directories.