Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Authenticator ¶
type Authenticator struct {
UserRepository persistence.UserRepository
}
Authenticator authenticates users. If used as a middleware it requires that the request is authenticated.
func (*Authenticator) HandlerFunc ¶
func (a *Authenticator) HandlerFunc(next http.HandlerFunc) http.HandlerFunc
HandlerFunc returns a handler func that authenticates the user making the request and add that user to the context. Using this middleware enables the usage of AuthenticatedUser to retrieve the user that made the request.
Click to show internal directories.
Click to hide internal directories.