Documentation ¶
Overview ¶
Package basicauth supply basicAuth middleware abstraction
Index ¶
Constants ¶
View Source
const HeaderAuth = "Authorization"
HeaderAuth is common auth header
Variables ¶
View Source
var ( ErrInvalidBase64 = errors.New("invalid base64") ErrNoHeader = errors.New("not authorized") ErrInvalidAuth = errors.New("invalid authentication") )
errors
Functions ¶
Types ¶
type BasicAuth ¶
type BasicAuth struct { Realm string //required Authenticate func(user, pwd string) error //required Authorize func(user string, req *http.Request) error //optional }
BasicAuth should implement basic auth server side logic it is singleton
type Handler ¶
type Handler struct { }
Handler is is a basic auth pre process raw data in handler
func (*Handler) Handle ¶
func (ph *Handler) Handle(chain *handler.Chain, i *invocation.Invocation, cb invocation.ResponseCallBack)
Handle pre process raw data in handler
Click to show internal directories.
Click to hide internal directories.