Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var (
ErrNoCredentials = errors.New("no credentials provided")
)
Errors
Functions ¶
This section is empty.
Types ¶
type BasicAuth ¶
type BasicAuth struct {
// contains filtered or unexported fields
}
BasicAuth is an authenticator that authenticate an user with the given username.
func NewBasicAuth ¶
func NewBasicAuth(realm string, validate func(username, password string) bool, store auth.IdentityStore) *BasicAuth
NewBasicAuth returns an instance of BasicAuth authticator.
func (*BasicAuth) Authenticate ¶
Authenticate implements Authenticator.Authenticate.
func (*BasicAuth) Challenge ¶
func (ba *BasicAuth) Challenge(w http.ResponseWriter)
Challenge implements Authenticator.Challenge.
type BearerToken ¶
type BearerToken struct {
// contains filtered or unexported fields
}
BearerToken is an authenticator that retrieves bearer token from authorization header and authenticate an user.
func NewBearerToken ¶
func NewBearerToken(realm string, store auth.IdentityStore) *BearerToken
NewBearerToken returns an instance of BearerToken authticator.
func (*BearerToken) Authenticate ¶
Authenticate implements Authenticator.Authenticate.
func (*BearerToken) Challenge ¶
func (bt *BearerToken) Challenge(w http.ResponseWriter)
Challenge implements Authenticator.Challenge.
type Composite ¶
type Composite struct {
// contains filtered or unexported fields
}
Composite is a set of authenticators.
func NewComposite ¶
func NewComposite(authenticators ...auth.Authenticator) *Composite
NewComposite returns an instance of composite authenticator.
func (*Composite) Authenticate ¶
Authenticate implements Authenticator.Authenticate.
func (*Composite) Challenge ¶
func (c *Composite) Challenge(w http.ResponseWriter)
Challenge implements Challenge.Authenticate.
type CookieToken ¶
type CookieToken struct {
// contains filtered or unexported fields
}
CookieToken is an authenticator that retrieves token from cookie and authenticate an user.
func NewCookieToken ¶
func NewCookieToken(param string, store auth.IdentityStore) *CookieToken
NewCookieToken returns an instance of CookieToken authenticator.
func (*CookieToken) Authenticate ¶
Authenticate implements Authenticator.Authenticate.
func (*CookieToken) Challenge ¶
func (ct *CookieToken) Challenge(http.ResponseWriter)
Challenge implements Authenticator.Challenge.
type QueryToken ¶
type QueryToken struct {
// contains filtered or unexported fields
}
QueryToken is an authenticator that retrieves token from URL query and authenticate an user.
func NewQueryToken ¶
func NewQueryToken(param string, store auth.IdentityStore) *QueryToken
NewQueryToken returns a instance of QueryToken authenticator.
func (*QueryToken) Authenticate ¶
Authenticate implements Authenticator.Authenticate.
func (*QueryToken) Challenge ¶
func (qt *QueryToken) Challenge(w http.ResponseWriter)
Challenge implements Authenticator.Challenge.