Documentation
¶
Overview ¶
Package auth contains utilities to perform authentication.
Index ¶
- Constants
- func GenerateNonce() (string, error)
- func GenerateWWWAuthenticate(methods []ValidateMethod, realm string, nonce string) base.HeaderValue
- func Validate(req *base.Request, user string, pass string, methods []ValidateMethod, ...) errordeprecated
- func Verify(req *base.Request, user string, pass string, methods []VerifyMethod, ...) error
- type Sender
- type ValidateMethoddeprecated
- type VerifyMethod
Constants ¶
View Source
const ( ValidateMethodBasic = VerifyMethodBasic ValidateMethodDigestMD5 = VerifyMethodDigestMD5 ValidateMethodSHA256 = VerifyMethodDigestSHA256 )
validation methods.
Deprecated.
Variables ¶
This section is empty.
Functions ¶
func GenerateNonce ¶
GenerateNonce generates a nonce that can be used in Validate().
func GenerateWWWAuthenticate ¶
func GenerateWWWAuthenticate(methods []ValidateMethod, realm string, nonce string) base.HeaderValue
GenerateWWWAuthenticate generates a WWW-Authenticate header.
Types ¶
type Sender ¶
type Sender struct {
WWWAuth base.HeaderValue
User string
Pass string
// contains filtered or unexported fields
}
Sender allows to send credentials. It requires a WWW-Authenticate header (provided by the server) and a set of credentials.
func (*Sender) AddAuthorization ¶
AddAuthorization adds the Authorization header to a Request.
type ValidateMethod
deprecated
type ValidateMethod = VerifyMethod
ValidateMethod is a validation method.
Deprecated: replaced by VerifyMethod
type VerifyMethod ¶
type VerifyMethod int
VerifyMethod is a validation method.
const ( VerifyMethodBasic VerifyMethod = iota VerifyMethodDigestMD5 VerifyMethodDigestSHA256 )
validation methods.
Click to show internal directories.
Click to hide internal directories.