Documentation
¶
Overview ¶
Package hawk provides support for Hawk authentication.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthOption ¶
type BewitConfig ¶
type BewitConfig struct { Credential *Credential Ttl time.Duration Ext string LocalTimeOffset time.Duration }
func NewBewitConfig ¶
func NewBewitConfig(c *Credential, ttl time.Duration) *BewitConfig
type Client ¶
type Client struct { Credential *Credential Option *Option }
func NewClient ¶
func NewClient(c *Credential, o *Option) *Client
func (*Client) Authenticate ¶
Authenticate authenticate the Hawk server response from the HTTP response. Successful case returns true.
type Clock ¶
type Clock interface { // Now returns the current unix-time obtained by adding a offset value. Now(offset time.Duration) int64 }
Clock returns a time.
type Credential ¶
type CredentialStore ¶
type CredentialStore interface {
GetCredential(id string) (*Credential, error)
}
type LocalClock ¶
type LocalClock struct{}
type Mac ¶
type NonceValidator ¶
type PayloadHash ¶
func (*PayloadHash) String ¶
func (h *PayloadHash) String() string
String returns a base64 encoded hash value of payload
type Server ¶
type Server struct { CredentialStore CredentialStore NonceValidator NonceValidator TimeStampSkew time.Duration LocaltimeOffset time.Duration Payload string AuthOption *AuthOption }
func (*Server) Authenticate ¶
func (s *Server) Authenticate(req *http.Request) (*Credential, error)
Authenticate authenticate the Hawk request from the HTTP request. Successful case returns credential information about requested user.
func (*Server) AuthenticateBewit ¶
func (s *Server) AuthenticateBewit(req *http.Request) (*Credential, error)
AuthenticateBewit authenticate the Hawk bewit request from the HTTP request. Successful case returns credential information about requested user.
Click to show internal directories.
Click to hide internal directories.