Documentation
¶
Overview ¶
Package auth provides HTTP client authentication support.
Index ¶
Constants ¶
View Source
const None = "None"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Authenticator ¶
type Authenticator interface {
Type() string
User() string
Password() string
// Challenge is the values from "WWW-Authenticate" header
Challenge([]string) Authenticator
Authenticate(*http.Request)
}
Authenticator stub
var Anonymous Authenticator = &noAuth{}
func Basic ¶
func Basic(user string, pw string) Authenticator
Basic provides HTTP basic authentication. See https://tools.ietf.org/html/rfc7617
func Deferred ¶
func Deferred(user string, pw string) Authenticator
type DigestAuth ¶
type DigestAuth struct {
// contains filtered or unexported fields
}
DigestAuth structure holds our credentials.
func Digest ¶
func Digest(user string, pw string) *DigestAuth
Digest implements HTTP digest authentication. See https://tools.ietf.org/html/rfc7616 TODO finish this: it only supports MD5 and the tests are inadequate
func (*DigestAuth) Authenticate ¶ added in v0.44.0
func (d *DigestAuth) Authenticate(req *http.Request)
Authenticate the current request.
func (*DigestAuth) Challenge ¶
func (d *DigestAuth) Challenge(ss []string) Authenticator
func (*DigestAuth) DigestParts ¶
func (d *DigestAuth) DigestParts(wwwAuthenticateHeader string) Authenticator
func (*DigestAuth) Password ¶
func (d *DigestAuth) Password() string
Password holds the DigestAuth password.
func (*DigestAuth) Type ¶
func (d *DigestAuth) Type() string
Type identifies the Digest authenticator.
Click to show internal directories.
Click to hide internal directories.