Versions in this module Expand all Collapse all v1 v1.0.1 Aug 12, 2022 v1.0.0 Oct 27, 2020 Changes in this version + func Nonce(n int) (string, error) + type Alg int + const SHA256 + const SHA512 + func (i Alg) String() string + type AuthOption struct + CustomClock Clock + CustomHostNameHeader string + CustomHostPort string + CustomURIHeader string + type AuthType int + const Bewit + const Header + const Response + func (i AuthType) String() string + type BewitConfig struct + Credential *Credential + Ext string + LocalTimeOffset time.Duration + Ttl time.Duration + func NewBewitConfig(c *Credential, ttl time.Duration) *BewitConfig + func (b *BewitConfig) GetBewit(url string, clock Clock) string + type Client struct + Credential *Credential + Option *Option + func NewClient(c *Credential, o *Option) *Client + func (c *Client) Authenticate(res *http.Response) (bool, error) + func (c *Client) Header(method, uri string) (string, error) + type Clock interface + Now func(offset time.Duration) int64 + type Credential struct + Alg Alg + ID string + Key string + type CredentialStore interface + GetCredential func(id string) (*Credential, error) + type LocalClock struct + func (c *LocalClock) Now(offset time.Duration) int64 + type Mac struct + Credential *Credential + HostPort string + Method string + Option *Option + Type AuthType + Uri string + func (m *Mac) String() (string, error) + type NonceValidator interface + Validate func(key, nonce string, ts int64) bool + type Option struct + App string + ContentType string + Dlg string + Ext string + Hash string + Nonce string + Payload string + TimeStamp int64 + type PayloadHash struct + Alg Alg + ContentType string + Payload string + func (h *PayloadHash) String() string + type Server struct + AuthOption *AuthOption + CredentialStore CredentialStore + LocaltimeOffset time.Duration + NonceValidator NonceValidator + Payload string + TimeStampSkew time.Duration + func NewServer(cs CredentialStore) *Server + func (s *Server) Authenticate(req *http.Request) (*Credential, error) + func (s *Server) AuthenticateBewit(req *http.Request) (*Credential, error) + func (s *Server) Header(req *http.Request, cred *Credential, opt *Option) (string, error) + type TsMac struct + Credential *Credential + TimeStamp int64 + func (tm *TsMac) String() string