Documentation
¶
Overview ¶
Package middleware provides oauth2 support as well as related middlewares.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator struct {
logger.L
JWTService TokenService
Providers []provider.Service
Validator token.Validator
AdminPasswd string
}
Authenticator is top level auth object providing middlewares
func (*Authenticator) AdminOnly ¶
func (a *Authenticator) AdminOnly(next http.Handler) http.Handler
AdminOnly middleware allows access for admins only
type TokenService ¶
type TokenService interface {
Parse(tokenString string) (claims token.Claims, err error)
Set(w http.ResponseWriter, claims token.Claims) error
Get(r *http.Request) (claims token.Claims, token string, err error)
IsExpired(claims token.Claims) bool
Reset(w http.ResponseWriter)
}
TokenService defines interface accessing tokens
Click to show internal directories.
Click to hide internal directories.