Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthorizationHeader ¶
type AuthorizationHeader struct { URI string Realm string Nonce string Username string Response string }
AuthorizationHeader is a struct stored the infomation of parsing "Authorization:" line
func ParseAuthorizationHeader ¶
func ParseAuthorizationHeader(buf string) *AuthorizationHeader
ParseAuthorizationHeader represents the parsing of "Authorization:" line, Authorization Header contains uri, realm, nonce, Username, response fields
type Database ¶
type Database struct { Realm string // contains filtered or unexported fields }
Database stores username and password to implement access control
func NewAuthDatabase ¶
NewAuthDatabase returns a pointer to a new instance of authorization database
func (*Database) InsertUserRecord ¶
InsertUserRecord inserts user record, it contains username and password fields
func (*Database) LookupPassword ¶
LookupPassword lookups the password by username
func (*Database) RemoveUserRecord ¶
RemoveUserRecord removes user record
type Digest ¶
Digest is a struct used for digest authentication. The "realm", and "nonce" fields are supplied by the server (in a "401 Unauthorized" response). The "username" and "password" fields are supplied by the client.
func NewDigest ¶
func NewDigest() *Digest
NewDigest returns a pointer to a new instance of authorization digest
func (*Digest) ComputeResponse ¶
ComputeResponse represents generating the response using cmd and url value